objc2_app_kit/generated/
NSClipView.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[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))]
23unsafe impl NSAccessibility for NSClipView {}
24
25#[cfg(all(
26 feature = "NSAccessibilityProtocols",
27 feature = "NSResponder",
28 feature = "NSView"
29))]
30unsafe impl NSAccessibilityElementProtocol for NSClipView {}
31
32#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
33unsafe impl NSAnimatablePropertyContainer for NSClipView {}
34
35#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
36unsafe impl NSAppearanceCustomization for NSClipView {}
37
38#[cfg(all(feature = "NSResponder", feature = "NSView"))]
39unsafe impl NSCoding for NSClipView {}
40
41#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
42unsafe impl NSDraggingDestination for NSClipView {}
43
44#[cfg(all(feature = "NSResponder", feature = "NSView"))]
45unsafe impl NSObjectProtocol for NSClipView {}
46
47#[cfg(all(
48 feature = "NSResponder",
49 feature = "NSUserInterfaceItemIdentification",
50 feature = "NSView"
51))]
52unsafe impl NSUserInterfaceItemIdentification for NSClipView {}
53
54#[cfg(all(feature = "NSResponder", feature = "NSView"))]
55impl NSClipView {
56 extern_methods!(
57 #[cfg(feature = "NSColor")]
58 #[unsafe(method(backgroundColor))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
61
62 #[cfg(feature = "NSColor")]
63 #[unsafe(method(setBackgroundColor:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);
67
68 #[unsafe(method(drawsBackground))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn drawsBackground(&self) -> bool;
71
72 #[unsafe(method(setDrawsBackground:))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn setDrawsBackground(&self, draws_background: bool);
76
77 #[unsafe(method(documentView))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn documentView(&self) -> Option<Retained<NSView>>;
80
81 #[unsafe(method(setDocumentView:))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn setDocumentView(&self, document_view: Option<&NSView>);
85
86 #[unsafe(method(documentRect))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn documentRect(&self) -> NSRect;
89
90 #[cfg(feature = "NSCursor")]
91 #[unsafe(method(documentCursor))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn documentCursor(&self) -> Option<Retained<NSCursor>>;
94
95 #[cfg(feature = "NSCursor")]
96 #[unsafe(method(setDocumentCursor:))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn setDocumentCursor(&self, document_cursor: Option<&NSCursor>);
100
101 #[unsafe(method(documentVisibleRect))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn documentVisibleRect(&self) -> NSRect;
104
105 #[unsafe(method(viewFrameChanged:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn viewFrameChanged(&self, notification: &NSNotification);
108
109 #[unsafe(method(viewBoundsChanged:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn viewBoundsChanged(&self, notification: &NSNotification);
112
113 #[cfg(feature = "NSEvent")]
114 #[unsafe(method(autoscroll:))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn autoscroll(&self, event: &NSEvent) -> bool;
117
118 #[unsafe(method(scrollToPoint:))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn scrollToPoint(&self, new_origin: NSPoint);
121
122 #[unsafe(method(constrainBoundsRect:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn constrainBoundsRect(&self, proposed_bounds: NSRect) -> NSRect;
125
126 #[unsafe(method(contentInsets))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn contentInsets(&self) -> NSEdgeInsets;
129
130 #[unsafe(method(setContentInsets:))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn setContentInsets(&self, content_insets: NSEdgeInsets);
134
135 #[unsafe(method(automaticallyAdjustsContentInsets))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn automaticallyAdjustsContentInsets(&self) -> bool;
138
139 #[unsafe(method(setAutomaticallyAdjustsContentInsets:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn setAutomaticallyAdjustsContentInsets(
143 &self,
144 automatically_adjusts_content_insets: bool,
145 );
146 );
147}
148
149#[cfg(all(feature = "NSResponder", feature = "NSView"))]
151impl NSClipView {
152 extern_methods!(
153 #[unsafe(method(initWithFrame:))]
154 #[unsafe(method_family = init)]
155 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
156
157 #[unsafe(method(initWithCoder:))]
158 #[unsafe(method_family = init)]
159 pub unsafe fn initWithCoder(
160 this: Allocated<Self>,
161 coder: &NSCoder,
162 ) -> Option<Retained<Self>>;
163 );
164}
165
166#[cfg(all(feature = "NSResponder", feature = "NSView"))]
168impl NSClipView {
169 extern_methods!(
170 #[unsafe(method(init))]
171 #[unsafe(method_family = init)]
172 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
173 );
174}
175
176#[cfg(all(feature = "NSResponder", feature = "NSView"))]
178impl NSClipView {
179 extern_methods!(
180 #[unsafe(method(new))]
181 #[unsafe(method_family = new)]
182 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
183 );
184}
185
186#[cfg(all(feature = "NSResponder", feature = "NSView"))]
188impl NSView {
189 extern_methods!(
190 #[unsafe(method(reflectScrolledClipView:))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn reflectScrolledClipView(&self, clip_view: &NSClipView);
193
194 #[unsafe(method(scrollClipView:toPoint:))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn scrollClipView_toPoint(&self, clip_view: &NSClipView, point: NSPoint);
197 );
198}
199
200#[cfg(all(feature = "NSResponder", feature = "NSView"))]
201impl NSClipView {
202 extern_methods!(
203 #[deprecated = "Use -constrainBoundsRect: instead."]
204 #[unsafe(method(constrainScrollPoint:))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn constrainScrollPoint(&self, new_origin: NSPoint) -> NSPoint;
207
208 #[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:]."]
209 #[unsafe(method(copiesOnScroll))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn copiesOnScroll(&self) -> bool;
212
213 #[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:]."]
215 #[unsafe(method(setCopiesOnScroll:))]
216 #[unsafe(method_family = none)]
217 pub unsafe fn setCopiesOnScroll(&self, copies_on_scroll: bool);
218 );
219}