objc2_quartz/generated/ImageKit/
IKImageBrowserView.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::*;
7use objc2_foundation::*;
8#[cfg(feature = "objc2-quartz-core")]
9use objc2_quartz_core::*;
10
11use crate::*;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikcellsstylenone?language=objc)
14pub const IKCellsStyleNone: c_uint = 0;
15/// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikcellsstyleshadowed?language=objc)
16pub const IKCellsStyleShadowed: c_uint = 1;
17/// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikcellsstyleoutlined?language=objc)
18pub const IKCellsStyleOutlined: c_uint = 2;
19/// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikcellsstyletitled?language=objc)
20pub const IKCellsStyleTitled: c_uint = 4;
21/// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikcellsstylesubtitled?language=objc)
22pub const IKCellsStyleSubtitled: c_uint = 8;
23
24/// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikgroupbezelstyle?language=objc)
25pub const IKGroupBezelStyle: c_uint = 0;
26/// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikgroupdisclosurestyle?language=objc)
27pub const IKGroupDisclosureStyle: c_uint = 1;
28
29/// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserdropoperation?language=objc)
30#[repr(transparent)]
31#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
32pub struct IKImageBrowserDropOperation(pub c_uint);
33impl IKImageBrowserDropOperation {
34    #[doc(alias = "IKImageBrowserDropOn")]
35    pub const On: Self = Self(0);
36    #[doc(alias = "IKImageBrowserDropBefore")]
37    pub const Before: Self = Self(1);
38}
39
40unsafe impl Encode for IKImageBrowserDropOperation {
41    const ENCODING: Encoding = c_uint::ENCODING;
42}
43
44unsafe impl RefEncode for IKImageBrowserDropOperation {
45    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
46}
47
48mod private_NSObjectIKImageBrowserDataSource {
49    pub trait Sealed {}
50}
51
52/// Category "IKImageBrowserDataSource" on [`NSObject`].
53/// The IKImageBrowserDataSource informal protocol declares the methods that an instance of IKImageBrowserView uses to access the contents of its data source object.
54#[doc(alias = "IKImageBrowserDataSource")]
55pub unsafe trait NSObjectIKImageBrowserDataSource:
56    ClassType + Sized + private_NSObjectIKImageBrowserDataSource::Sealed
57{
58    extern_methods!(
59        /// Returns the number of records managed for aBrowser by the data source object (required).
60        ///
61        /// An instance of IKImageView uses this method to determine how many cells it should create and display.
62        #[unsafe(method(numberOfItemsInImageBrowser:))]
63        #[unsafe(method_family = none)]
64        unsafe fn numberOfItemsInImageBrowser(
65            &self,
66            a_browser: Option<&IKImageBrowserView>,
67        ) -> NSUInteger;
68
69        /// Returns an object for the record in aBrowser corresponding to index
70        /// <i>
71        /// index
72        /// </i>
73        /// (required).
74        ///
75        /// The returned object must implement the required methods of
76        /// <i>
77        /// IKImageBrowserItem
78        /// </i>
79        /// .
80        #[unsafe(method(imageBrowser:itemAtIndex:))]
81        #[unsafe(method_family = none)]
82        unsafe fn imageBrowser_itemAtIndex(
83            &self,
84            a_browser: Option<&IKImageBrowserView>,
85            index: NSUInteger,
86        ) -> Option<Retained<AnyObject>>;
87
88        /// Invoked by the image browser after it has been determined that a remove operation should be applied (optional)
89        ///
90        /// The data source should update itself (usually by removing this indexes).
91        #[unsafe(method(imageBrowser:removeItemsAtIndexes:))]
92        #[unsafe(method_family = none)]
93        unsafe fn imageBrowser_removeItemsAtIndexes(
94            &self,
95            a_browser: Option<&IKImageBrowserView>,
96            indexes: Option<&NSIndexSet>,
97        );
98
99        /// Invoked by the image browser after it has been determined that a reordering operation should be applied (optional).
100        ///
101        /// The data source should update itself (usually by reordering its elements).
102        #[unsafe(method(imageBrowser:moveItemsAtIndexes:toIndex:))]
103        #[unsafe(method_family = none)]
104        unsafe fn imageBrowser_moveItemsAtIndexes_toIndex(
105            &self,
106            a_browser: Option<&IKImageBrowserView>,
107            indexes: Option<&NSIndexSet>,
108            destination_index: NSUInteger,
109        ) -> bool;
110
111        /// This method is called after it has been determined that a drag should begin, but before the drag has been started. 'itemIndexes' contains the indexes that will be participating in the drag. Return the number of items effectively written to the pasteboard.
112        ///
113        /// optional - drag and drop support
114        #[unsafe(method(imageBrowser:writeItemsAtIndexes:toPasteboard:))]
115        #[unsafe(method_family = none)]
116        unsafe fn imageBrowser_writeItemsAtIndexes_toPasteboard(
117            &self,
118            a_browser: Option<&IKImageBrowserView>,
119            item_indexes: Option<&NSIndexSet>,
120            pasteboard: Option<&NSPasteboard>,
121        ) -> NSUInteger;
122
123        /// Returns the number of groups
124        ///
125        /// this method is optional
126        #[unsafe(method(numberOfGroupsInImageBrowser:))]
127        #[unsafe(method_family = none)]
128        unsafe fn numberOfGroupsInImageBrowser(
129            &self,
130            a_browser: Option<&IKImageBrowserView>,
131        ) -> NSUInteger;
132
133        /// Returns the group at index 'index'
134        ///
135        /// A group is defined by a dictionay. Keys for this dictionary are defined below.
136        #[unsafe(method(imageBrowser:groupAtIndex:))]
137        #[unsafe(method_family = none)]
138        unsafe fn imageBrowser_groupAtIndex(
139            &self,
140            a_browser: Option<&IKImageBrowserView>,
141            index: NSUInteger,
142        ) -> Option<Retained<NSDictionary>>;
143    );
144}
145
146impl private_NSObjectIKImageBrowserDataSource::Sealed for NSObject {}
147unsafe impl NSObjectIKImageBrowserDataSource for NSObject {}
148
149mod private_NSObjectIKImageBrowserItem {
150    pub trait Sealed {}
151}
152
153/// Category "IKImageBrowserItem" on [`NSObject`].
154/// The IKImageBrowserItem informal protocol declares the methods that an instance of IKImageBrowserView uses to access the contents of its data source for a given item.
155///
156/// Some of the methods in this protocol, such as
157/// <i>
158/// image
159/// </i>
160/// are called very frequently, so they must be efficient.
161#[doc(alias = "IKImageBrowserItem")]
162pub unsafe trait NSObjectIKImageBrowserItem:
163    ClassType + Sized + private_NSObjectIKImageBrowserItem::Sealed
164{
165    extern_methods!(
166        /// Returns a unique string that identify this data source item (required).
167        ///
168        /// The image browser uses this identifier to keep the correspondance between its cache and the data source item
169        #[unsafe(method(imageUID))]
170        #[unsafe(method_family = none)]
171        unsafe fn imageUID(&self) -> Option<Retained<NSString>>;
172
173        /// Returns the representation of the image to display (required).
174        ///
175        /// Keys for imageRepresentationType are defined below.
176        #[unsafe(method(imageRepresentationType))]
177        #[unsafe(method_family = none)]
178        unsafe fn imageRepresentationType(&self) -> Option<Retained<NSString>>;
179
180        /// Returns the image to display (required). Can return nil if the item has no image to display.
181        #[unsafe(method(imageRepresentation))]
182        #[unsafe(method_family = none)]
183        unsafe fn imageRepresentation(&self) -> Option<Retained<AnyObject>>;
184
185        /// Returns a version of this item. The receiver can return a new version to let the image browser knows that it shouldn't use its cache for this item
186        #[unsafe(method(imageVersion))]
187        #[unsafe(method_family = none)]
188        unsafe fn imageVersion(&self) -> NSUInteger;
189
190        /// Returns the title to display as a NSString. Use setValue:forKey: with IKImageBrowserCellsTitleAttributesKey on the IKImageBrowserView instance to set text attributes.
191        #[unsafe(method(imageTitle))]
192        #[unsafe(method_family = none)]
193        unsafe fn imageTitle(&self) -> Option<Retained<NSString>>;
194
195        /// Returns the subtitle to display as a NSString. Use setValue:forKey: with IKImageBrowserCellsSubtitleAttributesKey on the IKImageBrowserView instance to set text attributes.
196        #[unsafe(method(imageSubtitle))]
197        #[unsafe(method_family = none)]
198        unsafe fn imageSubtitle(&self) -> Option<Retained<NSString>>;
199
200        /// Returns whether this item is selectable.
201        ///
202        /// The receiver can implement this methods to forbid selection of this item by returning NO.
203        #[unsafe(method(isSelectable))]
204        #[unsafe(method_family = none)]
205        unsafe fn isSelectable(&self) -> bool;
206    );
207}
208
209impl private_NSObjectIKImageBrowserItem::Sealed for NSObject {}
210unsafe impl NSObjectIKImageBrowserItem for NSObject {}
211
212extern_class!(
213    /// An IKImageBrowserView object is a view that display and browse images and movies. It supports scrolling and zooming.
214    ///
215    /// The IKImageBrowserView is deprecated. Please switch to NSCollectionView.
216    ///
217    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserview?language=objc)
218    #[unsafe(super(NSView, NSResponder, NSObject))]
219    #[derive(Debug, PartialEq, Eq, Hash)]
220    #[deprecated = "Deprecated - Please use NSCollectionView instead"]
221    pub struct IKImageBrowserView;
222);
223
224extern_conformance!(
225    unsafe impl NSAccessibility for IKImageBrowserView {}
226);
227
228extern_conformance!(
229    unsafe impl NSAccessibilityElementProtocol for IKImageBrowserView {}
230);
231
232extern_conformance!(
233    unsafe impl NSAnimatablePropertyContainer for IKImageBrowserView {}
234);
235
236extern_conformance!(
237    unsafe impl NSAppearanceCustomization for IKImageBrowserView {}
238);
239
240extern_conformance!(
241    unsafe impl NSCoding for IKImageBrowserView {}
242);
243
244extern_conformance!(
245    unsafe impl NSDraggingDestination for IKImageBrowserView {}
246);
247
248extern_conformance!(
249    unsafe impl NSDraggingSource for IKImageBrowserView {}
250);
251
252extern_conformance!(
253    unsafe impl NSObjectProtocol for IKImageBrowserView {}
254);
255
256extern_conformance!(
257    unsafe impl NSUserInterfaceItemIdentification for IKImageBrowserView {}
258);
259
260impl IKImageBrowserView {
261    extern_methods!();
262}
263
264/// Methods declared on superclass `NSView`.
265impl IKImageBrowserView {
266    extern_methods!(
267        #[unsafe(method(initWithCoder:))]
268        #[unsafe(method_family = init)]
269        pub unsafe fn initWithCoder(
270            this: Allocated<Self>,
271            coder: &NSCoder,
272        ) -> Option<Retained<Self>>;
273    );
274}
275
276/// Methods declared on superclass `NSResponder`.
277impl IKImageBrowserView {
278    extern_methods!(
279        #[unsafe(method(init))]
280        #[unsafe(method_family = init)]
281        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
282    );
283}
284
285/// Methods declared on superclass `NSObject`.
286impl IKImageBrowserView {
287    extern_methods!(
288        #[unsafe(method(new))]
289        #[unsafe(method_family = new)]
290        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
291    );
292}
293
294/// IKMainMethods.
295impl IKImageBrowserView {
296    extern_methods!(
297        /// The receiver's data source. the data source is not retained by the receiver.
298        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
299        #[unsafe(method(dataSource))]
300        #[unsafe(method_family = none)]
301        pub unsafe fn dataSource(&self) -> Option<Retained<AnyObject>>;
302
303        /// Setter for [`dataSource`][Self::dataSource].
304        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
305        #[unsafe(method(setDataSource:))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn setDataSource(&self, data_source: Option<&AnyObject>);
308
309        /// Marks the receiver as needing redisplay, so it will reload the data and draw the new values.
310        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
311        #[unsafe(method(reloadData))]
312        #[unsafe(method_family = none)]
313        pub unsafe fn reloadData(&self);
314
315        /// The receiver's delegate. aDelegate is expected to implement the IKImageBrowserDelegate informal protocol.
316        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
317        #[unsafe(method(delegate))]
318        #[unsafe(method_family = none)]
319        pub unsafe fn delegate(&self) -> Option<Retained<AnyObject>>;
320
321        /// Setter for [`delegate`][Self::delegate].
322        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
323        #[unsafe(method(setDelegate:))]
324        #[unsafe(method_family = none)]
325        pub unsafe fn setDelegate(&self, delegate: Option<&AnyObject>);
326    );
327}
328
329/// IKAppearance.
330impl IKImageBrowserView {
331    extern_methods!(
332        /// Defines the cells appearance style.
333        ///
334        /// Parameter `mask`: An integer bit mask; see the discussion below.
335        ///
336        /// mask can be specified by combining any of the options below using the C bitwise OR operator
337        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
338        #[unsafe(method(setCellsStyleMask:))]
339        #[unsafe(method_family = none)]
340        pub unsafe fn setCellsStyleMask(&self, mask: NSUInteger);
341
342        /// Return the cells appearance style mask.
343        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
344        #[unsafe(method(cellsStyleMask))]
345        #[unsafe(method_family = none)]
346        pub unsafe fn cellsStyleMask(&self) -> NSUInteger;
347
348        /// Sets whether the receiver constraints the cells's image to their original size. Default is NO.
349        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
350        #[unsafe(method(setConstrainsToOriginalSize:))]
351        #[unsafe(method_family = none)]
352        pub unsafe fn setConstrainsToOriginalSize(&self, flag: bool);
353
354        /// Returns whether the receiver constraints the cells's image to their original size.
355        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
356        #[unsafe(method(constrainsToOriginalSize))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn constrainsToOriginalSize(&self) -> bool;
359
360        #[cfg(feature = "objc2-quartz-core")]
361        /// Specifies the receiver�s background layer.
362        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
363        #[unsafe(method(setBackgroundLayer:))]
364        #[unsafe(method_family = none)]
365        pub unsafe fn setBackgroundLayer(&self, a_layer: Option<&CALayer>);
366
367        #[cfg(feature = "objc2-quartz-core")]
368        /// Provides the receiver�s background layer.
369        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
370        #[unsafe(method(backgroundLayer))]
371        #[unsafe(method_family = none)]
372        pub unsafe fn backgroundLayer(&self) -> Option<Retained<CALayer>>;
373
374        #[cfg(feature = "objc2-quartz-core")]
375        /// Specifies the receiver�s foreground layer.
376        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
377        #[unsafe(method(setForegroundLayer:))]
378        #[unsafe(method_family = none)]
379        pub unsafe fn setForegroundLayer(&self, a_layer: Option<&CALayer>);
380
381        #[cfg(feature = "objc2-quartz-core")]
382        /// Provides the receiver�s foreground layer.
383        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
384        #[unsafe(method(foregroundLayer))]
385        #[unsafe(method_family = none)]
386        pub unsafe fn foregroundLayer(&self) -> Option<Retained<CALayer>>;
387
388        #[cfg(feature = "IKImageBrowserCell")]
389        /// Returns the cell to use for the specified item. The returned cell should not be autoreleased.
390        ///
391        /// Parameter `The`: item that the returned cell will represent.
392        ///
393        /// Subclasses can override this method to customize the appearance of the cell that will represent "anItem".
394        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
395        #[unsafe(method(newCellForRepresentedItem:))]
396        #[unsafe(method_family = new)]
397        pub unsafe fn newCellForRepresentedItem(
398            &self,
399            an_item: Option<&AnyObject>,
400        ) -> Option<Retained<IKImageBrowserCell>>;
401
402        #[cfg(feature = "IKImageBrowserCell")]
403        /// Returns the cell at the specified index.
404        ///
405        /// Subclasses must not override this method.
406        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
407        #[unsafe(method(cellForItemAtIndex:))]
408        #[unsafe(method_family = none)]
409        pub unsafe fn cellForItemAtIndex(
410            &self,
411            index: NSUInteger,
412        ) -> Option<Retained<IKImageBrowserCell>>;
413    );
414}
415
416/// IKBrowsing.
417impl IKImageBrowserView {
418    extern_methods!(
419        /// Sets the zoom value to
420        /// <i>
421        /// aValue
422        /// </i>
423        /// .
424        ///
425        /// This value should be greater or equal to zero and less or equal than one. A zoom value of zero corresponds to the minimum size (40x40 pixels), A zoom value of one means images fit the browser bounds. Other values are interpolated.
426        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
427        #[unsafe(method(setZoomValue:))]
428        #[unsafe(method_family = none)]
429        pub unsafe fn setZoomValue(&self, a_value: c_float);
430
431        /// Returns the current zoom value.
432        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
433        #[unsafe(method(zoomValue))]
434        #[unsafe(method_family = none)]
435        pub unsafe fn zoomValue(&self) -> c_float;
436
437        /// Determines how the receiver resize its content when zooming.
438        ///
439        /// mask can be specified by combining any of the following options using the C bitwise OR operator:NSViewWidthSizable NSViewHeightSizable, other values are ignored.
440        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
441        #[unsafe(method(setContentResizingMask:))]
442        #[unsafe(method_family = none)]
443        pub unsafe fn setContentResizingMask(&self, mask: NSUInteger);
444
445        /// Returns the receiver�s content resizing mask, which determines how it�s content is resized while zooming.
446        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
447        #[unsafe(method(contentResizingMask))]
448        #[unsafe(method_family = none)]
449        pub unsafe fn contentResizingMask(&self) -> NSUInteger;
450
451        /// Scrolls the receiver so the item at the specified index is visible.
452        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
453        #[unsafe(method(scrollIndexToVisible:))]
454        #[unsafe(method_family = none)]
455        pub unsafe fn scrollIndexToVisible(&self, index: NSInteger);
456
457        /// sets the size of the cells to size
458        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
459        #[unsafe(method(setCellSize:))]
460        #[unsafe(method_family = none)]
461        pub unsafe fn setCellSize(&self, size: NSSize);
462
463        /// Returns the size of the cells
464        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
465        #[unsafe(method(cellSize))]
466        #[unsafe(method_family = none)]
467        pub unsafe fn cellSize(&self) -> NSSize;
468
469        /// Returns the spacing between cells in the image browser.
470        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
471        #[unsafe(method(intercellSpacing))]
472        #[unsafe(method_family = none)]
473        pub unsafe fn intercellSpacing(&self) -> NSSize;
474
475        /// Sets the spacing between cells in the matrix.
476        ///
477        /// Parameter `aSize`: The vertical and horizontal spacing to use between cells in the receiver. By default, both values are 10.0 in the receiver�s coordinate system.
478        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
479        #[unsafe(method(setIntercellSpacing:))]
480        #[unsafe(method_family = none)]
481        pub unsafe fn setIntercellSpacing(&self, a_size: NSSize);
482
483        /// Returns the item at the specified location or NSNotFound if no item at this location.
484        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
485        #[unsafe(method(indexOfItemAtPoint:))]
486        #[unsafe(method_family = none)]
487        pub unsafe fn indexOfItemAtPoint(&self, point: NSPoint) -> NSInteger;
488
489        /// Returns the frame rectangle of the item that would be drawn at the specified location.
490        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
491        #[unsafe(method(itemFrameAtIndex:))]
492        #[unsafe(method_family = none)]
493        pub unsafe fn itemFrameAtIndex(&self, index: NSInteger) -> NSRect;
494
495        /// Returns indexes of the receiver�s currently visible items.
496        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
497        #[unsafe(method(visibleItemIndexes))]
498        #[unsafe(method_family = none)]
499        pub unsafe fn visibleItemIndexes(&self) -> Option<Retained<NSIndexSet>>;
500
501        /// Returns the indexes of the receiver�s rows that intersect the specified rectangle.
502        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
503        #[unsafe(method(rowIndexesInRect:))]
504        #[unsafe(method_family = none)]
505        pub unsafe fn rowIndexesInRect(&self, rect: NSRect) -> Option<Retained<NSIndexSet>>;
506
507        /// Returns the indexes of the receiver�s columns that intersect the specified rectangle.
508        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
509        #[unsafe(method(columnIndexesInRect:))]
510        #[unsafe(method_family = none)]
511        pub unsafe fn columnIndexesInRect(&self, rect: NSRect) -> Option<Retained<NSIndexSet>>;
512
513        /// Returns the rectangle containing the column at a given index.
514        ///
515        /// Parameter `columnIndex`: The index of a column in the receiver.
516        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
517        #[unsafe(method(rectOfColumn:))]
518        #[unsafe(method_family = none)]
519        pub unsafe fn rectOfColumn(&self, column_index: NSUInteger) -> NSRect;
520
521        /// Returns the rectangle containing the row at a given index.
522        ///
523        /// Parameter `rowIndex`: The index of a row in the receiver.
524        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
525        #[unsafe(method(rectOfRow:))]
526        #[unsafe(method_family = none)]
527        pub unsafe fn rectOfRow(&self, row_index: NSUInteger) -> NSRect;
528
529        /// Returns the number of rows in the receiver.
530        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
531        #[unsafe(method(numberOfRows))]
532        #[unsafe(method_family = none)]
533        pub unsafe fn numberOfRows(&self) -> NSUInteger;
534
535        /// Returns the number of columns in the receiver.
536        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
537        #[unsafe(method(numberOfColumns))]
538        #[unsafe(method_family = none)]
539        pub unsafe fn numberOfColumns(&self) -> NSUInteger;
540
541        /// Sets whether the receiver can automatically take control of the Quick Look panel.
542        ///
543        /// Parameter `flag`: if YES, KImageBrowser can take control of the Quick Look panel automatically whenever it becomes first responder. This means that it provides the spacebar key store to open/close Quick Look panel and sets itself as the panel's datasource and delegate.
544        ///
545        /// default value is NO. IKImageBrowserView's datasource items should provide file paths or URLs as their representation (see IKImageBrowserItem protocol).
546        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
547        #[unsafe(method(setCanControlQuickLookPanel:))]
548        #[unsafe(method_family = none)]
549        pub unsafe fn setCanControlQuickLookPanel(&self, flag: bool);
550
551        /// Returns a Boolean value that indicates whether the receiver can automatically take control of the Quick Look panel.
552        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
553        #[unsafe(method(canControlQuickLookPanel))]
554        #[unsafe(method_family = none)]
555        pub unsafe fn canControlQuickLookPanel(&self) -> bool;
556    );
557}
558
559/// IKSelectionReorderingAndGrouping.
560impl IKImageBrowserView {
561    extern_methods!(
562        /// Returns the indexes of the selected cells
563        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
564        #[unsafe(method(selectionIndexes))]
565        #[unsafe(method_family = none)]
566        pub unsafe fn selectionIndexes(&self) -> Option<Retained<NSIndexSet>>;
567
568        /// Selects cells at indexes
569        /// <i>
570        /// indexes
571        /// </i>
572        /// . If
573        /// <i>
574        /// extendSelection
575        /// </i>
576        /// is YES it extends the current selection, otherwise it replaces the current selection.
577        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
578        #[unsafe(method(setSelectionIndexes:byExtendingSelection:))]
579        #[unsafe(method_family = none)]
580        pub unsafe fn setSelectionIndexes_byExtendingSelection(
581            &self,
582            indexes: Option<&NSIndexSet>,
583            extend_selection: bool,
584        );
585
586        /// Controls whether the user can select more than one cell at a time.
587        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
588        #[unsafe(method(setAllowsMultipleSelection:))]
589        #[unsafe(method_family = none)]
590        pub unsafe fn setAllowsMultipleSelection(&self, flag: bool);
591
592        /// Returns YES if the receiver allows the user to select more than one cell at a time, NO otherwise.
593        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
594        #[unsafe(method(allowsMultipleSelection))]
595        #[unsafe(method_family = none)]
596        pub unsafe fn allowsMultipleSelection(&self) -> bool;
597
598        /// Controls whether the receiver allows zero cell to be selected.
599        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
600        #[unsafe(method(setAllowsEmptySelection:))]
601        #[unsafe(method_family = none)]
602        pub unsafe fn setAllowsEmptySelection(&self, flag: bool);
603
604        /// Returns YES if the receiver allows the user to select zero cell, NO otherwise.
605        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
606        #[unsafe(method(allowsEmptySelection))]
607        #[unsafe(method_family = none)]
608        pub unsafe fn allowsEmptySelection(&self) -> bool;
609
610        /// Controls whether the user can reorder items.
611        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
612        #[unsafe(method(setAllowsReordering:))]
613        #[unsafe(method_family = none)]
614        pub unsafe fn setAllowsReordering(&self, flag: bool);
615
616        /// Returns YES if the receiver allows the user to reorder items, NO otherwise.
617        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
618        #[unsafe(method(allowsReordering))]
619        #[unsafe(method_family = none)]
620        pub unsafe fn allowsReordering(&self) -> bool;
621
622        /// Controls whether the receiver animate reordering and changes of the data source.
623        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
624        #[unsafe(method(setAnimates:))]
625        #[unsafe(method_family = none)]
626        pub unsafe fn setAnimates(&self, flag: bool);
627
628        /// Returns YES if the receiver animate changes of the data source, NO otherwise.
629        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
630        #[unsafe(method(animates))]
631        #[unsafe(method_family = none)]
632        pub unsafe fn animates(&self) -> bool;
633
634        /// Expands group at index 'index' if it is not already expanded; otherwise, does nothing.
635        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
636        #[unsafe(method(expandGroupAtIndex:))]
637        #[unsafe(method_family = none)]
638        pub unsafe fn expandGroupAtIndex(&self, index: NSUInteger);
639
640        /// Collapse group at index 'index' if it is expanded; otherwise, does nothing.
641        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
642        #[unsafe(method(collapseGroupAtIndex:))]
643        #[unsafe(method_family = none)]
644        pub unsafe fn collapseGroupAtIndex(&self, index: NSUInteger);
645
646        /// Returns YES if the group at index 'index' is expanded.
647        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
648        #[unsafe(method(isGroupExpandedAtIndex:))]
649        #[unsafe(method_family = none)]
650        pub unsafe fn isGroupExpandedAtIndex(&self, index: NSUInteger) -> bool;
651    );
652}
653
654/// IKDragNDrop.
655impl IKImageBrowserView {
656    extern_methods!(
657        /// Sets the receiver's dragging destination delegate to
658        /// <i>
659        /// delegate
660        /// </i>
661        /// .
662        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
663        #[unsafe(method(setDraggingDestinationDelegate:))]
664        #[unsafe(method_family = none)]
665        pub unsafe fn setDraggingDestinationDelegate(&self, delegate: Option<&AnyObject>);
666
667        /// Returns the receiver's dragging destination delegate.
668        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
669        #[unsafe(method(draggingDestinationDelegate))]
670        #[unsafe(method_family = none)]
671        pub unsafe fn draggingDestinationDelegate(&self) -> Option<Retained<AnyObject>>;
672
673        /// Returns the index of the cell where the drop operation occured. This index is valid when a drop occurred and until next drop.
674        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
675        #[unsafe(method(indexAtLocationOfDroppedItem))]
676        #[unsafe(method_family = none)]
677        pub unsafe fn indexAtLocationOfDroppedItem(&self) -> NSUInteger;
678
679        /// Returns the current dropOperation. The returned value is valid when a drop occurred and until next drop.
680        ///
681        /// Returns IKImageBrowserDropOn if the drop occurs on an item. Returns IKImageBrowserDropBefore otherwise.
682        /// In drag and drop, used to specify a dropOperation.  For example, given a browser with N cells (numbered with cell 0 at the top left visually), a cell of N-1 and operation of IKImageBrowserDropOn would specify a drop on the last cell.  To specify a drop after the last cell, one would use an index of N and IKImageBrowserDropBefore for the operation.
683        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
684        #[unsafe(method(dropOperation))]
685        #[unsafe(method_family = none)]
686        pub unsafe fn dropOperation(&self) -> IKImageBrowserDropOperation;
687
688        /// Controls whether the user can drop on items. Default is NO.
689        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
690        #[unsafe(method(setAllowsDroppingOnItems:))]
691        #[unsafe(method_family = none)]
692        pub unsafe fn setAllowsDroppingOnItems(&self, flag: bool);
693
694        /// Returns YES if the receiver allows the user to drop on items, NO otherwise.
695        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
696        #[unsafe(method(allowsDroppingOnItems))]
697        #[unsafe(method_family = none)]
698        pub unsafe fn allowsDroppingOnItems(&self) -> bool;
699
700        /// Used if you wish to �retarget� the proposed drop.
701        ///
702        /// To specify a drop on the second item, one would specify index as 1, and operation as IKImageBrowserDropOn. To specify a drop after the last item, one would specify index as the number of items and operation as IKImageBrowserDropBefore. Passing a value of �1 for index, and IKImageBrowserDropOn as the operation causes the entire browser view to be highlighted rather than a specific item. This is useful if the data displayed by the receiver does not allow the user to drop items at a specific item location.
703        #[deprecated = "Deprecated - Please use NSCollectionView instead"]
704        #[unsafe(method(setDropIndex:dropOperation:))]
705        #[unsafe(method_family = none)]
706        pub unsafe fn setDropIndex_dropOperation(
707            &self,
708            index: NSInteger,
709            operation: IKImageBrowserDropOperation,
710        );
711    );
712}
713
714mod private_NSObjectIKImageBrowserDelegate {
715    pub trait Sealed {}
716}
717
718/// Category "IKImageBrowserDelegate" on [`NSObject`].
719/// Informal protocol for image browser 's delegate
720#[doc(alias = "IKImageBrowserDelegate")]
721pub unsafe trait NSObjectIKImageBrowserDelegate:
722    ClassType + Sized + private_NSObjectIKImageBrowserDelegate::Sealed
723{
724    extern_methods!(
725        /// Invoked by 'aBrowser' when the selection did change
726        #[unsafe(method(imageBrowserSelectionDidChange:))]
727        #[unsafe(method_family = none)]
728        unsafe fn imageBrowserSelectionDidChange(&self, a_browser: Option<&IKImageBrowserView>);
729
730        /// Invoked by 'aBrowser' when a cell was double clicked.
731        ///
732        /// Parameter `index`: Index of the cell that was double clicked.
733        #[unsafe(method(imageBrowser:cellWasDoubleClickedAtIndex:))]
734        #[unsafe(method_family = none)]
735        unsafe fn imageBrowser_cellWasDoubleClickedAtIndex(
736            &self,
737            a_browser: Option<&IKImageBrowserView>,
738            index: NSUInteger,
739        );
740
741        /// Invoked by 'aBrowser' when a cell was right clicked or left clicked with the Alt key pressed.
742        ///
743        /// Parameter `index`: Index of the cell that was right clicked.
744        #[unsafe(method(imageBrowser:cellWasRightClickedAtIndex:withEvent:))]
745        #[unsafe(method_family = none)]
746        unsafe fn imageBrowser_cellWasRightClickedAtIndex_withEvent(
747            &self,
748            a_browser: Option<&IKImageBrowserView>,
749            index: NSUInteger,
750            event: Option<&NSEvent>,
751        );
752
753        /// Invoked by 'aBrowser' when a the background was right clicked or left clicked with the Alt key pressed.
754        #[unsafe(method(imageBrowser:backgroundWasRightClickedWithEvent:))]
755        #[unsafe(method_family = none)]
756        unsafe fn imageBrowser_backgroundWasRightClickedWithEvent(
757            &self,
758            a_browser: Option<&IKImageBrowserView>,
759            event: Option<&NSEvent>,
760        );
761    );
762}
763
764impl private_NSObjectIKImageBrowserDelegate::Sealed for NSObject {}
765unsafe impl NSObjectIKImageBrowserDelegate for NSObject {}
766
767extern "C" {
768    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserpathrepresentationtype?language=objc)
769    pub static IKImageBrowserPathRepresentationType: Option<&'static NSString>;
770}
771
772extern "C" {
773    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsernsurlrepresentationtype?language=objc)
774    pub static IKImageBrowserNSURLRepresentationType: Option<&'static NSString>;
775}
776
777extern "C" {
778    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsernsimagerepresentationtype?language=objc)
779    pub static IKImageBrowserNSImageRepresentationType: Option<&'static NSString>;
780}
781
782extern "C" {
783    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercgimagerepresentationtype?language=objc)
784    pub static IKImageBrowserCGImageRepresentationType: Option<&'static NSString>;
785}
786
787extern "C" {
788    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercgimagesourcerepresentationtype?language=objc)
789    pub static IKImageBrowserCGImageSourceRepresentationType: Option<&'static NSString>;
790}
791
792extern "C" {
793    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsernsdatarepresentationtype?language=objc)
794    pub static IKImageBrowserNSDataRepresentationType: Option<&'static NSString>;
795}
796
797extern "C" {
798    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsernsbitmapimagerepresentationtype?language=objc)
799    pub static IKImageBrowserNSBitmapImageRepresentationType: Option<&'static NSString>;
800}
801
802extern "C" {
803    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserqtmovierepresentationtype?language=objc)
804    pub static IKImageBrowserQTMovieRepresentationType: Option<&'static NSString>;
805}
806
807extern "C" {
808    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserqtmoviepathrepresentationtype?language=objc)
809    pub static IKImageBrowserQTMoviePathRepresentationType: Option<&'static NSString>;
810}
811
812extern "C" {
813    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserqccompositionrepresentationtype?language=objc)
814    pub static IKImageBrowserQCCompositionRepresentationType: Option<&'static NSString>;
815}
816
817extern "C" {
818    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserqccompositionpathrepresentationtype?language=objc)
819    pub static IKImageBrowserQCCompositionPathRepresentationType: Option<&'static NSString>;
820}
821
822extern "C" {
823    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserquicklookpathrepresentationtype?language=objc)
824    pub static IKImageBrowserQuickLookPathRepresentationType: Option<&'static NSString>;
825}
826
827extern "C" {
828    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsericonrefpathrepresentationtype?language=objc)
829    pub static IKImageBrowserIconRefPathRepresentationType: Option<&'static NSString>;
830}
831
832extern "C" {
833    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsericonrefrepresentationtype?language=objc)
834    pub static IKImageBrowserIconRefRepresentationType: Option<&'static NSString>;
835}
836
837extern "C" {
838    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserpdfpagerepresentationtype?language=objc)
839    pub static IKImageBrowserPDFPageRepresentationType: Option<&'static NSString>;
840}
841
842extern "C" {
843    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserbackgroundcolorkey?language=objc)
844    pub static IKImageBrowserBackgroundColorKey: Option<&'static NSString>;
845}
846
847extern "C" {
848    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowserselectioncolorkey?language=objc)
849    pub static IKImageBrowserSelectionColorKey: Option<&'static NSString>;
850}
851
852extern "C" {
853    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercellsoutlinecolorkey?language=objc)
854    pub static IKImageBrowserCellsOutlineColorKey: Option<&'static NSString>;
855}
856
857extern "C" {
858    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercellstitleattributeskey?language=objc)
859    pub static IKImageBrowserCellsTitleAttributesKey: Option<&'static NSString>;
860}
861
862extern "C" {
863    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercellshighlightedtitleattributeskey?language=objc)
864    pub static IKImageBrowserCellsHighlightedTitleAttributesKey: Option<&'static NSString>;
865}
866
867extern "C" {
868    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsercellssubtitleattributeskey?language=objc)
869    pub static IKImageBrowserCellsSubtitleAttributesKey: Option<&'static NSString>;
870}
871
872extern "C" {
873    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsergrouprangekey?language=objc)
874    pub static IKImageBrowserGroupRangeKey: Option<&'static NSString>;
875}
876
877extern "C" {
878    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsergroupbackgroundcolorkey?language=objc)
879    pub static IKImageBrowserGroupBackgroundColorKey: Option<&'static NSString>;
880}
881
882extern "C" {
883    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsergrouptitlekey?language=objc)
884    pub static IKImageBrowserGroupTitleKey: Option<&'static NSString>;
885}
886
887extern "C" {
888    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsergroupstylekey?language=objc)
889    pub static IKImageBrowserGroupStyleKey: Option<&'static NSString>;
890}
891
892extern "C" {
893    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsergroupheaderlayer?language=objc)
894    pub static IKImageBrowserGroupHeaderLayer: Option<&'static NSString>;
895}
896
897extern "C" {
898    /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimagebrowsergroupfooterlayer?language=objc)
899    pub static IKImageBrowserGroupFooterLayer: Option<&'static NSString>;
900}