objc2_itunes_library/generated/
ITLibAlbum.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
9extern_class!(
10    /// The ITLibAlbum class represents an album where a given media item (ITLibMediaItem) is contained.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibalbum?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct ITLibAlbum;
16);
17
18extern_conformance!(
19    unsafe impl NSObjectProtocol for ITLibAlbum {}
20);
21
22impl ITLibAlbum {
23    extern_methods!(
24        /// The name of this album.
25        #[unsafe(method(title))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
28
29        /// The name of this that should be used for sorting purposes.
30        #[unsafe(method(sortTitle))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn sortTitle(&self) -> Option<Retained<NSString>>;
33
34        /// Whether this album is a compilation.
35        #[unsafe(method(isCompilation))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn isCompilation(&self) -> bool;
38
39        #[cfg(feature = "ITLibArtist")]
40        /// Deprecated. Will be removed in future versions.
41        #[unsafe(method(artist))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn artist(&self) -> Option<Retained<ITLibArtist>>;
44
45        /// The number of discs in this album.
46        #[unsafe(method(discCount))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn discCount(&self) -> NSUInteger;
49
50        /// The index (i.e. 1, 2, 3, etc.) of the disc this album refers to within a compilation.
51        #[unsafe(method(discNumber))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn discNumber(&self) -> NSUInteger;
54
55        /// The rating of this track's album.
56        #[unsafe(method(rating))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn rating(&self) -> NSInteger;
59
60        /// The rating of this track's album.
61        #[unsafe(method(isRatingComputed))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn isRatingComputed(&self) -> bool;
64
65        /// Whether this track's album is gapless.
66        #[unsafe(method(isGapless))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn isGapless(&self) -> bool;
69
70        /// Number of tracks in this album.
71        #[unsafe(method(trackCount))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn trackCount(&self) -> NSUInteger;
74
75        /// The artist associated with this album.
76        #[unsafe(method(albumArtist))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn albumArtist(&self) -> Option<Retained<NSString>>;
79
80        /// The artist associated with this album. This field should be used when sorting.
81        #[unsafe(method(sortAlbumArtist))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn sortAlbumArtist(&self) -> Option<Retained<NSString>>;
84
85        /// The unique identifier of this album.
86        #[unsafe(method(persistentID))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn persistentID(&self) -> Retained<NSNumber>;
89    );
90}
91
92/// Methods declared on superclass `NSObject`.
93impl ITLibAlbum {
94    extern_methods!(
95        #[unsafe(method(init))]
96        #[unsafe(method_family = init)]
97        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
98
99        #[unsafe(method(new))]
100        #[unsafe(method_family = new)]
101        pub unsafe fn new() -> Retained<Self>;
102    );
103}