objc2_app_kit/generated/
NSScrollView.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrollelasticity?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSScrollElasticity(pub NSInteger);
17impl NSScrollElasticity {
18    #[doc(alias = "NSScrollElasticityAutomatic")]
19    pub const Automatic: Self = Self(0);
20    #[doc(alias = "NSScrollElasticityNone")]
21    pub const None: Self = Self(1);
22    #[doc(alias = "NSScrollElasticityAllowed")]
23    pub const Allowed: Self = Self(2);
24}
25
26unsafe impl Encode for NSScrollElasticity {
27    const ENCODING: Encoding = NSInteger::ENCODING;
28}
29
30unsafe impl RefEncode for NSScrollElasticity {
31    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern_class!(
35    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrollview?language=objc)
36    #[unsafe(super(NSView, NSResponder, NSObject))]
37    #[derive(Debug, PartialEq, Eq, Hash)]
38    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
39    pub struct NSScrollView;
40);
41
42#[cfg(all(
43    feature = "NSAccessibilityProtocols",
44    feature = "NSResponder",
45    feature = "NSView"
46))]
47unsafe impl NSAccessibility for NSScrollView {}
48
49#[cfg(all(
50    feature = "NSAccessibilityProtocols",
51    feature = "NSResponder",
52    feature = "NSView"
53))]
54unsafe impl NSAccessibilityElementProtocol for NSScrollView {}
55
56#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
57unsafe impl NSAnimatablePropertyContainer for NSScrollView {}
58
59#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
60unsafe impl NSAppearanceCustomization for NSScrollView {}
61
62#[cfg(all(feature = "NSResponder", feature = "NSView"))]
63unsafe impl NSCoding for NSScrollView {}
64
65#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
66unsafe impl NSDraggingDestination for NSScrollView {}
67
68#[cfg(all(feature = "NSResponder", feature = "NSView"))]
69unsafe impl NSObjectProtocol for NSScrollView {}
70
71#[cfg(all(feature = "NSResponder", feature = "NSTextFinder", feature = "NSView"))]
72unsafe impl NSTextFinderBarContainer for NSScrollView {}
73
74#[cfg(all(
75    feature = "NSResponder",
76    feature = "NSUserInterfaceItemIdentification",
77    feature = "NSView"
78))]
79unsafe impl NSUserInterfaceItemIdentification for NSScrollView {}
80
81#[cfg(all(feature = "NSResponder", feature = "NSView"))]
82impl NSScrollView {
83    extern_methods!(
84        #[unsafe(method(initWithFrame:))]
85        #[unsafe(method_family = init)]
86        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
87
88        #[unsafe(method(initWithCoder:))]
89        #[unsafe(method_family = init)]
90        pub unsafe fn initWithCoder(
91            this: Allocated<Self>,
92            coder: &NSCoder,
93        ) -> Option<Retained<Self>>;
94
95        #[cfg(all(feature = "NSCell", feature = "NSScroller"))]
96        #[unsafe(method(frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn frameSizeForContentSize_horizontalScrollerClass_verticalScrollerClass_borderType_controlSize_scrollerStyle(
99            c_size: NSSize,
100            horizontal_scroller_class: Option<&AnyClass>,
101            vertical_scroller_class: Option<&AnyClass>,
102            r#type: NSBorderType,
103            control_size: NSControlSize,
104            scroller_style: NSScrollerStyle,
105            mtm: MainThreadMarker,
106        ) -> NSSize;
107
108        #[cfg(all(feature = "NSCell", feature = "NSScroller"))]
109        #[unsafe(method(contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn contentSizeForFrameSize_horizontalScrollerClass_verticalScrollerClass_borderType_controlSize_scrollerStyle(
112            f_size: NSSize,
113            horizontal_scroller_class: Option<&AnyClass>,
114            vertical_scroller_class: Option<&AnyClass>,
115            r#type: NSBorderType,
116            control_size: NSControlSize,
117            scroller_style: NSScrollerStyle,
118            mtm: MainThreadMarker,
119        ) -> NSSize;
120
121        #[deprecated = "Use +frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle: instead"]
122        #[unsafe(method(frameSizeForContentSize:hasHorizontalScroller:hasVerticalScroller:borderType:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn frameSizeForContentSize_hasHorizontalScroller_hasVerticalScroller_borderType(
125            c_size: NSSize,
126            h_flag: bool,
127            v_flag: bool,
128            r#type: NSBorderType,
129            mtm: MainThreadMarker,
130        ) -> NSSize;
131
132        #[deprecated = "+contentSizeForFrameSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle: instead"]
133        #[unsafe(method(contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType:))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn contentSizeForFrameSize_hasHorizontalScroller_hasVerticalScroller_borderType(
136            f_size: NSSize,
137            h_flag: bool,
138            v_flag: bool,
139            r#type: NSBorderType,
140            mtm: MainThreadMarker,
141        ) -> NSSize;
142
143        #[unsafe(method(documentVisibleRect))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn documentVisibleRect(&self) -> NSRect;
146
147        #[unsafe(method(contentSize))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn contentSize(&self) -> NSSize;
150
151        #[unsafe(method(documentView))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn documentView(&self) -> Option<Retained<NSView>>;
154
155        /// Setter for [`documentView`][Self::documentView].
156        #[unsafe(method(setDocumentView:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn setDocumentView(&self, document_view: Option<&NSView>);
159
160        #[cfg(feature = "NSClipView")]
161        #[unsafe(method(contentView))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn contentView(&self) -> Retained<NSClipView>;
164
165        #[cfg(feature = "NSClipView")]
166        /// Setter for [`contentView`][Self::contentView].
167        #[unsafe(method(setContentView:))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn setContentView(&self, content_view: &NSClipView);
170
171        #[cfg(feature = "NSCursor")]
172        #[unsafe(method(documentCursor))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn documentCursor(&self) -> Option<Retained<NSCursor>>;
175
176        #[cfg(feature = "NSCursor")]
177        /// Setter for [`documentCursor`][Self::documentCursor].
178        #[unsafe(method(setDocumentCursor:))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn setDocumentCursor(&self, document_cursor: Option<&NSCursor>);
181
182        #[unsafe(method(borderType))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn borderType(&self) -> NSBorderType;
185
186        /// Setter for [`borderType`][Self::borderType].
187        #[unsafe(method(setBorderType:))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn setBorderType(&self, border_type: NSBorderType);
190
191        #[cfg(feature = "NSColor")]
192        #[unsafe(method(backgroundColor))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
195
196        #[cfg(feature = "NSColor")]
197        /// Setter for [`backgroundColor`][Self::backgroundColor].
198        #[unsafe(method(setBackgroundColor:))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);
201
202        #[unsafe(method(drawsBackground))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn drawsBackground(&self) -> bool;
205
206        /// Setter for [`drawsBackground`][Self::drawsBackground].
207        #[unsafe(method(setDrawsBackground:))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn setDrawsBackground(&self, draws_background: bool);
210
211        #[unsafe(method(hasVerticalScroller))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn hasVerticalScroller(&self) -> bool;
214
215        /// Setter for [`hasVerticalScroller`][Self::hasVerticalScroller].
216        #[unsafe(method(setHasVerticalScroller:))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn setHasVerticalScroller(&self, has_vertical_scroller: bool);
219
220        #[unsafe(method(hasHorizontalScroller))]
221        #[unsafe(method_family = none)]
222        pub unsafe fn hasHorizontalScroller(&self) -> bool;
223
224        /// Setter for [`hasHorizontalScroller`][Self::hasHorizontalScroller].
225        #[unsafe(method(setHasHorizontalScroller:))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn setHasHorizontalScroller(&self, has_horizontal_scroller: bool);
228
229        #[cfg(all(feature = "NSControl", feature = "NSScroller"))]
230        #[unsafe(method(verticalScroller))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn verticalScroller(&self) -> Option<Retained<NSScroller>>;
233
234        #[cfg(all(feature = "NSControl", feature = "NSScroller"))]
235        /// Setter for [`verticalScroller`][Self::verticalScroller].
236        #[unsafe(method(setVerticalScroller:))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn setVerticalScroller(&self, vertical_scroller: Option<&NSScroller>);
239
240        #[cfg(all(feature = "NSControl", feature = "NSScroller"))]
241        #[unsafe(method(horizontalScroller))]
242        #[unsafe(method_family = none)]
243        pub unsafe fn horizontalScroller(&self) -> Option<Retained<NSScroller>>;
244
245        #[cfg(all(feature = "NSControl", feature = "NSScroller"))]
246        /// Setter for [`horizontalScroller`][Self::horizontalScroller].
247        #[unsafe(method(setHorizontalScroller:))]
248        #[unsafe(method_family = none)]
249        pub unsafe fn setHorizontalScroller(&self, horizontal_scroller: Option<&NSScroller>);
250
251        #[unsafe(method(autohidesScrollers))]
252        #[unsafe(method_family = none)]
253        pub unsafe fn autohidesScrollers(&self) -> bool;
254
255        /// Setter for [`autohidesScrollers`][Self::autohidesScrollers].
256        #[unsafe(method(setAutohidesScrollers:))]
257        #[unsafe(method_family = none)]
258        pub unsafe fn setAutohidesScrollers(&self, autohides_scrollers: bool);
259
260        #[cfg(feature = "objc2-core-foundation")]
261        #[unsafe(method(horizontalLineScroll))]
262        #[unsafe(method_family = none)]
263        pub unsafe fn horizontalLineScroll(&self) -> CGFloat;
264
265        #[cfg(feature = "objc2-core-foundation")]
266        /// Setter for [`horizontalLineScroll`][Self::horizontalLineScroll].
267        #[unsafe(method(setHorizontalLineScroll:))]
268        #[unsafe(method_family = none)]
269        pub unsafe fn setHorizontalLineScroll(&self, horizontal_line_scroll: CGFloat);
270
271        #[cfg(feature = "objc2-core-foundation")]
272        #[unsafe(method(verticalLineScroll))]
273        #[unsafe(method_family = none)]
274        pub unsafe fn verticalLineScroll(&self) -> CGFloat;
275
276        #[cfg(feature = "objc2-core-foundation")]
277        /// Setter for [`verticalLineScroll`][Self::verticalLineScroll].
278        #[unsafe(method(setVerticalLineScroll:))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn setVerticalLineScroll(&self, vertical_line_scroll: CGFloat);
281
282        #[cfg(feature = "objc2-core-foundation")]
283        #[unsafe(method(lineScroll))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn lineScroll(&self) -> CGFloat;
286
287        #[cfg(feature = "objc2-core-foundation")]
288        /// Setter for [`lineScroll`][Self::lineScroll].
289        #[unsafe(method(setLineScroll:))]
290        #[unsafe(method_family = none)]
291        pub unsafe fn setLineScroll(&self, line_scroll: CGFloat);
292
293        #[cfg(feature = "objc2-core-foundation")]
294        #[unsafe(method(horizontalPageScroll))]
295        #[unsafe(method_family = none)]
296        pub unsafe fn horizontalPageScroll(&self) -> CGFloat;
297
298        #[cfg(feature = "objc2-core-foundation")]
299        /// Setter for [`horizontalPageScroll`][Self::horizontalPageScroll].
300        #[unsafe(method(setHorizontalPageScroll:))]
301        #[unsafe(method_family = none)]
302        pub unsafe fn setHorizontalPageScroll(&self, horizontal_page_scroll: CGFloat);
303
304        #[cfg(feature = "objc2-core-foundation")]
305        #[unsafe(method(verticalPageScroll))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn verticalPageScroll(&self) -> CGFloat;
308
309        #[cfg(feature = "objc2-core-foundation")]
310        /// Setter for [`verticalPageScroll`][Self::verticalPageScroll].
311        #[unsafe(method(setVerticalPageScroll:))]
312        #[unsafe(method_family = none)]
313        pub unsafe fn setVerticalPageScroll(&self, vertical_page_scroll: CGFloat);
314
315        #[cfg(feature = "objc2-core-foundation")]
316        #[unsafe(method(pageScroll))]
317        #[unsafe(method_family = none)]
318        pub unsafe fn pageScroll(&self) -> CGFloat;
319
320        #[cfg(feature = "objc2-core-foundation")]
321        /// Setter for [`pageScroll`][Self::pageScroll].
322        #[unsafe(method(setPageScroll:))]
323        #[unsafe(method_family = none)]
324        pub unsafe fn setPageScroll(&self, page_scroll: CGFloat);
325
326        #[unsafe(method(scrollsDynamically))]
327        #[unsafe(method_family = none)]
328        pub unsafe fn scrollsDynamically(&self) -> bool;
329
330        /// Setter for [`scrollsDynamically`][Self::scrollsDynamically].
331        #[unsafe(method(setScrollsDynamically:))]
332        #[unsafe(method_family = none)]
333        pub unsafe fn setScrollsDynamically(&self, scrolls_dynamically: bool);
334
335        #[unsafe(method(tile))]
336        #[unsafe(method_family = none)]
337        pub unsafe fn tile(&self);
338
339        #[cfg(feature = "NSClipView")]
340        #[unsafe(method(reflectScrolledClipView:))]
341        #[unsafe(method_family = none)]
342        pub unsafe fn reflectScrolledClipView(&self, c_view: &NSClipView);
343
344        #[cfg(feature = "NSEvent")]
345        #[unsafe(method(scrollWheel:))]
346        #[unsafe(method_family = none)]
347        pub unsafe fn scrollWheel(&self, event: &NSEvent);
348
349        #[cfg(feature = "NSScroller")]
350        #[unsafe(method(scrollerStyle))]
351        #[unsafe(method_family = none)]
352        pub unsafe fn scrollerStyle(&self) -> NSScrollerStyle;
353
354        #[cfg(feature = "NSScroller")]
355        /// Setter for [`scrollerStyle`][Self::scrollerStyle].
356        #[unsafe(method(setScrollerStyle:))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn setScrollerStyle(&self, scroller_style: NSScrollerStyle);
359
360        #[cfg(feature = "NSScroller")]
361        #[unsafe(method(scrollerKnobStyle))]
362        #[unsafe(method_family = none)]
363        pub unsafe fn scrollerKnobStyle(&self) -> NSScrollerKnobStyle;
364
365        #[cfg(feature = "NSScroller")]
366        /// Setter for [`scrollerKnobStyle`][Self::scrollerKnobStyle].
367        #[unsafe(method(setScrollerKnobStyle:))]
368        #[unsafe(method_family = none)]
369        pub unsafe fn setScrollerKnobStyle(&self, scroller_knob_style: NSScrollerKnobStyle);
370
371        #[unsafe(method(flashScrollers))]
372        #[unsafe(method_family = none)]
373        pub unsafe fn flashScrollers(&self);
374
375        #[unsafe(method(horizontalScrollElasticity))]
376        #[unsafe(method_family = none)]
377        pub unsafe fn horizontalScrollElasticity(&self) -> NSScrollElasticity;
378
379        /// Setter for [`horizontalScrollElasticity`][Self::horizontalScrollElasticity].
380        #[unsafe(method(setHorizontalScrollElasticity:))]
381        #[unsafe(method_family = none)]
382        pub unsafe fn setHorizontalScrollElasticity(
383            &self,
384            horizontal_scroll_elasticity: NSScrollElasticity,
385        );
386
387        #[unsafe(method(verticalScrollElasticity))]
388        #[unsafe(method_family = none)]
389        pub unsafe fn verticalScrollElasticity(&self) -> NSScrollElasticity;
390
391        /// Setter for [`verticalScrollElasticity`][Self::verticalScrollElasticity].
392        #[unsafe(method(setVerticalScrollElasticity:))]
393        #[unsafe(method_family = none)]
394        pub unsafe fn setVerticalScrollElasticity(
395            &self,
396            vertical_scroll_elasticity: NSScrollElasticity,
397        );
398
399        #[unsafe(method(usesPredominantAxisScrolling))]
400        #[unsafe(method_family = none)]
401        pub unsafe fn usesPredominantAxisScrolling(&self) -> bool;
402
403        /// Setter for [`usesPredominantAxisScrolling`][Self::usesPredominantAxisScrolling].
404        #[unsafe(method(setUsesPredominantAxisScrolling:))]
405        #[unsafe(method_family = none)]
406        pub unsafe fn setUsesPredominantAxisScrolling(&self, uses_predominant_axis_scrolling: bool);
407
408        #[unsafe(method(allowsMagnification))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn allowsMagnification(&self) -> bool;
411
412        /// Setter for [`allowsMagnification`][Self::allowsMagnification].
413        #[unsafe(method(setAllowsMagnification:))]
414        #[unsafe(method_family = none)]
415        pub unsafe fn setAllowsMagnification(&self, allows_magnification: bool);
416
417        #[cfg(feature = "objc2-core-foundation")]
418        #[unsafe(method(magnification))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn magnification(&self) -> CGFloat;
421
422        #[cfg(feature = "objc2-core-foundation")]
423        /// Setter for [`magnification`][Self::magnification].
424        #[unsafe(method(setMagnification:))]
425        #[unsafe(method_family = none)]
426        pub unsafe fn setMagnification(&self, magnification: CGFloat);
427
428        #[cfg(feature = "objc2-core-foundation")]
429        #[unsafe(method(maxMagnification))]
430        #[unsafe(method_family = none)]
431        pub unsafe fn maxMagnification(&self) -> CGFloat;
432
433        #[cfg(feature = "objc2-core-foundation")]
434        /// Setter for [`maxMagnification`][Self::maxMagnification].
435        #[unsafe(method(setMaxMagnification:))]
436        #[unsafe(method_family = none)]
437        pub unsafe fn setMaxMagnification(&self, max_magnification: CGFloat);
438
439        #[cfg(feature = "objc2-core-foundation")]
440        #[unsafe(method(minMagnification))]
441        #[unsafe(method_family = none)]
442        pub unsafe fn minMagnification(&self) -> CGFloat;
443
444        #[cfg(feature = "objc2-core-foundation")]
445        /// Setter for [`minMagnification`][Self::minMagnification].
446        #[unsafe(method(setMinMagnification:))]
447        #[unsafe(method_family = none)]
448        pub unsafe fn setMinMagnification(&self, min_magnification: CGFloat);
449
450        #[unsafe(method(magnifyToFitRect:))]
451        #[unsafe(method_family = none)]
452        pub unsafe fn magnifyToFitRect(&self, rect: NSRect);
453
454        #[cfg(feature = "objc2-core-foundation")]
455        #[unsafe(method(setMagnification:centeredAtPoint:))]
456        #[unsafe(method_family = none)]
457        pub unsafe fn setMagnification_centeredAtPoint(
458            &self,
459            magnification: CGFloat,
460            point: NSPoint,
461        );
462
463        #[cfg(feature = "NSEvent")]
464        #[unsafe(method(addFloatingSubview:forAxis:))]
465        #[unsafe(method_family = none)]
466        pub unsafe fn addFloatingSubview_forAxis(&self, view: &NSView, axis: NSEventGestureAxis);
467
468        #[unsafe(method(automaticallyAdjustsContentInsets))]
469        #[unsafe(method_family = none)]
470        pub unsafe fn automaticallyAdjustsContentInsets(&self) -> bool;
471
472        /// Setter for [`automaticallyAdjustsContentInsets`][Self::automaticallyAdjustsContentInsets].
473        #[unsafe(method(setAutomaticallyAdjustsContentInsets:))]
474        #[unsafe(method_family = none)]
475        pub unsafe fn setAutomaticallyAdjustsContentInsets(
476            &self,
477            automatically_adjusts_content_insets: bool,
478        );
479
480        #[unsafe(method(contentInsets))]
481        #[unsafe(method_family = none)]
482        pub unsafe fn contentInsets(&self) -> NSEdgeInsets;
483
484        /// Setter for [`contentInsets`][Self::contentInsets].
485        #[unsafe(method(setContentInsets:))]
486        #[unsafe(method_family = none)]
487        pub unsafe fn setContentInsets(&self, content_insets: NSEdgeInsets);
488
489        #[unsafe(method(scrollerInsets))]
490        #[unsafe(method_family = none)]
491        pub unsafe fn scrollerInsets(&self) -> NSEdgeInsets;
492
493        /// Setter for [`scrollerInsets`][Self::scrollerInsets].
494        #[unsafe(method(setScrollerInsets:))]
495        #[unsafe(method_family = none)]
496        pub unsafe fn setScrollerInsets(&self, scroller_insets: NSEdgeInsets);
497    );
498}
499
500/// Methods declared on superclass `NSResponder`.
501#[cfg(all(feature = "NSResponder", feature = "NSView"))]
502impl NSScrollView {
503    extern_methods!(
504        #[unsafe(method(init))]
505        #[unsafe(method_family = init)]
506        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
507    );
508}
509
510/// Methods declared on superclass `NSObject`.
511#[cfg(all(feature = "NSResponder", feature = "NSView"))]
512impl NSScrollView {
513    extern_methods!(
514        #[unsafe(method(new))]
515        #[unsafe(method_family = new)]
516        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
517    );
518}
519
520extern "C" {
521    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrollviewwillstartlivemagnifynotification?language=objc)
522    pub static NSScrollViewWillStartLiveMagnifyNotification: &'static NSNotificationName;
523}
524
525extern "C" {
526    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrollviewdidendlivemagnifynotification?language=objc)
527    pub static NSScrollViewDidEndLiveMagnifyNotification: &'static NSNotificationName;
528}
529
530extern "C" {
531    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrollviewwillstartlivescrollnotification?language=objc)
532    pub static NSScrollViewWillStartLiveScrollNotification: &'static NSNotificationName;
533}
534
535extern "C" {
536    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrollviewdidlivescrollnotification?language=objc)
537    pub static NSScrollViewDidLiveScrollNotification: &'static NSNotificationName;
538}
539
540extern "C" {
541    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrollviewdidendlivescrollnotification?language=objc)
542    pub static NSScrollViewDidEndLiveScrollNotification: &'static NSNotificationName;
543}
544
545/// NSRulerSupport.
546#[cfg(all(feature = "NSResponder", feature = "NSView"))]
547impl NSScrollView {
548    extern_methods!(
549        #[unsafe(method(rulerViewClass))]
550        #[unsafe(method_family = none)]
551        pub unsafe fn rulerViewClass(mtm: MainThreadMarker) -> Option<&'static AnyClass>;
552
553        /// Setter for [`rulerViewClass`][Self::rulerViewClass].
554        #[unsafe(method(setRulerViewClass:))]
555        #[unsafe(method_family = none)]
556        pub unsafe fn setRulerViewClass(ruler_view_class: Option<&AnyClass>, mtm: MainThreadMarker);
557
558        #[unsafe(method(rulersVisible))]
559        #[unsafe(method_family = none)]
560        pub unsafe fn rulersVisible(&self) -> bool;
561
562        /// Setter for [`rulersVisible`][Self::rulersVisible].
563        #[unsafe(method(setRulersVisible:))]
564        #[unsafe(method_family = none)]
565        pub unsafe fn setRulersVisible(&self, rulers_visible: bool);
566
567        #[unsafe(method(hasHorizontalRuler))]
568        #[unsafe(method_family = none)]
569        pub unsafe fn hasHorizontalRuler(&self) -> bool;
570
571        /// Setter for [`hasHorizontalRuler`][Self::hasHorizontalRuler].
572        #[unsafe(method(setHasHorizontalRuler:))]
573        #[unsafe(method_family = none)]
574        pub unsafe fn setHasHorizontalRuler(&self, has_horizontal_ruler: bool);
575
576        #[unsafe(method(hasVerticalRuler))]
577        #[unsafe(method_family = none)]
578        pub unsafe fn hasVerticalRuler(&self) -> bool;
579
580        /// Setter for [`hasVerticalRuler`][Self::hasVerticalRuler].
581        #[unsafe(method(setHasVerticalRuler:))]
582        #[unsafe(method_family = none)]
583        pub unsafe fn setHasVerticalRuler(&self, has_vertical_ruler: bool);
584
585        #[cfg(feature = "NSRulerView")]
586        #[unsafe(method(horizontalRulerView))]
587        #[unsafe(method_family = none)]
588        pub unsafe fn horizontalRulerView(&self) -> Option<Retained<NSRulerView>>;
589
590        #[cfg(feature = "NSRulerView")]
591        /// Setter for [`horizontalRulerView`][Self::horizontalRulerView].
592        #[unsafe(method(setHorizontalRulerView:))]
593        #[unsafe(method_family = none)]
594        pub unsafe fn setHorizontalRulerView(&self, horizontal_ruler_view: Option<&NSRulerView>);
595
596        #[cfg(feature = "NSRulerView")]
597        #[unsafe(method(verticalRulerView))]
598        #[unsafe(method_family = none)]
599        pub unsafe fn verticalRulerView(&self) -> Option<Retained<NSRulerView>>;
600
601        #[cfg(feature = "NSRulerView")]
602        /// Setter for [`verticalRulerView`][Self::verticalRulerView].
603        #[unsafe(method(setVerticalRulerView:))]
604        #[unsafe(method_family = none)]
605        pub unsafe fn setVerticalRulerView(&self, vertical_ruler_view: Option<&NSRulerView>);
606    );
607}
608
609/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsscrollviewfindbarposition?language=objc)
610// NS_ENUM
611#[repr(transparent)]
612#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
613pub struct NSScrollViewFindBarPosition(pub NSInteger);
614impl NSScrollViewFindBarPosition {
615    #[doc(alias = "NSScrollViewFindBarPositionAboveHorizontalRuler")]
616    pub const AboveHorizontalRuler: Self = Self(0);
617    #[doc(alias = "NSScrollViewFindBarPositionAboveContent")]
618    pub const AboveContent: Self = Self(1);
619    #[doc(alias = "NSScrollViewFindBarPositionBelowContent")]
620    pub const BelowContent: Self = Self(2);
621}
622
623unsafe impl Encode for NSScrollViewFindBarPosition {
624    const ENCODING: Encoding = NSInteger::ENCODING;
625}
626
627unsafe impl RefEncode for NSScrollViewFindBarPosition {
628    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
629}
630
631/// NSFindBarSupport.
632#[cfg(all(feature = "NSResponder", feature = "NSView"))]
633impl NSScrollView {
634    extern_methods!(
635        #[unsafe(method(findBarPosition))]
636        #[unsafe(method_family = none)]
637        pub unsafe fn findBarPosition(&self) -> NSScrollViewFindBarPosition;
638
639        /// Setter for [`findBarPosition`][Self::findBarPosition].
640        #[unsafe(method(setFindBarPosition:))]
641        #[unsafe(method_family = none)]
642        pub unsafe fn setFindBarPosition(&self, find_bar_position: NSScrollViewFindBarPosition);
643    );
644}