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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSUbiquitousKeyValueStore;

    unsafe impl ClassType for NSUbiquitousKeyValueStore {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for NSUbiquitousKeyValueStore {}

extern_methods!(
    unsafe impl NSUbiquitousKeyValueStore {
        #[method_id(@__retain_semantics Other defaultStore)]
        pub unsafe fn defaultStore() -> Retained<NSUbiquitousKeyValueStore>;

        #[cfg(feature = "NSString")]
        #[method_id(@__retain_semantics Other objectForKey:)]
        pub unsafe fn objectForKey(&self, a_key: &NSString) -> Option<Retained<AnyObject>>;

        #[cfg(feature = "NSString")]
        #[method(setObject:forKey:)]
        pub unsafe fn setObject_forKey(&self, an_object: Option<&AnyObject>, a_key: &NSString);

        #[cfg(feature = "NSString")]
        #[method(removeObjectForKey:)]
        pub unsafe fn removeObjectForKey(&self, a_key: &NSString);

        #[cfg(feature = "NSString")]
        #[method_id(@__retain_semantics Other stringForKey:)]
        pub unsafe fn stringForKey(&self, a_key: &NSString) -> Option<Retained<NSString>>;

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[method_id(@__retain_semantics Other arrayForKey:)]
        pub unsafe fn arrayForKey(&self, a_key: &NSString) -> Option<Retained<NSArray>>;

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[method_id(@__retain_semantics Other dictionaryForKey:)]
        pub unsafe fn dictionaryForKey(
            &self,
            a_key: &NSString,
        ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;

        #[cfg(all(feature = "NSData", feature = "NSString"))]
        #[method_id(@__retain_semantics Other dataForKey:)]
        pub unsafe fn dataForKey(&self, a_key: &NSString) -> Option<Retained<NSData>>;

        #[cfg(feature = "NSString")]
        #[method(longLongForKey:)]
        pub unsafe fn longLongForKey(&self, a_key: &NSString) -> c_longlong;

        #[cfg(feature = "NSString")]
        #[method(doubleForKey:)]
        pub unsafe fn doubleForKey(&self, a_key: &NSString) -> c_double;

        #[cfg(feature = "NSString")]
        #[method(boolForKey:)]
        pub unsafe fn boolForKey(&self, a_key: &NSString) -> bool;

        #[cfg(feature = "NSString")]
        #[method(setString:forKey:)]
        pub unsafe fn setString_forKey(&self, a_string: Option<&NSString>, a_key: &NSString);

        #[cfg(all(feature = "NSData", feature = "NSString"))]
        #[method(setData:forKey:)]
        pub unsafe fn setData_forKey(&self, a_data: Option<&NSData>, a_key: &NSString);

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[method(setArray:forKey:)]
        pub unsafe fn setArray_forKey(&self, an_array: Option<&NSArray>, a_key: &NSString);

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[method(setDictionary:forKey:)]
        pub unsafe fn setDictionary_forKey(
            &self,
            a_dictionary: Option<&NSDictionary<NSString, AnyObject>>,
            a_key: &NSString,
        );

        #[cfg(feature = "NSString")]
        #[method(setLongLong:forKey:)]
        pub unsafe fn setLongLong_forKey(&self, value: c_longlong, a_key: &NSString);

        #[cfg(feature = "NSString")]
        #[method(setDouble:forKey:)]
        pub unsafe fn setDouble_forKey(&self, value: c_double, a_key: &NSString);

        #[cfg(feature = "NSString")]
        #[method(setBool:forKey:)]
        pub unsafe fn setBool_forKey(&self, value: bool, a_key: &NSString);

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        #[method_id(@__retain_semantics Other dictionaryRepresentation)]
        pub unsafe fn dictionaryRepresentation(
            &self,
        ) -> Retained<NSDictionary<NSString, AnyObject>>;

        #[method(synchronize)]
        pub unsafe fn synchronize(&self) -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSUbiquitousKeyValueStore {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern "C" {
    #[cfg(all(feature = "NSNotification", feature = "NSString"))]
    pub static NSUbiquitousKeyValueStoreDidChangeExternallyNotification:
        &'static NSNotificationName;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSUbiquitousKeyValueStoreChangeReasonKey: &'static NSString;
}

extern "C" {
    #[cfg(feature = "NSString")]
    pub static NSUbiquitousKeyValueStoreChangedKeysKey: &'static NSString;
}

pub const NSUbiquitousKeyValueStoreServerChange: NSInteger = 0;
pub const NSUbiquitousKeyValueStoreInitialSyncChange: NSInteger = 1;
pub const NSUbiquitousKeyValueStoreQuotaViolationChange: NSInteger = 2;
pub const NSUbiquitousKeyValueStoreAccountChange: NSInteger = 3;