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:))]
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 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 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 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);