objc2_clock_kit/generated/
CLKTextProvider.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#[cfg(feature = "objc2-ui-kit")]
8use objc2_ui_kit::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clktextprovider?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
17    pub struct CLKTextProvider;
18);
19
20extern_conformance!(
21    unsafe impl NSCopying for CLKTextProvider {}
22);
23
24unsafe impl CopyingHelper for CLKTextProvider {
25    type Result = Self;
26}
27
28extern_conformance!(
29    unsafe impl NSObjectProtocol for CLKTextProvider {}
30);
31
32impl CLKTextProvider {
33    extern_methods!(
34        #[deprecated = "Use initializers that take parameters."]
35        #[unsafe(method(init))]
36        #[unsafe(method_family = init)]
37        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
38
39        #[deprecated = "Use factory methods that take parameters."]
40        #[unsafe(method(new))]
41        #[unsafe(method_family = new)]
42        pub unsafe fn new() -> Retained<Self>;
43
44        #[cfg(feature = "objc2-ui-kit")]
45        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
46        #[unsafe(method(tintColor))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn tintColor(&self) -> Retained<UIColor>;
49
50        #[cfg(feature = "objc2-ui-kit")]
51        /// Setter for [`tintColor`][Self::tintColor].
52        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
53        #[unsafe(method(setTintColor:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn setTintColor(&self, tint_color: &UIColor);
56
57        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
58        #[unsafe(method(accessibilityLabel))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn accessibilityLabel(&self) -> Option<Retained<NSString>>;
61
62        /// Setter for [`accessibilityLabel`][Self::accessibilityLabel].
63        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
64        #[unsafe(method(setAccessibilityLabel:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn setAccessibilityLabel(&self, accessibility_label: Option<&NSString>);
67    );
68}
69
70extern_class!(
71    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clksimpletextprovider?language=objc)
72    #[unsafe(super(CLKTextProvider, NSObject))]
73    #[derive(Debug, PartialEq, Eq, Hash)]
74    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
75    pub struct CLKSimpleTextProvider;
76);
77
78extern_conformance!(
79    unsafe impl NSCopying for CLKSimpleTextProvider {}
80);
81
82unsafe impl CopyingHelper for CLKSimpleTextProvider {
83    type Result = Self;
84}
85
86extern_conformance!(
87    unsafe impl NSObjectProtocol for CLKSimpleTextProvider {}
88);
89
90impl CLKSimpleTextProvider {
91    extern_methods!(
92        #[unsafe(method(initWithText:))]
93        #[unsafe(method_family = init)]
94        pub unsafe fn initWithText(this: Allocated<Self>, text: &NSString) -> Retained<Self>;
95
96        #[unsafe(method(initWithText:shortText:))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn initWithText_shortText(
99            this: Allocated<Self>,
100            text: &NSString,
101            short_text: Option<&NSString>,
102        ) -> Retained<Self>;
103
104        #[unsafe(method(initWithText:shortText:accessibilityLabel:))]
105        #[unsafe(method_family = init)]
106        pub unsafe fn initWithText_shortText_accessibilityLabel(
107            this: Allocated<Self>,
108            text: &NSString,
109            short_text: Option<&NSString>,
110            accessibility_label: Option<&NSString>,
111        ) -> Retained<Self>;
112
113        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
114        #[unsafe(method(textProviderWithText:))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn textProviderWithText(text: &NSString) -> Retained<Self>;
117
118        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
119        #[unsafe(method(textProviderWithText:shortText:))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn textProviderWithText_shortText(
122            text: &NSString,
123            short_text: Option<&NSString>,
124        ) -> Retained<Self>;
125
126        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
127        #[unsafe(method(textProviderWithText:shortText:accessibilityLabel:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn textProviderWithText_shortText_accessibilityLabel(
130            text: &NSString,
131            short_text: Option<&NSString>,
132            accessibility_label: Option<&NSString>,
133        ) -> Retained<Self>;
134
135        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
136        #[unsafe(method(text))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn text(&self) -> Retained<NSString>;
139
140        /// Setter for [`text`][Self::text].
141        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
142        #[unsafe(method(setText:))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn setText(&self, text: &NSString);
145
146        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
147        #[unsafe(method(shortText))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn shortText(&self) -> Option<Retained<NSString>>;
150
151        /// Setter for [`shortText`][Self::shortText].
152        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
153        #[unsafe(method(setShortText:))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn setShortText(&self, short_text: Option<&NSString>);
156    );
157}
158
159/// Methods declared on superclass `CLKTextProvider`.
160impl CLKSimpleTextProvider {
161    extern_methods!(
162        #[deprecated = "Use initializers that take parameters."]
163        #[unsafe(method(init))]
164        #[unsafe(method_family = init)]
165        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
166
167        #[deprecated = "Use factory methods that take parameters."]
168        #[unsafe(method(new))]
169        #[unsafe(method_family = new)]
170        pub unsafe fn new() -> Retained<Self>;
171    );
172}
173
174extern_class!(
175    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clkdatetextprovider?language=objc)
176    #[unsafe(super(CLKTextProvider, NSObject))]
177    #[derive(Debug, PartialEq, Eq, Hash)]
178    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
179    pub struct CLKDateTextProvider;
180);
181
182extern_conformance!(
183    unsafe impl NSCopying for CLKDateTextProvider {}
184);
185
186unsafe impl CopyingHelper for CLKDateTextProvider {
187    type Result = Self;
188}
189
190extern_conformance!(
191    unsafe impl NSObjectProtocol for CLKDateTextProvider {}
192);
193
194impl CLKDateTextProvider {
195    extern_methods!(
196        #[unsafe(method(initWithDate:units:))]
197        #[unsafe(method_family = init)]
198        pub unsafe fn initWithDate_units(
199            this: Allocated<Self>,
200            date: &NSDate,
201            calendar_units: NSCalendarUnit,
202        ) -> Retained<Self>;
203
204        #[unsafe(method(initWithDate:units:timeZone:))]
205        #[unsafe(method_family = init)]
206        pub unsafe fn initWithDate_units_timeZone(
207            this: Allocated<Self>,
208            date: &NSDate,
209            calendar_units: NSCalendarUnit,
210            time_zone: Option<&NSTimeZone>,
211        ) -> Retained<Self>;
212
213        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
214        #[unsafe(method(textProviderWithDate:units:))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn textProviderWithDate_units(
217            date: &NSDate,
218            calendar_units: NSCalendarUnit,
219        ) -> Retained<Self>;
220
221        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
222        #[unsafe(method(textProviderWithDate:units:timeZone:))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn textProviderWithDate_units_timeZone(
225            date: &NSDate,
226            calendar_units: NSCalendarUnit,
227            time_zone: Option<&NSTimeZone>,
228        ) -> Retained<Self>;
229
230        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
231        #[unsafe(method(date))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn date(&self) -> Retained<NSDate>;
234
235        /// Setter for [`date`][Self::date].
236        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
237        #[unsafe(method(setDate:))]
238        #[unsafe(method_family = none)]
239        pub unsafe fn setDate(&self, date: &NSDate);
240
241        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
242        #[unsafe(method(calendarUnits))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn calendarUnits(&self) -> NSCalendarUnit;
245
246        /// Setter for [`calendarUnits`][Self::calendarUnits].
247        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
248        #[unsafe(method(setCalendarUnits:))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn setCalendarUnits(&self, calendar_units: NSCalendarUnit);
251
252        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
253        #[unsafe(method(timeZone))]
254        #[unsafe(method_family = none)]
255        pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
256
257        /// Setter for [`timeZone`][Self::timeZone].
258        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
259        #[unsafe(method(setTimeZone:))]
260        #[unsafe(method_family = none)]
261        pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
262
263        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
264        #[unsafe(method(uppercase))]
265        #[unsafe(method_family = none)]
266        pub unsafe fn uppercase(&self) -> bool;
267
268        /// Setter for [`uppercase`][Self::uppercase].
269        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
270        #[unsafe(method(setUppercase:))]
271        #[unsafe(method_family = none)]
272        pub unsafe fn setUppercase(&self, uppercase: bool);
273    );
274}
275
276/// Methods declared on superclass `CLKTextProvider`.
277impl CLKDateTextProvider {
278    extern_methods!(
279        #[deprecated = "Use initializers that take parameters."]
280        #[unsafe(method(init))]
281        #[unsafe(method_family = init)]
282        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
283
284        #[deprecated = "Use factory methods that take parameters."]
285        #[unsafe(method(new))]
286        #[unsafe(method_family = new)]
287        pub unsafe fn new() -> Retained<Self>;
288    );
289}
290
291extern_class!(
292    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clktimetextprovider?language=objc)
293    #[unsafe(super(CLKTextProvider, NSObject))]
294    #[derive(Debug, PartialEq, Eq, Hash)]
295    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
296    pub struct CLKTimeTextProvider;
297);
298
299extern_conformance!(
300    unsafe impl NSCopying for CLKTimeTextProvider {}
301);
302
303unsafe impl CopyingHelper for CLKTimeTextProvider {
304    type Result = Self;
305}
306
307extern_conformance!(
308    unsafe impl NSObjectProtocol for CLKTimeTextProvider {}
309);
310
311impl CLKTimeTextProvider {
312    extern_methods!(
313        #[unsafe(method(initWithDate:))]
314        #[unsafe(method_family = init)]
315        pub unsafe fn initWithDate(this: Allocated<Self>, date: &NSDate) -> Retained<Self>;
316
317        #[unsafe(method(initWithDate:timeZone:))]
318        #[unsafe(method_family = init)]
319        pub unsafe fn initWithDate_timeZone(
320            this: Allocated<Self>,
321            date: &NSDate,
322            time_zone: Option<&NSTimeZone>,
323        ) -> Retained<Self>;
324
325        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
326        #[unsafe(method(textProviderWithDate:))]
327        #[unsafe(method_family = none)]
328        pub unsafe fn textProviderWithDate(date: &NSDate) -> Retained<Self>;
329
330        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
331        #[unsafe(method(textProviderWithDate:timeZone:))]
332        #[unsafe(method_family = none)]
333        pub unsafe fn textProviderWithDate_timeZone(
334            date: &NSDate,
335            time_zone: Option<&NSTimeZone>,
336        ) -> Retained<Self>;
337
338        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
339        #[unsafe(method(date))]
340        #[unsafe(method_family = none)]
341        pub unsafe fn date(&self) -> Retained<NSDate>;
342
343        /// Setter for [`date`][Self::date].
344        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
345        #[unsafe(method(setDate:))]
346        #[unsafe(method_family = none)]
347        pub unsafe fn setDate(&self, date: &NSDate);
348
349        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
350        #[unsafe(method(timeZone))]
351        #[unsafe(method_family = none)]
352        pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
353
354        /// Setter for [`timeZone`][Self::timeZone].
355        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
356        #[unsafe(method(setTimeZone:))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
359    );
360}
361
362/// Methods declared on superclass `CLKTextProvider`.
363impl CLKTimeTextProvider {
364    extern_methods!(
365        #[deprecated = "Use initializers that take parameters."]
366        #[unsafe(method(init))]
367        #[unsafe(method_family = init)]
368        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
369
370        #[deprecated = "Use factory methods that take parameters."]
371        #[unsafe(method(new))]
372        #[unsafe(method_family = new)]
373        pub unsafe fn new() -> Retained<Self>;
374    );
375}
376
377extern_class!(
378    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clktimeintervaltextprovider?language=objc)
379    #[unsafe(super(CLKTextProvider, NSObject))]
380    #[derive(Debug, PartialEq, Eq, Hash)]
381    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
382    pub struct CLKTimeIntervalTextProvider;
383);
384
385extern_conformance!(
386    unsafe impl NSCopying for CLKTimeIntervalTextProvider {}
387);
388
389unsafe impl CopyingHelper for CLKTimeIntervalTextProvider {
390    type Result = Self;
391}
392
393extern_conformance!(
394    unsafe impl NSObjectProtocol for CLKTimeIntervalTextProvider {}
395);
396
397impl CLKTimeIntervalTextProvider {
398    extern_methods!(
399        #[unsafe(method(initWithStartDate:endDate:))]
400        #[unsafe(method_family = init)]
401        pub unsafe fn initWithStartDate_endDate(
402            this: Allocated<Self>,
403            start_date: &NSDate,
404            end_date: &NSDate,
405        ) -> Retained<Self>;
406
407        #[unsafe(method(initWithStartDate:endDate:timeZone:))]
408        #[unsafe(method_family = init)]
409        pub unsafe fn initWithStartDate_endDate_timeZone(
410            this: Allocated<Self>,
411            start_date: &NSDate,
412            end_date: &NSDate,
413            time_zone: Option<&NSTimeZone>,
414        ) -> Retained<Self>;
415
416        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
417        #[unsafe(method(textProviderWithStartDate:endDate:))]
418        #[unsafe(method_family = none)]
419        pub unsafe fn textProviderWithStartDate_endDate(
420            start_date: &NSDate,
421            end_date: &NSDate,
422        ) -> Retained<Self>;
423
424        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
425        #[unsafe(method(textProviderWithStartDate:endDate:timeZone:))]
426        #[unsafe(method_family = none)]
427        pub unsafe fn textProviderWithStartDate_endDate_timeZone(
428            start_date: &NSDate,
429            end_date: &NSDate,
430            time_zone: Option<&NSTimeZone>,
431        ) -> Retained<Self>;
432
433        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
434        #[unsafe(method(startDate))]
435        #[unsafe(method_family = none)]
436        pub unsafe fn startDate(&self) -> Retained<NSDate>;
437
438        /// Setter for [`startDate`][Self::startDate].
439        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
440        #[unsafe(method(setStartDate:))]
441        #[unsafe(method_family = none)]
442        pub unsafe fn setStartDate(&self, start_date: &NSDate);
443
444        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
445        #[unsafe(method(endDate))]
446        #[unsafe(method_family = none)]
447        pub unsafe fn endDate(&self) -> Retained<NSDate>;
448
449        /// Setter for [`endDate`][Self::endDate].
450        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
451        #[unsafe(method(setEndDate:))]
452        #[unsafe(method_family = none)]
453        pub unsafe fn setEndDate(&self, end_date: &NSDate);
454
455        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
456        #[unsafe(method(timeZone))]
457        #[unsafe(method_family = none)]
458        pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
459
460        /// Setter for [`timeZone`][Self::timeZone].
461        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
462        #[unsafe(method(setTimeZone:))]
463        #[unsafe(method_family = none)]
464        pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
465    );
466}
467
468/// Methods declared on superclass `CLKTextProvider`.
469impl CLKTimeIntervalTextProvider {
470    extern_methods!(
471        #[deprecated = "Use initializers that take parameters."]
472        #[unsafe(method(init))]
473        #[unsafe(method_family = init)]
474        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
475
476        #[deprecated = "Use factory methods that take parameters."]
477        #[unsafe(method(new))]
478        #[unsafe(method_family = new)]
479        pub unsafe fn new() -> Retained<Self>;
480    );
481}
482
483/// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clkrelativedatestyle?language=objc)
484// NS_ENUM
485#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
486#[repr(transparent)]
487#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
488pub struct CLKRelativeDateStyle(pub NSInteger);
489impl CLKRelativeDateStyle {
490    #[doc(alias = "CLKRelativeDateStyleNatural")]
491    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
492    pub const Natural: Self = Self(0);
493    #[doc(alias = "CLKRelativeDateStyleOffset")]
494    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
495    pub const Offset: Self = Self(1);
496    #[doc(alias = "CLKRelativeDateStyleTimer")]
497    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
498    pub const Timer: Self = Self(2);
499    #[doc(alias = "CLKRelativeDateStyleNaturalAbbreviated")]
500    pub const NaturalAbbreviated: Self = Self(3);
501    #[doc(alias = "CLKRelativeDateStyleOffsetShort")]
502    pub const OffsetShort: Self = Self(4);
503    #[doc(alias = "CLKRelativeDateStyleNaturalFull")]
504    pub const NaturalFull: Self = Self(5);
505}
506
507unsafe impl Encode for CLKRelativeDateStyle {
508    const ENCODING: Encoding = NSInteger::ENCODING;
509}
510
511unsafe impl RefEncode for CLKRelativeDateStyle {
512    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
513}
514
515extern_class!(
516    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clkrelativedatetextprovider?language=objc)
517    #[unsafe(super(CLKTextProvider, NSObject))]
518    #[derive(Debug, PartialEq, Eq, Hash)]
519    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
520    pub struct CLKRelativeDateTextProvider;
521);
522
523extern_conformance!(
524    unsafe impl NSCopying for CLKRelativeDateTextProvider {}
525);
526
527unsafe impl CopyingHelper for CLKRelativeDateTextProvider {
528    type Result = Self;
529}
530
531extern_conformance!(
532    unsafe impl NSObjectProtocol for CLKRelativeDateTextProvider {}
533);
534
535impl CLKRelativeDateTextProvider {
536    extern_methods!(
537        #[unsafe(method(initWithDate:style:units:))]
538        #[unsafe(method_family = init)]
539        pub unsafe fn initWithDate_style_units(
540            this: Allocated<Self>,
541            date: &NSDate,
542            style: CLKRelativeDateStyle,
543            calendar_units: NSCalendarUnit,
544        ) -> Retained<Self>;
545
546        #[unsafe(method(initWithDate:relativeToDate:style:units:))]
547        #[unsafe(method_family = init)]
548        pub unsafe fn initWithDate_relativeToDate_style_units(
549            this: Allocated<Self>,
550            date: &NSDate,
551            relative_date: Option<&NSDate>,
552            style: CLKRelativeDateStyle,
553            calendar_units: NSCalendarUnit,
554        ) -> Retained<Self>;
555
556        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
557        #[unsafe(method(textProviderWithDate:style:units:))]
558        #[unsafe(method_family = none)]
559        pub unsafe fn textProviderWithDate_style_units(
560            date: &NSDate,
561            style: CLKRelativeDateStyle,
562            calendar_units: NSCalendarUnit,
563        ) -> Retained<Self>;
564
565        #[unsafe(method(textProviderWithDate:relativeToDate:style:units:))]
566        #[unsafe(method_family = none)]
567        pub unsafe fn textProviderWithDate_relativeToDate_style_units(
568            date: &NSDate,
569            relative_to_date: Option<&NSDate>,
570            style: CLKRelativeDateStyle,
571            calendar_units: NSCalendarUnit,
572        ) -> Retained<Self>;
573
574        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
575        #[unsafe(method(date))]
576        #[unsafe(method_family = none)]
577        pub unsafe fn date(&self) -> Retained<NSDate>;
578
579        /// Setter for [`date`][Self::date].
580        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
581        #[unsafe(method(setDate:))]
582        #[unsafe(method_family = none)]
583        pub unsafe fn setDate(&self, date: &NSDate);
584
585        #[unsafe(method(relativeToDate))]
586        #[unsafe(method_family = none)]
587        pub unsafe fn relativeToDate(&self) -> Option<Retained<NSDate>>;
588
589        /// Setter for [`relativeToDate`][Self::relativeToDate].
590        #[unsafe(method(setRelativeToDate:))]
591        #[unsafe(method_family = none)]
592        pub unsafe fn setRelativeToDate(&self, relative_to_date: Option<&NSDate>);
593
594        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
595        #[unsafe(method(relativeDateStyle))]
596        #[unsafe(method_family = none)]
597        pub unsafe fn relativeDateStyle(&self) -> CLKRelativeDateStyle;
598
599        /// Setter for [`relativeDateStyle`][Self::relativeDateStyle].
600        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
601        #[unsafe(method(setRelativeDateStyle:))]
602        #[unsafe(method_family = none)]
603        pub unsafe fn setRelativeDateStyle(&self, relative_date_style: CLKRelativeDateStyle);
604
605        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
606        #[unsafe(method(calendarUnits))]
607        #[unsafe(method_family = none)]
608        pub unsafe fn calendarUnits(&self) -> NSCalendarUnit;
609
610        /// Setter for [`calendarUnits`][Self::calendarUnits].
611        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
612        #[unsafe(method(setCalendarUnits:))]
613        #[unsafe(method_family = none)]
614        pub unsafe fn setCalendarUnits(&self, calendar_units: NSCalendarUnit);
615    );
616}
617
618/// Methods declared on superclass `CLKTextProvider`.
619impl CLKRelativeDateTextProvider {
620    extern_methods!(
621        #[deprecated = "Use initializers that take parameters."]
622        #[unsafe(method(init))]
623        #[unsafe(method_family = init)]
624        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
625
626        #[deprecated = "Use factory methods that take parameters."]
627        #[unsafe(method(new))]
628        #[unsafe(method_family = new)]
629        pub unsafe fn new() -> Retained<Self>;
630    );
631}
632
633/// Localizable.
634impl CLKTextProvider {
635    extern_methods!(
636        #[unsafe(method(localizableTextProviderWithStringsFileTextKey:))]
637        #[unsafe(method_family = none)]
638        pub unsafe fn localizableTextProviderWithStringsFileTextKey(
639            text_key: &NSString,
640        ) -> Retained<Self>;
641
642        #[unsafe(method(localizableTextProviderWithStringsFileTextKey:shortTextKey:))]
643        #[unsafe(method_family = none)]
644        pub unsafe fn localizableTextProviderWithStringsFileTextKey_shortTextKey(
645            text_key: &NSString,
646            short_text_key: Option<&NSString>,
647        ) -> Retained<Self>;
648
649        #[unsafe(method(localizableTextProviderWithStringsFileFormatKey:textProviders:))]
650        #[unsafe(method_family = none)]
651        pub unsafe fn localizableTextProviderWithStringsFileFormatKey_textProviders(
652            format_key: &NSString,
653            text_providers: &NSArray<CLKTextProvider>,
654        ) -> Retained<Self>;
655    );
656}