objc2_event_kit_ui/generated/
EKEventViewController.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-event-kit")]
7use objc2_event_kit::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-ui-kit")]
10use objc2_ui_kit::*;
11
12use crate::*;
13
14#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct EKEventViewAction(pub NSInteger);
19impl EKEventViewAction {
20 #[doc(alias = "EKEventViewActionDone")]
21 pub const Done: Self = Self(0);
22 #[doc(alias = "EKEventViewActionResponded")]
23 pub const Responded: Self = Self(1);
24 #[doc(alias = "EKEventViewActionDeleted")]
25 pub const Deleted: Self = Self(2);
26}
27
28unsafe impl Encode for EKEventViewAction {
29 const ENCODING: Encoding = NSInteger::ENCODING;
30}
31
32unsafe impl RefEncode for EKEventViewAction {
33 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37 #[unsafe(super(UIViewController, UIResponder, NSObject))]
39 #[derive(Debug, PartialEq, Eq, Hash)]
40 #[cfg(feature = "objc2-ui-kit")]
41 pub struct EKEventViewController;
42);
43
44#[cfg(feature = "objc2-ui-kit")]
45extern_conformance!(
46 unsafe impl NSCoding for EKEventViewController {}
47);
48
49#[cfg(feature = "objc2-ui-kit")]
50extern_conformance!(
51 unsafe impl NSObjectProtocol for EKEventViewController {}
52);
53
54#[cfg(feature = "objc2-ui-kit")]
55extern_conformance!(
56 unsafe impl UIAppearanceContainer for EKEventViewController {}
57);
58
59#[cfg(feature = "objc2-ui-kit")]
60extern_conformance!(
61 unsafe impl UIContentContainer for EKEventViewController {}
62);
63
64#[cfg(feature = "objc2-ui-kit")]
65extern_conformance!(
66 unsafe impl UIFocusEnvironment for EKEventViewController {}
67);
68
69#[cfg(feature = "objc2-ui-kit")]
70extern_conformance!(
71 unsafe impl UIResponderStandardEditActions for EKEventViewController {}
72);
73
74#[cfg(feature = "objc2-ui-kit")]
75extern_conformance!(
76 unsafe impl UITraitEnvironment for EKEventViewController {}
77);
78
79#[cfg(feature = "objc2-ui-kit")]
80impl EKEventViewController {
81 extern_methods!(
82 #[unsafe(method(delegate))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn EKEventViewDelegate>>>;
85
86 #[unsafe(method(setDelegate:))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn setDelegate(
91 &self,
92 delegate: Option<&ProtocolObject<dyn EKEventViewDelegate>>,
93 );
94
95 #[cfg(feature = "objc2-event-kit")]
96 #[unsafe(method(event))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn event(&self) -> Option<Retained<EKEvent>>;
102
103 #[cfg(feature = "objc2-event-kit")]
104 #[unsafe(method(setEvent:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn setEvent(&self, event: Option<&EKEvent>);
108
109 #[unsafe(method(allowsEditing))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn allowsEditing(&self) -> bool;
119
120 #[unsafe(method(setAllowsEditing:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn setAllowsEditing(&self, allows_editing: bool);
124
125 #[unsafe(method(allowsCalendarPreview))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn allowsCalendarPreview(&self) -> bool;
133
134 #[unsafe(method(setAllowsCalendarPreview:))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn setAllowsCalendarPreview(&self, allows_calendar_preview: bool);
138 );
139}
140
141#[cfg(feature = "objc2-ui-kit")]
143impl EKEventViewController {
144 extern_methods!(
145 #[unsafe(method(initWithNibName:bundle:))]
146 #[unsafe(method_family = init)]
147 pub unsafe fn initWithNibName_bundle(
148 this: Allocated<Self>,
149 nib_name_or_nil: Option<&NSString>,
150 nib_bundle_or_nil: Option<&NSBundle>,
151 ) -> Retained<Self>;
152
153 #[unsafe(method(initWithCoder:))]
154 #[unsafe(method_family = init)]
155 pub unsafe fn initWithCoder(
156 this: Allocated<Self>,
157 coder: &NSCoder,
158 ) -> Option<Retained<Self>>;
159 );
160}
161
162#[cfg(feature = "objc2-ui-kit")]
164impl EKEventViewController {
165 extern_methods!(
166 #[unsafe(method(init))]
167 #[unsafe(method_family = init)]
168 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
169
170 #[unsafe(method(new))]
171 #[unsafe(method_family = new)]
172 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
173 );
174}
175
176extern_protocol!(
177 pub unsafe trait EKEventViewDelegate: NSObjectProtocol {
189 #[cfg(feature = "objc2-ui-kit")]
190 #[unsafe(method(eventViewController:didCompleteWithAction:))]
203 #[unsafe(method_family = none)]
204 unsafe fn eventViewController_didCompleteWithAction(
205 &self,
206 controller: &EKEventViewController,
207 action: EKEventViewAction,
208 );
209 }
210);