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

/// [Apple's documentation](https://developer.apple.com/documentation/intents/invocabularystringtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct INVocabularyStringType(pub NSInteger);
impl INVocabularyStringType {
    /// The name of a contact as a person will say it, for example “Jon Smith”, “Apple”.
    #[doc(alias = "INVocabularyStringTypeContactName")]
    pub const ContactName: Self = Self(1);
    /// The name of a group of contacts as a person will say it, for example "Tahoe Trip".
    #[doc(alias = "INVocabularyStringTypeContactGroupName")]
    pub const ContactGroupName: Self = Self(2);
    /// A keyword associated with an image or images, for example "food", "Vacation".
    #[doc(alias = "INVocabularyStringTypePhotoTag")]
    pub const PhotoTag: Self = Self(100);
    /// The name for a photograph album, for example "WWDC 2015 Karaoke".
    /// You may find that INVocabularyStringTypePhotoTag is a better match for concepts that are similar to, but not exactly, albums.
    #[doc(alias = "INVocabularyStringTypePhotoAlbumName")]
    pub const PhotoAlbumName: Self = Self(101);
    /// The name a user has created for a workout, for example  “Half Marathon”, “Kettlebell exercise”
    #[doc(alias = "INVocabularyStringTypeWorkoutActivityName")]
    pub const WorkoutActivityName: Self = Self(200);
    /// The name of a vehicle configuration profile, for example "Roadtrip", "Rally", "Good Weather".
    /// For use by automaker apps that are enabled to work with CarPlay
    /// <https
    /// ://developer.apple.com/carplay/>.
    #[doc(alias = "INVocabularyStringTypeCarProfileName")]
    pub const CarProfileName: Self = Self(300);
    /// The name of a vehicle as a person will say it, for example “BMW”, “My Convertible”.
    #[doc(alias = "INVocabularyStringTypeCarName")]
    pub const CarName: Self = Self(301);
    /// The name of an organization to pay as a person will say it, for example “PG
    /// &E
    /// ”, “Comcast”.
    #[doc(alias = "INVocabularyStringTypePaymentsOrganizationName")]
    pub const PaymentsOrganizationName: Self = Self(400);
    /// The name of an account nick name as a person will say it, for example “Checking”, “Rainy day savings”.
    #[doc(alias = "INVocabularyStringTypePaymentsAccountNickname")]
    pub const PaymentsAccountNickname: Self = Self(401);
    /// The title of a note, task, or task list as a person will say it; for example, "Grocery list" or "Weekly meeting minutes".
    #[doc(alias = "INVocabularyStringTypeNotebookItemTitle")]
    pub const NotebookItemTitle: Self = Self(500);
    /// The name of the note or task list's group (folder, directory, account); for example, "iCloud" or "Shopping"
    #[doc(alias = "INVocabularyStringTypeNotebookItemGroupName")]
    pub const NotebookItemGroupName: Self = Self(501);
    /// The title of a playlist as a person will say it, for example "Today's Hits".
    #[doc(alias = "INVocabularyStringTypeMediaPlaylistTitle")]
    pub const MediaPlaylistTitle: Self = Self(700);
    /// The name of a music artist as a person will say it, for example "The Beatles".
    #[doc(alias = "INVocabularyStringTypeMediaMusicArtistName")]
    pub const MediaMusicArtistName: Self = Self(701);
    /// The title of an audiobook as a person will say it, for example "The Time Machine".
    #[doc(alias = "INVocabularyStringTypeMediaAudiobookTitle")]
    pub const MediaAudiobookTitle: Self = Self(702);
    /// The name of an audiobook author as a person will say it, for example "Mary Shelley".
    #[doc(alias = "INVocabularyStringTypeMediaAudiobookAuthorName")]
    pub const MediaAudiobookAuthorName: Self = Self(703);
    /// The name of a Podcast or Radio show title as a person will say it, for example "Fresh Air".
    #[doc(alias = "INVocabularyStringTypeMediaShowTitle")]
    pub const MediaShowTitle: Self = Self(704);
}

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

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

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

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

impl INVocabulary {
    extern_methods!(
        #[unsafe(method(sharedVocabulary))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedVocabulary() -> Retained<Self>;

        /// Replaces all vocabulary strings already set for the given type.
        /// Strings should be sorted by their expected importance to the user, in descending order.
        /// There is no guarantee that every provided string will be used, but preference is given to strings at the beginning of the set.
        /// Any strings larger than 1024 bytes when encoded as UTF-16 (roughly 500 characters) will be discarded.
        #[unsafe(method(setVocabularyStrings:ofType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setVocabularyStrings_ofType(
            &self,
            vocabulary: &NSOrderedSet<NSString>,
            r#type: INVocabularyStringType,
        );

        #[cfg(feature = "INSpeakable")]
        #[unsafe(method(setVocabulary:ofType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setVocabulary_ofType(
            &self,
            vocabulary: &NSOrderedSet<ProtocolObject<dyn INSpeakable>>,
            r#type: INVocabularyStringType,
        );

        /// Removes all vocabulary strings for every INVocabularyStringType the calling app has previously registered.
        #[unsafe(method(removeAllVocabularyStrings))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeAllVocabularyStrings(&self);
    );
}

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