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        #[unsafe(method(setCoordinatedAnimations:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn setCoordinatedAnimations(
46            &self,
47            coordinated_animations: Option<&NSArray<WKInterfaceObject>>,
48        );
49
50        #[unsafe(method(setEnabled:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn setEnabled(&self, enabled: bool);
53    );
54}
55
56/// Methods declared on superclass `WKInterfaceObject`.
57#[cfg(feature = "WKInterfaceObject")]
58impl WKInterfacePicker {
59    extern_methods!(
60        #[unsafe(method(init))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
63    );
64}
65
66/// Methods declared on superclass `NSObject`.
67#[cfg(feature = "WKInterfaceObject")]
68impl WKInterfacePicker {
69    extern_methods!(
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub unsafe fn new() -> Retained<Self>;
73    );
74}
75
76extern_class!(
77    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkpickeritem?language=objc)
78    #[unsafe(super(NSObject))]
79    #[derive(Debug, PartialEq, Eq, Hash)]
80    pub struct WKPickerItem;
81);
82
83extern_conformance!(
84    unsafe impl NSCoding for WKPickerItem {}
85);
86
87extern_conformance!(
88    unsafe impl NSObjectProtocol for WKPickerItem {}
89);
90
91extern_conformance!(
92    unsafe impl NSSecureCoding for WKPickerItem {}
93);
94
95impl WKPickerItem {
96    extern_methods!(
97        #[unsafe(method(title))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
100
101        /// Setter for [`title`][Self::title].
102        #[unsafe(method(setTitle:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setTitle(&self, title: Option<&NSString>);
105
106        #[unsafe(method(caption))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn caption(&self) -> Option<Retained<NSString>>;
109
110        /// Setter for [`caption`][Self::caption].
111        #[unsafe(method(setCaption:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn setCaption(&self, caption: Option<&NSString>);
114
115        #[cfg(feature = "WKImage")]
116        #[unsafe(method(accessoryImage))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn accessoryImage(&self) -> Option<Retained<WKImage>>;
119
120        #[cfg(feature = "WKImage")]
121        /// Setter for [`accessoryImage`][Self::accessoryImage].
122        #[unsafe(method(setAccessoryImage:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn setAccessoryImage(&self, accessory_image: Option<&WKImage>);
125
126        #[cfg(feature = "WKImage")]
127        #[unsafe(method(contentImage))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn contentImage(&self) -> Option<Retained<WKImage>>;
130
131        #[cfg(feature = "WKImage")]
132        /// Setter for [`contentImage`][Self::contentImage].
133        #[unsafe(method(setContentImage:))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn setContentImage(&self, content_image: Option<&WKImage>);
136    );
137}
138
139/// Methods declared on superclass `NSObject`.
140impl WKPickerItem {
141    extern_methods!(
142        #[unsafe(method(init))]
143        #[unsafe(method_family = init)]
144        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
145
146        #[unsafe(method(new))]
147        #[unsafe(method_family = new)]
148        pub unsafe fn new() -> Retained<Self>;
149    );
150}