use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
pub struct CLKTextProvider;
);
extern_conformance!(
unsafe impl NSCopying for CLKTextProvider {}
);
unsafe impl CopyingHelper for CLKTextProvider {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CLKTextProvider {}
);
impl CLKTextProvider {
extern_methods!(
#[deprecated = "Use initializers that take parameters."]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[deprecated = "Use factory methods that take parameters."]
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[cfg(feature = "objc2-ui-kit")]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(tintColor))]
#[unsafe(method_family = none)]
pub unsafe fn tintColor(&self) -> Retained<UIColor>;
#[cfg(feature = "objc2-ui-kit")]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setTintColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setTintColor(&self, tint_color: &UIColor);
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(accessibilityLabel))]
#[unsafe(method_family = none)]
pub unsafe fn accessibilityLabel(&self) -> Option<Retained<NSString>>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setAccessibilityLabel:))]
#[unsafe(method_family = none)]
pub unsafe fn setAccessibilityLabel(&self, accessibility_label: Option<&NSString>);
);
}
extern_class!(
#[unsafe(super(CLKTextProvider, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
pub struct CLKSimpleTextProvider;
);
extern_conformance!(
unsafe impl NSCopying for CLKSimpleTextProvider {}
);
unsafe impl CopyingHelper for CLKSimpleTextProvider {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CLKSimpleTextProvider {}
);
impl CLKSimpleTextProvider {
extern_methods!(
#[unsafe(method(initWithText:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithText(this: Allocated<Self>, text: &NSString) -> Retained<Self>;
#[unsafe(method(initWithText:shortText:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithText_shortText(
this: Allocated<Self>,
text: &NSString,
short_text: Option<&NSString>,
) -> Retained<Self>;
#[unsafe(method(initWithText:shortText:accessibilityLabel:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithText_shortText_accessibilityLabel(
this: Allocated<Self>,
text: &NSString,
short_text: Option<&NSString>,
accessibility_label: Option<&NSString>,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(textProviderWithText:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithText(text: &NSString) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(textProviderWithText:shortText:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithText_shortText(
text: &NSString,
short_text: Option<&NSString>,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(textProviderWithText:shortText:accessibilityLabel:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithText_shortText_accessibilityLabel(
text: &NSString,
short_text: Option<&NSString>,
accessibility_label: Option<&NSString>,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(text))]
#[unsafe(method_family = none)]
pub unsafe fn text(&self) -> Retained<NSString>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setText:))]
#[unsafe(method_family = none)]
pub unsafe fn setText(&self, text: &NSString);
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(shortText))]
#[unsafe(method_family = none)]
pub unsafe fn shortText(&self) -> Option<Retained<NSString>>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setShortText:))]
#[unsafe(method_family = none)]
pub unsafe fn setShortText(&self, short_text: Option<&NSString>);
);
}
impl CLKSimpleTextProvider {
extern_methods!(
#[deprecated = "Use initializers that take parameters."]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[deprecated = "Use factory methods that take parameters."]
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(CLKTextProvider, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
pub struct CLKDateTextProvider;
);
extern_conformance!(
unsafe impl NSCopying for CLKDateTextProvider {}
);
unsafe impl CopyingHelper for CLKDateTextProvider {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CLKDateTextProvider {}
);
impl CLKDateTextProvider {
extern_methods!(
#[unsafe(method(initWithDate:units:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDate_units(
this: Allocated<Self>,
date: &NSDate,
calendar_units: NSCalendarUnit,
) -> Retained<Self>;
#[unsafe(method(initWithDate:units:timeZone:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDate_units_timeZone(
this: Allocated<Self>,
date: &NSDate,
calendar_units: NSCalendarUnit,
time_zone: Option<&NSTimeZone>,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(textProviderWithDate:units:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithDate_units(
date: &NSDate,
calendar_units: NSCalendarUnit,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(textProviderWithDate:units:timeZone:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithDate_units_timeZone(
date: &NSDate,
calendar_units: NSCalendarUnit,
time_zone: Option<&NSTimeZone>,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(date))]
#[unsafe(method_family = none)]
pub unsafe fn date(&self) -> Retained<NSDate>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setDate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDate(&self, date: &NSDate);
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(calendarUnits))]
#[unsafe(method_family = none)]
pub unsafe fn calendarUnits(&self) -> NSCalendarUnit;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setCalendarUnits:))]
#[unsafe(method_family = none)]
pub unsafe fn setCalendarUnits(&self, calendar_units: NSCalendarUnit);
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(timeZone))]
#[unsafe(method_family = none)]
pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setTimeZone:))]
#[unsafe(method_family = none)]
pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(uppercase))]
#[unsafe(method_family = none)]
pub unsafe fn uppercase(&self) -> bool;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setUppercase:))]
#[unsafe(method_family = none)]
pub unsafe fn setUppercase(&self, uppercase: bool);
);
}
impl CLKDateTextProvider {
extern_methods!(
#[deprecated = "Use initializers that take parameters."]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[deprecated = "Use factory methods that take parameters."]
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(CLKTextProvider, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
pub struct CLKTimeTextProvider;
);
extern_conformance!(
unsafe impl NSCopying for CLKTimeTextProvider {}
);
unsafe impl CopyingHelper for CLKTimeTextProvider {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CLKTimeTextProvider {}
);
impl CLKTimeTextProvider {
extern_methods!(
#[unsafe(method(initWithDate:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDate(this: Allocated<Self>, date: &NSDate) -> Retained<Self>;
#[unsafe(method(initWithDate:timeZone:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDate_timeZone(
this: Allocated<Self>,
date: &NSDate,
time_zone: Option<&NSTimeZone>,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(textProviderWithDate:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithDate(date: &NSDate) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(textProviderWithDate:timeZone:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithDate_timeZone(
date: &NSDate,
time_zone: Option<&NSTimeZone>,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(date))]
#[unsafe(method_family = none)]
pub unsafe fn date(&self) -> Retained<NSDate>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setDate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDate(&self, date: &NSDate);
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(timeZone))]
#[unsafe(method_family = none)]
pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setTimeZone:))]
#[unsafe(method_family = none)]
pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
);
}
impl CLKTimeTextProvider {
extern_methods!(
#[deprecated = "Use initializers that take parameters."]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[deprecated = "Use factory methods that take parameters."]
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(CLKTextProvider, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
pub struct CLKTimeIntervalTextProvider;
);
extern_conformance!(
unsafe impl NSCopying for CLKTimeIntervalTextProvider {}
);
unsafe impl CopyingHelper for CLKTimeIntervalTextProvider {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CLKTimeIntervalTextProvider {}
);
impl CLKTimeIntervalTextProvider {
extern_methods!(
#[unsafe(method(initWithStartDate:endDate:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithStartDate_endDate(
this: Allocated<Self>,
start_date: &NSDate,
end_date: &NSDate,
) -> Retained<Self>;
#[unsafe(method(initWithStartDate:endDate:timeZone:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithStartDate_endDate_timeZone(
this: Allocated<Self>,
start_date: &NSDate,
end_date: &NSDate,
time_zone: Option<&NSTimeZone>,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(textProviderWithStartDate:endDate:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithStartDate_endDate(
start_date: &NSDate,
end_date: &NSDate,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(textProviderWithStartDate:endDate:timeZone:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithStartDate_endDate_timeZone(
start_date: &NSDate,
end_date: &NSDate,
time_zone: Option<&NSTimeZone>,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(startDate))]
#[unsafe(method_family = none)]
pub unsafe fn startDate(&self) -> Retained<NSDate>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setStartDate:))]
#[unsafe(method_family = none)]
pub unsafe fn setStartDate(&self, start_date: &NSDate);
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(endDate))]
#[unsafe(method_family = none)]
pub unsafe fn endDate(&self) -> Retained<NSDate>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setEndDate:))]
#[unsafe(method_family = none)]
pub unsafe fn setEndDate(&self, end_date: &NSDate);
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(timeZone))]
#[unsafe(method_family = none)]
pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setTimeZone:))]
#[unsafe(method_family = none)]
pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
);
}
impl CLKTimeIntervalTextProvider {
extern_methods!(
#[deprecated = "Use initializers that take parameters."]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[deprecated = "Use factory methods that take parameters."]
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CLKRelativeDateStyle(pub NSInteger);
impl CLKRelativeDateStyle {
#[doc(alias = "CLKRelativeDateStyleNatural")]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
pub const Natural: Self = Self(0);
#[doc(alias = "CLKRelativeDateStyleOffset")]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
pub const Offset: Self = Self(1);
#[doc(alias = "CLKRelativeDateStyleTimer")]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
pub const Timer: Self = Self(2);
#[doc(alias = "CLKRelativeDateStyleNaturalAbbreviated")]
pub const NaturalAbbreviated: Self = Self(3);
#[doc(alias = "CLKRelativeDateStyleOffsetShort")]
pub const OffsetShort: Self = Self(4);
#[doc(alias = "CLKRelativeDateStyleNaturalFull")]
pub const NaturalFull: Self = Self(5);
}
unsafe impl Encode for CLKRelativeDateStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CLKRelativeDateStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(CLKTextProvider, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
pub struct CLKRelativeDateTextProvider;
);
extern_conformance!(
unsafe impl NSCopying for CLKRelativeDateTextProvider {}
);
unsafe impl CopyingHelper for CLKRelativeDateTextProvider {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for CLKRelativeDateTextProvider {}
);
impl CLKRelativeDateTextProvider {
extern_methods!(
#[unsafe(method(initWithDate:style:units:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDate_style_units(
this: Allocated<Self>,
date: &NSDate,
style: CLKRelativeDateStyle,
calendar_units: NSCalendarUnit,
) -> Retained<Self>;
#[unsafe(method(initWithDate:relativeToDate:style:units:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDate_relativeToDate_style_units(
this: Allocated<Self>,
date: &NSDate,
relative_date: Option<&NSDate>,
style: CLKRelativeDateStyle,
calendar_units: NSCalendarUnit,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(textProviderWithDate:style:units:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithDate_style_units(
date: &NSDate,
style: CLKRelativeDateStyle,
calendar_units: NSCalendarUnit,
) -> Retained<Self>;
#[unsafe(method(textProviderWithDate:relativeToDate:style:units:))]
#[unsafe(method_family = none)]
pub unsafe fn textProviderWithDate_relativeToDate_style_units(
date: &NSDate,
relative_to_date: Option<&NSDate>,
style: CLKRelativeDateStyle,
calendar_units: NSCalendarUnit,
) -> Retained<Self>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(date))]
#[unsafe(method_family = none)]
pub unsafe fn date(&self) -> Retained<NSDate>;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setDate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDate(&self, date: &NSDate);
#[unsafe(method(relativeToDate))]
#[unsafe(method_family = none)]
pub unsafe fn relativeToDate(&self) -> Option<Retained<NSDate>>;
#[unsafe(method(setRelativeToDate:))]
#[unsafe(method_family = none)]
pub unsafe fn setRelativeToDate(&self, relative_to_date: Option<&NSDate>);
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(relativeDateStyle))]
#[unsafe(method_family = none)]
pub unsafe fn relativeDateStyle(&self) -> CLKRelativeDateStyle;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setRelativeDateStyle:))]
#[unsafe(method_family = none)]
pub unsafe fn setRelativeDateStyle(&self, relative_date_style: CLKRelativeDateStyle);
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(calendarUnits))]
#[unsafe(method_family = none)]
pub unsafe fn calendarUnits(&self) -> NSCalendarUnit;
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
#[unsafe(method(setCalendarUnits:))]
#[unsafe(method_family = none)]
pub unsafe fn setCalendarUnits(&self, calendar_units: NSCalendarUnit);
);
}
impl CLKRelativeDateTextProvider {
extern_methods!(
#[deprecated = "Use initializers that take parameters."]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[deprecated = "Use factory methods that take parameters."]
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
impl CLKTextProvider {
extern_methods!(
#[unsafe(method(localizableTextProviderWithStringsFileTextKey:))]
#[unsafe(method_family = none)]
pub unsafe fn localizableTextProviderWithStringsFileTextKey(
text_key: &NSString,
) -> Retained<Self>;
#[unsafe(method(localizableTextProviderWithStringsFileTextKey:shortTextKey:))]
#[unsafe(method_family = none)]
pub unsafe fn localizableTextProviderWithStringsFileTextKey_shortTextKey(
text_key: &NSString,
short_text_key: Option<&NSString>,
) -> Retained<Self>;
#[unsafe(method(localizableTextProviderWithStringsFileFormatKey:textProviders:))]
#[unsafe(method_family = none)]
pub unsafe fn localizableTextProviderWithStringsFileFormatKey_textProviders(
format_key: &NSString,
text_providers: &NSArray<CLKTextProvider>,
) -> Retained<Self>;
);
}