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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//! 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 UIGuidedAccessErrorDomain: &'static NSErrorDomain;
}

// NS_ERROR_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIGuidedAccessErrorCode(pub NSInteger);
impl UIGuidedAccessErrorCode {
    pub const UIGuidedAccessErrorPermissionDenied: Self = Self(0);
    pub const UIGuidedAccessErrorFailed: Self = Self(NSIntegerMax as _);
}

unsafe impl Encode for UIGuidedAccessErrorCode {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIGuidedAccessErrorCode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIGuidedAccessRestrictionState(pub NSInteger);
impl UIGuidedAccessRestrictionState {
    #[doc(alias = "UIGuidedAccessRestrictionStateAllow")]
    pub const Allow: Self = Self(0);
    #[doc(alias = "UIGuidedAccessRestrictionStateDeny")]
    pub const Deny: Self = Self(1);
}

unsafe impl Encode for UIGuidedAccessRestrictionState {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIGuidedAccessRestrictionState {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_protocol!(
    pub unsafe trait UIGuidedAccessRestrictionDelegate:
        NSObjectProtocol + IsMainThreadOnly
    {
        #[method_id(@__retain_semantics Other guidedAccessRestrictionIdentifiers)]
        unsafe fn guidedAccessRestrictionIdentifiers(&self) -> Option<Retained<NSArray<NSString>>>;

        #[method(guidedAccessRestrictionWithIdentifier:didChangeState:)]
        unsafe fn guidedAccessRestrictionWithIdentifier_didChangeState(
            &self,
            restriction_identifier: &NSString,
            new_restriction_state: UIGuidedAccessRestrictionState,
        );

        #[method_id(@__retain_semantics Other textForGuidedAccessRestrictionWithIdentifier:)]
        unsafe fn textForGuidedAccessRestrictionWithIdentifier(
            &self,
            restriction_identifier: &NSString,
        ) -> Option<Retained<NSString>>;

        #[optional]
        #[method_id(@__retain_semantics Other detailTextForGuidedAccessRestrictionWithIdentifier:)]
        unsafe fn detailTextForGuidedAccessRestrictionWithIdentifier(
            &self,
            restriction_identifier: &NSString,
        ) -> Option<Retained<NSString>>;
    }

    unsafe impl ProtocolType for dyn UIGuidedAccessRestrictionDelegate {}
);

extern "C" {
    pub fn UIGuidedAccessRestrictionStateForIdentifier(
        restriction_identifier: &NSString,
    ) -> UIGuidedAccessRestrictionState;
}

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIGuidedAccessAccessibilityFeature(pub NSUInteger);
bitflags::bitflags! {
    impl UIGuidedAccessAccessibilityFeature: NSUInteger {
        #[doc(alias = "UIGuidedAccessAccessibilityFeatureVoiceOver")]
        const VoiceOver = 1<<0;
        #[doc(alias = "UIGuidedAccessAccessibilityFeatureZoom")]
        const Zoom = 1<<1;
        #[doc(alias = "UIGuidedAccessAccessibilityFeatureAssistiveTouch")]
        const AssistiveTouch = 1<<2;
        #[doc(alias = "UIGuidedAccessAccessibilityFeatureInvertColors")]
        const InvertColors = 1<<3;
        #[doc(alias = "UIGuidedAccessAccessibilityFeatureGrayscaleDisplay")]
        const GrayscaleDisplay = 1<<4;
    }
}

unsafe impl Encode for UIGuidedAccessAccessibilityFeature {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for UIGuidedAccessAccessibilityFeature {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern "C" {
    #[cfg(feature = "block2")]
    pub fn UIGuidedAccessConfigureAccessibilityFeatures(
        features: UIGuidedAccessAccessibilityFeature,
        enabled: Bool,
        completion: &block2::Block<dyn Fn(Bool, *mut NSError)>,
    );
}