1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern "C" {
    pub static UIStateRestorationViewControllerStoryboardKey: &'static NSString;
}

extern "C" {
    pub static UIApplicationStateRestorationBundleVersionKey: &'static NSString;
}

extern "C" {
    pub static UIApplicationStateRestorationUserInterfaceIdiomKey: &'static NSString;
}

extern "C" {
    pub static UIApplicationStateRestorationTimestampKey: &'static NSString;
}

extern "C" {
    pub static UIApplicationStateRestorationSystemVersionKey: &'static NSString;
}

extern_protocol!(
    pub unsafe trait UIViewControllerRestoration: IsMainThreadOnly {
        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[method_id(@__retain_semantics Other viewControllerWithRestorationIdentifierPath:coder:)]
        unsafe fn viewControllerWithRestorationIdentifierPath_coder(
            identifier_components: &NSArray<NSString>,
            coder: &NSCoder,
            mtm: MainThreadMarker,
        ) -> Option<Retained<UIViewController>>;
    }

    unsafe impl ProtocolType for dyn UIViewControllerRestoration {}
);

extern_protocol!(
    pub unsafe trait UIDataSourceModelAssociation: IsMainThreadOnly {
        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[method_id(@__retain_semantics Other modelIdentifierForElementAtIndexPath:inView:)]
        unsafe fn modelIdentifierForElementAtIndexPath_inView(
            &self,
            idx: &NSIndexPath,
            view: &UIView,
        ) -> Option<Retained<NSString>>;

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[method_id(@__retain_semantics Other indexPathForElementWithModelIdentifier:inView:)]
        unsafe fn indexPathForElementWithModelIdentifier_inView(
            &self,
            identifier: &NSString,
            view: &UIView,
        ) -> Option<Retained<NSIndexPath>>;
    }

    unsafe impl ProtocolType for dyn UIDataSourceModelAssociation {}
);

extern_protocol!(
    pub unsafe trait UIStateRestoring: NSObjectProtocol + IsMainThreadOnly {
        #[optional]
        #[method_id(@__retain_semantics Other restorationParent)]
        unsafe fn restorationParent(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UIStateRestoring>>>;

        #[optional]
        #[method(objectRestorationClass)]
        unsafe fn objectRestorationClass(&self) -> Option<&'static AnyClass>;

        #[optional]
        #[method(encodeRestorableStateWithCoder:)]
        unsafe fn encodeRestorableStateWithCoder(&self, coder: &NSCoder);

        #[optional]
        #[method(decodeRestorableStateWithCoder:)]
        unsafe fn decodeRestorableStateWithCoder(&self, coder: &NSCoder);

        #[optional]
        #[method(applicationFinishedRestoringState)]
        unsafe fn applicationFinishedRestoringState(&self);
    }

    unsafe impl ProtocolType for dyn UIStateRestoring {}
);

extern_protocol!(
    pub unsafe trait UIObjectRestoration: IsMainThreadOnly {
        #[method_id(@__retain_semantics Other objectWithRestorationIdentifierPath:coder:)]
        unsafe fn objectWithRestorationIdentifierPath_coder(
            identifier_components: &NSArray<NSString>,
            coder: &NSCoder,
            mtm: MainThreadMarker,
        ) -> Option<Retained<ProtocolObject<dyn UIStateRestoring>>>;
    }

    unsafe impl ProtocolType for dyn UIObjectRestoration {}
);