objc2-intents 0.3.2

Bindings to the Intents framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/intents/insnoozetaskstaskunsupportedreason?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct INSnoozeTasksTaskUnsupportedReason(pub NSInteger);
impl INSnoozeTasksTaskUnsupportedReason {
    #[doc(alias = "INSnoozeTasksTaskUnsupportedReasonNoTasksFound")]
    pub const NoTasksFound: Self = Self(1);
}

unsafe impl Encode for INSnoozeTasksTaskUnsupportedReason {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for INSnoozeTasksTaskUnsupportedReason {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/intents/insnoozetaskstaskresolutionresult?language=objc)
    #[unsafe(super(INTaskResolutionResult, INIntentResolutionResult, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "INIntentResolutionResult",
        feature = "INTaskResolutionResult"
    ))]
    pub struct INSnoozeTasksTaskResolutionResult;
);

#[cfg(all(
    feature = "INIntentResolutionResult",
    feature = "INTaskResolutionResult"
))]
extern_conformance!(
    unsafe impl NSObjectProtocol for INSnoozeTasksTaskResolutionResult {}
);

#[cfg(all(
    feature = "INIntentResolutionResult",
    feature = "INTaskResolutionResult"
))]
impl INSnoozeTasksTaskResolutionResult {
    extern_methods!(
        #[unsafe(method(unsupportedForReason:))]
        #[unsafe(method_family = none)]
        pub unsafe fn unsupportedForReason(
            reason: INSnoozeTasksTaskUnsupportedReason,
        ) -> Retained<Self>;

        #[unsafe(method(initWithTaskResolutionResult:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTaskResolutionResult(
            this: Allocated<Self>,
            task_resolution_result: &INTaskResolutionResult,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `INTaskResolutionResult`.
#[cfg(all(
    feature = "INIntentResolutionResult",
    feature = "INTaskResolutionResult"
))]
impl INSnoozeTasksTaskResolutionResult {
    extern_methods!(
        #[cfg(feature = "INTask")]
        #[unsafe(method(successWithResolvedTask:))]
        #[unsafe(method_family = none)]
        pub unsafe fn successWithResolvedTask(resolved_task: &INTask) -> Retained<Self>;

        #[cfg(feature = "INTask")]
        #[unsafe(method(disambiguationWithTasksToDisambiguate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn disambiguationWithTasksToDisambiguate(
            tasks_to_disambiguate: &NSArray<INTask>,
        ) -> Retained<Self>;

        #[cfg(feature = "INTask")]
        #[unsafe(method(confirmationRequiredWithTaskToConfirm:))]
        #[unsafe(method_family = none)]
        pub unsafe fn confirmationRequiredWithTaskToConfirm(
            task_to_confirm: Option<&INTask>,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `INIntentResolutionResult`.
#[cfg(all(
    feature = "INIntentResolutionResult",
    feature = "INTaskResolutionResult"
))]
impl INSnoozeTasksTaskResolutionResult {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(needsValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn needsValue() -> Retained<Self>;

        #[unsafe(method(notRequired))]
        #[unsafe(method_family = none)]
        pub unsafe fn notRequired() -> Retained<Self>;

        #[unsafe(method(unsupported))]
        #[unsafe(method_family = none)]
        pub unsafe fn unsupported() -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(
    feature = "INIntentResolutionResult",
    feature = "INTaskResolutionResult"
))]
impl INSnoozeTasksTaskResolutionResult {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}