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