objc2_quartz/generated/ImageKit/
IKImageBrowserCell.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_app_kit::*;
7#[cfg(feature = "objc2-core-foundation")]
8use objc2_core_foundation::*;
9use objc2_foundation::*;
10#[cfg(feature = "objc2-quartz-core")]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercellstate?language=objc)
16#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct IKImageBrowserCellState(pub c_uint);
19impl IKImageBrowserCellState {
20    #[doc(alias = "IKImageStateNoImage")]
21    pub const StateNoImage: Self = Self(0);
22    #[doc(alias = "IKImageStateInvalid")]
23    pub const StateInvalid: Self = Self(1);
24    #[doc(alias = "IKImageStateReady")]
25    pub const StateReady: Self = Self(2);
26}
27
28unsafe impl Encode for IKImageBrowserCellState {
29    const ENCODING: Encoding = c_uint::ENCODING;
30}
31
32unsafe impl RefEncode for IKImageBrowserCellState {
33    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern "C" {
37    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercellbackgroundlayer?language=objc)
38    pub static IKImageBrowserCellBackgroundLayer: Option<&'static NSString>;
39}
40
41extern "C" {
42    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercellforegroundlayer?language=objc)
43    pub static IKImageBrowserCellForegroundLayer: Option<&'static NSString>;
44}
45
46extern "C" {
47    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercellselectionlayer?language=objc)
48    pub static IKImageBrowserCellSelectionLayer: Option<&'static NSString>;
49}
50
51extern "C" {
52    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercellplaceholderlayer?language=objc)
53    pub static IKImageBrowserCellPlaceHolderLayer: Option<&'static NSString>;
54}
55
56extern_class!(
57    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercell?language=objc)
58    #[unsafe(super(NSObject))]
59    #[derive(Debug, PartialEq, Eq, Hash)]
60    pub struct IKImageBrowserCell;
61);
62
63extern_conformance!(
64    unsafe impl NSObjectProtocol for IKImageBrowserCell {}
65);
66
67impl IKImageBrowserCell {
68    extern_methods!(
69        #[cfg(feature = "IKImageBrowserView")]
70        /// Returns the view the receiver uses to display its represented object.
71        ///
72        /// Subclasses should not override this method.
73        #[unsafe(method(imageBrowserView))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn imageBrowserView(
76            &self,
77            mtm: MainThreadMarker,
78        ) -> Option<Retained<IKImageBrowserView>>;
79
80        /// Returns the receiver�s represented object.
81        ///
82        /// Subclasses should not override this method.
83        #[unsafe(method(representedItem))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn representedItem(&self) -> Option<Retained<AnyObject>>;
86
87        /// Returns the index of the receiver�s represented object in the datasource.
88        ///
89        /// Subclasses should not override this method.
90        #[unsafe(method(indexOfRepresentedItem))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn indexOfRepresentedItem(&self) -> NSUInteger;
93
94        /// Returns the receiver�s frame rectangle, which defines its position in its IKImageBrowserView.
95        ///
96        /// The coordinates of this frame are in view's coordinate space. Subclasses should not override this method.
97        #[unsafe(method(frame))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn frame(&self) -> NSRect;
100
101        /// Returns the receiver�s image container frame rectangle, which defines the position of the container of the thumbnail in its IKImageBrowserView.
102        ///
103        /// The coordinates of this frame are in view's coordinate space. Subclasses can override this method to customize the position of the thumbnail container. The image frame is computed automatically from the image container frame by taking in account the image alignment and the image aspect ratio.
104        #[unsafe(method(imageContainerFrame))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn imageContainerFrame(&self) -> NSRect;
107
108        /// Returns the receiver�s image frame rectangle, which defines the position of the thumbnail in its IKImageBrowserView.
109        ///
110        /// The coordinates of this frame are in view's coordinate space. Subclasses can override this method to customize the position of the thumbnail.
111        #[unsafe(method(imageFrame))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn imageFrame(&self) -> NSRect;
114
115        /// Returns the receiver�s selection frame rectangle, which defines the position of the selection rectangle in its IKImageBrowserView.
116        ///
117        /// The coordinates of this frame are in view's coordinate space. Subclasses can override this method to customize the position of the selection frame.
118        #[unsafe(method(selectionFrame))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn selectionFrame(&self) -> NSRect;
121
122        /// Returns the receiver�s title frame rectangle, which defines the position of the title in its IKImageBrowserView.
123        ///
124        /// The coordinates of this frame are in view's coordinate space. Subclasses can override this method to customize the position of the title.
125        #[unsafe(method(titleFrame))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn titleFrame(&self) -> NSRect;
128
129        /// Returns the receiver�s subtitle frame rectangle, which defines the position of the subtitle in its IKImageBrowserView.
130        ///
131        /// The coordinates of this frame are in view's coordinate space. Subclasses can override this method to customize the position of the subtitle.
132        #[unsafe(method(subtitleFrame))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn subtitleFrame(&self) -> NSRect;
135
136        /// Returns the position of the cell�s image in the frame. The default is NSImageAlignCenter.
137        ///
138        /// Subclasses can override this method to customize the image alignment. For the list of possible alignments, see [NSImageView setImageAlignment:].
139        /// The image frame will be computed automatically from the image container frame by taking in account the image alignment and the image aspect ratio.
140        #[unsafe(method(imageAlignment))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn imageAlignment(&self) -> NSImageAlignment;
143
144        /// Returns the selection state of the receiver.
145        ///
146        /// Returns YES if the receiver is selected, otherwise NO. Subclasses should not override this method.
147        #[unsafe(method(isSelected))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn isSelected(&self) -> bool;
150
151        /// Returns the current cell state of the receiver.
152        ///
153        /// Returns IKImageStateReady if the receiver�s represented object has been set and the cell is ready to display. The IKImageBrowserView creates thumbnails asynchronously; This method returns IKImageStateNoImage until a thumbnail has been created from the represented object.
154        #[unsafe(method(cellState))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn cellState(&self) -> IKImageBrowserCellState;
157
158        #[cfg(feature = "objc2-core-foundation")]
159        /// Determines the opacity of the receiver.
160        ///
161        /// Possible values are between 0.0 (transparent) and 1.0 (opaque). Subclasses can override this method to customize the opacity of the cell.
162        #[unsafe(method(opacity))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn opacity(&self) -> CGFloat;
165
166        #[cfg(feature = "objc2-quartz-core")]
167        /// Provides the receiver�s layer for the given type. The default is nil.
168        ///
169        /// Subclasses can override this method to add a layer in the background, foreground... of the cell (see possible types above).
170        #[unsafe(method(layerForType:))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn layerForType(&self, r#type: Option<&NSString>) -> Option<Retained<CALayer>>;
173    );
174}
175
176/// Methods declared on superclass `NSObject`.
177impl IKImageBrowserCell {
178    extern_methods!(
179        #[unsafe(method(init))]
180        #[unsafe(method_family = init)]
181        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
182
183        #[unsafe(method(new))]
184        #[unsafe(method_family = new)]
185        pub unsafe fn new() -> Retained<Self>;
186    );
187}