objc2_intents/generated/
INVocabulary.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/intents/invocabularystringtype?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct INVocabularyStringType(pub NSInteger);
15impl INVocabularyStringType {
16    /// The name of a contact as a person will say it, for example “Jon Smith”, “Apple”.
17    #[doc(alias = "INVocabularyStringTypeContactName")]
18    pub const ContactName: Self = Self(1);
19    /// The name of a group of contacts as a person will say it, for example "Tahoe Trip".
20    #[doc(alias = "INVocabularyStringTypeContactGroupName")]
21    pub const ContactGroupName: Self = Self(2);
22    /// A keyword associated with an image or images, for example "food", "Vacation".
23    #[doc(alias = "INVocabularyStringTypePhotoTag")]
24    pub const PhotoTag: Self = Self(100);
25    /// The name for a photograph album, for example "WWDC 2015 Karaoke".
26    /// You may find that INVocabularyStringTypePhotoTag is a better match for concepts that are similar to, but not exactly, albums.
27    #[doc(alias = "INVocabularyStringTypePhotoAlbumName")]
28    pub const PhotoAlbumName: Self = Self(101);
29    /// The name a user has created for a workout, for example  “Half Marathon”, “Kettlebell exercise”
30    #[doc(alias = "INVocabularyStringTypeWorkoutActivityName")]
31    pub const WorkoutActivityName: Self = Self(200);
32    /// The name of a vehicle configuration profile, for example "Roadtrip", "Rally", "Good Weather".
33    /// For use by automaker apps that are enabled to work with CarPlay
34    /// <https
35    /// ://developer.apple.com/carplay/>.
36    #[doc(alias = "INVocabularyStringTypeCarProfileName")]
37    pub const CarProfileName: Self = Self(300);
38    /// The name of a vehicle as a person will say it, for example “BMW”, “My Convertible”.
39    #[doc(alias = "INVocabularyStringTypeCarName")]
40    pub const CarName: Self = Self(301);
41    /// The name of an organization to pay as a person will say it, for example “PG
42    /// &E
43    /// ”, “Comcast”.
44    #[doc(alias = "INVocabularyStringTypePaymentsOrganizationName")]
45    pub const PaymentsOrganizationName: Self = Self(400);
46    /// The name of an account nick name as a person will say it, for example “Checking”, “Rainy day savings”.
47    #[doc(alias = "INVocabularyStringTypePaymentsAccountNickname")]
48    pub const PaymentsAccountNickname: Self = Self(401);
49    /// The title of a note, task, or task list as a person will say it; for example, "Grocery list" or "Weekly meeting minutes".
50    #[doc(alias = "INVocabularyStringTypeNotebookItemTitle")]
51    pub const NotebookItemTitle: Self = Self(500);
52    /// The name of the note or task list's group (folder, directory, account); for example, "iCloud" or "Shopping"
53    #[doc(alias = "INVocabularyStringTypeNotebookItemGroupName")]
54    pub const NotebookItemGroupName: Self = Self(501);
55    /// The title of a playlist as a person will say it, for example "Today's Hits".
56    #[doc(alias = "INVocabularyStringTypeMediaPlaylistTitle")]
57    pub const MediaPlaylistTitle: Self = Self(700);
58    /// The name of a music artist as a person will say it, for example "The Beatles".
59    #[doc(alias = "INVocabularyStringTypeMediaMusicArtistName")]
60    pub const MediaMusicArtistName: Self = Self(701);
61    /// The title of an audiobook as a person will say it, for example "The Time Machine".
62    #[doc(alias = "INVocabularyStringTypeMediaAudiobookTitle")]
63    pub const MediaAudiobookTitle: Self = Self(702);
64    /// The name of an audiobook author as a person will say it, for example "Mary Shelley".
65    #[doc(alias = "INVocabularyStringTypeMediaAudiobookAuthorName")]
66    pub const MediaAudiobookAuthorName: Self = Self(703);
67    /// The name of a Podcast or Radio show title as a person will say it, for example "Fresh Air".
68    #[doc(alias = "INVocabularyStringTypeMediaShowTitle")]
69    pub const MediaShowTitle: Self = Self(704);
70}
71
72unsafe impl Encode for INVocabularyStringType {
73    const ENCODING: Encoding = NSInteger::ENCODING;
74}
75
76unsafe impl RefEncode for INVocabularyStringType {
77    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
78}
79
80extern_class!(
81    /// [Apple's documentation](https://developer.apple.com/documentation/intents/invocabulary?language=objc)
82    #[unsafe(super(NSObject))]
83    #[derive(Debug, PartialEq, Eq, Hash)]
84    pub struct INVocabulary;
85);
86
87extern_conformance!(
88    unsafe impl NSObjectProtocol for INVocabulary {}
89);
90
91impl INVocabulary {
92    extern_methods!(
93        #[unsafe(method(sharedVocabulary))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn sharedVocabulary() -> Retained<Self>;
96
97        /// Replaces all vocabulary strings already set for the given type.
98        /// Strings should be sorted by their expected importance to the user, in descending order.
99        /// There is no guarantee that every provided string will be used, but preference is given to strings at the beginning of the set.
100        /// Any strings larger than 1024 bytes when encoded as UTF-16 (roughly 500 characters) will be discarded.
101        #[unsafe(method(setVocabularyStrings:ofType:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn setVocabularyStrings_ofType(
104            &self,
105            vocabulary: &NSOrderedSet<NSString>,
106            r#type: INVocabularyStringType,
107        );
108
109        #[cfg(feature = "INSpeakable")]
110        #[unsafe(method(setVocabulary:ofType:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn setVocabulary_ofType(
113            &self,
114            vocabulary: &NSOrderedSet<ProtocolObject<dyn INSpeakable>>,
115            r#type: INVocabularyStringType,
116        );
117
118        /// Removes all vocabulary strings for every INVocabularyStringType the calling app has previously registered.
119        #[unsafe(method(removeAllVocabularyStrings))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn removeAllVocabularyStrings(&self);
122    );
123}
124
125/// Methods declared on superclass `NSObject`.
126impl INVocabulary {
127    extern_methods!(
128        #[unsafe(method(init))]
129        #[unsafe(method_family = init)]
130        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
131
132        #[unsafe(method(new))]
133        #[unsafe(method_family = new)]
134        pub unsafe fn new() -> Retained<Self>;
135    );
136}