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        #[unsafe(method(viewControllerWithRestorationIdentifierPath:coder:))]
40        #[unsafe(method_family = none)]
41        unsafe fn viewControllerWithRestorationIdentifierPath_coder(
42            identifier_components: &NSArray<NSString>,
43            coder: &NSCoder,
44            mtm: MainThreadMarker,
45        ) -> Option<Retained<UIViewController>>;
46    }
47);
48
49extern_protocol!(
50    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uidatasourcemodelassociation?language=objc)
51    pub unsafe trait UIDataSourceModelAssociation: MainThreadOnly {
52        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
53        #[unsafe(method(modelIdentifierForElementAtIndexPath:inView:))]
54        #[unsafe(method_family = none)]
55        unsafe fn modelIdentifierForElementAtIndexPath_inView(
56            &self,
57            idx: &NSIndexPath,
58            view: &UIView,
59        ) -> Option<Retained<NSString>>;
60
61        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
62        #[unsafe(method(indexPathForElementWithModelIdentifier:inView:))]
63        #[unsafe(method_family = none)]
64        unsafe fn indexPathForElementWithModelIdentifier_inView(
65            &self,
66            identifier: &NSString,
67            view: &UIView,
68        ) -> Option<Retained<NSIndexPath>>;
69    }
70);
71
72extern_protocol!(
73    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uistaterestoring?language=objc)
74    pub unsafe trait UIStateRestoring: NSObjectProtocol + MainThreadOnly {
75        #[optional]
76        #[unsafe(method(restorationParent))]
77        #[unsafe(method_family = none)]
78        unsafe fn restorationParent(
79            &self,
80        ) -> Option<Retained<ProtocolObject<dyn UIStateRestoring>>>;
81
82        #[optional]
83        #[unsafe(method(objectRestorationClass))]
84        #[unsafe(method_family = none)]
85        unsafe fn objectRestorationClass(&self) -> Option<&'static AnyClass>;
86
87        #[optional]
88        #[unsafe(method(encodeRestorableStateWithCoder:))]
89        #[unsafe(method_family = none)]
90        unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder);
91
92        #[optional]
93        #[unsafe(method(decodeRestorableStateWithCoder:))]
94        #[unsafe(method_family = none)]
95        unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder);
96
97        #[optional]
98        #[unsafe(method(applicationFinishedRestoringState))]
99        #[unsafe(method_family = none)]
100        unsafe fn applicationFinishedRestoringState(&self);
101    }
102);
103
104extern_protocol!(
105    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiobjectrestoration?language=objc)
106    pub unsafe trait UIObjectRestoration: MainThreadOnly {
107        #[unsafe(method(objectWithRestorationIdentifierPath:coder:))]
108        #[unsafe(method_family = none)]
109        unsafe fn objectWithRestorationIdentifierPath_coder(
110            identifier_components: &NSArray<NSString>,
111            coder: &NSCoder,
112            mtm: MainThreadMarker,
113        ) -> Option<Retained<ProtocolObject<dyn UIStateRestoring>>>;
114    }
115);