objc2_app_kit/generated/
NSBackgroundExtensionView.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    /// A view that extends content to fill its own bounds.
12    ///
13    /// A background extension view can be laid out to extend outside the safe area,
14    /// such as under the titlebar, sidebar, or inspector. By default it lays out
15    /// its content to stay within the safe area, and uses modifications of the
16    /// content along the edges to fill the container view.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackgroundextensionview?language=objc)
19    #[unsafe(super(NSView, NSResponder, NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
22    pub struct NSBackgroundExtensionView;
23);
24
25#[cfg(all(
26    feature = "NSAccessibilityProtocols",
27    feature = "NSResponder",
28    feature = "NSView"
29))]
30extern_conformance!(
31    unsafe impl NSAccessibility for NSBackgroundExtensionView {}
32);
33
34#[cfg(all(
35    feature = "NSAccessibilityProtocols",
36    feature = "NSResponder",
37    feature = "NSView"
38))]
39extern_conformance!(
40    unsafe impl NSAccessibilityElementProtocol for NSBackgroundExtensionView {}
41);
42
43#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
44extern_conformance!(
45    unsafe impl NSAnimatablePropertyContainer for NSBackgroundExtensionView {}
46);
47
48#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
49extern_conformance!(
50    unsafe impl NSAppearanceCustomization for NSBackgroundExtensionView {}
51);
52
53#[cfg(all(feature = "NSResponder", feature = "NSView"))]
54extern_conformance!(
55    unsafe impl NSCoding for NSBackgroundExtensionView {}
56);
57
58#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
59extern_conformance!(
60    unsafe impl NSDraggingDestination for NSBackgroundExtensionView {}
61);
62
63#[cfg(all(feature = "NSResponder", feature = "NSView"))]
64extern_conformance!(
65    unsafe impl NSObjectProtocol for NSBackgroundExtensionView {}
66);
67
68#[cfg(all(
69    feature = "NSResponder",
70    feature = "NSUserInterfaceItemIdentification",
71    feature = "NSView"
72))]
73extern_conformance!(
74    unsafe impl NSUserInterfaceItemIdentification for NSBackgroundExtensionView {}
75);
76
77#[cfg(all(feature = "NSResponder", feature = "NSView"))]
78impl NSBackgroundExtensionView {
79    extern_methods!(
80        /// The content view to extend to fill the `NSBackgroundExtensionView`.
81        ///
82        /// The content view will be added as a subview of the extension view and
83        /// placed within the safe area by default. See `automaticallyPlacesContentView`
84        /// to customize the layout.
85        #[unsafe(method(contentView))]
86        #[unsafe(method_family = none)]
87        pub fn contentView(&self) -> Option<Retained<NSView>>;
88
89        /// Setter for [`contentView`][Self::contentView].
90        #[unsafe(method(setContentView:))]
91        #[unsafe(method_family = none)]
92        pub fn setContentView(&self, content_view: Option<&NSView>);
93
94        /// Controls the automatic safe area placement of the `contentView` within the
95        /// container.
96        ///
97        /// When `NO`, the frame of the content view must be explicitly set or
98        /// constraints added. The extension effect will be used to fill the container
99        /// view around the content.
100        ///
101        /// Defaults to `YES`.
102        #[unsafe(method(automaticallyPlacesContentView))]
103        #[unsafe(method_family = none)]
104        pub fn automaticallyPlacesContentView(&self) -> bool;
105
106        /// Setter for [`automaticallyPlacesContentView`][Self::automaticallyPlacesContentView].
107        #[unsafe(method(setAutomaticallyPlacesContentView:))]
108        #[unsafe(method_family = none)]
109        pub fn setAutomaticallyPlacesContentView(&self, automatically_places_content_view: bool);
110    );
111}
112
113/// Methods declared on superclass `NSView`.
114#[cfg(all(feature = "NSResponder", feature = "NSView"))]
115impl NSBackgroundExtensionView {
116    extern_methods!(
117        #[unsafe(method(initWithFrame:))]
118        #[unsafe(method_family = init)]
119        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
120
121        /// # Safety
122        ///
123        /// `coder` possibly has further requirements.
124        #[unsafe(method(initWithCoder:))]
125        #[unsafe(method_family = init)]
126        pub unsafe fn initWithCoder(
127            this: Allocated<Self>,
128            coder: &NSCoder,
129        ) -> Option<Retained<Self>>;
130    );
131}
132
133/// Methods declared on superclass `NSResponder`.
134#[cfg(all(feature = "NSResponder", feature = "NSView"))]
135impl NSBackgroundExtensionView {
136    extern_methods!(
137        #[unsafe(method(init))]
138        #[unsafe(method_family = init)]
139        pub fn init(this: Allocated<Self>) -> Retained<Self>;
140    );
141}
142
143/// Methods declared on superclass `NSObject`.
144#[cfg(all(feature = "NSResponder", feature = "NSView"))]
145impl NSBackgroundExtensionView {
146    extern_methods!(
147        #[unsafe(method(new))]
148        #[unsafe(method_family = new)]
149        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
150    );
151}