1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//! 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>;
);
}