motion-firebase 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1008 @@
1
+ /*
2
+ * Firebase iOS Client Library
3
+ *
4
+ * Copyright © 2013 Firebase - All Rights Reserved
5
+ * https://www.firebase.com
6
+ *
7
+ * Redistribution and use in source and binary forms, with or without
8
+ * modification, are permitted provided that the following conditions are met:
9
+ *
10
+ * 1. Redistributions of source code must retain the above copyright notice, this
11
+ * list of conditions and the following disclaimer.
12
+ *
13
+ * 2. Redistributions in binaryform must reproduce the above copyright notice,
14
+ * this list of conditions and the following disclaimer in the documentation
15
+ * and/or other materials provided with the distribution.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY FIREBASE AS IS AND ANY EXPRESS OR
18
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
20
+ * EVENT SHALL FIREBASE BE LIABLE FOR ANY DIRECT,
21
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+
29
+
30
+ #import <Foundation/Foundation.h>
31
+ #import "FQuery.h"
32
+ #import "FDataSnapshot.h"
33
+ #import "FMutableData.h"
34
+ #import "FTransactionResult.h"
35
+ #import "FAuthData.h"
36
+ #import "FAuthType.h"
37
+
38
+ /**
39
+ * A Firebase reference represents a particular location in your Firebase
40
+ * and can be used for reading or writing data to that Firebase location.
41
+ *
42
+ * This class is the starting point for all Firebase operations. After you've
43
+ * initialized it with initWithUrl: you can use it
44
+ * to read data (ie. observeEventType:withBlock:), write data (ie. setValue:), and to create new
45
+ * Firebase references (ie. child:).
46
+ */
47
+ @interface Firebase : FQuery
48
+
49
+
50
+ /** @name Initializing a Firebase object */
51
+
52
+ /**
53
+ * Initialize this Firebase reference with an absolute URL.
54
+ *
55
+ * @param url The Firebase URL (ie: https://SampleChat.firebaseIO-demo.com)
56
+ */
57
+ - (id)initWithUrl:(NSString *)url;
58
+
59
+ /** @name Getting references to children locations */
60
+
61
+ /**
62
+ * Get a Firebase reference for the location at the specified relative path.
63
+ * The relative path can either be a simple child key (e.g. 'fred') or a
64
+ * deeper slash-separated path (e.g. 'fred/name/first').
65
+ *
66
+ * @param pathString A relative path from this location to the desired child location.
67
+ * @return A Firebase reference for the specified relative path.
68
+ */
69
+ - (Firebase *) childByAppendingPath:(NSString *)pathString;
70
+
71
+
72
+ /**
73
+ * childByAutoId generates a new child location using a unique key and returns a
74
+ * Firebase reference to it. This is useful when the children of a Firebase
75
+ * location represent a list of items.
76
+ *
77
+ * The unique key generated by childByAutoId: is prefixed with a client-generated
78
+ * timestamp so that the resulting list will be chronologically-sorted.
79
+ *
80
+ * @return A Firebase reference for the generated location.
81
+ */
82
+ - (Firebase *) childByAutoId;
83
+
84
+
85
+ /** @name Writing data */
86
+
87
+ /*! Write data to this Firebase location.
88
+
89
+ This will overwrite any data at this location and all child locations.
90
+
91
+ Data types that can be set are:
92
+
93
+ - NSString -- @"Hello World"
94
+ - NSNumber (also includes boolean) -- @YES, @43, @4.333
95
+ - NSDictionary -- @{@"key": @"value", @"nested": @{@"another": @"value"} }
96
+ - NSArray
97
+
98
+ The effect of the write will be visible immediately and the corresponding
99
+ events will be triggered. Synchronization of the data to the Firebase
100
+ servers will also be started.
101
+
102
+ Passing null for the new value is equivalent to calling remove:;
103
+ all data at this location or any child location will be deleted.
104
+
105
+ Note that setValue: will remove any priority stored at this location, so if priority
106
+ is meant to be preserved, you should use setValue:andPriority: instead.
107
+
108
+
109
+ **Server Values** - Placeholder values you may write into Firebase as a value or priority
110
+ that will automatically be populated by the Firebase Server.
111
+
112
+ - kFirebaseServerValueTimestamp - The number of milliseconds since the Unix epoch
113
+
114
+
115
+ @param value The value to be written.
116
+ */
117
+ - (void) setValue:(id)value;
118
+
119
+
120
+ #define kFirebaseServerValueTimestamp @{ @".sv": @"timestamp" }
121
+
122
+ /**
123
+ * The same as setValue: with a block that gets triggered after the write operation has
124
+ * been committed to the Firebase servers.
125
+ *
126
+ * @param value The value to be written.
127
+ * @param block The block to be called after the write has been committed to the Firebase servers.
128
+ */
129
+ - (void) setValue:(id)value withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block;
130
+
131
+
132
+ /**
133
+ * The same as setValue: with an additional priority to be attached to the data being written.
134
+ * Priorities are used to order items.
135
+ *
136
+ * @param value The value to be written.
137
+ * @param priority The priority to be attached to that data.
138
+ */
139
+ - (void) setValue:(id)value andPriority:(id)priority;
140
+
141
+
142
+ /**
143
+ * The same as setValue:andPriority: with a block that gets triggered after the write operation has
144
+ * been committed to the Firebase servers.
145
+ *
146
+ * @param value The value to be written.
147
+ * @param priority The priority to be attached to that data.
148
+ * @param block The block to be called after the write has been committed to the Firebase servers.
149
+ */
150
+ - (void) setValue:(id)value andPriority:(id)priority withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block;
151
+
152
+
153
+ /**
154
+ * Remove the data at this Firebase location. Any data at child locations will also be deleted.
155
+ *
156
+ * The effect of the delete will be visible immediately and the corresponding events
157
+ * will be triggered. Synchronization of the delete to the Firebase servers will
158
+ * also be started.
159
+ *
160
+ * remove: is equivalent to calling setValue:nil
161
+ */
162
+ - (void) removeValue;
163
+
164
+
165
+ /**
166
+ * The same as remove: with a block that gets triggered after the remove operation has
167
+ * been committed to the Firebase servers.
168
+ *
169
+ * @param block The block to be called after the remove has been committed to the Firebase servers.
170
+ */
171
+ - (void) removeValueWithCompletionBlock:(void (^)(NSError* error, Firebase* ref))block;
172
+
173
+ /**
174
+ * Set a priority for the data at this Firebase location.
175
+ * Priorities can be used to provide a custom ordering for the children at a location
176
+ * (if no priorities are specified, the children are ordered by key).
177
+ *
178
+ * You cannot set a priority on an empty location. For this reason
179
+ * setValue:andPriority: should be used when setting initial data with a specific priority
180
+ * and setPriority: should be used when updating the priority of existing data.
181
+ *
182
+ * Children are sorted based on this priority using the following rules:
183
+ *
184
+ * Children with no priority come first.
185
+ * Children with a number as their priority come next. They are sorted numerically by priority (small to large).
186
+ * Children with a string as their priority come last. They are sorted lexicographically by priority.
187
+ * Whenever two children have the same priority (including no priority), they are sorted by key. Numeric
188
+ * keys come first (sorted numerically), followed by the remaining keys (sorted lexicographically).
189
+ *
190
+ * Note that priorities are parsed and ordered as IEEE 754 double-precision floating-point numbers.
191
+ * Keys are always stored as strings and are treated as numbers only when they can be parsed as a
192
+ * 32-bit integer
193
+ *
194
+ * @param priority The priority to set at the specified location.
195
+ */
196
+ - (void) setPriority:(id)priority;
197
+
198
+
199
+ /**
200
+ * The same as setPriority: with a block block that is called once the priority has
201
+ * been committed to the Firebase servers.
202
+ *
203
+ * @param priority The priority to set at the specified location.
204
+ * @param block The block that is triggered after the priority has been written on the servers.
205
+ */
206
+ - (void) setPriority:(id)priority withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block;
207
+
208
+ /**
209
+ * Update changes the values of the keys specified in the dictionary without overwriting other
210
+ * keys at this location.
211
+ *
212
+ * @param values A dictionary of the keys to change and their new values
213
+ */
214
+ - (void) updateChildValues:(NSDictionary *)values;
215
+
216
+ /**
217
+ * The same as update: with a block block that is called once the update has been committed to the
218
+ * Firebase servers
219
+ *
220
+ * @param values A dictionary of the keys to change and their new values
221
+ * @param block The block that is triggered after the update has been written on the Firebase servers
222
+ */
223
+ - (void) updateChildValues:(NSDictionary *)values withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block;
224
+
225
+
226
+ /** @name Attaching observers to read data */
227
+
228
+ /*! observeEventType:withBlock: is used to listen for data changes at a particular location.
229
+
230
+ This is the primary way to read data from Firebase. Your block will be triggered
231
+ for the initial data and again whenever the data changes.
232
+
233
+ Use removeObserverWithHandle: to stop receiving updates.
234
+
235
+ Supported events types for all realtime observers are specified in FEventType as:
236
+
237
+ typedef NS_ENUM(NSInteger, FEventType) {
238
+ FEventTypeChildAdded, // 0, fired when a new child node is added to a location
239
+ FEventTypeChildRemoved, // 1, fired when a child node is removed from a location
240
+ FEventTypeChildChanged, // 2, fired when a child node at a location changes
241
+ FEventTypeChildMoved, // 3, fired when a child node moves relative to the other child nodes at a location
242
+ FEventTypeValue // 4, fired when any data changes at a location and, recursively, any children
243
+ };
244
+
245
+ @param eventType The type of event to listen for.
246
+ @param block The block that should be called with initial data and updates as a FDataSnapshot.
247
+ @return A handle used to unregister this block later using removeObserverWithHandle:
248
+ */
249
+ - (FirebaseHandle) observeEventType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block;
250
+
251
+
252
+ /**
253
+ * observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data changes at a particular location.
254
+ * This is the primary way to read data from Firebase. Your block will be triggered
255
+ * for the initial data and again whenever the data changes. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and
256
+ * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order.
257
+ *
258
+ * Use removeObserverWithHandle: to stop receiving updates.
259
+ *
260
+ * @param eventType The type of event to listen for.
261
+ * @param block The block that should be called with initial data and updates as a FDataSnapshot, as well as the
262
+ * previous child's key.
263
+ * @return A handle used to unregister this block later using removeObserverWithHandle:
264
+ */
265
+ - (FirebaseHandle) observeEventType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block;
266
+
267
+
268
+ /**
269
+ * observeEventType:withBlock: is used to listen for data changes at a particular location.
270
+ * This is the primary way to read data from Firebase. Your block will be triggered
271
+ * for the initial data and again whenever the data changes.
272
+ *
273
+ * The cancelBlock will be called if you will no longer receive new events due to no longer having permission.
274
+ *
275
+ * Use removeObserverWithHandle: to stop receiving updates.
276
+ *
277
+ * @param eventType The type of event to listen for.
278
+ * @param block The block that should be called with initial data and updates as a FDataSnapshot.
279
+ * @param cancelBlock The block that should be called if this client no longer has permission to receive these events
280
+ * @return A handle used to unregister this block later using removeObserverWithHandle:
281
+ */
282
+ - (FirebaseHandle) observeEventType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block withCancelBlock:(void (^)(NSError* error))cancelBlock;
283
+
284
+
285
+ /**
286
+ * observeEventType:andPreviousSiblingKeyWithBlock: is used to listen for data changes at a particular location.
287
+ * This is the primary way to read data from Firebase. Your block will be triggered
288
+ * for the initial data and again whenever the data changes. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and
289
+ * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order.
290
+ *
291
+ * The cancelBlock will be called if you will no longer receive new events due to no longer having permission.
292
+ *
293
+ * Use removeObserverWithHandle: to stop receiving updates.
294
+ *
295
+ * @param eventType The type of event to listen for.
296
+ * @param block The block that should be called with initial data and updates as a FDataSnapshot, as well as the previous child's key.
297
+ * @param cancelBlock The block that should be called if this client no longer has permission to receive these events
298
+ * @return A handle used to unregister this block later using removeObserverWithHandle:
299
+ */
300
+ - (FirebaseHandle) observeEventType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block withCancelBlock:(void (^)(NSError* error))cancelBlock;
301
+
302
+
303
+ /**
304
+ * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned.
305
+ *
306
+ * @param eventType The type of event to listen for.
307
+ * @param block The block that should be called with initial data and updates as a FDataSnapshot.
308
+ */
309
+ - (void) observeSingleEventOfType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block;
310
+
311
+
312
+ /**
313
+ * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and
314
+ * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order.
315
+ *
316
+ * @param eventType The type of event to listen for.
317
+ * @param block The block that should be called with initial data and updates as a FDataSnapshot, as well as the previous child's key.
318
+ */
319
+ - (void) observeSingleEventOfType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block;
320
+
321
+
322
+ /**
323
+ * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned.
324
+ *
325
+ * The cancelBlock will be called if you do not have permission to read data at this location.
326
+ *
327
+ * @param eventType The type of event to listen for.
328
+ * @param block The block that should be called with initial data and updates as a FDataSnapshot.
329
+ * @param cancelBlock The block that will be called if you don't have permission to access this data
330
+ */
331
+ - (void) observeSingleEventOfType:(FEventType)eventType withBlock:(void (^)(FDataSnapshot* snapshot))block withCancelBlock:(void (^)(NSError* error))cancelBlock;
332
+
333
+
334
+ /**
335
+ * This is equivalent to observeEventType:withBlock:, except the block is immediately canceled after the initial data is returned. In addition, for FEventTypeChildAdded, FEventTypeChildMoved, and
336
+ * FEventTypeChildChanged events, your block will be passed the key of the previous node by priority order.
337
+ *
338
+ * The cancelBlock will be called if you do not have permission to read data at this location.
339
+ *
340
+ * @param eventType The type of event to listen for.
341
+ * @param block The block that should be called with initial data and updates as a FDataSnapshot, as well as the previous child's key.
342
+ * @param cancelBlock The block that will be called if you don't have permission to access this data
343
+ */
344
+ - (void) observeSingleEventOfType:(FEventType)eventType andPreviousSiblingKeyWithBlock:(void (^)(FDataSnapshot* snapshot, NSString* prevKey))block withCancelBlock:(void (^)(NSError* error))cancelBlock;
345
+
346
+ /** @name Detaching observers */
347
+
348
+ /**
349
+ * Detach a block previously attached with observeEventType:withBlock:.
350
+ *
351
+ * @param handle The handle returned by the call to observeEventType:withBlock: which we are trying to remove.
352
+ */
353
+ - (void) removeObserverWithHandle:(FirebaseHandle)handle;
354
+
355
+
356
+ /**
357
+ * Detach all blocks previously attached to this Firebase location with observeEventType:withBlock:
358
+ */
359
+ - (void) removeAllObservers;
360
+
361
+ /** @name Querying and limiting */
362
+
363
+
364
+ /**
365
+ * This method is deprecated in favor of using queryStartingAtValue:. This can be used with queryOrderedByPriority
366
+ * to query by priority.
367
+ *
368
+ * queryStartingAtPriority: is used to generate a reference to a limited view of the data at this location.
369
+ * The FQuery instance returned by queryStartingAtPriority: will respond to events at nodes with a priority
370
+ * greater than or equal to startPriority
371
+ *
372
+ * @param startPriority The lower bound, inclusive, for the priority of data visible to the returned FQuery
373
+ * @return An FQuery instance, limited to data with priority greater than or equal to startPriority
374
+ */
375
+ - (FQuery *) queryStartingAtPriority:(id)startPriority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryStartingAtValue:] instead")));
376
+
377
+
378
+ /**
379
+ * This method is deprecated in favor of using queryStartingAtValue:childKey:. This can be used with queryOrderedByPriority
380
+ * to query by priority.
381
+ *
382
+ * queryStartingAtPriority:andChildName: is used to generate a reference to a limited view of the data at this location.
383
+ * The FQuery instance returned by queryStartingAtPriority:andChildName will respond to events at nodes with a priority
384
+ * greater than startPriority, or equal to startPriority and with a name greater than or equal to childName
385
+ *
386
+ * @param startPriority The lower bound, inclusive, for the priority of data visible to the returned FQuery
387
+ * @param childName The lower bound, inclusive, for the name of nodes with priority equal to startPriority
388
+ * @return An FQuery instance, limited to data with priority greater than or equal to startPriority
389
+ */
390
+ - (FQuery *) queryStartingAtPriority:(id)startPriority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryStartingAtValue:childKey:] instead")));
391
+
392
+ /**
393
+ * This method is deprecated in favor of using queryEndingAtValue:. This can be used with queryOrderedByPriority
394
+ * to query by priority.
395
+ *
396
+ * queryEndingAtPriority: is used to generate a reference to a limited view of the data at this location.
397
+ * The FQuery instance returned by queryEndingAtPriority: will respond to events at nodes with a priority
398
+ * less than or equal to startPriority and with a name greater than or equal to childName
399
+ *
400
+ * @param endPriority The upper bound, inclusive, for the priority of data visible to the returned FQuery
401
+ * @return An FQuery instance, limited to data with priority less than or equal to endPriority
402
+ */
403
+ - (FQuery *) queryEndingAtPriority:(id)endPriority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEndingAtValue:] instead")));
404
+
405
+
406
+ /**
407
+ * This method is deprecated in favor of using queryEndingAtValue:childKey:. This can be used with queryOrderedByPriority
408
+ * to query by priority.
409
+ *
410
+ * queryEndingAtPriority:andChildName: is used to generate a reference to a limited view of the data at this location.
411
+ * The FQuery instance returned by queryEndingAtPriority:andChildName will respond to events at nodes with a priority
412
+ * less than endPriority, or equal to endPriority and with a name less than or equal to childName
413
+ *
414
+ * @param endPriority The upper bound, inclusive, for the priority of data visible to the returned FQuery
415
+ * @param childName The upper bound, inclusive, for the name of nodes with priority equal to endPriority
416
+ * @return An FQuery instance, limited to data with priority less than endPriority or equal to endPriority and with a name less than or equal to childName
417
+ */
418
+ - (FQuery *) queryEndingAtPriority:(id)endPriority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEndingAtValue:childKey:] instead")));
419
+
420
+
421
+ /**
422
+ * This method is deprecated in favor of using queryEqualToValue:. This can be used with queryOrderedByPriority
423
+ * to query by priority.
424
+ *
425
+ * queryEqualToPriority: is used to generate a reference to a limited view of the data at this location.
426
+ * The FQuery instance returned by queryEqualToPriority: will respond to events at nodes with a priority equal to
427
+ * supplied argument.
428
+ *
429
+ * @param priority The priority that the data returned by this FQuery will have
430
+ * @return An Fquery instance, limited to data with the supplied priority.
431
+ */
432
+ - (FQuery *) queryEqualToPriority:(id)priority __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEqualToValue:] instead")));
433
+
434
+
435
+ /**
436
+ * This method is deprecated in favor of using queryEqualAtValue:childKey:. This can be used with queryOrderedByPriority
437
+ * to query by priority.
438
+ *
439
+ * queryEqualToPriority:andChildName: is used to generate a reference to a limited view of the data at this location.
440
+ * The FQuery instance returned by queryEqualToPriority:andChildName will respond to events at nodes with a priority
441
+ * equal to the supplied argument with a name equal to childName. There will be at most one node that matches because
442
+ * child names are unique.
443
+ *
444
+ * @param priority The priority that the data returned by this FQuery will have
445
+ * @param childName The name of nodes with the right priority
446
+ * @return An FQuery instance, limited to data with the supplied priority and the name.
447
+ */
448
+ - (FQuery *) queryEqualToPriority:(id)priority andChildName:(NSString *)childName __attribute__((deprecated("Use [[FQuery queryOrderedByPriority] queryEqualToValue:childKey:] instead")));
449
+
450
+ /**
451
+ * This method is deprecated in favor of using queryLimitedToFirst:limit or queryLimitedToLast:limit instead.
452
+ *
453
+ * queryLimitedToNumberOfChildren: is used to generate a reference to a limited view of the data at this location.
454
+ * The FQuery instance returned by queryLimitedToNumberOfChildren: will respond to events from at most limit child nodes.
455
+ *
456
+ * @param limit The upper bound, inclusive, for the number of child nodes to receive events for
457
+ * @return An FQuery instance, limited to at most limit child nodes.
458
+ */
459
+ - (FQuery *) queryLimitedToNumberOfChildren:(NSUInteger)limit __attribute__((deprecated("Use [FQuery queryLimitedToFirst:limit] or [FQuery queryLimitedToLast:limit] instead")));
460
+
461
+
462
+ /**
463
+ * queryLimitedToFirst: is used to generate a reference to a limited view of the data at this location.
464
+ * The FQuery instance returned by queryLimitedToFirst: will respond to at most the first limit child nodes.
465
+ *
466
+ * @param limit The upper bound, inclusive, for the number of child nodes to receive events for
467
+ * @return An FQuery instance, limited to at most limit child nodes.
468
+ */
469
+ - (FQuery *) queryLimitedToFirst:(NSUInteger)limit;
470
+
471
+
472
+ /**
473
+ * queryLimitedToLast: is used to generate a reference to a limited view of the data at this location.
474
+ * The FQuery instance returned by queryLimitedToLast: will respond to at most the last limit child nodes.
475
+ *
476
+ * @param limit The upper bound, inclusive, for the number of child nodes to receive events for
477
+ * @return An FQuery instance, limited to at most limit child nodes.
478
+ */
479
+ - (FQuery *) queryLimitedToLast:(NSUInteger)limit;
480
+
481
+ /**
482
+ * queryOrderBy: is used to generate a reference to a view of the data that's been sorted by the values of
483
+ * a particular child key. This method is intended to be used in combination with queryStartingAtValue:,
484
+ * queryEndingAtValue:, or queryEqualToValue:.
485
+ *
486
+ * @param key The child key to use in ordering data visible to the returned FQuery
487
+ * @return An FQuery instance, ordered by the values of the specified child key.
488
+ */
489
+ - (FQuery *) queryOrderedByChild:(NSString *)key;
490
+
491
+ /**
492
+ * queryOrderedByKey: is used to generate a reference to a view of the data that's been sorted by child key.
493
+ * This method is intended to be used in combination with queryStartingAtValue:, queryEndingAtValue:,
494
+ * or queryEqualToValue:.
495
+ *
496
+ * @return An FQuery instance, ordered by child keys.
497
+ */
498
+ - (FQuery *) queryOrderedByKey;
499
+
500
+ /**
501
+ * queryOrderedByPriority: is used to generate a reference to a view of the data that's been sorted by child
502
+ * priority. This method is intended to be used in combination with queryStartingAtValue:, queryEndingAtValue:,
503
+ * or queryEqualToValue:.
504
+ *
505
+ * @return An FQuery instance, ordered by child priorities.
506
+ */
507
+ - (FQuery *) queryOrderedByPriority;
508
+
509
+ /**
510
+ * queryStartingAtValue: is used to generate a reference to a limited view of the data at this location.
511
+ * The FQuery instance returned by queryStartingAtValue: will respond to events at nodes with a value
512
+ * greater than or equal to startValue.
513
+ *
514
+ * @param startValue The lower bound, inclusive, for the value of data visible to the returned FQuery
515
+ * @return An FQuery instance, limited to data with value greater than or equal to startValue
516
+ */
517
+ - (FQuery *) queryStartingAtValue:(id)startValue;
518
+
519
+ /**
520
+ * queryStartingAtValue:childKey: is used to generate a reference to a limited view of the data at this location.
521
+ * The FQuery instance returned by queryStartingAtValue:childKey will respond to events at nodes with a value
522
+ * greater than startValue, or equal to startValue and with a key greater than or equal to childKey.
523
+ *
524
+ * @param startValue The lower bound, inclusive, for the value of data visible to the returned FQuery
525
+ * @param childKey The lower bound, inclusive, for the key of nodes with value equal to startValue
526
+ * @return An FQuery instance, limited to data with value greater than or equal to startValue
527
+ */
528
+ - (FQuery *) queryStartingAtValue:(id)startValue childKey:(NSString *)childKey;
529
+
530
+ /**
531
+ * queryEndingAtValue: is used to generate a reference to a limited view of the data at this location.
532
+ * The FQuery instance returned by queryEndingAtValue: will respond to events at nodes with a value
533
+ * less than or equal to endValue.
534
+ *
535
+ * @param endValue The upper bound, inclusive, for the value of data visible to the returned FQuery
536
+ * @return An FQuery instance, limited to data with value less than or equal to endValue
537
+ */
538
+ - (FQuery *) queryEndingAtValue:(id)endValue;
539
+
540
+ /**
541
+ * queryEndingAtValue:childKey: is used to generate a reference to a limited view of the data at this location.
542
+ * The FQuery instance returned by queryEndingAtValue:childKey will respond to events at nodes with a value
543
+ * less than endValue, or equal to endValue and with a key less than or equal to childKey.
544
+ *
545
+ * @param endValue The upper bound, inclusive, for the value of data visible to the returned FQuery
546
+ * @param childKey The upper bound, inclusive, for the key of nodes with value equal to endValue
547
+ * @return An FQuery instance, limited to data with value less than or equal to endValue
548
+ */
549
+ - (FQuery *) queryEndingAtValue:(id)endValue childKey:(NSString *)childKey;
550
+
551
+ /**
552
+ * queryEqualToValue: is used to generate a reference to a limited view of the data at this location.
553
+ * The FQuery instance returned by queryEqualToValue: will respond to events at nodes with a value equal
554
+ * to the supplied argument.
555
+ *
556
+ * @param value The value that the data returned by this FQuery will have
557
+ * @return An Fquery instance, limited to data with the supplied value.
558
+ */
559
+ - (FQuery *) queryEqualToValue:(id)value;
560
+
561
+ /**
562
+ * queryEqualToValue:childKey: is used to generate a reference to a limited view of the data at this location.
563
+ * The FQuery instance returned by queryEqualToValue:childKey will respond to events at nodes with a value
564
+ * equal to the supplied argument with a name equal to childKey. There will be at most one node that matches because
565
+ * child keys are unique.
566
+ *
567
+ * @param value The value that the data returned by this FQuery will have
568
+ * @param childKey The name of nodes with the right value
569
+ * @return An FQuery instance, limited to data with the supplied value and the key.
570
+ */
571
+ - (FQuery *) queryEqualToValue:(id)value childKey:(NSString *)childKey;
572
+
573
+ /** @name Managing presence */
574
+
575
+ /**
576
+ * Ensure the data at this location is set to the specified value when
577
+ * the client is disconnected (due to closing the browser, navigating
578
+ * to a new page, or network issues).
579
+ *
580
+ * onDisconnectSetValue: is especially useful for implementing "presence" systems,
581
+ * where a value should be changed or cleared when a user disconnects
582
+ * so that he appears "offline" to other users.
583
+ *
584
+ * @param value The value to be set after the connection is lost.
585
+ */
586
+ - (void) onDisconnectSetValue:(id)value;
587
+
588
+
589
+ /**
590
+ * Ensure the data at this location is set to the specified value when
591
+ * the client is disconnected (due to closing the browser, navigating
592
+ * to a new page, or network issues).
593
+ *
594
+ * The completion block will be triggered when the operation has been successfully queued up on the Firebase servers
595
+ *
596
+ * @param value The value to be set after the connection is lost.
597
+ * @param block Block to be triggered when the operation has been queued up on the Firebase servers
598
+ */
599
+ - (void) onDisconnectSetValue:(id)value withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block;
600
+
601
+
602
+ /**
603
+ * Ensure the data at this location is set to the specified value and priority when
604
+ * the client is disconnected (due to closing the browser, navigating
605
+ * to a new page, or network issues).
606
+ *
607
+ * @param value The value to be set after the connection is lost.
608
+ * @param priority The priority to be set after the connection is lost.
609
+ */
610
+ - (void) onDisconnectSetValue:(id)value andPriority:(id)priority;
611
+
612
+
613
+ /**
614
+ * Ensure the data at this location is set to the specified value and priority when
615
+ * the client is disconnected (due to closing the browser, navigating
616
+ * to a new page, or network issues).
617
+ *
618
+ * The completion block will be triggered when the operation has been successfully queued up on the Firebase servers
619
+ *
620
+ * @param value The value to be set after the connection is lost.
621
+ * @param priority The priority to be set after the connection is lost.
622
+ * @param block Block to be triggered when the operation has been queued up on the Firebase servers
623
+ */
624
+ - (void) onDisconnectSetValue:(id)value andPriority:(id)priority withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block;
625
+
626
+
627
+ /**
628
+ * Ensure the data at this location is removed when
629
+ * the client is disconnected (due to closing the app, navigating
630
+ * to a new page, or network issues).
631
+ *
632
+ * onDisconnectRemoveValue is especially useful for implementing "presence" systems.
633
+ */
634
+ - (void) onDisconnectRemoveValue;
635
+
636
+
637
+ /**
638
+ * Ensure the data at this location is removed when
639
+ * the client is disconnected (due to closing the app, navigating
640
+ * to a new page, or network issues).
641
+ *
642
+ * onDisconnectRemoveValueWithCompletionBlock: is especially useful for implementing "presence" systems.
643
+ *
644
+ * @param block Block to be triggered when the operation has been queued up on the Firebase servers
645
+ */
646
+ - (void) onDisconnectRemoveValueWithCompletionBlock:(void (^)(NSError* error, Firebase* ref))block;
647
+
648
+
649
+
650
+ /**
651
+ * Ensure the data has the specified child values updated when
652
+ * the client is disconnected (due to closing the browser, navigating
653
+ * to a new page, or network issues).
654
+ *
655
+ *
656
+ * @param values A dictionary of child node keys and the values to set them to after the connection is lost.
657
+ */
658
+ - (void) onDisconnectUpdateChildValues:(NSDictionary *)values;
659
+
660
+
661
+ /**
662
+ * Ensure the data has the specified child values updated when
663
+ * the client is disconnected (due to closing the browser, navigating
664
+ * to a new page, or network issues).
665
+ *
666
+ *
667
+ * @param values A dictionary of child node keys and the values to set them to after the connection is lost.
668
+ * @param block A block that will be called once the operation has been queued up on the Firebase servers
669
+ */
670
+ - (void) onDisconnectUpdateChildValues:(NSDictionary *)values withCompletionBlock:(void (^)(NSError* error, Firebase* ref))block;
671
+
672
+
673
+ /**
674
+ * Cancel any operations that are set to run on disconnect. If you previously called onDisconnectSetValue:,
675
+ * onDisconnectRemoveValue:, or onDisconnectUpdateChildValues:, and no longer want the values updated when the
676
+ * connection is lost, call cancelDisconnectOperations:
677
+ */
678
+ - (void) cancelDisconnectOperations;
679
+
680
+
681
+ /**
682
+ * Cancel any operations that are set to run on disconnect. If you previously called onDisconnectSetValue:,
683
+ * onDisconnectRemoveValue:, or onDisconnectUpdateChildValues:, and no longer want the values updated when the
684
+ * connection is lost, call cancelDisconnectOperations:
685
+ *
686
+ * @param block A block that will be triggered once the Firebase servers have acknowledged the cancel request.
687
+ */
688
+ - (void) cancelDisconnectOperationsWithCompletionBlock:(void (^)(NSError* error, Firebase* ref))block;
689
+
690
+
691
+ /** @name Reading and observing authentication data */
692
+
693
+ /**
694
+ * Get the authentication data of the current user.
695
+ *
696
+ * @return Authentication data of the current user.
697
+ */
698
+ @property (nonatomic, strong, readonly) FAuthData *authData;
699
+
700
+
701
+ /**
702
+ * Observer block will be triggered whenever a user gets authenticated or logged out.
703
+ *
704
+ * Authentication data is persisted across app restarts. If your have an old authentication, Firebase will attempt to
705
+ * resume your old session. This approach does not wait for a server roundtrip. Rather, it inspects the
706
+ * contents of the persisted JWT and assumes that the Firebase secret used to generate the token has not been revoked.
707
+ *
708
+ * In the event that the Firebase secret used to generate the token has been revoked, observers will likely see one
709
+ * flicker / rapid flip-flop of authentication state once the server rejects the token.
710
+ *
711
+ * Use removeAuthEventObserverWithHandle: to stop receiving updates.
712
+ *
713
+ * @param block The block that should be called with initial authentication data and future updates
714
+ * @return A handle used to unregister this block later with removeAuthEventObserverWithHandle:
715
+ */
716
+ - (FirebaseHandle) observeAuthEventWithBlock:(void (^)(FAuthData *authData))block;
717
+
718
+
719
+ /**
720
+ * Detach a block previously attached with observeAuthEventWithBlock:.
721
+ *
722
+ * @param handle The handle returned by the call to observeAuthEventWithBlock: which we are trying to remove.
723
+ */
724
+ - (void) removeAuthEventObserverWithHandle:(FirebaseHandle)handle;
725
+
726
+ /** @name User creation and modification */
727
+
728
+ /**
729
+ * Used to create a new user account with the given email and password combo. The results will be passed to the given block.
730
+ * Note that this method will not log the new user in.
731
+ *
732
+ * @param email The email for the account to be created
733
+ * @param password The password for the account to be created
734
+ * @param block The block to be called with the results of the operation
735
+ */- (void) createUser:(NSString *)email password:(NSString *)password withCompletionBlock:(void (^)(NSError *error))block;
736
+
737
+
738
+ /**
739
+ * Remove a user account with the given email and password.
740
+ *
741
+ * @param email The email of the account to be removed
742
+ * @param password The password for the account to be removed
743
+ * @param block A block to receive the results of the operation
744
+ */
745
+ - (void) removeUser:(NSString *)email password:(NSString *)password withCompletionBlock:(void (^)(NSError *error))block;
746
+
747
+
748
+ /**
749
+ * Attempts to change the password for the account with the given credentials to the new password given. Results are reported to the supplied block.
750
+ *
751
+ * @param email The email for the account to be changed
752
+ * @param oldPassword The old password for the account to be changed
753
+ * @param newPassword The desired newPassword for the account
754
+ * @param block A block to receive the results of the operation
755
+ */
756
+ - (void) changePasswordForUser:(NSString *)email fromOld:(NSString *)oldPassword toNew:(NSString *)newPassword withCompletionBlock:(void (^)(NSError *error))block;
757
+
758
+
759
+ /**
760
+ * Send a password reset email to the owner of the account with the given email. Results are reported to the supplied block.
761
+ *
762
+ * @param email The email of the account to be removed
763
+ * @param block A block to receive the results of the operation
764
+ */
765
+ - (void) resetPasswordForUser:(NSString *)email withCompletionBlock:(void (^)(NSError* error))block;
766
+
767
+ /** @name Authenticating */
768
+
769
+ /**
770
+ * Attempts to log the user in anonymously. The block will receive the results of the attempt.
771
+ *
772
+ * @param block A block to receive the results of the authentication attempt.
773
+ */
774
+ - (void) authAnonymouslyWithCompletionBlock:(void (^)(NSError *error, FAuthData *authData))block;
775
+
776
+ /**
777
+ * Attempts to authenticate to Firebase with the given credentials. The block will receive the results of the attempt.
778
+ *
779
+ * @param email The email of the account
780
+ * @param password The password for the account
781
+ * @param block A block to receive the results of the authentication attempt
782
+ */
783
+ - (void) authUser:(NSString *)email password:(NSString *)password withCompletionBlock:(void (^)(NSError *error, FAuthData *authData))block;
784
+
785
+ /**
786
+ * Authenticate access to this Firebase using the provided credentials.
787
+ *
788
+ * The completion block will be called with the results of the authenticated attempt. Unlike
789
+ * authWithCredential:withCompletionBlock:withCancelBlock:, no block will be called when the credentials become invalid.
790
+ *
791
+ * Instead, please use observeAuthEventWithBlock: to observe if a user gets logged out.
792
+ *
793
+ * @param token The Firebase authentication JWT generated by a secure code on a remote server.
794
+ * @param block This block will be called with the results of the authentication attempt
795
+ */
796
+ - (void) authWithCustomToken:(NSString *)token withCompletionBlock:(void (^)(NSError *error, FAuthData *authData))block;
797
+
798
+ /**
799
+ * Authenticate to Firebase with an OAuth token from a provider.
800
+ *
801
+ * This method works with current OAuth 2.0 providers such as Facebook, Google+, and Github.
802
+ *
803
+ * For other providers that Firebase supports which require additional parameters for login, such as Twitter, please use authWithOAuthProvider:parameters:withCompletionBlock:.
804
+ *
805
+ * @param provider The provider, all lower case with no spaces.
806
+ * @param oauthToken The OAuth Token to authenticate with the provider
807
+ * @param block A block to receive the results of the authentication attempt
808
+ */
809
+ - (void) authWithOAuthProvider:(NSString *)provider token:(NSString *)oauthToken withCompletionBlock:(void (^) (NSError *error, FAuthData *authData))block;
810
+
811
+ /**
812
+ * Authenticate to Firebase with an OAuth token from a provider.
813
+ *
814
+ * This method is for OAuth providers that require extra parameters when authentication with the server, such as Twitter.
815
+ * The OAuth token should be included as a parameter.
816
+ *
817
+ * @param provider The provider, all lowercase with no spaces.
818
+ * @param parameters The parameters necessary to authenticate with the provider
819
+ * @param block A block to receive the results of the authentication attempt
820
+ */
821
+ - (void) authWithOAuthProvider:(NSString *)provider parameters:(NSDictionary *)parameters withCompletionBlock:(void (^) (NSError *error, FAuthData *authData))block;
822
+
823
+ /**
824
+ * Make a reverse OAuth Request to a provider.
825
+ *
826
+ * This method is for OAuth providers that require a reverse request be made first. The json output of this block
827
+ *
828
+ * @param provider The provider, all lowercase with no spaces.
829
+ * @param block The block to receive the results of the reverse OAuth request.
830
+ */
831
+ - (void) makeReverseOAuthRequestTo:(NSString *)provider withCompletionBlock:(void (^)(NSError *error, NSDictionary *json))block;
832
+
833
+ /**
834
+ * Removes any credentials associated with this Firebase.
835
+ */
836
+ - (void) unauth;
837
+
838
+ /**
839
+ * This method is deprecated. Use authWithCustomToken:withCompletionBlock: instead.
840
+ *
841
+ * Authenticate access to this Firebase using the provided credentials. The completion block will be called with
842
+ * the results of the authenticated attempt, and the cancelBlock will be called if the credentials become invalid
843
+ * at some point after authentication has succeeded.
844
+ *
845
+ * @param credential The Firebase authentication JWT generated by a secure code on a remote server.
846
+ * @param block This block will be called with the results of the authentication attempt
847
+ * @param cancelBlock This block will be called if at any time in the future the credentials become invalid
848
+ */
849
+ - (void) authWithCredential:(NSString *)credential withCompletionBlock:(void (^) (NSError* error, id data))block withCancelBlock:(void (^)(NSError* error))cancelBlock __attribute__((deprecated("Use authWithCustomToken:withCompletionblock: instead")));
850
+
851
+ /**
852
+ * This method is deprecated. Use unauth: instead.
853
+ *
854
+ * Removes any credentials associated with this Firebase. The callback block will be triggered after this operation
855
+ * has been acknowledged by the Firebase servers.
856
+ *
857
+ * @param block This block will be called once the unauth has completed.
858
+ */
859
+ - (void) unauthWithCompletionBlock:(void (^)(NSError* error))block __attribute__((deprecated("Use unauth: instead")));
860
+
861
+
862
+ /** @name Manual Connection Management */
863
+
864
+ /**
865
+ * Manually disconnect the Firebase client from the server and disable automatic reconnection.
866
+ *
867
+ * The Firebase client automatically maintains a persistent connection to the Firebase server,
868
+ * which will remain active indefinitely and reconnect when disconnected. However, the goOffline( )
869
+ * and goOnline( ) methods may be used to manually control the client connection in cases where
870
+ * a persistent connection is undesirable.
871
+ *
872
+ * While offline, the Firebase client will no longer receive data updates from the server. However,
873
+ * all Firebase operations performed locally will continue to immediately fire events, allowing
874
+ * your application to continue behaving normally. Additionally, each operation performed locally
875
+ * will automatically be queued and retried upon reconnection to the Firebase server.
876
+ *
877
+ * To reconnect to the Firebase server and begin receiving remote events, see goOnline( ).
878
+ * Once the connection is reestablished, the Firebase client will transmit the appropriate data
879
+ * and fire the appropriate events so that your client "catches up" automatically.
880
+ *
881
+ * Note: Invoking this method will impact all Firebase connections.
882
+ */
883
+ + (void) goOffline;
884
+
885
+ /**
886
+ * Manually reestablish a connection to the Firebase server and enable automatic reconnection.
887
+ *
888
+ * The Firebase client automatically maintains a persistent connection to the Firebase server,
889
+ * which will remain active indefinitely and reconnect when disconnected. However, the goOffline( )
890
+ * and goOnline( ) methods may be used to manually control the client connection in cases where
891
+ * a persistent connection is undesirable.
892
+ *
893
+ * This method should be used after invoking goOffline( ) to disable the active connection.
894
+ * Once reconnected, the Firebase client will automatically transmit the proper data and fire
895
+ * the appropriate events so that your client "catches up" automatically.
896
+ *
897
+ * To disconnect from the Firebase server, see goOffline( ).
898
+ *
899
+ * Note: Invoking this method will impact all Firebase connections.
900
+ */
901
+ + (void) goOnline;
902
+
903
+
904
+ /** @name Transactions */
905
+
906
+ /**
907
+ * Performs an optimistic-concurrency transactional update to the data at this location. Your block will be called with an FMutableData
908
+ * instance that contains the current data at this location. Your block should update this data to the value you
909
+ * wish to write to this location, and then return an instance of FTransactionResult with the new data.
910
+ *
911
+ * If, when the operation reaches the server, it turns out that this client had stale data, your block will be run
912
+ * again with the latest data from the server.
913
+ *
914
+ * When your block is run, you may decide to abort the transaction by return [FTransactionResult abort].
915
+ *
916
+ * @param block This block receives the current data at this location and must return an instance of FTransactionResult
917
+ */
918
+ - (void) runTransactionBlock:(FTransactionResult* (^) (FMutableData* currentData))block;
919
+
920
+
921
+ /**
922
+ * Performs an optimistic-concurrency transactional update to the data at this location. Your block will be called with an FMutableData
923
+ * instance that contains the current data at this location. Your block should update this data to the value you
924
+ * wish to write to this location, and then return an instance of FTransactionResult with the new data.
925
+ *
926
+ * If, when the operation reaches the server, it turns out that this client had stale data, your block will be run
927
+ * again with the latest data from the server.
928
+ *
929
+ * When your block is run, you may decide to abort the transaction by return [FTransactionResult abort].
930
+ *
931
+ * @param block This block receives the current data at this location and must return an instance of FTransactionResult
932
+ * @param completionBlock This block will be triggered once the transaction is complete, whether it was successful or not. It will indicate if there was an error, whether or not the data was committed, and what the current value of the data at this location is.
933
+ */
934
+ - (void) runTransactionBlock:(FTransactionResult* (^) (FMutableData* currentData))block andCompletionBlock:(void (^) (NSError* error, BOOL committed, FDataSnapshot* snapshot))completionBlock;
935
+
936
+
937
+
938
+ /**
939
+ * Performs an optimistic-concurrency transactional update to the data at this location. Your block will be called with an FMutableData
940
+ * instance that contains the current data at this location. Your block should update this data to the value you
941
+ * wish to write to this location, and then return an instance of FTransactionResult with the new data.
942
+ *
943
+ * If, when the operation reaches the server, it turns out that this client had stale data, your block will be run
944
+ * again with the latest data from the server.
945
+ *
946
+ * When your block is run, you may decide to abort the transaction by return [FTransactionResult abort].
947
+ *
948
+ * Since your block may be run multiple times, this client could see several immediate states that don't exist on the server. You can suppress those immediate states until the server confirms the final state of the transaction.
949
+ *
950
+ * @param block This block receives the current data at this location and must return an instance of FTransactionResult
951
+ * @param completionBlock This block will be triggered once the transaction is complete, whether it was successful or not. It will indicate if there was an error, whether or not the data was committed, and what the current value of the data at this location is.
952
+ * @param localEvents Set this to NO to suppress events raised for intermediate states, and only get events based on the final state of the transaction.
953
+ */
954
+ - (void) runTransactionBlock:(FTransactionResult* (^) (FMutableData* currentData))block andCompletionBlock:(void (^) (NSError* error, BOOL committed, FDataSnapshot* snapshot))completionBlock withLocalEvents:(BOOL)localEvents;
955
+
956
+
957
+ /** @name Retrieving String Representation */
958
+
959
+ /**
960
+ * Gets the absolute URL of this Firebase location.
961
+ *
962
+ * @return The absolute URL of the referenced Firebase location.
963
+ */
964
+ - (NSString *) description;
965
+
966
+ /** @name Properties */
967
+
968
+ /**
969
+ * Get a Firebase reference for the parent location.
970
+ * If this instance refers to the root of your Firebase, it has no parent,
971
+ * and therefore parent( ) will return null.
972
+ *
973
+ * @return A Firebase reference for the parent location.
974
+ */
975
+ @property (strong, readonly, nonatomic) Firebase* parent;
976
+
977
+
978
+ /**
979
+ * Get a Firebase reference for the root location
980
+ *
981
+ * @return A new Firebase reference to root location.
982
+ */
983
+ @property (strong, readonly, nonatomic) Firebase* root;
984
+
985
+
986
+ /**
987
+ * Gets last token in a Firebase location (e.g. 'fred' in https://SampleChat.firebaseIO-demo.com/users/fred)
988
+ *
989
+ * @return The key of the location this reference points to.
990
+ */
991
+ @property (strong, readonly, nonatomic) NSString* key;
992
+
993
+
994
+ /** @name Global configuration and settings */
995
+
996
+ /** Set the default dispatch queue for event blocks.
997
+ *
998
+ * @param queue The queue to set as the default for running blocks for all Firebase event types.
999
+ */
1000
+ + (void) setDispatchQueue:(dispatch_queue_t)queue;
1001
+
1002
+ /** Retrieve the Firebase SDK version. */
1003
+ + (NSString *) sdkVersion;
1004
+
1005
+ + (void) setLoggingEnabled:(BOOL)enabled;
1006
+
1007
+ + (void) setOption:(NSString*)option to:(id)value;
1008
+ @end