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