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        #[deprecated]
42        #[unsafe(method(artist))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn artist(&self) -> Option<Retained<ITLibArtist>>;
45
46        /// The number of discs in this album.
47        #[unsafe(method(discCount))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn discCount(&self) -> NSUInteger;
50
51        /// The index (i.e. 1, 2, 3, etc.) of the disc this album refers to within a compilation.
52        #[unsafe(method(discNumber))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn discNumber(&self) -> NSUInteger;
55
56        /// The rating of this track's album.
57        #[unsafe(method(rating))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn rating(&self) -> NSInteger;
60
61        /// The rating of this track's album.
62        #[unsafe(method(isRatingComputed))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn isRatingComputed(&self) -> bool;
65
66        /// Whether this track's album is gapless.
67        #[unsafe(method(isGapless))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn isGapless(&self) -> bool;
70
71        /// Number of tracks in this album.
72        #[unsafe(method(trackCount))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn trackCount(&self) -> NSUInteger;
75
76        /// The artist associated with this album.
77        #[unsafe(method(albumArtist))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn albumArtist(&self) -> Option<Retained<NSString>>;
80
81        /// The artist associated with this album. This field should be used when sorting.
82        #[unsafe(method(sortAlbumArtist))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn sortAlbumArtist(&self) -> Option<Retained<NSString>>;
85
86        /// The unique identifier of this album.
87        #[unsafe(method(persistentID))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn persistentID(&self) -> Retained<NSNumber>;
90    );
91}
92
93/// Methods declared on superclass `NSObject`.
94impl ITLibAlbum {
95    extern_methods!(
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99
100        #[unsafe(method(new))]
101        #[unsafe(method_family = new)]
102        pub unsafe fn new() -> Retained<Self>;
103    );
104}