objc2_cloud_kit/generated/CKFetchDatabaseChangesOperation.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 /// This operation will fetch changes to record zones within a database
12 ///
13 ///
14 /// If a change anchor from a previous
15 /// `CKFetchDatabaseChangesOperation`is passed in, only the zones that have changed since that anchor will be returned.
16 /// This per-database
17 /// `serverChangeToken`is not to be confused with the per-recordZone
18 /// `serverChangeToken`from
19 /// `CKFetchRecordZoneChangesOperation.`If this is your first fetch or if you wish to re-fetch all zones, pass nil for the change token.
20 /// Change token are opaque tokens and clients should not infer any behavior based on their content.
21 /// `CKFetchDatabaseChangesOperation`is supported in a
22 /// `privateCloudDatabase`and
23 /// `sharedCloudDatabase`
24 ///
25 /// See also [Apple's documentation](https://developer.apple.com/documentation/cloudkit/ckfetchdatabasechangesoperation?language=objc)
26 #[unsafe(super(CKDatabaseOperation, CKOperation, NSOperation, NSObject))]
27 #[derive(Debug, PartialEq, Eq, Hash)]
28 #[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
29 pub struct CKFetchDatabaseChangesOperation;
30);
31
32#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
33extern_conformance!(
34 unsafe impl NSObjectProtocol for CKFetchDatabaseChangesOperation {}
35);
36
37#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
38impl CKFetchDatabaseChangesOperation {
39 extern_methods!(
40 #[unsafe(method(init))]
41 #[unsafe(method_family = init)]
42 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
43
44 #[cfg(feature = "CKServerChangeToken")]
45 #[unsafe(method(initWithPreviousServerChangeToken:))]
46 #[unsafe(method_family = init)]
47 pub unsafe fn initWithPreviousServerChangeToken(
48 this: Allocated<Self>,
49 previous_server_change_token: Option<&CKServerChangeToken>,
50 ) -> Retained<Self>;
51
52 #[cfg(feature = "CKServerChangeToken")]
53 #[unsafe(method(previousServerChangeToken))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn previousServerChangeToken(&self) -> Option<Retained<CKServerChangeToken>>;
56
57 #[cfg(feature = "CKServerChangeToken")]
58 /// Setter for [`previousServerChangeToken`][Self::previousServerChangeToken].
59 #[unsafe(method(setPreviousServerChangeToken:))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn setPreviousServerChangeToken(
62 &self,
63 previous_server_change_token: Option<&CKServerChangeToken>,
64 );
65
66 #[unsafe(method(resultsLimit))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn resultsLimit(&self) -> NSUInteger;
69
70 /// Setter for [`resultsLimit`][Self::resultsLimit].
71 #[unsafe(method(setResultsLimit:))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn setResultsLimit(&self, results_limit: NSUInteger);
74
75 /// When set to YES, this operation will send repeated requests to the server until all record zone changes have been fetched.
76 ///
77 /// `changeTokenUpdatedBlock`will be invoked periodically, to give clients an updated change token so that already-fetched record zone changes don't need to be re-fetched on a subsequent operation.
78 /// When set to NO, it is the responsibility of the caller to issue subsequent fetch-changes operations when moreComing is YES in a
79 /// `fetchDatabaseChangesCompletionBlock`invocation.
80 /// `fetchAllChanges`is
81 /// `YES`by default
82 /// Each
83 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations
84 /// Blocks assigned to this operation may share mutable state with other blocks assigned to this operation, but any such mutable state
85 /// should not be concurrently used outside of blocks assigned to this operation.
86 #[unsafe(method(fetchAllChanges))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn fetchAllChanges(&self) -> bool;
89
90 /// Setter for [`fetchAllChanges`][Self::fetchAllChanges].
91 #[unsafe(method(setFetchAllChanges:))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn setFetchAllChanges(&self, fetch_all_changes: bool);
94
95 #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
96 /// Each
97 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
98 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
99 /// should not be concurrently used outside of blocks assigned to this operation.
100 #[unsafe(method(recordZoneWithIDChangedBlock))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn recordZoneWithIDChangedBlock(
103 &self,
104 ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>;
105
106 #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
107 /// Setter for [`recordZoneWithIDChangedBlock`][Self::recordZoneWithIDChangedBlock].
108 #[unsafe(method(setRecordZoneWithIDChangedBlock:))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn setRecordZoneWithIDChangedBlock(
111 &self,
112 record_zone_with_id_changed_block: Option<
113 &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>,
114 >,
115 );
116
117 #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
118 /// Each
119 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
120 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
121 /// should not be concurrently used outside of blocks assigned to this operation.
122 #[unsafe(method(recordZoneWithIDWasDeletedBlock))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn recordZoneWithIDWasDeletedBlock(
125 &self,
126 ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>;
127
128 #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
129 /// Setter for [`recordZoneWithIDWasDeletedBlock`][Self::recordZoneWithIDWasDeletedBlock].
130 #[unsafe(method(setRecordZoneWithIDWasDeletedBlock:))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn setRecordZoneWithIDWasDeletedBlock(
133 &self,
134 record_zone_with_id_was_deleted_block: Option<
135 &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>,
136 >,
137 );
138
139 #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
140 /// If this block is set it will be called instead of
141 /// `recordZoneWithIDWasDeletedBlock`if the user deleted this zone via the iCloud storage UI.
142 ///
143 ///
144 /// This is an indication that the user wanted all data deleted, so local cached data should be wiped and not re-uploaded to the server.
145 /// Each
146 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations
147 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
148 /// should not be concurrently used outside of blocks assigned to this operation.
149 #[unsafe(method(recordZoneWithIDWasPurgedBlock))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn recordZoneWithIDWasPurgedBlock(
152 &self,
153 ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>;
154
155 #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
156 /// Setter for [`recordZoneWithIDWasPurgedBlock`][Self::recordZoneWithIDWasPurgedBlock].
157 #[unsafe(method(setRecordZoneWithIDWasPurgedBlock:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn setRecordZoneWithIDWasPurgedBlock(
160 &self,
161 record_zone_with_id_was_purged_block: Option<
162 &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>,
163 >,
164 );
165
166 #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
167 /// If this block is set it will be called instead of
168 /// `recordZoneWithIDWasDeletedBlock`if the user chose to reset all encrypted data for their account.
169 ///
170 ///
171 /// This is an indication that the user had to reset encrypted data during account recovery, so local cached data should be re-uploaded to the server to minimize data loss.
172 /// Each
173 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations
174 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
175 /// should not be concurrently used outside of blocks assigned to this operation.
176 #[unsafe(method(recordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn recordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock(
179 &self,
180 ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>;
181
182 #[cfg(all(feature = "CKRecordZoneID", feature = "block2"))]
183 /// Setter for [`recordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock`][Self::recordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock].
184 #[unsafe(method(setRecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock:))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn setRecordZoneWithIDWasDeletedDueToUserEncryptedDataResetBlock(
187 &self,
188 record_zone_with_id_was_deleted_due_to_user_encrypted_data_reset_block: Option<
189 &block2::DynBlock<dyn Fn(NonNull<CKRecordZoneID>)>,
190 >,
191 );
192
193 #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
194 /// Each
195 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations.
196 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
197 /// should not be concurrently used outside of blocks assigned to this operation.
198 #[unsafe(method(changeTokenUpdatedBlock))]
199 #[unsafe(method_family = none)]
200 pub unsafe fn changeTokenUpdatedBlock(
201 &self,
202 ) -> *mut block2::DynBlock<dyn Fn(NonNull<CKServerChangeToken>)>;
203
204 #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
205 /// Setter for [`changeTokenUpdatedBlock`][Self::changeTokenUpdatedBlock].
206 #[unsafe(method(setChangeTokenUpdatedBlock:))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn setChangeTokenUpdatedBlock(
209 &self,
210 change_token_updated_block: Option<
211 &block2::DynBlock<dyn Fn(NonNull<CKServerChangeToken>)>,
212 >,
213 );
214
215 #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
216 /// This block is called when the operation completes.
217 ///
218 ///
219 /// Clients are responsible for saving the change token at the end of the operation and passing it in to the next call to
220 /// `CKFetchDatabaseChangesOperation.`If the server returns a
221 /// `CKErrorChangeTokenExpired`error, the
222 /// `previousServerChangeToken`value was too old and the client should toss its local cache and re-fetch the changes in this record zone starting with a nil
223 /// `previousServerChangeToken.`If
224 /// `moreComing`is true then the server wasn't able to return all the changes in this response. Another
225 /// `CKFetchDatabaseChangesOperation`operation should be run with the
226 /// `previousServerChangeToken`token from this operation.
227 /// Each
228 /// `CKOperation`instance has a private serial queue. This queue is used for all callback block invocations
229 /// This block may share mutable state with other blocks assigned to this operation, but any such mutable state
230 /// should not be concurrently used outside of blocks assigned to this operation.
231 #[unsafe(method(fetchDatabaseChangesCompletionBlock))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn fetchDatabaseChangesCompletionBlock(
234 &self,
235 ) -> *mut block2::DynBlock<dyn Fn(*mut CKServerChangeToken, Bool, *mut NSError)>;
236
237 #[cfg(all(feature = "CKServerChangeToken", feature = "block2"))]
238 /// Setter for [`fetchDatabaseChangesCompletionBlock`][Self::fetchDatabaseChangesCompletionBlock].
239 #[unsafe(method(setFetchDatabaseChangesCompletionBlock:))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn setFetchDatabaseChangesCompletionBlock(
242 &self,
243 fetch_database_changes_completion_block: Option<
244 &block2::DynBlock<dyn Fn(*mut CKServerChangeToken, Bool, *mut NSError)>,
245 >,
246 );
247 );
248}
249
250/// Methods declared on superclass `NSObject`.
251#[cfg(all(feature = "CKDatabaseOperation", feature = "CKOperation"))]
252impl CKFetchDatabaseChangesOperation {
253 extern_methods!(
254 #[unsafe(method(new))]
255 #[unsafe(method_family = new)]
256 pub unsafe fn new() -> Retained<Self>;
257 );
258}