objc2_itunes_library/generated/
ITLibPlaylist.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// These constants specify the possible kinds of playlists.
10///
11///
12/// The playlist is not a distinguished playlist.
13///
14/// The playlist contains all the movies in the iTunes Library.
15///
16/// The playlists contains all the TV shows in the iTunes Library.
17///
18/// The playlist contains all the music items in the iTunes Library.
19///
20/// The playlist contains all the audiobooks in the iTunes Library
21///
22/// The playlist contains all the ringtones in the iTunes Library.
23///
24/// The playlist contains all the podcasts in the iTunes library
25///
26/// The playlist contains all voice memos.
27///
28/// The playlist contains all the iOS applications of the user in iTunes.
29///
30/// The playlist contains all the user's purchases in the iTunes Store.
31///
32/// The playlist contains the user's iTunesU items.
33///
34/// The playlist is the default 90's music iTunes playlist.
35///
36/// The playlist is the default Top Rated smart playlist generated by iTunes.
37///
38/// The playlist is the default 25 Most Played smart playlist generated by iTunes.
39///
40/// The playlist is the default Recently Played smart playlist generated by iTunes .
41///
42/// The playlist is the default Recently Added smart playlist generated by iTunes.
43///
44/// The playlist is the default Music Videos smart playlist generated by iTunes.
45///
46/// The playlist is the default Classical Music smart playlist generated by iTunes.
47///
48/// The playlist contains all music videos in the iTunes Library. This is NOT the same as the default Music Videos smart playlist.
49///
50/// The playlist contains all homes videos in the iTunes Library.
51///
52/// The playlist is the default Music Shows and Movies smart playlist generated by iTunes.
53///
54/// See also [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibdistinguishedplaylistkind?language=objc)
55// NS_ENUM
56#[repr(transparent)]
57#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
58pub struct ITLibDistinguishedPlaylistKind(pub NSUInteger);
59impl ITLibDistinguishedPlaylistKind {
60    #[doc(alias = "ITLibDistinguishedPlaylistKindNone")]
61    pub const KindNone: Self = Self(0);
62    #[doc(alias = "ITLibDistinguishedPlaylistKindMovies")]
63    pub const KindMovies: Self = Self(1);
64    #[doc(alias = "ITLibDistinguishedPlaylistKindTVShows")]
65    pub const KindTVShows: Self = Self(2);
66    #[doc(alias = "ITLibDistinguishedPlaylistKindMusic")]
67    pub const KindMusic: Self = Self(3);
68    #[doc(alias = "ITLibDistinguishedPlaylistKindAudiobooks")]
69    pub const KindAudiobooks: Self = Self(4);
70    #[doc(alias = "ITLibDistinguishedPlaylistKindBooks")]
71    pub const KindBooks: Self = Self(ITLibDistinguishedPlaylistKind::KindAudiobooks.0);
72    #[doc(alias = "ITLibDistinguishedPlaylistKindRingtones")]
73    pub const KindRingtones: Self = Self(5);
74    #[doc(alias = "ITLibDistinguishedPlaylistKindPodcasts")]
75    pub const KindPodcasts: Self = Self(7);
76    #[doc(alias = "ITLibDistinguishedPlaylistKindVoiceMemos")]
77    pub const KindVoiceMemos: Self = Self(14);
78    #[doc(alias = "ITLibDistinguishedPlaylistKindPurchases")]
79    pub const KindPurchases: Self = Self(16);
80    #[doc(alias = "ITLibDistinguishedPlaylistKindiTunesU")]
81    pub const KindiTunesU: Self = Self(26);
82    #[doc(alias = "ITLibDistinguishedPlaylistKind90sMusic")]
83    pub const Kind90sMusic: Self = Self(42);
84    #[doc(alias = "ITLibDistinguishedPlaylistKindMyTopRated")]
85    pub const KindMyTopRated: Self = Self(43);
86    #[doc(alias = "ITLibDistinguishedPlaylistKindTop25MostPlayed")]
87    pub const KindTop25MostPlayed: Self = Self(44);
88    #[doc(alias = "ITLibDistinguishedPlaylistKindRecentlyPlayed")]
89    pub const KindRecentlyPlayed: Self = Self(45);
90    #[doc(alias = "ITLibDistinguishedPlaylistKindRecentlyAdded")]
91    pub const KindRecentlyAdded: Self = Self(46);
92    #[doc(alias = "ITLibDistinguishedPlaylistKindMusicVideos")]
93    pub const KindMusicVideos: Self = Self(47);
94    #[doc(alias = "ITLibDistinguishedPlaylistKindClassicalMusic")]
95    pub const KindClassicalMusic: Self = Self(48);
96    #[doc(alias = "ITLibDistinguishedPlaylistKindLibraryMusicVideos")]
97    pub const KindLibraryMusicVideos: Self = Self(49);
98    #[doc(alias = "ITLibDistinguishedPlaylistKindHomeVideos")]
99    pub const KindHomeVideos: Self = Self(50);
100    #[doc(alias = "ITLibDistinguishedPlaylistKindApplications")]
101    pub const KindApplications: Self = Self(51);
102    #[doc(alias = "ITLibDistinguishedPlaylistKindLovedSongs")]
103    pub const KindLovedSongs: Self = Self(52);
104    #[doc(alias = "ITLibDistinguishedPlaylistKindMusicShowsAndMovies")]
105    pub const KindMusicShowsAndMovies: Self = Self(53);
106}
107
108unsafe impl Encode for ITLibDistinguishedPlaylistKind {
109    const ENCODING: Encoding = NSUInteger::ENCODING;
110}
111
112unsafe impl RefEncode for ITLibDistinguishedPlaylistKind {
113    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
114}
115
116/// These constants specify the possible kinds of playlists.
117///
118///
119/// A normal playlist created by the user or by iTunes (e.g. "Music", "Movies", "Brit-Pop Mix" or "My Awesome Stone Roses Playlist").
120///
121/// A smart playlist whose contents are dynamically generated by evaluating a set of rules. (e.g. "90s Music" or "Songs From 1999").
122///
123/// A saved Genius playlist.
124///
125/// A playlist folder created by the user or by iTunes (e.g. "My Playlist Folder" or "Genius Mixes").
126///
127/// A Genius Mix playlist.
128///
129/// See also [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylistkind?language=objc)
130// NS_ENUM
131#[repr(transparent)]
132#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
133pub struct ITLibPlaylistKind(pub NSUInteger);
134impl ITLibPlaylistKind {
135    #[doc(alias = "ITLibPlaylistKindRegular")]
136    pub const Regular: Self = Self(0);
137    #[doc(alias = "ITLibPlaylistKindSmart")]
138    pub const Smart: Self = Self(1);
139    #[doc(alias = "ITLibPlaylistKindGenius")]
140    pub const Genius: Self = Self(2);
141    #[doc(alias = "ITLibPlaylistKindFolder")]
142    pub const Folder: Self = Self(3);
143    #[doc(alias = "ITLibPlaylistKindGeniusMix")]
144    pub const GeniusMix: Self = Self(4);
145}
146
147unsafe impl Encode for ITLibPlaylistKind {
148    const ENCODING: Encoding = NSUInteger::ENCODING;
149}
150
151unsafe impl RefEncode for ITLibPlaylistKind {
152    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
153}
154
155extern_class!(
156    /// A playlist is a collection of related media items. (Media items are described in ITLibMediaItem Class Reference.)
157    /// Each playlist has a name, a set of attributes, and a unique identifier that persists across application launches.
158    ///
159    /// See also [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylist?language=objc)
160    #[unsafe(super(ITLibMediaEntity, NSObject))]
161    #[derive(Debug, PartialEq, Eq, Hash)]
162    #[cfg(feature = "ITLibMediaEntity")]
163    pub struct ITLibPlaylist;
164);
165
166#[cfg(feature = "ITLibMediaEntity")]
167extern_conformance!(
168    unsafe impl NSObjectProtocol for ITLibPlaylist {}
169);
170
171#[cfg(feature = "ITLibMediaEntity")]
172impl ITLibPlaylist {
173    extern_methods!(
174        /// The name or title of this playlist.
175        #[unsafe(method(name))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn name(&self) -> Retained<NSString>;
178
179        /// Whether this playlist is the primary playlist.
180        #[unsafe(method(isPrimary))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn isPrimary(&self) -> bool;
183
184        /// The unique identifier of this playlist' parent.
185        #[unsafe(method(parentID))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn parentID(&self) -> Option<Retained<NSNumber>>;
188
189        /// Whether this playlist is visible.
190        #[unsafe(method(isVisible))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn isVisible(&self) -> bool;
193
194        /// Whether or not every item in this playlist is exposed via this API.  Generally true but not that useful.
195        #[deprecated]
196        #[unsafe(method(isAllItemsPlaylist))]
197        #[unsafe(method_family = none)]
198        pub unsafe fn isAllItemsPlaylist(&self) -> bool;
199
200        #[cfg(feature = "ITLibMediaItem")]
201        /// The media items contained within this playlist.
202        #[unsafe(method(items))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn items(&self) -> Retained<NSArray<ITLibMediaItem>>;
205
206        /// The distinguished kind of this playlist.
207        #[unsafe(method(distinguishedKind))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn distinguishedKind(&self) -> ITLibDistinguishedPlaylistKind;
210
211        /// The kind of this playlist.
212        #[unsafe(method(kind))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn kind(&self) -> ITLibPlaylistKind;
215
216        /// Whether this playlist is the primary playlist.
217        #[deprecated]
218        #[unsafe(method(isMaster))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn isMaster(&self) -> bool;
221    );
222}
223
224/// Methods declared on superclass `NSObject`.
225#[cfg(feature = "ITLibMediaEntity")]
226impl ITLibPlaylist {
227    extern_methods!(
228        #[unsafe(method(init))]
229        #[unsafe(method_family = init)]
230        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
231
232        #[unsafe(method(new))]
233        #[unsafe(method_family = new)]
234        pub unsafe fn new() -> Retained<Self>;
235    );
236}
237
238extern "C" {
239    /// Retrieves the name or title of the playlist. See
240    ///
241    /// ```text
242    ///  name
243    /// ```
244    ///
245    /// .
246    ///
247    /// See also [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylistpropertyname?language=objc)
248    pub static ITLibPlaylistPropertyName: &'static NSString;
249}
250
251extern "C" {
252    /// [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylistpropertyallitemsplaylist?language=objc)
253    pub static ITLibPlaylistPropertyAllItemsPlaylist: &'static NSString;
254}
255
256extern "C" {
257    /// [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylistpropertydistinguisedkind?language=objc)
258    pub static ITLibPlaylistPropertyDistinguisedKind: &'static NSString;
259}
260
261extern "C" {
262    /// [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylistpropertyprimary?language=objc)
263    pub static ITLibPlaylistPropertyPrimary: &'static NSString;
264}
265
266extern "C" {
267    /// [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylistpropertyparentpersistentid?language=objc)
268    pub static ITLibPlaylistPropertyParentPersistentID: &'static NSString;
269}
270
271extern "C" {
272    /// [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylistpropertyvisible?language=objc)
273    pub static ITLibPlaylistPropertyVisible: &'static NSString;
274}
275
276extern "C" {
277    /// [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylistpropertyitems?language=objc)
278    pub static ITLibPlaylistPropertyItems: &'static NSString;
279}
280
281extern "C" {
282    /// [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylistpropertykind?language=objc)
283    pub static ITLibPlaylistPropertyKind: &'static NSString;
284}
285
286extern "C" {
287    /// [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibplaylistpropertymaster?language=objc)
288    #[deprecated]
289    pub static ITLibPlaylistPropertyMaster: &'static NSString;
290}