objc2_ui_kit/generated/
UIStateRestoration.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 "C" {
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uistaterestorationviewcontrollerstoryboardkey?language=objc)
12    pub static UIStateRestorationViewControllerStoryboardKey: &'static NSString;
13}
14
15extern "C" {
16    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiapplicationstaterestorationbundleversionkey?language=objc)
17    pub static UIApplicationStateRestorationBundleVersionKey: &'static NSString;
18}
19
20extern "C" {
21    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiapplicationstaterestorationuserinterfaceidiomkey?language=objc)
22    pub static UIApplicationStateRestorationUserInterfaceIdiomKey: &'static NSString;
23}
24
25extern "C" {
26    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiapplicationstaterestorationtimestampkey?language=objc)
27    pub static UIApplicationStateRestorationTimestampKey: &'static NSString;
28}
29
30extern "C" {
31    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiapplicationstaterestorationsystemversionkey?language=objc)
32    pub static UIApplicationStateRestorationSystemVersionKey: &'static NSString;
33}
34
35extern_protocol!(
36    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewcontrollerrestoration?language=objc)
37    pub unsafe trait UIViewControllerRestoration: MainThreadOnly {
38        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
39        /// # Safety
40        ///
41        /// `coder` possibly has further requirements.
42        #[unsafe(method(viewControllerWithRestorationIdentifierPath:coder:))]
43        #[unsafe(method_family = none)]
44        unsafe fn viewControllerWithRestorationIdentifierPath_coder(
45            identifier_components: &NSArray<NSString>,
46            coder: &NSCoder,
47            mtm: MainThreadMarker,
48        ) -> Option<Retained<UIViewController>>;
49    }
50);
51
52extern_protocol!(
53    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uidatasourcemodelassociation?language=objc)
54    pub unsafe trait UIDataSourceModelAssociation: MainThreadOnly {
55        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
56        #[unsafe(method(modelIdentifierForElementAtIndexPath:inView:))]
57        #[unsafe(method_family = none)]
58        fn modelIdentifierForElementAtIndexPath_inView(
59            &self,
60            idx: &NSIndexPath,
61            view: &UIView,
62        ) -> Option<Retained<NSString>>;
63
64        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
65        #[unsafe(method(indexPathForElementWithModelIdentifier:inView:))]
66        #[unsafe(method_family = none)]
67        fn indexPathForElementWithModelIdentifier_inView(
68            &self,
69            identifier: &NSString,
70            view: &UIView,
71        ) -> Option<Retained<NSIndexPath>>;
72    }
73);
74
75extern_protocol!(
76    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uistaterestoring?language=objc)
77    pub unsafe trait UIStateRestoring: NSObjectProtocol + MainThreadOnly {
78        #[optional]
79        #[unsafe(method(restorationParent))]
80        #[unsafe(method_family = none)]
81        fn restorationParent(&self) -> Option<Retained<ProtocolObject<dyn UIStateRestoring>>>;
82
83        #[optional]
84        #[unsafe(method(objectRestorationClass))]
85        #[unsafe(method_family = none)]
86        fn objectRestorationClass(&self) -> Option<&'static AnyClass>;
87
88        /// # Safety
89        ///
90        /// `coder` possibly has further requirements.
91        #[optional]
92        #[unsafe(method(encodeRestorableStateWithCoder:))]
93        #[unsafe(method_family = none)]
94        unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder);
95
96        /// # Safety
97        ///
98        /// `coder` possibly has further requirements.
99        #[optional]
100        #[unsafe(method(decodeRestorableStateWithCoder:))]
101        #[unsafe(method_family = none)]
102        unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder);
103
104        #[optional]
105        #[unsafe(method(applicationFinishedRestoringState))]
106        #[unsafe(method_family = none)]
107        fn applicationFinishedRestoringState(&self);
108    }
109);
110
111extern_protocol!(
112    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiobjectrestoration?language=objc)
113    pub unsafe trait UIObjectRestoration: MainThreadOnly {
114        /// # Safety
115        ///
116        /// `coder` possibly has further requirements.
117        #[unsafe(method(objectWithRestorationIdentifierPath:coder:))]
118        #[unsafe(method_family = none)]
119        unsafe fn objectWithRestorationIdentifierPath_coder(
120            identifier_components: &NSArray<NSString>,
121            coder: &NSCoder,
122            mtm: MainThreadMarker,
123        ) -> Option<Retained<ProtocolObject<dyn UIStateRestoring>>>;
124    }
125);