objc2_watch_kit/generated/
WKInterfaceObject.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
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 WKInterfaceObjectHorizontalAlignment(pub NSInteger);
19impl WKInterfaceObjectHorizontalAlignment {
20 #[doc(alias = "WKInterfaceObjectHorizontalAlignmentLeft")]
21 pub const Left: Self = Self(0);
22 #[doc(alias = "WKInterfaceObjectHorizontalAlignmentCenter")]
23 pub const Center: Self = Self(1);
24 #[doc(alias = "WKInterfaceObjectHorizontalAlignmentRight")]
25 pub const Right: Self = Self(2);
26}
27
28unsafe impl Encode for WKInterfaceObjectHorizontalAlignment {
29 const ENCODING: Encoding = NSInteger::ENCODING;
30}
31
32unsafe impl RefEncode for WKInterfaceObjectHorizontalAlignment {
33 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36#[repr(transparent)]
39#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
40pub struct WKInterfaceObjectVerticalAlignment(pub NSInteger);
41impl WKInterfaceObjectVerticalAlignment {
42 #[doc(alias = "WKInterfaceObjectVerticalAlignmentTop")]
43 pub const Top: Self = Self(0);
44 #[doc(alias = "WKInterfaceObjectVerticalAlignmentCenter")]
45 pub const Center: Self = Self(1);
46 #[doc(alias = "WKInterfaceObjectVerticalAlignmentBottom")]
47 pub const Bottom: Self = Self(2);
48}
49
50unsafe impl Encode for WKInterfaceObjectVerticalAlignment {
51 const ENCODING: Encoding = NSInteger::ENCODING;
52}
53
54unsafe impl RefEncode for WKInterfaceObjectVerticalAlignment {
55 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
56}
57
58extern_class!(
59 #[unsafe(super(NSObject))]
61 #[derive(Debug, PartialEq, Eq, Hash)]
62 pub struct WKInterfaceObject;
63);
64
65extern_conformance!(
66 unsafe impl NSObjectProtocol for WKInterfaceObject {}
67);
68
69impl WKInterfaceObject {
70 extern_methods!(
71 #[unsafe(method(init))]
72 #[unsafe(method_family = init)]
73 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
74
75 #[unsafe(method(setHidden:))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn setHidden(&self, hidden: bool);
78
79 #[cfg(feature = "objc2-core-foundation")]
80 #[unsafe(method(setAlpha:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn setAlpha(&self, alpha: CGFloat);
83
84 #[cfg(feature = "WKInterfaceDevice")]
85 #[unsafe(method(setSemanticContentAttribute:))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn setSemanticContentAttribute(
88 &self,
89 semantic_content_attribute: WKInterfaceSemanticContentAttribute,
90 );
91
92 #[unsafe(method(setHorizontalAlignment:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn setHorizontalAlignment(
95 &self,
96 horizontal_alignment: WKInterfaceObjectHorizontalAlignment,
97 );
98
99 #[unsafe(method(setVerticalAlignment:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn setVerticalAlignment(
102 &self,
103 vertical_alignment: WKInterfaceObjectVerticalAlignment,
104 );
105
106 #[cfg(feature = "objc2-core-foundation")]
107 #[unsafe(method(setWidth:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setWidth(&self, width: CGFloat);
110
111 #[cfg(feature = "objc2-core-foundation")]
112 #[unsafe(method(setHeight:))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn setHeight(&self, height: CGFloat);
115
116 #[cfg(feature = "objc2-core-foundation")]
117 #[unsafe(method(setRelativeWidth:withAdjustment:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn setRelativeWidth_withAdjustment(&self, width: CGFloat, adjustment: CGFloat);
120
121 #[cfg(feature = "objc2-core-foundation")]
122 #[unsafe(method(setRelativeHeight:withAdjustment:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn setRelativeHeight_withAdjustment(&self, height: CGFloat, adjustment: CGFloat);
125
126 #[unsafe(method(sizeToFitWidth))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn sizeToFitWidth(&self);
129
130 #[unsafe(method(sizeToFitHeight))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn sizeToFitHeight(&self);
133
134 #[unsafe(method(interfaceProperty))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn interfaceProperty(&self) -> Retained<NSString>;
137 );
138}
139
140impl WKInterfaceObject {
142 extern_methods!(
143 #[unsafe(method(new))]
144 #[unsafe(method_family = new)]
145 pub unsafe fn new() -> Retained<Self>;
146 );
147}
148
149impl WKInterfaceObject {
151 extern_methods!(
152 #[unsafe(method(setAccessibilityIdentifier:))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn setAccessibilityIdentifier(
155 &self,
156 accessibility_identifier: Option<&NSString>,
157 );
158
159 #[unsafe(method(setAccessibilityLabel:))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn setAccessibilityLabel(&self, accessibility_label: Option<&NSString>);
162
163 #[unsafe(method(setAccessibilityHint:))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn setAccessibilityHint(&self, accessibility_hint: Option<&NSString>);
166
167 #[unsafe(method(setAccessibilityValue:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn setAccessibilityValue(&self, accessibility_value: Option<&NSString>);
170
171 #[unsafe(method(setIsAccessibilityElement:))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn setIsAccessibilityElement(&self, is_accessibility_element: bool);
174
175 #[cfg(feature = "objc2-ui-kit")]
176 #[unsafe(method(setAccessibilityTraits:))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn setAccessibilityTraits(&self, accessibility_traits: UIAccessibilityTraits);
179
180 #[unsafe(method(setAccessibilityImageRegions:))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn setAccessibilityImageRegions(
183 &self,
184 accessibility_image_regions: &NSArray<WKAccessibilityImageRegion>,
185 );
186 );
187}
188
189extern_class!(
190 #[unsafe(super(NSObject))]
192 #[derive(Debug, PartialEq, Eq, Hash)]
193 pub struct WKAccessibilityImageRegion;
194);
195
196extern_conformance!(
197 unsafe impl NSObjectProtocol for WKAccessibilityImageRegion {}
198);
199
200impl WKAccessibilityImageRegion {
201 extern_methods!(
202 #[cfg(feature = "objc2-core-foundation")]
203 #[unsafe(method(frame))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn frame(&self) -> CGRect;
206
207 #[cfg(feature = "objc2-core-foundation")]
208 #[unsafe(method(setFrame:))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn setFrame(&self, frame: CGRect);
212
213 #[unsafe(method(label))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn label(&self) -> Retained<NSString>;
216
217 #[unsafe(method(setLabel:))]
221 #[unsafe(method_family = none)]
222 pub unsafe fn setLabel(&self, label: &NSString);
223 );
224}
225
226impl WKAccessibilityImageRegion {
228 extern_methods!(
229 #[unsafe(method(init))]
230 #[unsafe(method_family = init)]
231 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
232
233 #[unsafe(method(new))]
234 #[unsafe(method_family = new)]
235 pub unsafe fn new() -> Retained<Self>;
236 );
237}