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 fn backgroundColor(&self) -> Retained<NSColor>;
77
78        #[cfg(feature = "NSColor")]
79        /// Setter for [`backgroundColor`][Self::backgroundColor].
80        ///
81        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
82        #[unsafe(method(setBackgroundColor:))]
83        #[unsafe(method_family = none)]
84        pub fn setBackgroundColor(&self, background_color: &NSColor);
85
86        #[unsafe(method(drawsBackground))]
87        #[unsafe(method_family = none)]
88        pub fn drawsBackground(&self) -> bool;
89
90        /// Setter for [`drawsBackground`][Self::drawsBackground].
91        #[unsafe(method(setDrawsBackground:))]
92        #[unsafe(method_family = none)]
93        pub fn setDrawsBackground(&self, draws_background: bool);
94
95        #[unsafe(method(documentView))]
96        #[unsafe(method_family = none)]
97        pub fn documentView(&self) -> Option<Retained<NSView>>;
98
99        /// Setter for [`documentView`][Self::documentView].
100        #[unsafe(method(setDocumentView:))]
101        #[unsafe(method_family = none)]
102        pub fn setDocumentView(&self, document_view: Option<&NSView>);
103
104        #[unsafe(method(documentRect))]
105        #[unsafe(method_family = none)]
106        pub fn documentRect(&self) -> NSRect;
107
108        #[cfg(feature = "NSCursor")]
109        #[unsafe(method(documentCursor))]
110        #[unsafe(method_family = none)]
111        pub fn documentCursor(&self) -> Option<Retained<NSCursor>>;
112
113        #[cfg(feature = "NSCursor")]
114        /// Setter for [`documentCursor`][Self::documentCursor].
115        #[unsafe(method(setDocumentCursor:))]
116        #[unsafe(method_family = none)]
117        pub fn setDocumentCursor(&self, document_cursor: Option<&NSCursor>);
118
119        #[unsafe(method(documentVisibleRect))]
120        #[unsafe(method_family = none)]
121        pub fn documentVisibleRect(&self) -> NSRect;
122
123        #[unsafe(method(viewFrameChanged:))]
124        #[unsafe(method_family = none)]
125        pub fn viewFrameChanged(&self, notification: &NSNotification);
126
127        #[unsafe(method(viewBoundsChanged:))]
128        #[unsafe(method_family = none)]
129        pub fn viewBoundsChanged(&self, notification: &NSNotification);
130
131        #[cfg(feature = "NSEvent")]
132        #[unsafe(method(autoscroll:))]
133        #[unsafe(method_family = none)]
134        pub fn autoscroll(&self, event: &NSEvent) -> bool;
135
136        #[unsafe(method(scrollToPoint:))]
137        #[unsafe(method_family = none)]
138        pub fn scrollToPoint(&self, new_origin: NSPoint);
139
140        #[unsafe(method(constrainBoundsRect:))]
141        #[unsafe(method_family = none)]
142        pub fn constrainBoundsRect(&self, proposed_bounds: NSRect) -> NSRect;
143
144        #[unsafe(method(contentInsets))]
145        #[unsafe(method_family = none)]
146        pub fn contentInsets(&self) -> NSEdgeInsets;
147
148        /// Setter for [`contentInsets`][Self::contentInsets].
149        #[unsafe(method(setContentInsets:))]
150        #[unsafe(method_family = none)]
151        pub fn setContentInsets(&self, content_insets: NSEdgeInsets);
152
153        #[unsafe(method(automaticallyAdjustsContentInsets))]
154        #[unsafe(method_family = none)]
155        pub fn automaticallyAdjustsContentInsets(&self) -> bool;
156
157        /// Setter for [`automaticallyAdjustsContentInsets`][Self::automaticallyAdjustsContentInsets].
158        #[unsafe(method(setAutomaticallyAdjustsContentInsets:))]
159        #[unsafe(method_family = none)]
160        pub fn setAutomaticallyAdjustsContentInsets(
161            &self,
162            automatically_adjusts_content_insets: bool,
163        );
164    );
165}
166
167/// Methods declared on superclass `NSView`.
168#[cfg(all(feature = "NSResponder", feature = "NSView"))]
169impl NSClipView {
170    extern_methods!(
171        #[unsafe(method(initWithFrame:))]
172        #[unsafe(method_family = init)]
173        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
174
175        /// # Safety
176        ///
177        /// `coder` possibly has further requirements.
178        #[unsafe(method(initWithCoder:))]
179        #[unsafe(method_family = init)]
180        pub unsafe fn initWithCoder(
181            this: Allocated<Self>,
182            coder: &NSCoder,
183        ) -> Option<Retained<Self>>;
184    );
185}
186
187/// Methods declared on superclass `NSResponder`.
188#[cfg(all(feature = "NSResponder", feature = "NSView"))]
189impl NSClipView {
190    extern_methods!(
191        #[unsafe(method(init))]
192        #[unsafe(method_family = init)]
193        pub fn init(this: Allocated<Self>) -> Retained<Self>;
194    );
195}
196
197/// Methods declared on superclass `NSObject`.
198#[cfg(all(feature = "NSResponder", feature = "NSView"))]
199impl NSClipView {
200    extern_methods!(
201        #[unsafe(method(new))]
202        #[unsafe(method_family = new)]
203        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
204    );
205}
206
207/// NSClipViewSuperview.
208#[cfg(all(feature = "NSResponder", feature = "NSView"))]
209impl NSView {
210    extern_methods!(
211        #[unsafe(method(reflectScrolledClipView:))]
212        #[unsafe(method_family = none)]
213        pub fn reflectScrolledClipView(&self, clip_view: &NSClipView);
214
215        #[unsafe(method(scrollClipView:toPoint:))]
216        #[unsafe(method_family = none)]
217        pub fn scrollClipView_toPoint(&self, clip_view: &NSClipView, point: NSPoint);
218    );
219}
220
221#[cfg(all(feature = "NSResponder", feature = "NSView"))]
222impl NSClipView {
223    extern_methods!(
224        #[deprecated = "Use -constrainBoundsRect: instead."]
225        #[unsafe(method(constrainScrollPoint:))]
226        #[unsafe(method_family = none)]
227        pub fn constrainScrollPoint(&self, new_origin: NSPoint) -> NSPoint;
228
229        #[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:]."]
230        #[unsafe(method(copiesOnScroll))]
231        #[unsafe(method_family = none)]
232        pub fn copiesOnScroll(&self) -> bool;
233
234        /// Setter for [`copiesOnScroll`][Self::copiesOnScroll].
235        #[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:]."]
236        #[unsafe(method(setCopiesOnScroll:))]
237        #[unsafe(method_family = none)]
238        pub fn setCopiesOnScroll(&self, copies_on_scroll: bool);
239    );
240}