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

use crate::*;

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

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

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

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

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

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

#[cfg(feature = "INIntent")]
impl INSearchForMessagesIntent {
    extern_methods!(
        #[cfg(all(
            feature = "INDateComponentsRange",
            feature = "INMessageAttributeOptions",
            feature = "INPerson",
            feature = "INSpeakableString"
        ))]
        #[unsafe(method(initWithRecipients:senders:searchTerms:attributes:dateTimeRange:identifiers:notificationIdentifiers:speakableGroupNames:conversationIdentifiers:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRecipients_senders_searchTerms_attributes_dateTimeRange_identifiers_notificationIdentifiers_speakableGroupNames_conversationIdentifiers(
            this: Allocated<Self>,
            recipients: Option<&NSArray<INPerson>>,
            senders: Option<&NSArray<INPerson>>,
            search_terms: Option<&NSArray<NSString>>,
            attributes: INMessageAttributeOptions,
            date_time_range: Option<&INDateComponentsRange>,
            identifiers: Option<&NSArray<NSString>>,
            notification_identifiers: Option<&NSArray<NSString>>,
            speakable_group_names: Option<&NSArray<INSpeakableString>>,
            conversation_identifiers: Option<&NSArray<NSString>>,
        ) -> Retained<Self>;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "INIntent")]
impl INSearchForMessagesIntent {
    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 INSearchForMessagesIntent. 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/insearchformessagesintenthandling?language=objc)
    pub unsafe trait INSearchForMessagesIntentHandling: NSObjectProtocol {
        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResponse",
            feature = "INSearchForMessagesIntentResponse",
            feature = "block2"
        ))]
        /// Handling method - Execute the task represented by the INSearchForMessagesIntent 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 INSearchForMessagesIntentResponse containing the details of the result of having executed the intent
        ///
        ///
        /// See: INSearchForMessagesIntentResponse
        #[unsafe(method(handleSearchForMessages:completion:))]
        #[unsafe(method_family = none)]
        unsafe fn handleSearchForMessages_completion(
            &self,
            intent: &INSearchForMessagesIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INSearchForMessagesIntentResponse>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResponse",
            feature = "INSearchForMessagesIntentResponse",
            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 INSearchForMessagesIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
        ///
        ///
        /// See: INSearchForMessagesIntentResponse
        #[optional]
        #[unsafe(method(confirmSearchForMessages:completion:))]
        #[unsafe(method_family = none)]
        unsafe fn confirmSearchForMessages_completion(
            &self,
            intent: &INSearchForMessagesIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INSearchForMessagesIntentResponse>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INPersonResolutionResult",
            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(resolveRecipientsForSearchForMessages:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveRecipientsForSearchForMessages_withCompletion(
            &self,
            intent: &INSearchForMessagesIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<NSArray<INPersonResolutionResult>>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INPersonResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveSendersForSearchForMessages:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveSendersForSearchForMessages_withCompletion(
            &self,
            intent: &INSearchForMessagesIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<NSArray<INPersonResolutionResult>>)>,
        );

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

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

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INStringResolutionResult",
            feature = "block2"
        ))]
        #[deprecated = "resolveGroupNamesForSearchForMessages:withCompletion: is deprecated. Use resolveSpeakableGroupNamesForSearchForMessages:withCompletion: instead"]
        #[optional]
        #[unsafe(method(resolveGroupNamesForSearchForMessages:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveGroupNamesForSearchForMessages_withCompletion(
            &self,
            intent: &INSearchForMessagesIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<NSArray<INStringResolutionResult>>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INSpeakableStringResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveSpeakableGroupNamesForSearchForMessages:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveSpeakableGroupNamesForSearchForMessages_withCompletion(
            &self,
            intent: &INSearchForMessagesIntent,
            completion: &block2::DynBlock<
                dyn Fn(NonNull<NSArray<INSpeakableStringResolutionResult>>),
            >,
        );
    }
);