objc2-clock-kit 0.3.2

Bindings to the ClockKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clkgaugeprovider?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
    pub struct CLKGaugeProvider;
);

extern_conformance!(
    unsafe impl NSCopying for CLKGaugeProvider {}
);

unsafe impl CopyingHelper for CLKGaugeProvider {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CLKGaugeProvider {}
);

impl CLKGaugeProvider {
    extern_methods!(
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[cfg(feature = "CLKDefines")]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(style))]
        #[unsafe(method_family = none)]
        pub unsafe fn style(&self) -> CLKGaugeProviderStyle;

        #[cfg(feature = "objc2-ui-kit")]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(gaugeColors))]
        #[unsafe(method_family = none)]
        pub unsafe fn gaugeColors(&self) -> Option<Retained<NSArray<UIColor>>>;

        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(gaugeColorLocations))]
        #[unsafe(method_family = none)]
        pub unsafe fn gaugeColorLocations(&self) -> Option<Retained<NSArray<NSNumber>>>;

        /// Text for accessibility.
        #[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>>;

        /// Setter for [`accessibilityLabel`][Self::accessibilityLabel].
        #[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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clksimplegaugeprovider?language=objc)
    #[unsafe(super(CLKGaugeProvider, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
    pub struct CLKSimpleGaugeProvider;
);

extern_conformance!(
    unsafe impl NSCopying for CLKSimpleGaugeProvider {}
);

unsafe impl CopyingHelper for CLKSimpleGaugeProvider {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CLKSimpleGaugeProvider {}
);

impl CLKSimpleGaugeProvider {
    extern_methods!(
        #[cfg(all(feature = "CLKDefines", feature = "objc2-ui-kit"))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(gaugeProviderWithStyle:gaugeColors:gaugeColorLocations:fillFraction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn gaugeProviderWithStyle_gaugeColors_gaugeColorLocations_fillFraction(
            style: CLKGaugeProviderStyle,
            gauge_colors: Option<&NSArray<UIColor>>,
            gauge_color_locations: Option<&NSArray<NSNumber>>,
            fill_fraction: c_float,
        ) -> Retained<Self>;

        #[cfg(all(feature = "CLKDefines", feature = "objc2-ui-kit"))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(gaugeProviderWithStyle:gaugeColor:fillFraction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn gaugeProviderWithStyle_gaugeColor_fillFraction(
            style: CLKGaugeProviderStyle,
            color: &UIColor,
            fill_fraction: c_float,
        ) -> Retained<Self>;

        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(fillFraction))]
        #[unsafe(method_family = none)]
        pub unsafe fn fillFraction(&self) -> c_float;
    );
}

/// Methods declared on superclass `CLKGaugeProvider`.
impl CLKSimpleGaugeProvider {
    extern_methods!(
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clktimeintervalgaugeprovider?language=objc)
    #[unsafe(super(CLKGaugeProvider, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
    pub struct CLKTimeIntervalGaugeProvider;
);

extern_conformance!(
    unsafe impl NSCopying for CLKTimeIntervalGaugeProvider {}
);

unsafe impl CopyingHelper for CLKTimeIntervalGaugeProvider {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for CLKTimeIntervalGaugeProvider {}
);

impl CLKTimeIntervalGaugeProvider {
    extern_methods!(
        #[cfg(all(feature = "CLKDefines", feature = "objc2-ui-kit"))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(gaugeProviderWithStyle:gaugeColors:gaugeColorLocations:startDate:endDate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn gaugeProviderWithStyle_gaugeColors_gaugeColorLocations_startDate_endDate(
            style: CLKGaugeProviderStyle,
            gauge_colors: Option<&NSArray<UIColor>>,
            gauge_color_locations: Option<&NSArray<NSNumber>>,
            start_date: &NSDate,
            end_date: &NSDate,
        ) -> Retained<Self>;

        #[cfg(all(feature = "CLKDefines", feature = "objc2-ui-kit"))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(gaugeProviderWithStyle:gaugeColors:gaugeColorLocations:startDate:startFillFraction:endDate:endFillFraction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn gaugeProviderWithStyle_gaugeColors_gaugeColorLocations_startDate_startFillFraction_endDate_endFillFraction(
            style: CLKGaugeProviderStyle,
            gauge_colors: Option<&NSArray<UIColor>>,
            gauge_color_locations: Option<&NSArray<NSNumber>>,
            start_date: &NSDate,
            start_fill_fraction: c_float,
            end_date: &NSDate,
            end_fill_fraction: c_float,
        ) -> 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(endDate))]
        #[unsafe(method_family = none)]
        pub unsafe fn endDate(&self) -> Retained<NSDate>;

        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(startFillFraction))]
        #[unsafe(method_family = none)]
        pub unsafe fn startFillFraction(&self) -> c_float;

        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(endFillFraction))]
        #[unsafe(method_family = none)]
        pub unsafe fn endFillFraction(&self) -> c_float;
    );
}

/// Methods declared on superclass `CLKGaugeProvider`.
impl CLKTimeIntervalGaugeProvider {
    extern_methods!(
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}