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/inintent?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct INIntent;
);

extern_conformance!(
    unsafe impl NSCoding for INIntent {}
);

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

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

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

extern_conformance!(
    unsafe impl NSSecureCoding for INIntent {}
);

impl INIntent {
    extern_methods!(
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;

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

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

        /// Setter for [`suggestedInvocationPhrase`][Self::suggestedInvocationPhrase].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSuggestedInvocationPhrase:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSuggestedInvocationPhrase(
            &self,
            suggested_invocation_phrase: Option<&NSString>,
        );

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

        #[cfg(feature = "INShortcutAvailabilityOptions")]
        /// Setter for [`shortcutAvailability`][Self::shortcutAvailability].
        #[unsafe(method(setShortcutAvailability:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShortcutAvailability(
            &self,
            shortcut_availability: INShortcutAvailabilityOptions,
        );

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

        #[cfg(feature = "INIntentDonationMetadata")]
        /// Setter for [`donationMetadata`][Self::donationMetadata].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDonationMetadata:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDonationMetadata(
            &self,
            donation_metadata: Option<&INIntentDonationMetadata>,
        );

        #[cfg(feature = "INImage")]
        #[unsafe(method(setImage:forParameterNamed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setImage_forParameterNamed(
            &self,
            image: Option<&INImage>,
            parameter_name: &NSString,
        );

        #[cfg(feature = "INImage")]
        #[unsafe(method(imageForParameterNamed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn imageForParameterNamed(
            &self,
            parameter_name: &NSString,
        ) -> Option<Retained<INImage>>;

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

/// Methods declared on superclass `NSObject`.
impl INIntent {
    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>;
    );
}