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