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::*;

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/clockkit/clkcomplicationdatasource?language=objc)
    pub unsafe trait CLKComplicationDataSource: NSObjectProtocol + MainThreadOnly {
        #[cfg(all(feature = "CLKComplication", feature = "block2"))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[optional]
        #[unsafe(method(getTimelineEndDateForComplication:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getTimelineEndDateForComplication_withHandler(
            &self,
            complication: &CLKComplication,
            handler: &block2::DynBlock<dyn Fn(*mut NSDate)>,
        );

        #[cfg(all(
            feature = "CLKComplication",
            feature = "CLKDefines",
            feature = "block2"
        ))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[optional]
        #[unsafe(method(getPrivacyBehaviorForComplication:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getPrivacyBehaviorForComplication_withHandler(
            &self,
            complication: &CLKComplication,
            handler: &block2::DynBlock<dyn Fn(CLKComplicationPrivacyBehavior)>,
        );

        #[cfg(all(
            feature = "CLKComplication",
            feature = "CLKDefines",
            feature = "block2"
        ))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[optional]
        #[unsafe(method(getTimelineAnimationBehaviorForComplication:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getTimelineAnimationBehaviorForComplication_withHandler(
            &self,
            complication: &CLKComplication,
            handler: &block2::DynBlock<dyn Fn(CLKComplicationTimelineAnimationBehavior)>,
        );

        #[cfg(all(
            feature = "CLKComplication",
            feature = "CLKComplicationTemplate",
            feature = "block2"
        ))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[optional]
        #[unsafe(method(getAlwaysOnTemplateForComplication:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getAlwaysOnTemplateForComplication_withHandler(
            &self,
            complication: &CLKComplication,
            handler: &block2::DynBlock<dyn Fn(*mut CLKComplicationTemplate)>,
        );

        #[cfg(all(
            feature = "CLKComplication",
            feature = "CLKComplicationTimelineEntry",
            feature = "block2"
        ))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[unsafe(method(getCurrentTimelineEntryForComplication:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getCurrentTimelineEntryForComplication_withHandler(
            &self,
            complication: &CLKComplication,
            handler: &block2::DynBlock<dyn Fn(*mut CLKComplicationTimelineEntry)>,
        );

        #[cfg(all(
            feature = "CLKComplication",
            feature = "CLKComplicationTimelineEntry",
            feature = "block2"
        ))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[optional]
        #[unsafe(method(getTimelineEntriesForComplication:afterDate:limit:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getTimelineEntriesForComplication_afterDate_limit_withHandler(
            &self,
            complication: &CLKComplication,
            date: &NSDate,
            limit: NSUInteger,
            handler: &block2::DynBlock<dyn Fn(*mut NSArray<CLKComplicationTimelineEntry>)>,
        );

        #[cfg(all(
            feature = "CLKComplication",
            feature = "CLKComplicationTemplate",
            feature = "block2"
        ))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[optional]
        #[unsafe(method(getLocalizableSampleTemplateForComplication:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getLocalizableSampleTemplateForComplication_withHandler(
            &self,
            complication: &CLKComplication,
            handler: &block2::DynBlock<dyn Fn(*mut CLKComplicationTemplate)>,
        );

        #[cfg(all(feature = "CLKComplicationDescriptor", feature = "block2"))]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[optional]
        #[unsafe(method(getComplicationDescriptorsWithHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getComplicationDescriptorsWithHandler(
            &self,
            handler: &block2::DynBlock<dyn Fn(NonNull<NSArray<CLKComplicationDescriptor>>)>,
        );

        #[cfg(feature = "CLKComplicationDescriptor")]
        #[deprecated = "On watchOS 9.0 or later, use WidgetKit instead"]
        #[optional]
        #[unsafe(method(handleSharedComplicationDescriptors:))]
        #[unsafe(method_family = none)]
        unsafe fn handleSharedComplicationDescriptors(
            &self,
            complication_descriptors: &NSArray<CLKComplicationDescriptor>,
        );

        #[cfg(feature = "CLKComplicationWidgetMigrator")]
        #[optional]
        #[unsafe(method(widgetMigrator))]
        #[unsafe(method_family = none)]
        unsafe fn widgetMigrator(
            &self,
        ) -> Retained<ProtocolObject<dyn CLKComplicationWidgetMigrator>>;

        #[cfg(all(
            feature = "CLKComplication",
            feature = "CLKComplicationTemplate",
            feature = "block2"
        ))]
        #[deprecated]
        #[optional]
        #[unsafe(method(getPlaceholderTemplateForComplication:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getPlaceholderTemplateForComplication_withHandler(
            &self,
            complication: &CLKComplication,
            handler: &block2::DynBlock<dyn Fn(*mut CLKComplicationTemplate)>,
        );

        #[cfg(all(
            feature = "CLKComplication",
            feature = "CLKDefines",
            feature = "block2"
        ))]
        #[deprecated = "Time Travel is no longer supported. Use CLKComplicationDataSource's getTimelineEndDateForComplication:withHandler: to specify forward timeline support."]
        #[optional]
        #[unsafe(method(getSupportedTimeTravelDirectionsForComplication:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getSupportedTimeTravelDirectionsForComplication_withHandler(
            &self,
            complication: &CLKComplication,
            handler: &block2::DynBlock<dyn Fn(CLKComplicationTimeTravelDirections)>,
        );

        #[cfg(all(feature = "CLKComplication", feature = "block2"))]
        #[deprecated = "Time Travel and backwards extension of timelines are no longer supported."]
        #[optional]
        #[unsafe(method(getTimelineStartDateForComplication:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getTimelineStartDateForComplication_withHandler(
            &self,
            complication: &CLKComplication,
            handler: &block2::DynBlock<dyn Fn(*mut NSDate)>,
        );

        #[cfg(all(
            feature = "CLKComplication",
            feature = "CLKComplicationTimelineEntry",
            feature = "block2"
        ))]
        #[deprecated = "Time Travel and backwards extension of timelines are no longer supported."]
        #[optional]
        #[unsafe(method(getTimelineEntriesForComplication:beforeDate:limit:withHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getTimelineEntriesForComplication_beforeDate_limit_withHandler(
            &self,
            complication: &CLKComplication,
            date: &NSDate,
            limit: NSUInteger,
            handler: &block2::DynBlock<dyn Fn(*mut NSArray<CLKComplicationTimelineEntry>)>,
        );

        #[cfg(feature = "block2")]
        #[deprecated = "Use WKRefreshBackgroundTask instead"]
        #[optional]
        #[unsafe(method(getNextRequestedUpdateDateWithHandler:))]
        #[unsafe(method_family = none)]
        unsafe fn getNextRequestedUpdateDateWithHandler(
            &self,
            handler: &block2::DynBlock<dyn Fn(*mut NSDate)>,
        );

        #[deprecated = "Use WKRefreshBackgroundTask instead"]
        #[optional]
        #[unsafe(method(requestedUpdateDidBegin))]
        #[unsafe(method_family = none)]
        unsafe fn requestedUpdateDidBegin(&self);

        #[deprecated = "Use WKRefreshBackgroundTask instead"]
        #[optional]
        #[unsafe(method(requestedUpdateBudgetExhausted))]
        #[unsafe(method_family = none)]
        unsafe fn requestedUpdateBudgetExhausted(&self);
    }
);