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