objc2_app_kit/generated/
NSScrubberItemView.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_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubberarrangedview?language=objc)
12    #[unsafe(super(NSView, NSResponder, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
15    pub struct NSScrubberArrangedView;
16);
17
18#[cfg(all(
19    feature = "NSAccessibilityProtocols",
20    feature = "NSResponder",
21    feature = "NSView"
22))]
23extern_conformance!(
24    unsafe impl NSAccessibility for NSScrubberArrangedView {}
25);
26
27#[cfg(all(
28    feature = "NSAccessibilityProtocols",
29    feature = "NSResponder",
30    feature = "NSView"
31))]
32extern_conformance!(
33    unsafe impl NSAccessibilityElementProtocol for NSScrubberArrangedView {}
34);
35
36#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
37extern_conformance!(
38    unsafe impl NSAnimatablePropertyContainer for NSScrubberArrangedView {}
39);
40
41#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
42extern_conformance!(
43    unsafe impl NSAppearanceCustomization for NSScrubberArrangedView {}
44);
45
46#[cfg(all(feature = "NSResponder", feature = "NSView"))]
47extern_conformance!(
48    unsafe impl NSCoding for NSScrubberArrangedView {}
49);
50
51#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
52extern_conformance!(
53    unsafe impl NSDraggingDestination for NSScrubberArrangedView {}
54);
55
56#[cfg(all(feature = "NSResponder", feature = "NSView"))]
57extern_conformance!(
58    unsafe impl NSObjectProtocol for NSScrubberArrangedView {}
59);
60
61#[cfg(all(
62    feature = "NSResponder",
63    feature = "NSUserInterfaceItemIdentification",
64    feature = "NSView"
65))]
66extern_conformance!(
67    unsafe impl NSUserInterfaceItemIdentification for NSScrubberArrangedView {}
68);
69
70#[cfg(all(feature = "NSResponder", feature = "NSView"))]
71impl NSScrubberArrangedView {
72    extern_methods!(
73        #[unsafe(method(isSelected))]
74        #[unsafe(method_family = none)]
75        pub fn isSelected(&self) -> bool;
76
77        /// Setter for [`isSelected`][Self::isSelected].
78        #[unsafe(method(setSelected:))]
79        #[unsafe(method_family = none)]
80        pub fn setSelected(&self, selected: bool);
81
82        #[unsafe(method(isHighlighted))]
83        #[unsafe(method_family = none)]
84        pub fn isHighlighted(&self) -> bool;
85
86        /// Setter for [`isHighlighted`][Self::isHighlighted].
87        #[unsafe(method(setHighlighted:))]
88        #[unsafe(method_family = none)]
89        pub fn setHighlighted(&self, highlighted: bool);
90
91        #[cfg(feature = "NSScrubberLayout")]
92        #[unsafe(method(applyLayoutAttributes:))]
93        #[unsafe(method_family = none)]
94        pub fn applyLayoutAttributes(&self, layout_attributes: &NSScrubberLayoutAttributes);
95    );
96}
97
98/// Methods declared on superclass `NSView`.
99#[cfg(all(feature = "NSResponder", feature = "NSView"))]
100impl NSScrubberArrangedView {
101    extern_methods!(
102        #[unsafe(method(initWithFrame:))]
103        #[unsafe(method_family = init)]
104        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
105
106        /// # Safety
107        ///
108        /// `coder` possibly has further requirements.
109        #[unsafe(method(initWithCoder:))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn initWithCoder(
112            this: Allocated<Self>,
113            coder: &NSCoder,
114        ) -> Option<Retained<Self>>;
115    );
116}
117
118/// Methods declared on superclass `NSResponder`.
119#[cfg(all(feature = "NSResponder", feature = "NSView"))]
120impl NSScrubberArrangedView {
121    extern_methods!(
122        #[unsafe(method(init))]
123        #[unsafe(method_family = init)]
124        pub fn init(this: Allocated<Self>) -> Retained<Self>;
125    );
126}
127
128/// Methods declared on superclass `NSObject`.
129#[cfg(all(feature = "NSResponder", feature = "NSView"))]
130impl NSScrubberArrangedView {
131    extern_methods!(
132        #[unsafe(method(new))]
133        #[unsafe(method_family = new)]
134        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
135    );
136}
137
138extern_class!(
139    /// The base view class for all selection decorations used by the
140    /// `NSScrubber`control.
141    ///
142    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubberselectionview?language=objc)
143    #[unsafe(super(NSScrubberArrangedView, NSView, NSResponder, NSObject))]
144    #[derive(Debug, PartialEq, Eq, Hash)]
145    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
146    pub struct NSScrubberSelectionView;
147);
148
149#[cfg(all(
150    feature = "NSAccessibilityProtocols",
151    feature = "NSResponder",
152    feature = "NSView"
153))]
154extern_conformance!(
155    unsafe impl NSAccessibility for NSScrubberSelectionView {}
156);
157
158#[cfg(all(
159    feature = "NSAccessibilityProtocols",
160    feature = "NSResponder",
161    feature = "NSView"
162))]
163extern_conformance!(
164    unsafe impl NSAccessibilityElementProtocol for NSScrubberSelectionView {}
165);
166
167#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
168extern_conformance!(
169    unsafe impl NSAnimatablePropertyContainer for NSScrubberSelectionView {}
170);
171
172#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
173extern_conformance!(
174    unsafe impl NSAppearanceCustomization for NSScrubberSelectionView {}
175);
176
177#[cfg(all(feature = "NSResponder", feature = "NSView"))]
178extern_conformance!(
179    unsafe impl NSCoding for NSScrubberSelectionView {}
180);
181
182#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
183extern_conformance!(
184    unsafe impl NSDraggingDestination for NSScrubberSelectionView {}
185);
186
187#[cfg(all(feature = "NSResponder", feature = "NSView"))]
188extern_conformance!(
189    unsafe impl NSObjectProtocol for NSScrubberSelectionView {}
190);
191
192#[cfg(all(
193    feature = "NSResponder",
194    feature = "NSUserInterfaceItemIdentification",
195    feature = "NSView"
196))]
197extern_conformance!(
198    unsafe impl NSUserInterfaceItemIdentification for NSScrubberSelectionView {}
199);
200
201#[cfg(all(feature = "NSResponder", feature = "NSView"))]
202impl NSScrubberSelectionView {
203    extern_methods!();
204}
205
206/// Methods declared on superclass `NSView`.
207#[cfg(all(feature = "NSResponder", feature = "NSView"))]
208impl NSScrubberSelectionView {
209    extern_methods!(
210        #[unsafe(method(initWithFrame:))]
211        #[unsafe(method_family = init)]
212        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
213
214        /// # Safety
215        ///
216        /// `coder` possibly has further requirements.
217        #[unsafe(method(initWithCoder:))]
218        #[unsafe(method_family = init)]
219        pub unsafe fn initWithCoder(
220            this: Allocated<Self>,
221            coder: &NSCoder,
222        ) -> Option<Retained<Self>>;
223    );
224}
225
226/// Methods declared on superclass `NSResponder`.
227#[cfg(all(feature = "NSResponder", feature = "NSView"))]
228impl NSScrubberSelectionView {
229    extern_methods!(
230        #[unsafe(method(init))]
231        #[unsafe(method_family = init)]
232        pub fn init(this: Allocated<Self>) -> Retained<Self>;
233    );
234}
235
236/// Methods declared on superclass `NSObject`.
237#[cfg(all(feature = "NSResponder", feature = "NSView"))]
238impl NSScrubberSelectionView {
239    extern_methods!(
240        #[unsafe(method(new))]
241        #[unsafe(method_family = new)]
242        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
243    );
244}
245
246extern_class!(
247    /// The base view class that is arranged by a
248    /// `NSScrubber`control.
249    ///
250    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubberitemview?language=objc)
251    #[unsafe(super(NSScrubberArrangedView, NSView, NSResponder, NSObject))]
252    #[derive(Debug, PartialEq, Eq, Hash)]
253    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
254    pub struct NSScrubberItemView;
255);
256
257#[cfg(all(
258    feature = "NSAccessibilityProtocols",
259    feature = "NSResponder",
260    feature = "NSView"
261))]
262extern_conformance!(
263    unsafe impl NSAccessibility for NSScrubberItemView {}
264);
265
266#[cfg(all(
267    feature = "NSAccessibilityProtocols",
268    feature = "NSResponder",
269    feature = "NSView"
270))]
271extern_conformance!(
272    unsafe impl NSAccessibilityElementProtocol for NSScrubberItemView {}
273);
274
275#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
276extern_conformance!(
277    unsafe impl NSAnimatablePropertyContainer for NSScrubberItemView {}
278);
279
280#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
281extern_conformance!(
282    unsafe impl NSAppearanceCustomization for NSScrubberItemView {}
283);
284
285#[cfg(all(feature = "NSResponder", feature = "NSView"))]
286extern_conformance!(
287    unsafe impl NSCoding for NSScrubberItemView {}
288);
289
290#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
291extern_conformance!(
292    unsafe impl NSDraggingDestination for NSScrubberItemView {}
293);
294
295#[cfg(all(feature = "NSResponder", feature = "NSView"))]
296extern_conformance!(
297    unsafe impl NSObjectProtocol for NSScrubberItemView {}
298);
299
300#[cfg(all(
301    feature = "NSResponder",
302    feature = "NSUserInterfaceItemIdentification",
303    feature = "NSView"
304))]
305extern_conformance!(
306    unsafe impl NSUserInterfaceItemIdentification for NSScrubberItemView {}
307);
308
309#[cfg(all(feature = "NSResponder", feature = "NSView"))]
310impl NSScrubberItemView {
311    extern_methods!();
312}
313
314/// Methods declared on superclass `NSView`.
315#[cfg(all(feature = "NSResponder", feature = "NSView"))]
316impl NSScrubberItemView {
317    extern_methods!(
318        #[unsafe(method(initWithFrame:))]
319        #[unsafe(method_family = init)]
320        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
321
322        /// # Safety
323        ///
324        /// `coder` possibly has further requirements.
325        #[unsafe(method(initWithCoder:))]
326        #[unsafe(method_family = init)]
327        pub unsafe fn initWithCoder(
328            this: Allocated<Self>,
329            coder: &NSCoder,
330        ) -> Option<Retained<Self>>;
331    );
332}
333
334/// Methods declared on superclass `NSResponder`.
335#[cfg(all(feature = "NSResponder", feature = "NSView"))]
336impl NSScrubberItemView {
337    extern_methods!(
338        #[unsafe(method(init))]
339        #[unsafe(method_family = init)]
340        pub fn init(this: Allocated<Self>) -> Retained<Self>;
341    );
342}
343
344/// Methods declared on superclass `NSObject`.
345#[cfg(all(feature = "NSResponder", feature = "NSView"))]
346impl NSScrubberItemView {
347    extern_methods!(
348        #[unsafe(method(new))]
349        #[unsafe(method_family = new)]
350        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
351    );
352}
353
354extern_class!(
355    /// A simple
356    /// `NSScrubberItemView`for displaying text. The -fittingSize method can be used to measure the smallest size for the view which fits the title without truncating.
357    ///
358    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubbertextitemview?language=objc)
359    #[unsafe(super(
360        NSScrubberItemView,
361        NSScrubberArrangedView,
362        NSView,
363        NSResponder,
364        NSObject
365    ))]
366    #[derive(Debug, PartialEq, Eq, Hash)]
367    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
368    pub struct NSScrubberTextItemView;
369);
370
371#[cfg(all(
372    feature = "NSAccessibilityProtocols",
373    feature = "NSResponder",
374    feature = "NSView"
375))]
376extern_conformance!(
377    unsafe impl NSAccessibility for NSScrubberTextItemView {}
378);
379
380#[cfg(all(
381    feature = "NSAccessibilityProtocols",
382    feature = "NSResponder",
383    feature = "NSView"
384))]
385extern_conformance!(
386    unsafe impl NSAccessibilityElementProtocol for NSScrubberTextItemView {}
387);
388
389#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
390extern_conformance!(
391    unsafe impl NSAnimatablePropertyContainer for NSScrubberTextItemView {}
392);
393
394#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
395extern_conformance!(
396    unsafe impl NSAppearanceCustomization for NSScrubberTextItemView {}
397);
398
399#[cfg(all(feature = "NSResponder", feature = "NSView"))]
400extern_conformance!(
401    unsafe impl NSCoding for NSScrubberTextItemView {}
402);
403
404#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
405extern_conformance!(
406    unsafe impl NSDraggingDestination for NSScrubberTextItemView {}
407);
408
409#[cfg(all(feature = "NSResponder", feature = "NSView"))]
410extern_conformance!(
411    unsafe impl NSObjectProtocol for NSScrubberTextItemView {}
412);
413
414#[cfg(all(
415    feature = "NSResponder",
416    feature = "NSUserInterfaceItemIdentification",
417    feature = "NSView"
418))]
419extern_conformance!(
420    unsafe impl NSUserInterfaceItemIdentification for NSScrubberTextItemView {}
421);
422
423#[cfg(all(feature = "NSResponder", feature = "NSView"))]
424impl NSScrubberTextItemView {
425    extern_methods!(
426        #[cfg(all(feature = "NSControl", feature = "NSTextField"))]
427        #[unsafe(method(textField))]
428        #[unsafe(method_family = none)]
429        pub fn textField(&self) -> Retained<NSTextField>;
430
431        #[unsafe(method(title))]
432        #[unsafe(method_family = none)]
433        pub fn title(&self) -> Retained<NSString>;
434
435        /// Setter for [`title`][Self::title].
436        ///
437        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
438        #[unsafe(method(setTitle:))]
439        #[unsafe(method_family = none)]
440        pub fn setTitle(&self, title: &NSString);
441    );
442}
443
444/// Methods declared on superclass `NSView`.
445#[cfg(all(feature = "NSResponder", feature = "NSView"))]
446impl NSScrubberTextItemView {
447    extern_methods!(
448        #[unsafe(method(initWithFrame:))]
449        #[unsafe(method_family = init)]
450        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
451
452        /// # Safety
453        ///
454        /// `coder` possibly has further requirements.
455        #[unsafe(method(initWithCoder:))]
456        #[unsafe(method_family = init)]
457        pub unsafe fn initWithCoder(
458            this: Allocated<Self>,
459            coder: &NSCoder,
460        ) -> Option<Retained<Self>>;
461    );
462}
463
464/// Methods declared on superclass `NSResponder`.
465#[cfg(all(feature = "NSResponder", feature = "NSView"))]
466impl NSScrubberTextItemView {
467    extern_methods!(
468        #[unsafe(method(init))]
469        #[unsafe(method_family = init)]
470        pub fn init(this: Allocated<Self>) -> Retained<Self>;
471    );
472}
473
474/// Methods declared on superclass `NSObject`.
475#[cfg(all(feature = "NSResponder", feature = "NSView"))]
476impl NSScrubberTextItemView {
477    extern_methods!(
478        #[unsafe(method(new))]
479        #[unsafe(method_family = new)]
480        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
481    );
482}
483
484extern_class!(
485    /// A simple
486    /// `NSScrubberItemView`for displaying an image.
487    ///
488    /// If the provided image is larger than the view's frame, it is scaled proportionally to fill the entire frame. The cropped portion of the image is determined by the
489    /// `imageAlignment`property.
490    ///
491    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrubberimageitemview?language=objc)
492    #[unsafe(super(
493        NSScrubberItemView,
494        NSScrubberArrangedView,
495        NSView,
496        NSResponder,
497        NSObject
498    ))]
499    #[derive(Debug, PartialEq, Eq, Hash)]
500    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
501    pub struct NSScrubberImageItemView;
502);
503
504#[cfg(all(
505    feature = "NSAccessibilityProtocols",
506    feature = "NSResponder",
507    feature = "NSView"
508))]
509extern_conformance!(
510    unsafe impl NSAccessibility for NSScrubberImageItemView {}
511);
512
513#[cfg(all(
514    feature = "NSAccessibilityProtocols",
515    feature = "NSResponder",
516    feature = "NSView"
517))]
518extern_conformance!(
519    unsafe impl NSAccessibilityElementProtocol for NSScrubberImageItemView {}
520);
521
522#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
523extern_conformance!(
524    unsafe impl NSAnimatablePropertyContainer for NSScrubberImageItemView {}
525);
526
527#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
528extern_conformance!(
529    unsafe impl NSAppearanceCustomization for NSScrubberImageItemView {}
530);
531
532#[cfg(all(feature = "NSResponder", feature = "NSView"))]
533extern_conformance!(
534    unsafe impl NSCoding for NSScrubberImageItemView {}
535);
536
537#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
538extern_conformance!(
539    unsafe impl NSDraggingDestination for NSScrubberImageItemView {}
540);
541
542#[cfg(all(feature = "NSResponder", feature = "NSView"))]
543extern_conformance!(
544    unsafe impl NSObjectProtocol for NSScrubberImageItemView {}
545);
546
547#[cfg(all(
548    feature = "NSResponder",
549    feature = "NSUserInterfaceItemIdentification",
550    feature = "NSView"
551))]
552extern_conformance!(
553    unsafe impl NSUserInterfaceItemIdentification for NSScrubberImageItemView {}
554);
555
556#[cfg(all(feature = "NSResponder", feature = "NSView"))]
557impl NSScrubberImageItemView {
558    extern_methods!(
559        #[cfg(all(feature = "NSControl", feature = "NSImageView"))]
560        #[unsafe(method(imageView))]
561        #[unsafe(method_family = none)]
562        pub fn imageView(&self) -> Retained<NSImageView>;
563
564        #[cfg(feature = "NSImage")]
565        #[unsafe(method(image))]
566        #[unsafe(method_family = none)]
567        pub fn image(&self) -> Retained<NSImage>;
568
569        #[cfg(feature = "NSImage")]
570        /// Setter for [`image`][Self::image].
571        ///
572        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
573        #[unsafe(method(setImage:))]
574        #[unsafe(method_family = none)]
575        pub fn setImage(&self, image: &NSImage);
576
577        #[cfg(feature = "NSImageCell")]
578        #[unsafe(method(imageAlignment))]
579        #[unsafe(method_family = none)]
580        pub fn imageAlignment(&self) -> NSImageAlignment;
581
582        #[cfg(feature = "NSImageCell")]
583        /// Setter for [`imageAlignment`][Self::imageAlignment].
584        #[unsafe(method(setImageAlignment:))]
585        #[unsafe(method_family = none)]
586        pub fn setImageAlignment(&self, image_alignment: NSImageAlignment);
587    );
588}
589
590/// Methods declared on superclass `NSView`.
591#[cfg(all(feature = "NSResponder", feature = "NSView"))]
592impl NSScrubberImageItemView {
593    extern_methods!(
594        #[unsafe(method(initWithFrame:))]
595        #[unsafe(method_family = init)]
596        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
597
598        /// # Safety
599        ///
600        /// `coder` possibly has further requirements.
601        #[unsafe(method(initWithCoder:))]
602        #[unsafe(method_family = init)]
603        pub unsafe fn initWithCoder(
604            this: Allocated<Self>,
605            coder: &NSCoder,
606        ) -> Option<Retained<Self>>;
607    );
608}
609
610/// Methods declared on superclass `NSResponder`.
611#[cfg(all(feature = "NSResponder", feature = "NSView"))]
612impl NSScrubberImageItemView {
613    extern_methods!(
614        #[unsafe(method(init))]
615        #[unsafe(method_family = init)]
616        pub fn init(this: Allocated<Self>) -> Retained<Self>;
617    );
618}
619
620/// Methods declared on superclass `NSObject`.
621#[cfg(all(feature = "NSResponder", feature = "NSView"))]
622impl NSScrubberImageItemView {
623    extern_methods!(
624        #[unsafe(method(new))]
625        #[unsafe(method_family = new)]
626        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
627    );
628}