objc2_watch_kit/generated/
WKInterfacePicker.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkinterfacepicker?language=objc)
12    #[unsafe(super(WKInterfaceObject, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "WKInterfaceObject")]
15    pub struct WKInterfacePicker;
16);
17
18#[cfg(feature = "WKInterfaceObject")]
19extern_conformance!(
20    unsafe impl NSObjectProtocol for WKInterfacePicker {}
21);
22
23#[cfg(feature = "WKInterfaceObject")]
24impl WKInterfacePicker {
25    extern_methods!(
26        #[unsafe(method(focus))]
27        #[unsafe(method_family = none)]
28        pub unsafe fn focus(&self);
29
30        #[unsafe(method(resignFocus))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn resignFocus(&self);
33
34        #[unsafe(method(setSelectedItemIndex:))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn setSelectedItemIndex(&self, item_index: NSInteger);
37
38        #[unsafe(method(setItems:))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn setItems(&self, items: Option<&NSArray<WKPickerItem>>);
41
42        #[cfg(feature = "WKInterfaceImage")]
43        /// # Safety
44        ///
45        /// `coordinated_animations` generic must implement WKImageAnimatable.
46        #[unsafe(method(setCoordinatedAnimations:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn setCoordinatedAnimations(
49            &self,
50            coordinated_animations: Option<&NSArray<WKInterfaceObject>>,
51        );
52
53        #[unsafe(method(setEnabled:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn setEnabled(&self, enabled: bool);
56    );
57}
58
59/// Methods declared on superclass `WKInterfaceObject`.
60#[cfg(feature = "WKInterfaceObject")]
61impl WKInterfacePicker {
62    extern_methods!(
63        #[unsafe(method(init))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70#[cfg(feature = "WKInterfaceObject")]
71impl WKInterfacePicker {
72    extern_methods!(
73        #[unsafe(method(new))]
74        #[unsafe(method_family = new)]
75        pub unsafe fn new() -> Retained<Self>;
76    );
77}
78
79extern_class!(
80    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkpickeritem?language=objc)
81    #[unsafe(super(NSObject))]
82    #[derive(Debug, PartialEq, Eq, Hash)]
83    pub struct WKPickerItem;
84);
85
86extern_conformance!(
87    unsafe impl NSCoding for WKPickerItem {}
88);
89
90extern_conformance!(
91    unsafe impl NSObjectProtocol for WKPickerItem {}
92);
93
94extern_conformance!(
95    unsafe impl NSSecureCoding for WKPickerItem {}
96);
97
98impl WKPickerItem {
99    extern_methods!(
100        #[unsafe(method(title))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
103
104        /// Setter for [`title`][Self::title].
105        ///
106        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
107        #[unsafe(method(setTitle:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn setTitle(&self, title: Option<&NSString>);
110
111        #[unsafe(method(caption))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn caption(&self) -> Option<Retained<NSString>>;
114
115        /// Setter for [`caption`][Self::caption].
116        ///
117        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
118        #[unsafe(method(setCaption:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn setCaption(&self, caption: Option<&NSString>);
121
122        #[cfg(feature = "WKImage")]
123        #[unsafe(method(accessoryImage))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn accessoryImage(&self) -> Option<Retained<WKImage>>;
126
127        #[cfg(feature = "WKImage")]
128        /// Setter for [`accessoryImage`][Self::accessoryImage].
129        ///
130        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
131        #[unsafe(method(setAccessoryImage:))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn setAccessoryImage(&self, accessory_image: Option<&WKImage>);
134
135        #[cfg(feature = "WKImage")]
136        #[unsafe(method(contentImage))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn contentImage(&self) -> Option<Retained<WKImage>>;
139
140        #[cfg(feature = "WKImage")]
141        /// Setter for [`contentImage`][Self::contentImage].
142        ///
143        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
144        #[unsafe(method(setContentImage:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setContentImage(&self, content_image: Option<&WKImage>);
147    );
148}
149
150/// Methods declared on superclass `NSObject`.
151impl WKPickerItem {
152    extern_methods!(
153        #[unsafe(method(init))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
156
157        #[unsafe(method(new))]
158        #[unsafe(method_family = new)]
159        pub unsafe fn new() -> Retained<Self>;
160    );
161}