objc2_itunes_library/generated/
ITLibArtwork.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::*;
5#[cfg(feature = "objc2-app-kit")]
6use objc2_app_kit::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11/// These constants specify the possible formats of the data returned by ITLibArtwork's imageData method.
12///
13/// The image data format is unknown.
14///
15/// The image data format is a bitmap.
16///
17/// The image data corresponds to a JPEG image.
18///
19/// The image data corresponds to a JPEG2000 image.
20///
21/// The image data corresponds to a GIF image.
22///
23/// The image data corresponds to a PNG image.
24///
25/// The image data corresponds to a BMP image.
26///
27/// The image data corresponds to a TIFF image.
28///
29/// The image data corresponds to a PICT image.
30///
31/// See also [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibartworkformat?language=objc)
32// NS_ENUM
33#[repr(transparent)]
34#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
35pub struct ITLibArtworkFormat(pub NSUInteger);
36impl ITLibArtworkFormat {
37    #[doc(alias = "ITLibArtworkFormatNone")]
38    pub const None: Self = Self(0);
39    #[doc(alias = "ITLibArtworkFormatBitmap")]
40    pub const Bitmap: Self = Self(1);
41    #[doc(alias = "ITLibArtworkFormatJPEG")]
42    pub const JPEG: Self = Self(2);
43    #[doc(alias = "ITLibArtworkFormatJPEG2000")]
44    pub const JPEG2000: Self = Self(3);
45    #[doc(alias = "ITLibArtworkFormatGIF")]
46    pub const GIF: Self = Self(4);
47    #[doc(alias = "ITLibArtworkFormatPNG")]
48    pub const PNG: Self = Self(5);
49    #[doc(alias = "ITLibArtworkFormatBMP")]
50    pub const BMP: Self = Self(6);
51    #[doc(alias = "ITLibArtworkFormatTIFF")]
52    pub const TIFF: Self = Self(7);
53    #[doc(alias = "ITLibArtworkFormatPICT")]
54    pub const PICT: Self = Self(8);
55}
56
57unsafe impl Encode for ITLibArtworkFormat {
58    const ENCODING: Encoding = NSUInteger::ENCODING;
59}
60
61unsafe impl RefEncode for ITLibArtworkFormat {
62    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
63}
64
65extern_class!(
66    /// The ITLibArtwork class represents a media item artwork.
67    ///
68    /// See also [Apple's documentation](https://developer.apple.com/documentation/ituneslibrary/itlibartwork?language=objc)
69    #[unsafe(super(NSObject))]
70    #[derive(Debug, PartialEq, Eq, Hash)]
71    pub struct ITLibArtwork;
72);
73
74extern_conformance!(
75    unsafe impl NSObjectProtocol for ITLibArtwork {}
76);
77
78impl ITLibArtwork {
79    extern_methods!(
80        #[cfg(feature = "objc2-app-kit")]
81        /// The NSImage formed by calling [[NSImage alloc] initWithData:self.imageData].
82        #[unsafe(method(image))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
85
86        /// The data (bytes) of this artwork image.
87        #[unsafe(method(imageData))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn imageData(&self) -> Option<Retained<NSData>>;
90
91        /// The fortmat of the data returned by the imageData method.
92        #[unsafe(method(imageDataFormat))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn imageDataFormat(&self) -> ITLibArtworkFormat;
95    );
96}
97
98/// Methods declared on superclass `NSObject`.
99impl ITLibArtwork {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108    );
109}