objc2_ui_kit/generated/
UITargetedPreview.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12 #[unsafe(super(NSObject))]
14 #[thread_kind = MainThreadOnly]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct UIPreviewTarget;
17);
18
19extern_conformance!(
20 unsafe impl NSCopying for UIPreviewTarget {}
21);
22
23unsafe impl CopyingHelper for UIPreviewTarget {
24 type Result = Self;
25}
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for UIPreviewTarget {}
29);
30
31impl UIPreviewTarget {
32 extern_methods!(
33 #[cfg(all(
34 feature = "UIResponder",
35 feature = "UIView",
36 feature = "objc2-core-foundation"
37 ))]
38 #[unsafe(method(initWithContainer:center:transform:))]
39 #[unsafe(method_family = init)]
40 pub fn initWithContainer_center_transform(
41 this: Allocated<Self>,
42 container: &UIView,
43 center: CGPoint,
44 transform: CGAffineTransform,
45 ) -> Retained<Self>;
46
47 #[cfg(all(
48 feature = "UIResponder",
49 feature = "UIView",
50 feature = "objc2-core-foundation"
51 ))]
52 #[unsafe(method(initWithContainer:center:))]
53 #[unsafe(method_family = init)]
54 pub fn initWithContainer_center(
55 this: Allocated<Self>,
56 container: &UIView,
57 center: CGPoint,
58 ) -> Retained<Self>;
59
60 #[unsafe(method(init))]
61 #[unsafe(method_family = init)]
62 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
63
64 #[unsafe(method(new))]
65 #[unsafe(method_family = new)]
66 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
67
68 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
69 #[unsafe(method(container))]
70 #[unsafe(method_family = none)]
71 pub fn container(&self) -> Retained<UIView>;
72
73 #[cfg(feature = "objc2-core-foundation")]
74 #[unsafe(method(center))]
75 #[unsafe(method_family = none)]
76 pub fn center(&self) -> CGPoint;
77
78 #[cfg(feature = "objc2-core-foundation")]
79 #[unsafe(method(transform))]
80 #[unsafe(method_family = none)]
81 pub fn transform(&self) -> CGAffineTransform;
82 );
83}
84
85extern_class!(
86 #[unsafe(super(NSObject))]
88 #[thread_kind = MainThreadOnly]
89 #[derive(Debug, PartialEq, Eq, Hash)]
90 pub struct UITargetedPreview;
91);
92
93extern_conformance!(
94 unsafe impl NSCopying for UITargetedPreview {}
95);
96
97unsafe impl CopyingHelper for UITargetedPreview {
98 type Result = Self;
99}
100
101extern_conformance!(
102 unsafe impl NSObjectProtocol for UITargetedPreview {}
103);
104
105impl UITargetedPreview {
106 extern_methods!(
107 #[cfg(all(
108 feature = "UIPreviewParameters",
109 feature = "UIResponder",
110 feature = "UIView"
111 ))]
112 #[unsafe(method(initWithView:parameters:target:))]
113 #[unsafe(method_family = init)]
114 pub fn initWithView_parameters_target(
115 this: Allocated<Self>,
116 view: &UIView,
117 parameters: &UIPreviewParameters,
118 target: &UIPreviewTarget,
119 ) -> Retained<Self>;
120
121 #[cfg(all(
122 feature = "UIPreviewParameters",
123 feature = "UIResponder",
124 feature = "UIView"
125 ))]
126 #[unsafe(method(initWithView:parameters:))]
127 #[unsafe(method_family = init)]
128 pub fn initWithView_parameters(
129 this: Allocated<Self>,
130 view: &UIView,
131 parameters: &UIPreviewParameters,
132 ) -> Retained<Self>;
133
134 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
135 #[unsafe(method(initWithView:))]
136 #[unsafe(method_family = init)]
137 pub fn initWithView(this: Allocated<Self>, view: &UIView) -> Retained<Self>;
138
139 #[unsafe(method(init))]
140 #[unsafe(method_family = init)]
141 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
142
143 #[unsafe(method(new))]
144 #[unsafe(method_family = new)]
145 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
146
147 #[unsafe(method(target))]
148 #[unsafe(method_family = none)]
149 pub fn target(&self) -> Retained<UIPreviewTarget>;
150
151 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
152 #[unsafe(method(view))]
153 #[unsafe(method_family = none)]
154 pub fn view(&self) -> Retained<UIView>;
155
156 #[cfg(feature = "UIPreviewParameters")]
157 #[unsafe(method(parameters))]
158 #[unsafe(method_family = none)]
159 pub fn parameters(&self) -> Retained<UIPreviewParameters>;
160
161 #[cfg(feature = "objc2-core-foundation")]
162 #[unsafe(method(size))]
163 #[unsafe(method_family = none)]
164 pub fn size(&self) -> CGSize;
165
166 #[unsafe(method(retargetedPreviewWithTarget:))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn retargetedPreviewWithTarget(
169 &self,
170 new_target: &UIPreviewTarget,
171 ) -> Retained<UITargetedPreview>;
172 );
173}