public
Description:
Homepage:
Clone URL: git://github.com/jessegrosjean/bdocuments.git
bdocuments / BCloudDocumentsService.h
100644 66 lines (52 sloc) 2.136 kb
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
//
// BSyncedDocumentService.h
// BDocuments
//
// Created by Jesse Grosjean on 2/28/09.
// Copyright 2009 Hog Bay Software. All rights reserved.
//
 
#import <Cocoa/Cocoa.h>
#import <Blocks/Blocks.h>
 
 
@class BCloudDocument;
@class FMDatabase;
 
@interface BCloudDocumentsService : NSObject {
NSString *service;
NSString *serviceLabel;
NSString *serviceRootURLString;
NSMutableArray *activeFetchers;
NSInteger totalActiveFetchers;
NSMutableString *failedPatches;
FMDatabase *shadowStorage;
}
 
+ (id)sharedInstance;
+ (BOOL)isDocumentURLManagedByDocumentsService:(NSURL *)aURL;
+ (NSString *)displayNameForDocumentsServiceDocument:(NSURL *)aURL;
 
@property(readonly) NSString *service;
@property(readonly) NSString *serviceLabel;
@property(readonly) NSString *serviceRootURLString;
 
- (IBAction)beginSync:(id)sender;
- (IBAction)cancelSync:(id)sender;
- (IBAction)newCloudDocument:(id)sender;
//- (IBAction)renameCloudDocument:(id)sender;
- (IBAction)deleteCloudDocument:(id)sender;
- (IBAction)browseCloudDocumentsOnline:(id)sender;
- (IBAction)browseCloudDocumentsOnlineAboutPage:(id)sender;
- (IBAction)toggleDocumentsServiceAuthentication:(id)sender;
 
#pragma mark Local Storage
 
- (BOOL)initDB;
- (NSArray *)localDocumentIDs;
- (void)scheduleForInsertOnClientWithName:(NSString *)name;
- (void)scheduledForDeleteOnClient:(BCloudDocument *)syncingDocument;
- (void)updateLocalDocumentState:(BCloudDocument *)syncingDocument originalDocumentID:(NSString *)originalDocumentID;
- (void)deleteLocalDocumentStateForDocumentID:(NSString *)documentID;
- (BCloudDocument *)cloudDocumentForID:(NSString *)documentID serverState:(NSDictionary *)serverState;
- (NSString *)onlineDocumentCacheFolder;
#pragma mark Server Requests
 
- (void)GETServerDocuments;
- (void)POSTServerDocument:(BCloudDocument *)syncingDocument;
- (void)GETServerDocument:(BCloudDocument *)syncingDocument;
- (void)POSTServerDocumentEdits:(BCloudDocument *)syncingDocument;
- (void)GETServerDocumentEdits:(BCloudDocument *)syncingDocument;
- (void)DELETEServerDocument:(BCloudDocument *)syncingDocument;
- (void)noteFailedPatches:(NSString *)patches;
 
 
@end