objc2_ui_kit/generated/
UIContentConfiguration.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_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicontentconfiguration?language=objc)
12    pub unsafe trait UIContentConfiguration:
13        NSObjectProtocol + NSCopying + MainThreadOnly
14    {
15        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
16        /// Initializes and returns a new instance of the content view using this configuration.
17        #[unsafe(method(makeContentView))]
18        #[unsafe(method_family = none)]
19        unsafe fn makeContentView(&self) -> Retained<UIView>;
20
21        #[cfg(feature = "UIConfigurationState")]
22        /// Returns a copy of the configuration updated for the specified state, by applying the configuration's default values for that state to any properties that have not been customized.
23        #[unsafe(method(updatedConfigurationForState:))]
24        #[unsafe(method_family = none)]
25        unsafe fn updatedConfigurationForState(
26            &self,
27            state: &ProtocolObject<dyn UIConfigurationState>,
28        ) -> Retained<Self>;
29    }
30);
31
32extern_protocol!(
33    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicontentview?language=objc)
34    pub unsafe trait UIContentView: NSObjectProtocol + MainThreadOnly {
35        /// Returns the current configuration of the view. Setting this property applies the new configuration to the view.
36        #[unsafe(method(configuration))]
37        #[unsafe(method_family = none)]
38        unsafe fn configuration(&self) -> Retained<ProtocolObject<dyn UIContentConfiguration>>;
39
40        /// Setter for [`configuration`][Self::configuration].
41        #[unsafe(method(setConfiguration:))]
42        #[unsafe(method_family = none)]
43        unsafe fn setConfiguration(
44            &self,
45            configuration: &ProtocolObject<dyn UIContentConfiguration>,
46        );
47
48        /// Whether this view is compatible with the provided configuration, meaning the view supports
49        /// it being set to the `configuration` property and is capable of updating itself for the
50        /// configuration. If not implemented, the view is assumed to be compatible with configuration
51        /// classes that match the class of the view's existing configuration.
52        #[optional]
53        #[unsafe(method(supportsConfiguration:))]
54        #[unsafe(method_family = none)]
55        unsafe fn supportsConfiguration(
56            &self,
57            configuration: &ProtocolObject<dyn UIContentConfiguration>,
58        ) -> bool;
59    }
60);