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