objc2_ui_kit/generated/
UIConfigurationState.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
10/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiconfigurationstatecustomkey?language=objc)
11// NS_TYPED_EXTENSIBLE_ENUM
12pub type UIConfigurationStateCustomKey = NSString;
13
14extern_protocol!(
15    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiconfigurationstate?language=objc)
16    pub unsafe trait UIConfigurationState:
17        NSObjectProtocol + NSCopying + NSSecureCoding + MainThreadOnly
18    {
19        #[cfg(feature = "UITraitCollection")]
20        /// Returns a new instance with the specified trait collection.
21        #[unsafe(method(initWithTraitCollection:))]
22        #[unsafe(method_family = init)]
23        unsafe fn initWithTraitCollection(
24            this: Allocated<Self>,
25            trait_collection: &UITraitCollection,
26        ) -> Retained<Self>;
27
28        #[cfg(feature = "UITraitCollection")]
29        #[unsafe(method(traitCollection))]
30        #[unsafe(method_family = none)]
31        unsafe fn traitCollection(&self) -> Retained<UITraitCollection>;
32
33        #[cfg(feature = "UITraitCollection")]
34        /// Setter for [`traitCollection`][Self::traitCollection].
35        #[unsafe(method(setTraitCollection:))]
36        #[unsafe(method_family = none)]
37        unsafe fn setTraitCollection(&self, trait_collection: &UITraitCollection);
38
39        /// Returns the custom state for the specified key.
40        #[unsafe(method(customStateForKey:))]
41        #[unsafe(method_family = none)]
42        unsafe fn customStateForKey(
43            &self,
44            key: &UIConfigurationStateCustomKey,
45        ) -> Option<Retained<AnyObject>>;
46
47        /// Sets the custom state for the specified key.
48        #[unsafe(method(setCustomState:forKey:))]
49        #[unsafe(method_family = none)]
50        unsafe fn setCustomState_forKey(
51            &self,
52            custom_state: Option<&AnyObject>,
53            key: &UIConfigurationStateCustomKey,
54        );
55
56        #[unsafe(method(objectForKeyedSubscript:))]
57        #[unsafe(method_family = none)]
58        unsafe fn objectForKeyedSubscript(
59            &self,
60            key: &UIConfigurationStateCustomKey,
61        ) -> Option<Retained<AnyObject>>;
62
63        #[unsafe(method(setObject:forKeyedSubscript:))]
64        #[unsafe(method_family = none)]
65        unsafe fn setObject_forKeyedSubscript(
66            &self,
67            obj: Option<&AnyObject>,
68            key: &UIConfigurationStateCustomKey,
69        );
70    }
71);