objc2_app_kit/generated/
NSDatePicker.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/appkit/nsdatepicker?language=objc)
12    #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
15    pub struct NSDatePicker;
16);
17
18#[cfg(all(
19    feature = "NSAccessibilityProtocols",
20    feature = "NSControl",
21    feature = "NSResponder",
22    feature = "NSView"
23))]
24extern_conformance!(
25    unsafe impl NSAccessibility for NSDatePicker {}
26);
27
28#[cfg(all(
29    feature = "NSAccessibilityProtocols",
30    feature = "NSControl",
31    feature = "NSResponder",
32    feature = "NSView"
33))]
34extern_conformance!(
35    unsafe impl NSAccessibilityElementProtocol for NSDatePicker {}
36);
37
38#[cfg(all(
39    feature = "NSAnimation",
40    feature = "NSControl",
41    feature = "NSResponder",
42    feature = "NSView"
43))]
44extern_conformance!(
45    unsafe impl NSAnimatablePropertyContainer for NSDatePicker {}
46);
47
48#[cfg(all(
49    feature = "NSAppearance",
50    feature = "NSControl",
51    feature = "NSResponder",
52    feature = "NSView"
53))]
54extern_conformance!(
55    unsafe impl NSAppearanceCustomization for NSDatePicker {}
56);
57
58#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
59extern_conformance!(
60    unsafe impl NSCoding for NSDatePicker {}
61);
62
63#[cfg(all(
64    feature = "NSControl",
65    feature = "NSDragging",
66    feature = "NSResponder",
67    feature = "NSView"
68))]
69extern_conformance!(
70    unsafe impl NSDraggingDestination for NSDatePicker {}
71);
72
73#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
74extern_conformance!(
75    unsafe impl NSObjectProtocol for NSDatePicker {}
76);
77
78#[cfg(all(
79    feature = "NSControl",
80    feature = "NSResponder",
81    feature = "NSUserInterfaceItemIdentification",
82    feature = "NSView"
83))]
84extern_conformance!(
85    unsafe impl NSUserInterfaceItemIdentification for NSDatePicker {}
86);
87
88#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
89impl NSDatePicker {
90    extern_methods!(
91        #[cfg(feature = "NSDatePickerCell")]
92        #[unsafe(method(datePickerStyle))]
93        #[unsafe(method_family = none)]
94        pub fn datePickerStyle(&self) -> NSDatePickerStyle;
95
96        #[cfg(feature = "NSDatePickerCell")]
97        /// Setter for [`datePickerStyle`][Self::datePickerStyle].
98        #[unsafe(method(setDatePickerStyle:))]
99        #[unsafe(method_family = none)]
100        pub fn setDatePickerStyle(&self, date_picker_style: NSDatePickerStyle);
101
102        #[unsafe(method(isBezeled))]
103        #[unsafe(method_family = none)]
104        pub fn isBezeled(&self) -> bool;
105
106        /// Setter for [`isBezeled`][Self::isBezeled].
107        #[unsafe(method(setBezeled:))]
108        #[unsafe(method_family = none)]
109        pub fn setBezeled(&self, bezeled: bool);
110
111        #[unsafe(method(isBordered))]
112        #[unsafe(method_family = none)]
113        pub fn isBordered(&self) -> bool;
114
115        /// Setter for [`isBordered`][Self::isBordered].
116        #[unsafe(method(setBordered:))]
117        #[unsafe(method_family = none)]
118        pub fn setBordered(&self, bordered: bool);
119
120        #[unsafe(method(drawsBackground))]
121        #[unsafe(method_family = none)]
122        pub fn drawsBackground(&self) -> bool;
123
124        /// Setter for [`drawsBackground`][Self::drawsBackground].
125        #[unsafe(method(setDrawsBackground:))]
126        #[unsafe(method_family = none)]
127        pub fn setDrawsBackground(&self, draws_background: bool);
128
129        #[cfg(feature = "NSColor")]
130        #[unsafe(method(backgroundColor))]
131        #[unsafe(method_family = none)]
132        pub fn backgroundColor(&self) -> Retained<NSColor>;
133
134        #[cfg(feature = "NSColor")]
135        /// Setter for [`backgroundColor`][Self::backgroundColor].
136        ///
137        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
138        #[unsafe(method(setBackgroundColor:))]
139        #[unsafe(method_family = none)]
140        pub fn setBackgroundColor(&self, background_color: &NSColor);
141
142        #[cfg(feature = "NSColor")]
143        #[unsafe(method(textColor))]
144        #[unsafe(method_family = none)]
145        pub fn textColor(&self) -> Retained<NSColor>;
146
147        #[cfg(feature = "NSColor")]
148        /// Setter for [`textColor`][Self::textColor].
149        ///
150        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
151        #[unsafe(method(setTextColor:))]
152        #[unsafe(method_family = none)]
153        pub fn setTextColor(&self, text_color: &NSColor);
154
155        #[cfg(feature = "NSDatePickerCell")]
156        #[unsafe(method(datePickerMode))]
157        #[unsafe(method_family = none)]
158        pub fn datePickerMode(&self) -> NSDatePickerMode;
159
160        #[cfg(feature = "NSDatePickerCell")]
161        /// Setter for [`datePickerMode`][Self::datePickerMode].
162        #[unsafe(method(setDatePickerMode:))]
163        #[unsafe(method_family = none)]
164        pub fn setDatePickerMode(&self, date_picker_mode: NSDatePickerMode);
165
166        #[cfg(feature = "NSDatePickerCell")]
167        #[unsafe(method(datePickerElements))]
168        #[unsafe(method_family = none)]
169        pub fn datePickerElements(&self) -> NSDatePickerElementFlags;
170
171        #[cfg(feature = "NSDatePickerCell")]
172        /// Setter for [`datePickerElements`][Self::datePickerElements].
173        #[unsafe(method(setDatePickerElements:))]
174        #[unsafe(method_family = none)]
175        pub fn setDatePickerElements(&self, date_picker_elements: NSDatePickerElementFlags);
176
177        #[unsafe(method(calendar))]
178        #[unsafe(method_family = none)]
179        pub fn calendar(&self) -> Option<Retained<NSCalendar>>;
180
181        /// Setter for [`calendar`][Self::calendar].
182        ///
183        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
184        #[unsafe(method(setCalendar:))]
185        #[unsafe(method_family = none)]
186        pub fn setCalendar(&self, calendar: Option<&NSCalendar>);
187
188        #[unsafe(method(locale))]
189        #[unsafe(method_family = none)]
190        pub fn locale(&self) -> Option<Retained<NSLocale>>;
191
192        /// Setter for [`locale`][Self::locale].
193        ///
194        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
195        #[unsafe(method(setLocale:))]
196        #[unsafe(method_family = none)]
197        pub fn setLocale(&self, locale: Option<&NSLocale>);
198
199        #[unsafe(method(timeZone))]
200        #[unsafe(method_family = none)]
201        pub fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
202
203        /// Setter for [`timeZone`][Self::timeZone].
204        ///
205        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
206        #[unsafe(method(setTimeZone:))]
207        #[unsafe(method_family = none)]
208        pub fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
209
210        #[unsafe(method(dateValue))]
211        #[unsafe(method_family = none)]
212        pub fn dateValue(&self) -> Retained<NSDate>;
213
214        /// Setter for [`dateValue`][Self::dateValue].
215        ///
216        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
217        #[unsafe(method(setDateValue:))]
218        #[unsafe(method_family = none)]
219        pub fn setDateValue(&self, date_value: &NSDate);
220
221        #[unsafe(method(timeInterval))]
222        #[unsafe(method_family = none)]
223        pub fn timeInterval(&self) -> NSTimeInterval;
224
225        /// Setter for [`timeInterval`][Self::timeInterval].
226        #[unsafe(method(setTimeInterval:))]
227        #[unsafe(method_family = none)]
228        pub fn setTimeInterval(&self, time_interval: NSTimeInterval);
229
230        #[unsafe(method(minDate))]
231        #[unsafe(method_family = none)]
232        pub fn minDate(&self) -> Option<Retained<NSDate>>;
233
234        /// Setter for [`minDate`][Self::minDate].
235        ///
236        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
237        #[unsafe(method(setMinDate:))]
238        #[unsafe(method_family = none)]
239        pub fn setMinDate(&self, min_date: Option<&NSDate>);
240
241        #[unsafe(method(maxDate))]
242        #[unsafe(method_family = none)]
243        pub fn maxDate(&self) -> Option<Retained<NSDate>>;
244
245        /// Setter for [`maxDate`][Self::maxDate].
246        ///
247        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
248        #[unsafe(method(setMaxDate:))]
249        #[unsafe(method_family = none)]
250        pub fn setMaxDate(&self, max_date: Option<&NSDate>);
251
252        #[unsafe(method(presentsCalendarOverlay))]
253        #[unsafe(method_family = none)]
254        pub fn presentsCalendarOverlay(&self) -> bool;
255
256        /// Setter for [`presentsCalendarOverlay`][Self::presentsCalendarOverlay].
257        #[unsafe(method(setPresentsCalendarOverlay:))]
258        #[unsafe(method_family = none)]
259        pub fn setPresentsCalendarOverlay(&self, presents_calendar_overlay: bool);
260
261        #[cfg(feature = "NSDatePickerCell")]
262        #[unsafe(method(delegate))]
263        #[unsafe(method_family = none)]
264        pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSDatePickerCellDelegate>>>;
265
266        #[cfg(feature = "NSDatePickerCell")]
267        /// Setter for [`delegate`][Self::delegate].
268        ///
269        /// This is a [weak property][objc2::topics::weak_property].
270        #[unsafe(method(setDelegate:))]
271        #[unsafe(method_family = none)]
272        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSDatePickerCellDelegate>>);
273    );
274}
275
276/// Methods declared on superclass `NSControl`.
277#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
278impl NSDatePicker {
279    extern_methods!(
280        #[unsafe(method(initWithFrame:))]
281        #[unsafe(method_family = init)]
282        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
283
284        /// # Safety
285        ///
286        /// `coder` possibly has further requirements.
287        #[unsafe(method(initWithCoder:))]
288        #[unsafe(method_family = init)]
289        pub unsafe fn initWithCoder(
290            this: Allocated<Self>,
291            coder: &NSCoder,
292        ) -> Option<Retained<Self>>;
293    );
294}
295
296/// Methods declared on superclass `NSResponder`.
297#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
298impl NSDatePicker {
299    extern_methods!(
300        #[unsafe(method(init))]
301        #[unsafe(method_family = init)]
302        pub fn init(this: Allocated<Self>) -> Retained<Self>;
303    );
304}
305
306/// Methods declared on superclass `NSObject`.
307#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
308impl NSDatePicker {
309    extern_methods!(
310        #[unsafe(method(new))]
311        #[unsafe(method_family = new)]
312        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
313    );
314}