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