objc2_ui_kit/generated/
UIStateRestoration.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11 pub static UIStateRestorationViewControllerStoryboardKey: &'static NSString;
13}
14
15extern "C" {
16 pub static UIApplicationStateRestorationBundleVersionKey: &'static NSString;
18}
19
20extern "C" {
21 pub static UIApplicationStateRestorationUserInterfaceIdiomKey: &'static NSString;
23}
24
25extern "C" {
26 pub static UIApplicationStateRestorationTimestampKey: &'static NSString;
28}
29
30extern "C" {
31 pub static UIApplicationStateRestorationSystemVersionKey: &'static NSString;
33}
34
35extern_protocol!(
36 pub unsafe trait UIViewControllerRestoration: MainThreadOnly {
38 #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
39 #[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 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 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 #[optional]
92 #[unsafe(method(encodeRestorableStateWithCoder:))]
93 #[unsafe(method_family = none)]
94 unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder);
95
96 #[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 pub unsafe trait UIObjectRestoration: MainThreadOnly {
114 #[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);