objc2_foundation/generated/
NSUbiquitousKeyValueStore.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct NSUbiquitousKeyValueStore;
14);
15
16unsafe impl NSObjectProtocol for NSUbiquitousKeyValueStore {}
17
18impl NSUbiquitousKeyValueStore {
19    extern_methods!(
20        #[unsafe(method(defaultStore))]
21        #[unsafe(method_family = none)]
22        pub unsafe fn defaultStore() -> Retained<NSUbiquitousKeyValueStore>;
23
24        #[cfg(feature = "NSString")]
25        #[unsafe(method(objectForKey:))]
26        #[unsafe(method_family = none)]
27        pub unsafe fn objectForKey(&self, a_key: &NSString) -> Option<Retained<AnyObject>>;
28
29        #[cfg(feature = "NSString")]
30        #[unsafe(method(setObject:forKey:))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn setObject_forKey(&self, an_object: Option<&AnyObject>, a_key: &NSString);
33
34        #[cfg(feature = "NSString")]
35        #[unsafe(method(removeObjectForKey:))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn removeObjectForKey(&self, a_key: &NSString);
38
39        #[cfg(feature = "NSString")]
40        #[unsafe(method(stringForKey:))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn stringForKey(&self, a_key: &NSString) -> Option<Retained<NSString>>;
43
44        #[cfg(all(feature = "NSArray", feature = "NSString"))]
45        #[unsafe(method(arrayForKey:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn arrayForKey(&self, a_key: &NSString) -> Option<Retained<NSArray>>;
48
49        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
50        #[unsafe(method(dictionaryForKey:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn dictionaryForKey(
53            &self,
54            a_key: &NSString,
55        ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
56
57        #[cfg(all(feature = "NSData", feature = "NSString"))]
58        #[unsafe(method(dataForKey:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn dataForKey(&self, a_key: &NSString) -> Option<Retained<NSData>>;
61
62        #[cfg(feature = "NSString")]
63        #[unsafe(method(longLongForKey:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn longLongForKey(&self, a_key: &NSString) -> c_longlong;
66
67        #[cfg(feature = "NSString")]
68        #[unsafe(method(doubleForKey:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn doubleForKey(&self, a_key: &NSString) -> c_double;
71
72        #[cfg(feature = "NSString")]
73        #[unsafe(method(boolForKey:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn boolForKey(&self, a_key: &NSString) -> bool;
76
77        #[cfg(feature = "NSString")]
78        #[unsafe(method(setString:forKey:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn setString_forKey(&self, a_string: Option<&NSString>, a_key: &NSString);
81
82        #[cfg(all(feature = "NSData", feature = "NSString"))]
83        #[unsafe(method(setData:forKey:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setData_forKey(&self, a_data: Option<&NSData>, a_key: &NSString);
86
87        #[cfg(all(feature = "NSArray", feature = "NSString"))]
88        #[unsafe(method(setArray:forKey:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setArray_forKey(&self, an_array: Option<&NSArray>, a_key: &NSString);
91
92        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
93        #[unsafe(method(setDictionary:forKey:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn setDictionary_forKey(
96            &self,
97            a_dictionary: Option<&NSDictionary<NSString, AnyObject>>,
98            a_key: &NSString,
99        );
100
101        #[cfg(feature = "NSString")]
102        #[unsafe(method(setLongLong:forKey:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setLongLong_forKey(&self, value: c_longlong, a_key: &NSString);
105
106        #[cfg(feature = "NSString")]
107        #[unsafe(method(setDouble:forKey:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn setDouble_forKey(&self, value: c_double, a_key: &NSString);
110
111        #[cfg(feature = "NSString")]
112        #[unsafe(method(setBool:forKey:))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn setBool_forKey(&self, value: bool, a_key: &NSString);
115
116        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
117        #[unsafe(method(dictionaryRepresentation))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn dictionaryRepresentation(
120            &self,
121        ) -> Retained<NSDictionary<NSString, AnyObject>>;
122
123        #[unsafe(method(synchronize))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn synchronize(&self) -> bool;
126    );
127}
128
129/// Methods declared on superclass `NSObject`.
130impl NSUbiquitousKeyValueStore {
131    extern_methods!(
132        #[unsafe(method(init))]
133        #[unsafe(method_family = init)]
134        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
135
136        #[unsafe(method(new))]
137        #[unsafe(method_family = new)]
138        pub unsafe fn new() -> Retained<Self>;
139    );
140}
141
142extern "C" {
143    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestoredidchangeexternallynotification?language=objc)
144    #[cfg(all(feature = "NSNotification", feature = "NSString"))]
145    pub static NSUbiquitousKeyValueStoreDidChangeExternallyNotification:
146        &'static NSNotificationName;
147}
148
149extern "C" {
150    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestorechangereasonkey?language=objc)
151    #[cfg(feature = "NSString")]
152    pub static NSUbiquitousKeyValueStoreChangeReasonKey: &'static NSString;
153}
154
155extern "C" {
156    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestorechangedkeyskey?language=objc)
157    #[cfg(feature = "NSString")]
158    pub static NSUbiquitousKeyValueStoreChangedKeysKey: &'static NSString;
159}
160
161/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestoreserverchange?language=objc)
162pub const NSUbiquitousKeyValueStoreServerChange: NSInteger = 0;
163/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestoreinitialsyncchange?language=objc)
164pub const NSUbiquitousKeyValueStoreInitialSyncChange: NSInteger = 1;
165/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestorequotaviolationchange?language=objc)
166pub const NSUbiquitousKeyValueStoreQuotaViolationChange: NSInteger = 2;
167/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestoreaccountchange?language=objc)
168pub const NSUbiquitousKeyValueStoreAccountChange: NSInteger = 3;