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