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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-location")]
use objc2_core_location::*;
use objc2_foundation::*;

use crate::*;

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

#[cfg(feature = "INIntent")]
extern_conformance!(
    unsafe impl NSCoding for INSearchForNotebookItemsIntent {}
);

#[cfg(feature = "INIntent")]
extern_conformance!(
    unsafe impl NSCopying for INSearchForNotebookItemsIntent {}
);

#[cfg(feature = "INIntent")]
unsafe impl CopyingHelper for INSearchForNotebookItemsIntent {
    type Result = Self;
}

#[cfg(feature = "INIntent")]
extern_conformance!(
    unsafe impl NSObjectProtocol for INSearchForNotebookItemsIntent {}
);

#[cfg(feature = "INIntent")]
extern_conformance!(
    unsafe impl NSSecureCoding for INSearchForNotebookItemsIntent {}
);

#[cfg(feature = "INIntent")]
impl INSearchForNotebookItemsIntent {
    extern_methods!(
        #[cfg(all(
            feature = "INDateComponentsRange",
            feature = "INDateSearchType",
            feature = "INLocationSearchType",
            feature = "INNotebookItemType",
            feature = "INSpeakableString",
            feature = "INTaskPriority",
            feature = "INTaskStatus",
            feature = "INTemporalEventTriggerTypeOptions",
            feature = "objc2-core-location"
        ))]
        #[unsafe(method(initWithTitle:content:itemType:status:location:locationSearchType:dateTime:dateSearchType:temporalEventTriggerTypes:taskPriority:notebookItemIdentifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTitle_content_itemType_status_location_locationSearchType_dateTime_dateSearchType_temporalEventTriggerTypes_taskPriority_notebookItemIdentifier(
            this: Allocated<Self>,
            title: Option<&INSpeakableString>,
            content: Option<&NSString>,
            item_type: INNotebookItemType,
            status: INTaskStatus,
            location: Option<&CLPlacemark>,
            location_search_type: INLocationSearchType,
            date_time: Option<&INDateComponentsRange>,
            date_search_type: INDateSearchType,
            temporal_event_trigger_types: INTemporalEventTriggerTypeOptions,
            task_priority: INTaskPriority,
            notebook_item_identifier: Option<&NSString>,
        ) -> Retained<Self>;

        #[cfg(feature = "INSpeakableString")]
        #[unsafe(method(title))]
        #[unsafe(method_family = none)]
        pub unsafe fn title(&self) -> Option<Retained<INSpeakableString>>;

        #[unsafe(method(content))]
        #[unsafe(method_family = none)]
        pub unsafe fn content(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "INNotebookItemType")]
        #[unsafe(method(itemType))]
        #[unsafe(method_family = none)]
        pub unsafe fn itemType(&self) -> INNotebookItemType;

        #[cfg(feature = "INTaskStatus")]
        #[unsafe(method(status))]
        #[unsafe(method_family = none)]
        pub unsafe fn status(&self) -> INTaskStatus;

        #[cfg(feature = "objc2-core-location")]
        #[unsafe(method(location))]
        #[unsafe(method_family = none)]
        pub unsafe fn location(&self) -> Option<Retained<CLPlacemark>>;

        #[cfg(feature = "INLocationSearchType")]
        #[unsafe(method(locationSearchType))]
        #[unsafe(method_family = none)]
        pub unsafe fn locationSearchType(&self) -> INLocationSearchType;

        #[cfg(feature = "INDateComponentsRange")]
        #[unsafe(method(dateTime))]
        #[unsafe(method_family = none)]
        pub unsafe fn dateTime(&self) -> Option<Retained<INDateComponentsRange>>;

        #[cfg(feature = "INDateSearchType")]
        #[unsafe(method(dateSearchType))]
        #[unsafe(method_family = none)]
        pub unsafe fn dateSearchType(&self) -> INDateSearchType;

        #[cfg(feature = "INTemporalEventTriggerTypeOptions")]
        #[unsafe(method(temporalEventTriggerTypes))]
        #[unsafe(method_family = none)]
        pub unsafe fn temporalEventTriggerTypes(&self) -> INTemporalEventTriggerTypeOptions;

        #[cfg(feature = "INTaskPriority")]
        #[unsafe(method(taskPriority))]
        #[unsafe(method_family = none)]
        pub unsafe fn taskPriority(&self) -> INTaskPriority;

        #[unsafe(method(notebookItemIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn notebookItemIdentifier(&self) -> Option<Retained<NSString>>;
    );
}

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

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

extern_protocol!(
    /// Protocol to declare support for handling an INSearchForNotebookItemsIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
    ///
    /// The minimum requirement for an implementing class is that it should be able to handle the intent. The resolution and confirmation methods are optional. The handling method is always called last, after resolving and confirming the intent.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/insearchfornotebookitemsintenthandling?language=objc)
    pub unsafe trait INSearchForNotebookItemsIntentHandling: NSObjectProtocol {
        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResponse",
            feature = "INSearchForNotebookItemsIntentResponse",
            feature = "block2"
        ))]
        /// Handling method - Execute the task represented by the INSearchForNotebookItemsIntent that's passed in
        ///
        /// Called to actually execute the intent. The app must return a response for this intent.
        ///
        ///
        /// Parameter `intent`: The input intent
        ///
        /// Parameter `completion`: The response handling block takes a INSearchForNotebookItemsIntentResponse containing the details of the result of having executed the intent
        ///
        ///
        /// See: INSearchForNotebookItemsIntentResponse
        #[unsafe(method(handleSearchForNotebookItems:completion:))]
        #[unsafe(method_family = none)]
        unsafe fn handleSearchForNotebookItems_completion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INSearchForNotebookItemsIntentResponse>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResponse",
            feature = "INSearchForNotebookItemsIntentResponse",
            feature = "block2"
        ))]
        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
        ///
        /// Called prior to asking the app to handle the intent. The app should return a response object that contains additional information about the intent, which may be relevant for the system to show the user prior to handling. If unimplemented, the system will assume the intent is valid following resolution, and will assume there is no additional information relevant to this intent.
        ///
        ///
        /// Parameter `intent`: The input intent
        ///
        /// Parameter `completion`: The response block contains an INSearchForNotebookItemsIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
        ///
        ///
        /// See: INSearchForNotebookItemsIntentResponse
        #[optional]
        #[unsafe(method(confirmSearchForNotebookItems:completion:))]
        #[unsafe(method_family = none)]
        unsafe fn confirmSearchForNotebookItems_completion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INSearchForNotebookItemsIntentResponse>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INSpeakableStringResolutionResult",
            feature = "block2"
        ))]
        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
        ///
        /// Called to make sure the app extension is capable of handling this intent in its current form. This method is for validating if the intent needs any further fleshing out.
        ///
        ///
        /// Parameter `intent`: The input intent
        ///
        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
        ///
        ///
        /// See: INIntentResolutionResult
        #[optional]
        #[unsafe(method(resolveTitleForSearchForNotebookItems:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveTitleForSearchForNotebookItems_withCompletion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INSpeakableStringResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INStringResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveContentForSearchForNotebookItems:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveContentForSearchForNotebookItems_withCompletion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INStringResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INNotebookItemTypeResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveItemTypeForSearchForNotebookItems:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveItemTypeForSearchForNotebookItems_withCompletion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INNotebookItemTypeResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INTaskStatusResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveStatusForSearchForNotebookItems:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveStatusForSearchForNotebookItems_withCompletion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INTaskStatusResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INPlacemarkResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveLocationForSearchForNotebookItems:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveLocationForSearchForNotebookItems_withCompletion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INPlacemarkResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INLocationSearchTypeResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveLocationSearchTypeForSearchForNotebookItems:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveLocationSearchTypeForSearchForNotebookItems_withCompletion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INLocationSearchTypeResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INDateComponentsRangeResolutionResult",
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveDateTimeForSearchForNotebookItems:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveDateTimeForSearchForNotebookItems_withCompletion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INDateComponentsRangeResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INDateSearchTypeResolutionResult",
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveDateSearchTypeForSearchForNotebookItems:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveDateSearchTypeForSearchForNotebookItems_withCompletion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INDateSearchTypeResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INTemporalEventTriggerTypeOptionsResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveTemporalEventTriggerTypesForSearchForNotebookItems:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveTemporalEventTriggerTypesForSearchForNotebookItems_withCompletion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<
                dyn Fn(NonNull<INTemporalEventTriggerTypeOptionsResolutionResult>),
            >,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INTaskPriorityResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveTaskPriorityForSearchForNotebookItems:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveTaskPriorityForSearchForNotebookItems_withCompletion(
            &self,
            intent: &INSearchForNotebookItemsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INTaskPriorityResolutionResult>)>,
        );
    }
);