objc2_app_kit/generated/
NSScrubber.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_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubberdatasource?language=objc)
12    pub unsafe trait NSScrubberDataSource: NSObjectProtocol + MainThreadOnly {
13        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
14        #[unsafe(method(numberOfItemsForScrubber:))]
15        #[unsafe(method_family = none)]
16        unsafe fn numberOfItemsForScrubber(&self, scrubber: &NSScrubber) -> NSInteger;
17
18        #[cfg(all(
19            feature = "NSResponder",
20            feature = "NSScrubberItemView",
21            feature = "NSView"
22        ))]
23        #[unsafe(method(scrubber:viewForItemAtIndex:))]
24        #[unsafe(method_family = none)]
25        unsafe fn scrubber_viewForItemAtIndex(
26            &self,
27            scrubber: &NSScrubber,
28            index: NSInteger,
29        ) -> Retained<NSScrubberItemView>;
30    }
31);
32
33extern_protocol!(
34    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubberdelegate?language=objc)
35    pub unsafe trait NSScrubberDelegate: NSObjectProtocol + MainThreadOnly {
36        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
37        #[optional]
38        #[unsafe(method(scrubber:didSelectItemAtIndex:))]
39        #[unsafe(method_family = none)]
40        unsafe fn scrubber_didSelectItemAtIndex(
41            &self,
42            scrubber: &NSScrubber,
43            selected_index: NSInteger,
44        );
45
46        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
47        #[optional]
48        #[unsafe(method(scrubber:didHighlightItemAtIndex:))]
49        #[unsafe(method_family = none)]
50        unsafe fn scrubber_didHighlightItemAtIndex(
51            &self,
52            scrubber: &NSScrubber,
53            highlighted_index: NSInteger,
54        );
55
56        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
57        #[optional]
58        #[unsafe(method(scrubber:didChangeVisibleRange:))]
59        #[unsafe(method_family = none)]
60        unsafe fn scrubber_didChangeVisibleRange(
61            &self,
62            scrubber: &NSScrubber,
63            visible_range: NSRange,
64        );
65
66        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
67        #[optional]
68        #[unsafe(method(didBeginInteractingWithScrubber:))]
69        #[unsafe(method_family = none)]
70        unsafe fn didBeginInteractingWithScrubber(&self, scrubber: &NSScrubber);
71
72        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
73        #[optional]
74        #[unsafe(method(didFinishInteractingWithScrubber:))]
75        #[unsafe(method_family = none)]
76        unsafe fn didFinishInteractingWithScrubber(&self, scrubber: &NSScrubber);
77
78        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
79        #[optional]
80        #[unsafe(method(didCancelInteractingWithScrubber:))]
81        #[unsafe(method_family = none)]
82        unsafe fn didCancelInteractingWithScrubber(&self, scrubber: &NSScrubber);
83    }
84);
85
86/// Determines the interaction mode for a NSScrubber control.
87///
88/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubbermode?language=objc)
89// NS_ENUM
90#[repr(transparent)]
91#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
92pub struct NSScrubberMode(pub NSInteger);
93impl NSScrubberMode {
94    #[doc(alias = "NSScrubberModeFixed")]
95    pub const Fixed: Self = Self(0);
96    #[doc(alias = "NSScrubberModeFree")]
97    pub const Free: Self = Self(1);
98}
99
100unsafe impl Encode for NSScrubberMode {
101    const ENCODING: Encoding = NSInteger::ENCODING;
102}
103
104unsafe impl RefEncode for NSScrubberMode {
105    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
106}
107
108/// NSScrubberAlignment specifies the preferred alignment of elements within the control.
109///
110/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubberalignment?language=objc)
111// NS_ENUM
112#[repr(transparent)]
113#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
114pub struct NSScrubberAlignment(pub NSInteger);
115impl NSScrubberAlignment {
116    #[doc(alias = "NSScrubberAlignmentNone")]
117    pub const None: Self = Self(0);
118    #[doc(alias = "NSScrubberAlignmentLeading")]
119    pub const Leading: Self = Self(1);
120    #[doc(alias = "NSScrubberAlignmentTrailing")]
121    pub const Trailing: Self = Self(2);
122    #[doc(alias = "NSScrubberAlignmentCenter")]
123    pub const Center: Self = Self(3);
124}
125
126unsafe impl Encode for NSScrubberAlignment {
127    const ENCODING: Encoding = NSInteger::ENCODING;
128}
129
130unsafe impl RefEncode for NSScrubberAlignment {
131    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
132}
133
134extern_class!(
135    /// `NSScrubberSelectionStyle`is an abstract class that provides decorative accessory views for selected and highlighted items within a NSScrubber control. Class properties provide convenient access to built-in styles. For a completely custom style, subclassers can override
136    /// `-makeSelectionView`to create and configure arbitrary
137    /// `NSScrubberSelectionView`subclasses.
138    ///
139    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubberselectionstyle?language=objc)
140    #[unsafe(super(NSObject))]
141    #[thread_kind = MainThreadOnly]
142    #[derive(Debug, PartialEq, Eq, Hash)]
143    pub struct NSScrubberSelectionStyle;
144);
145
146unsafe impl NSCoding for NSScrubberSelectionStyle {}
147
148unsafe impl NSObjectProtocol for NSScrubberSelectionStyle {}
149
150impl NSScrubberSelectionStyle {
151    extern_methods!(
152        #[unsafe(method(outlineOverlayStyle))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn outlineOverlayStyle(
155            mtm: MainThreadMarker,
156        ) -> Retained<NSScrubberSelectionStyle>;
157
158        #[unsafe(method(roundedBackgroundStyle))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn roundedBackgroundStyle(
161            mtm: MainThreadMarker,
162        ) -> Retained<NSScrubberSelectionStyle>;
163
164        #[unsafe(method(init))]
165        #[unsafe(method_family = init)]
166        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
167
168        #[unsafe(method(initWithCoder:))]
169        #[unsafe(method_family = init)]
170        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
171
172        #[cfg(all(
173            feature = "NSResponder",
174            feature = "NSScrubberItemView",
175            feature = "NSView"
176        ))]
177        #[unsafe(method(makeSelectionView))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn makeSelectionView(&self) -> Option<Retained<NSScrubberSelectionView>>;
180    );
181}
182
183/// Methods declared on superclass `NSObject`.
184impl NSScrubberSelectionStyle {
185    extern_methods!(
186        #[unsafe(method(new))]
187        #[unsafe(method_family = new)]
188        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
189    );
190}
191
192extern_class!(
193    /// `NSScrubber`is a control designed for the NSTouchBar environment.
194    ///
195    /// `NSScrubber`arranges a finite number of "items" (represented by views of type
196    /// `NSScrubberItemView`) according to a layout object (see
197    /// `NSScrubberLayout`), and provides several methods for navigating and selecting those items.
198    ///
199    /// Clients provide data to
200    /// `NSScrubber`via a data source object (see the
201    /// `NSScrubberDataSource`protocol) and react to user interaction via a delegate object (see the
202    /// `NSScrubberDelegate`protocol).
203    ///
204    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubber?language=objc)
205    #[unsafe(super(NSView, NSResponder, NSObject))]
206    #[derive(Debug, PartialEq, Eq, Hash)]
207    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
208    pub struct NSScrubber;
209);
210
211#[cfg(all(
212    feature = "NSAccessibilityProtocols",
213    feature = "NSResponder",
214    feature = "NSView"
215))]
216unsafe impl NSAccessibility for NSScrubber {}
217
218#[cfg(all(
219    feature = "NSAccessibilityProtocols",
220    feature = "NSResponder",
221    feature = "NSView"
222))]
223unsafe impl NSAccessibilityElementProtocol for NSScrubber {}
224
225#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
226unsafe impl NSAnimatablePropertyContainer for NSScrubber {}
227
228#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
229unsafe impl NSAppearanceCustomization for NSScrubber {}
230
231#[cfg(all(feature = "NSResponder", feature = "NSView"))]
232unsafe impl NSCoding for NSScrubber {}
233
234#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
235unsafe impl NSDraggingDestination for NSScrubber {}
236
237#[cfg(all(feature = "NSResponder", feature = "NSView"))]
238unsafe impl NSObjectProtocol for NSScrubber {}
239
240#[cfg(all(
241    feature = "NSResponder",
242    feature = "NSUserInterfaceItemIdentification",
243    feature = "NSView"
244))]
245unsafe impl NSUserInterfaceItemIdentification for NSScrubber {}
246
247#[cfg(all(feature = "NSResponder", feature = "NSView"))]
248impl NSScrubber {
249    extern_methods!(
250        #[unsafe(method(dataSource))]
251        #[unsafe(method_family = none)]
252        pub unsafe fn dataSource(
253            &self,
254        ) -> Option<Retained<ProtocolObject<dyn NSScrubberDataSource>>>;
255
256        /// This is a [weak property][objc2::topics::weak_property].
257        /// Setter for [`dataSource`][Self::dataSource].
258        #[unsafe(method(setDataSource:))]
259        #[unsafe(method_family = none)]
260        pub unsafe fn setDataSource(
261            &self,
262            data_source: Option<&ProtocolObject<dyn NSScrubberDataSource>>,
263        );
264
265        #[unsafe(method(delegate))]
266        #[unsafe(method_family = none)]
267        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSScrubberDelegate>>>;
268
269        /// This is a [weak property][objc2::topics::weak_property].
270        /// Setter for [`delegate`][Self::delegate].
271        #[unsafe(method(setDelegate:))]
272        #[unsafe(method_family = none)]
273        pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSScrubberDelegate>>);
274
275        #[cfg(feature = "NSScrubberLayout")]
276        #[unsafe(method(scrubberLayout))]
277        #[unsafe(method_family = none)]
278        pub unsafe fn scrubberLayout(&self) -> Retained<NSScrubberLayout>;
279
280        #[cfg(feature = "NSScrubberLayout")]
281        /// Setter for [`scrubberLayout`][Self::scrubberLayout].
282        #[unsafe(method(setScrubberLayout:))]
283        #[unsafe(method_family = none)]
284        pub unsafe fn setScrubberLayout(&self, scrubber_layout: &NSScrubberLayout);
285
286        /// Returns the number of items represented by the scrubber control.
287        #[unsafe(method(numberOfItems))]
288        #[unsafe(method_family = none)]
289        pub unsafe fn numberOfItems(&self) -> NSInteger;
290
291        /// The index of the currently highlighted item within the control. If there is no highlighted item, the value of this property is (-1).
292        #[unsafe(method(highlightedIndex))]
293        #[unsafe(method_family = none)]
294        pub unsafe fn highlightedIndex(&self) -> NSInteger;
295
296        /// The index of the selected item within the control. If there is no selected item, the value of this property is (-1). Setting this property through the animator proxy will animate the selection change. Programmatic selection changes do not trigger delegate callbacks.
297        #[unsafe(method(selectedIndex))]
298        #[unsafe(method_family = none)]
299        pub unsafe fn selectedIndex(&self) -> NSInteger;
300
301        /// Setter for [`selectedIndex`][Self::selectedIndex].
302        #[unsafe(method(setSelectedIndex:))]
303        #[unsafe(method_family = none)]
304        pub unsafe fn setSelectedIndex(&self, selected_index: NSInteger);
305
306        /// Describes the interaction mode for the scrubber control. See the
307        /// `NSScrubberMode`enumeration for a list of possible values. The default value is
308        /// `NSScrubberModeFixed.`
309        #[unsafe(method(mode))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn mode(&self) -> NSScrubberMode;
312
313        /// Setter for [`mode`][Self::mode].
314        #[unsafe(method(setMode:))]
315        #[unsafe(method_family = none)]
316        pub unsafe fn setMode(&self, mode: NSScrubberMode);
317
318        /// If the value of
319        /// `itemAlignment`is not
320        /// `NSScrubberAlignmentNone,`the scrubber will ensure that some item rests at the preferred alignment within the control following a scrolling or paging interaction. The default value is
321        /// `NSScrubberAlignmentNone.`
322        #[unsafe(method(itemAlignment))]
323        #[unsafe(method_family = none)]
324        pub unsafe fn itemAlignment(&self) -> NSScrubberAlignment;
325
326        /// Setter for [`itemAlignment`][Self::itemAlignment].
327        #[unsafe(method(setItemAlignment:))]
328        #[unsafe(method_family = none)]
329        pub unsafe fn setItemAlignment(&self, item_alignment: NSScrubberAlignment);
330
331        /// When
332        /// `continuous`is
333        /// `YES,`panning over the control in
334        /// `NSScrubberModeFixed`will immediately select the item under the user's finger, and scrolling in
335        /// `NSScrubberModeFree`will continuously select items as they pass through the current
336        /// `itemAlignment.`The default is
337        /// `NO.`
338        #[unsafe(method(isContinuous))]
339        #[unsafe(method_family = none)]
340        pub unsafe fn isContinuous(&self) -> bool;
341
342        /// Setter for [`isContinuous`][Self::isContinuous].
343        #[unsafe(method(setContinuous:))]
344        #[unsafe(method_family = none)]
345        pub unsafe fn setContinuous(&self, continuous: bool);
346
347        /// When
348        /// `floatsSelectionViews`is
349        /// `YES,`the selection decorations provided by
350        /// `selectionBackgroundStyle`and
351        /// `selectionOverlayStyle`will smoothly float between selected items, rather than animating their entrance/exit in-place. The default is
352        /// `NO.`
353        #[unsafe(method(floatsSelectionViews))]
354        #[unsafe(method_family = none)]
355        pub unsafe fn floatsSelectionViews(&self) -> bool;
356
357        /// Setter for [`floatsSelectionViews`][Self::floatsSelectionViews].
358        #[unsafe(method(setFloatsSelectionViews:))]
359        #[unsafe(method_family = none)]
360        pub unsafe fn setFloatsSelectionViews(&self, floats_selection_views: bool);
361
362        /// Specifies a style of decoration to place behind items that are selected and/or highlighted. The default value is
363        /// `nil,`indicating no built-in background decoration.
364        #[unsafe(method(selectionBackgroundStyle))]
365        #[unsafe(method_family = none)]
366        pub unsafe fn selectionBackgroundStyle(&self)
367            -> Option<Retained<NSScrubberSelectionStyle>>;
368
369        /// Setter for [`selectionBackgroundStyle`][Self::selectionBackgroundStyle].
370        #[unsafe(method(setSelectionBackgroundStyle:))]
371        #[unsafe(method_family = none)]
372        pub unsafe fn setSelectionBackgroundStyle(
373            &self,
374            selection_background_style: Option<&NSScrubberSelectionStyle>,
375        );
376
377        /// Specifies a style of decoration to place above items that are selected and/or highlighted. The default value is
378        /// `nil,`indicating no built-in overlay decoration.
379        #[unsafe(method(selectionOverlayStyle))]
380        #[unsafe(method_family = none)]
381        pub unsafe fn selectionOverlayStyle(&self) -> Option<Retained<NSScrubberSelectionStyle>>;
382
383        /// Setter for [`selectionOverlayStyle`][Self::selectionOverlayStyle].
384        #[unsafe(method(setSelectionOverlayStyle:))]
385        #[unsafe(method_family = none)]
386        pub unsafe fn setSelectionOverlayStyle(
387            &self,
388            selection_overlay_style: Option<&NSScrubberSelectionStyle>,
389        );
390
391        /// If
392        /// `showsArrowButtons`is
393        /// `YES,`the control provides leading and trailing arrow buttons. Tapping an arrow button moves the selection index by one element; pressing and holding repeatedly moves the selection. The default is
394        /// `NO.`
395        #[unsafe(method(showsArrowButtons))]
396        #[unsafe(method_family = none)]
397        pub unsafe fn showsArrowButtons(&self) -> bool;
398
399        /// Setter for [`showsArrowButtons`][Self::showsArrowButtons].
400        #[unsafe(method(setShowsArrowButtons:))]
401        #[unsafe(method_family = none)]
402        pub unsafe fn setShowsArrowButtons(&self, shows_arrow_buttons: bool);
403
404        /// If
405        /// `showsAdditionalContentIndicators`is
406        /// `YES,`the control will draw a fade effect to indicate that there is additional unscrolled content. The default is
407        /// `NO.`
408        #[unsafe(method(showsAdditionalContentIndicators))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn showsAdditionalContentIndicators(&self) -> bool;
411
412        /// Setter for [`showsAdditionalContentIndicators`][Self::showsAdditionalContentIndicators].
413        #[unsafe(method(setShowsAdditionalContentIndicators:))]
414        #[unsafe(method_family = none)]
415        pub unsafe fn setShowsAdditionalContentIndicators(
416            &self,
417            shows_additional_content_indicators: bool,
418        );
419
420        #[cfg(feature = "NSColor")]
421        /// If set,
422        /// `backgroundColor`is displayed behind the scrubber content. The background color is suppressed if the scrubber is assigned a non-nil
423        /// `backgroundView.`The default value is
424        /// `nil.`
425        #[unsafe(method(backgroundColor))]
426        #[unsafe(method_family = none)]
427        pub unsafe fn backgroundColor(&self) -> Option<Retained<NSColor>>;
428
429        #[cfg(feature = "NSColor")]
430        /// Setter for [`backgroundColor`][Self::backgroundColor].
431        #[unsafe(method(setBackgroundColor:))]
432        #[unsafe(method_family = none)]
433        pub unsafe fn setBackgroundColor(&self, background_color: Option<&NSColor>);
434
435        /// If non-nil, the
436        /// `backgroundView`is displayed below the scrubber content. The view's layout is managed by
437        /// `NSScrubber`to match the content area. If this property is non-nil, the
438        /// `backgroundColor`property has no effect. The default value is
439        /// `nil.`
440        #[unsafe(method(backgroundView))]
441        #[unsafe(method_family = none)]
442        pub unsafe fn backgroundView(&self) -> Option<Retained<NSView>>;
443
444        /// Setter for [`backgroundView`][Self::backgroundView].
445        #[unsafe(method(setBackgroundView:))]
446        #[unsafe(method_family = none)]
447        pub unsafe fn setBackgroundView(&self, background_view: Option<&NSView>);
448
449        #[unsafe(method(initWithFrame:))]
450        #[unsafe(method_family = init)]
451        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
452
453        #[unsafe(method(initWithCoder:))]
454        #[unsafe(method_family = init)]
455        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
456
457        /// Invalidate all data within the scrubber control, triggering a reload of all content, and clearing the current selection.
458        #[unsafe(method(reloadData))]
459        #[unsafe(method_family = none)]
460        pub unsafe fn reloadData(&self);
461
462        #[cfg(feature = "block2")]
463        /// Updates inside the
464        /// `performSequentialBatchUpdates`block are processed and displayed all at once, including insertion, removal, moving, reloading items, and changing the selected index. Changes are performed iteratively using the same semantics as
465        /// `NSMutableArray.`NSScrubber expects its dataSource to reflect the changes made inside
466        /// `-performSequentialBatchUpdates:`immediately after the
467        /// `updateBlock`finishes executing.
468        #[unsafe(method(performSequentialBatchUpdates:))]
469        #[unsafe(method_family = none)]
470        pub unsafe fn performSequentialBatchUpdates(
471            &self,
472            update_block: &block2::Block<dyn Fn() + '_>,
473        );
474
475        /// Inserts new items at the specified indexes. NSScrubber will request views for each new index from the
476        /// `dataSource.`This method uses the same semantics as
477        /// `NSMutableArray;`each index in the set specifies the destination index after all previous insertions have occurred. Therefore, an NSIndexSet of [1,2,3] will result in three new contiguous items.
478        #[unsafe(method(insertItemsAtIndexes:))]
479        #[unsafe(method_family = none)]
480        pub unsafe fn insertItemsAtIndexes(&self, indexes: &NSIndexSet);
481
482        /// Removes the items at the specified indexes. This method uses the same semantics as
483        /// `NSMutableArray.`
484        #[unsafe(method(removeItemsAtIndexes:))]
485        #[unsafe(method_family = none)]
486        pub unsafe fn removeItemsAtIndexes(&self, indexes: &NSIndexSet);
487
488        /// Reloads the items at the specified indexes. NSScrubber will request new views for each item and smoothly crossfade between them before discarding the original views.
489        #[unsafe(method(reloadItemsAtIndexes:))]
490        #[unsafe(method_family = none)]
491        pub unsafe fn reloadItemsAtIndexes(&self, indexes: &NSIndexSet);
492
493        /// Moves an item from one index to another.
494        /// `oldIndex`refers to the item's index prior to the movement, whereas
495        /// `newIndex`refers to the item's final location.
496        #[unsafe(method(moveItemAtIndex:toIndex:))]
497        #[unsafe(method_family = none)]
498        pub unsafe fn moveItemAtIndex_toIndex(&self, old_index: NSInteger, new_index: NSInteger);
499
500        /// Scrolls an item to a given alignment within the control. If
501        /// `NSScrubberAlignmentNone`is provided, then the control scrolls the minimum amount necessary to make the item visible. Scrolling is animated if called on the animator proxy.
502        #[unsafe(method(scrollItemAtIndex:toAlignment:))]
503        #[unsafe(method_family = none)]
504        pub unsafe fn scrollItemAtIndex_toAlignment(
505            &self,
506            index: NSInteger,
507            alignment: NSScrubberAlignment,
508        );
509
510        #[cfg(feature = "NSScrubberItemView")]
511        /// Returns the
512        /// `NSScrubberItemView`for the given index, if one currently exists; returns
513        /// `nil`otherwise.
514        #[unsafe(method(itemViewForItemAtIndex:))]
515        #[unsafe(method_family = none)]
516        pub unsafe fn itemViewForItemAtIndex(
517            &self,
518            index: NSInteger,
519        ) -> Option<Retained<NSScrubberItemView>>;
520
521        #[cfg(feature = "NSUserInterfaceItemIdentification")]
522        /// Registers a
523        /// `NSScrubberItemView`class to be instantiated for the given
524        /// `itemIdentifier.`Raises an exception if
525        /// `itemViewClass`is not a subclass of
526        /// `NSScrubberItemView.`Passing
527        /// `nil`for
528        /// `itemViewClass`removes a previous registration. Registrations made through this method do not persist through NSCoding.
529        #[unsafe(method(registerClass:forItemIdentifier:))]
530        #[unsafe(method_family = none)]
531        pub unsafe fn registerClass_forItemIdentifier(
532            &self,
533            item_view_class: Option<&AnyClass>,
534            item_identifier: &NSUserInterfaceItemIdentifier,
535        );
536
537        #[cfg(all(feature = "NSNib", feature = "NSUserInterfaceItemIdentification"))]
538        /// Register a nib to be instantiated for the given
539        /// `itemIdentifier.`The nib must contain a top-level object which is a subclass of NSScrubberItemView; otherwise,
540        /// `-makeItemWithIdentifier:`may return
541        /// `nil`for this identifier. Passing
542        /// `nil`for
543        /// `nib`removes a previous registration.
544        #[unsafe(method(registerNib:forItemIdentifier:))]
545        #[unsafe(method_family = none)]
546        pub unsafe fn registerNib_forItemIdentifier(
547            &self,
548            nib: Option<&NSNib>,
549            item_identifier: &NSUserInterfaceItemIdentifier,
550        );
551
552        #[cfg(all(
553            feature = "NSScrubberItemView",
554            feature = "NSUserInterfaceItemIdentification"
555        ))]
556        /// Creates or reuses a
557        /// `NSScrubberItemView`corresponding to the provided
558        /// `itemIdentifier.``NSScrubber`searches, in order: the reuse queue, the list of registered classes, and then the list of registered nibs. If the reuse queue is empty, and there is no Class or Interface Builder archive registered for the
559        /// `itemIdentifier,`this method returns
560        /// `nil.`
561        #[unsafe(method(makeItemWithIdentifier:owner:))]
562        #[unsafe(method_family = none)]
563        pub unsafe fn makeItemWithIdentifier_owner(
564            &self,
565            item_identifier: &NSUserInterfaceItemIdentifier,
566            owner: Option<&AnyObject>,
567        ) -> Option<Retained<NSScrubberItemView>>;
568    );
569}
570
571/// Methods declared on superclass `NSResponder`.
572#[cfg(all(feature = "NSResponder", feature = "NSView"))]
573impl NSScrubber {
574    extern_methods!(
575        #[unsafe(method(init))]
576        #[unsafe(method_family = init)]
577        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
578    );
579}
580
581/// Methods declared on superclass `NSObject`.
582#[cfg(all(feature = "NSResponder", feature = "NSView"))]
583impl NSScrubber {
584    extern_methods!(
585        #[unsafe(method(new))]
586        #[unsafe(method_family = new)]
587        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
588    );
589}