objc2_ui_kit/generated/
UIBackgroundExtensionView.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15extern_class!(
16    /// A view that extends content to fill its own bounds.
17    ///
18    /// A background extension view can be laid out to extend outside the safe area,
19    /// such as under a sidebar or an inspector. By default, the view lays out
20    /// its content to stay within the safe area, and uses modifications of the
21    /// content along the edges to fill the container view.
22    ///
23    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uibackgroundextensionview?language=objc)
24    #[unsafe(super(UIView, UIResponder, NSObject))]
25    #[derive(Debug, PartialEq, Eq, Hash)]
26    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
27    pub struct UIBackgroundExtensionView;
28);
29
30#[cfg(all(
31    feature = "UIResponder",
32    feature = "UIView",
33    feature = "objc2-quartz-core"
34))]
35#[cfg(not(target_os = "watchos"))]
36extern_conformance!(
37    unsafe impl CALayerDelegate for UIBackgroundExtensionView {}
38);
39
40#[cfg(all(feature = "UIResponder", feature = "UIView"))]
41extern_conformance!(
42    unsafe impl NSCoding for UIBackgroundExtensionView {}
43);
44
45#[cfg(all(feature = "UIResponder", feature = "UIView"))]
46extern_conformance!(
47    unsafe impl NSObjectProtocol for UIBackgroundExtensionView {}
48);
49
50#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
51extern_conformance!(
52    unsafe impl UIAppearance for UIBackgroundExtensionView {}
53);
54
55#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
56extern_conformance!(
57    unsafe impl UIAppearanceContainer for UIBackgroundExtensionView {}
58);
59
60#[cfg(all(feature = "UIResponder", feature = "UIView"))]
61extern_conformance!(
62    unsafe impl UICoordinateSpace for UIBackgroundExtensionView {}
63);
64
65#[cfg(all(
66    feature = "UIDynamicBehavior",
67    feature = "UIResponder",
68    feature = "UIView"
69))]
70extern_conformance!(
71    unsafe impl UIDynamicItem for UIBackgroundExtensionView {}
72);
73
74#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
75extern_conformance!(
76    unsafe impl UIFocusEnvironment for UIBackgroundExtensionView {}
77);
78
79#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
80extern_conformance!(
81    unsafe impl UIFocusItem for UIBackgroundExtensionView {}
82);
83
84#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
85extern_conformance!(
86    unsafe impl UIFocusItemContainer for UIBackgroundExtensionView {}
87);
88
89#[cfg(all(feature = "UIResponder", feature = "UIView"))]
90extern_conformance!(
91    unsafe impl UIResponderStandardEditActions for UIBackgroundExtensionView {}
92);
93
94#[cfg(all(
95    feature = "UIResponder",
96    feature = "UITraitCollection",
97    feature = "UIView"
98))]
99extern_conformance!(
100    unsafe impl UITraitEnvironment for UIBackgroundExtensionView {}
101);
102
103#[cfg(all(feature = "UIResponder", feature = "UIView"))]
104impl UIBackgroundExtensionView {
105    extern_methods!(
106        /// The content view to extend to fill the `UIBackgroundExtensionView`.
107        ///
108        /// The content view will be added as a subview of the extension view and
109        /// placed within the safe area by default. See `automaticallyPlacesContentView` to
110        /// customize the layout.
111        #[unsafe(method(contentView))]
112        #[unsafe(method_family = none)]
113        pub fn contentView(&self) -> Option<Retained<UIView>>;
114
115        /// Setter for [`contentView`][Self::contentView].
116        #[unsafe(method(setContentView:))]
117        #[unsafe(method_family = none)]
118        pub fn setContentView(&self, content_view: Option<&UIView>);
119
120        /// Controls the automatic safe area placement of the `contentView` within the
121        /// container.
122        ///
123        /// When `NO`, the frame of the content view must be explicitly set or
124        /// constraints added. The extension effect will be used to fill the container
125        /// view around the content.
126        ///
127        /// Defaults to `YES`.
128        #[unsafe(method(automaticallyPlacesContentView))]
129        #[unsafe(method_family = none)]
130        pub fn automaticallyPlacesContentView(&self) -> bool;
131
132        /// Setter for [`automaticallyPlacesContentView`][Self::automaticallyPlacesContentView].
133        #[unsafe(method(setAutomaticallyPlacesContentView:))]
134        #[unsafe(method_family = none)]
135        pub fn setAutomaticallyPlacesContentView(&self, automatically_places_content_view: bool);
136    );
137}
138
139/// Methods declared on superclass `UIView`.
140#[cfg(all(feature = "UIResponder", feature = "UIView"))]
141impl UIBackgroundExtensionView {
142    extern_methods!(
143        #[cfg(feature = "objc2-core-foundation")]
144        #[unsafe(method(initWithFrame:))]
145        #[unsafe(method_family = init)]
146        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
147
148        /// # Safety
149        ///
150        /// `coder` possibly has further requirements.
151        #[unsafe(method(initWithCoder:))]
152        #[unsafe(method_family = init)]
153        pub unsafe fn initWithCoder(
154            this: Allocated<Self>,
155            coder: &NSCoder,
156        ) -> Option<Retained<Self>>;
157
158        #[unsafe(method(init))]
159        #[unsafe(method_family = init)]
160        pub fn init(this: Allocated<Self>) -> Retained<Self>;
161    );
162}
163
164/// Methods declared on superclass `NSObject`.
165#[cfg(all(feature = "UIResponder", feature = "UIView"))]
166impl UIBackgroundExtensionView {
167    extern_methods!(
168        #[unsafe(method(new))]
169        #[unsafe(method_family = new)]
170        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
171    );
172}