objc2_app_kit/generated/
NSClipView.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/nsclipview?language=objc)
12    #[unsafe(super(NSView, NSResponder, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
15    pub struct NSClipView;
16);
17
18#[cfg(all(
19    feature = "NSAccessibilityProtocols",
20    feature = "NSResponder",
21    feature = "NSView"
22))]
23extern_conformance!(
24    unsafe impl NSAccessibility for NSClipView {}
25);
26
27#[cfg(all(
28    feature = "NSAccessibilityProtocols",
29    feature = "NSResponder",
30    feature = "NSView"
31))]
32extern_conformance!(
33    unsafe impl NSAccessibilityElementProtocol for NSClipView {}
34);
35
36#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
37extern_conformance!(
38    unsafe impl NSAnimatablePropertyContainer for NSClipView {}
39);
40
41#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
42extern_conformance!(
43    unsafe impl NSAppearanceCustomization for NSClipView {}
44);
45
46#[cfg(all(feature = "NSResponder", feature = "NSView"))]
47extern_conformance!(
48    unsafe impl NSCoding for NSClipView {}
49);
50
51#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
52extern_conformance!(
53    unsafe impl NSDraggingDestination for NSClipView {}
54);
55
56#[cfg(all(feature = "NSResponder", feature = "NSView"))]
57extern_conformance!(
58    unsafe impl NSObjectProtocol for NSClipView {}
59);
60
61#[cfg(all(
62    feature = "NSResponder",
63    feature = "NSUserInterfaceItemIdentification",
64    feature = "NSView"
65))]
66extern_conformance!(
67    unsafe impl NSUserInterfaceItemIdentification for NSClipView {}
68);
69
70#[cfg(all(feature = "NSResponder", feature = "NSView"))]
71impl NSClipView {
72    extern_methods!(
73        #[cfg(feature = "NSColor")]
74        #[unsafe(method(backgroundColor))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
77
78        #[cfg(feature = "NSColor")]
79        /// Setter for [`backgroundColor`][Self::backgroundColor].
80        #[unsafe(method(setBackgroundColor:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);
83
84        #[unsafe(method(drawsBackground))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn drawsBackground(&self) -> bool;
87
88        /// Setter for [`drawsBackground`][Self::drawsBackground].
89        #[unsafe(method(setDrawsBackground:))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn setDrawsBackground(&self, draws_background: bool);
92
93        #[unsafe(method(documentView))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn documentView(&self) -> Option<Retained<NSView>>;
96
97        /// Setter for [`documentView`][Self::documentView].
98        #[unsafe(method(setDocumentView:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn setDocumentView(&self, document_view: Option<&NSView>);
101
102        #[unsafe(method(documentRect))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn documentRect(&self) -> NSRect;
105
106        #[cfg(feature = "NSCursor")]
107        #[unsafe(method(documentCursor))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn documentCursor(&self) -> Option<Retained<NSCursor>>;
110
111        #[cfg(feature = "NSCursor")]
112        /// Setter for [`documentCursor`][Self::documentCursor].
113        #[unsafe(method(setDocumentCursor:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setDocumentCursor(&self, document_cursor: Option<&NSCursor>);
116
117        #[unsafe(method(documentVisibleRect))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn documentVisibleRect(&self) -> NSRect;
120
121        #[unsafe(method(viewFrameChanged:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn viewFrameChanged(&self, notification: &NSNotification);
124
125        #[unsafe(method(viewBoundsChanged:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn viewBoundsChanged(&self, notification: &NSNotification);
128
129        #[cfg(feature = "NSEvent")]
130        #[unsafe(method(autoscroll:))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn autoscroll(&self, event: &NSEvent) -> bool;
133
134        #[unsafe(method(scrollToPoint:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn scrollToPoint(&self, new_origin: NSPoint);
137
138        #[unsafe(method(constrainBoundsRect:))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn constrainBoundsRect(&self, proposed_bounds: NSRect) -> NSRect;
141
142        #[unsafe(method(contentInsets))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn contentInsets(&self) -> NSEdgeInsets;
145
146        /// Setter for [`contentInsets`][Self::contentInsets].
147        #[unsafe(method(setContentInsets:))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn setContentInsets(&self, content_insets: NSEdgeInsets);
150
151        #[unsafe(method(automaticallyAdjustsContentInsets))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn automaticallyAdjustsContentInsets(&self) -> bool;
154
155        /// Setter for [`automaticallyAdjustsContentInsets`][Self::automaticallyAdjustsContentInsets].
156        #[unsafe(method(setAutomaticallyAdjustsContentInsets:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn setAutomaticallyAdjustsContentInsets(
159            &self,
160            automatically_adjusts_content_insets: bool,
161        );
162    );
163}
164
165/// Methods declared on superclass `NSView`.
166#[cfg(all(feature = "NSResponder", feature = "NSView"))]
167impl NSClipView {
168    extern_methods!(
169        #[unsafe(method(initWithFrame:))]
170        #[unsafe(method_family = init)]
171        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
172
173        #[unsafe(method(initWithCoder:))]
174        #[unsafe(method_family = init)]
175        pub unsafe fn initWithCoder(
176            this: Allocated<Self>,
177            coder: &NSCoder,
178        ) -> Option<Retained<Self>>;
179    );
180}
181
182/// Methods declared on superclass `NSResponder`.
183#[cfg(all(feature = "NSResponder", feature = "NSView"))]
184impl NSClipView {
185    extern_methods!(
186        #[unsafe(method(init))]
187        #[unsafe(method_family = init)]
188        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
189    );
190}
191
192/// Methods declared on superclass `NSObject`.
193#[cfg(all(feature = "NSResponder", feature = "NSView"))]
194impl NSClipView {
195    extern_methods!(
196        #[unsafe(method(new))]
197        #[unsafe(method_family = new)]
198        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
199    );
200}
201
202/// NSClipViewSuperview.
203#[cfg(all(feature = "NSResponder", feature = "NSView"))]
204impl NSView {
205    extern_methods!(
206        #[unsafe(method(reflectScrolledClipView:))]
207        #[unsafe(method_family = none)]
208        pub unsafe fn reflectScrolledClipView(&self, clip_view: &NSClipView);
209
210        #[unsafe(method(scrollClipView:toPoint:))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn scrollClipView_toPoint(&self, clip_view: &NSClipView, point: NSPoint);
213    );
214}
215
216#[cfg(all(feature = "NSResponder", feature = "NSView"))]
217impl NSClipView {
218    extern_methods!(
219        #[deprecated = "Use -constrainBoundsRect: instead."]
220        #[unsafe(method(constrainScrollPoint:))]
221        #[unsafe(method_family = none)]
222        pub unsafe fn constrainScrollPoint(&self, new_origin: NSPoint) -> NSPoint;
223
224        #[deprecated = "Setting this property has no effect.  NSClipView will always minimize the area of the document view that is invalidated.  To force invalidation of the document view, use -[NSView setNeedsDisplayInRect:]."]
225        #[unsafe(method(copiesOnScroll))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn copiesOnScroll(&self) -> bool;
228
229        /// Setter for [`copiesOnScroll`][Self::copiesOnScroll].
230        #[deprecated = "Setting this property has no effect.  NSClipView will always minimize the area of the document view that is invalidated.  To force invalidation of the document view, use -[NSView setNeedsDisplayInRect:]."]
231        #[unsafe(method(setCopiesOnScroll:))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn setCopiesOnScroll(&self, copies_on_scroll: bool);
234    );
235}