Yini  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
DBSession.h
Go to the documentation of this file.
1 //
2 // DBSession.h
3 // DropboxSDK
4 //
5 // Created by Brian Smith on 4/8/10.
6 // Copyright 2010 Dropbox, Inc. All rights reserved.
7 //
8 
10 
11 extern NSString *kDBSDKVersion;
12 
13 extern NSString *kDBDropboxAPIHost;
14 extern NSString *kDBDropboxAPIContentHost;
15 extern NSString *kDBDropboxWebHost;
16 extern NSString *kDBDropboxAPIVersion;
17 
18 extern NSString *kDBRootDropbox;
19 extern NSString *kDBRootAppFolder;
20 
21 extern NSString *kDBProtocolHTTPS;
22 
23 @protocol DBSessionDelegate;
24 
25 
26 /* Creating and setting the shared DBSession should be done before any other Dropbox objects are
27  used, perferrably in the UIApplication delegate. */
28 @interface DBSession : NSObject {
29  NSDictionary *baseCredentials;
30  NSMutableDictionary *credentialStores;
32  NSString *root;
33  id<DBSessionDelegate> delegate;
34 }
35 
36 + (DBSession*)sharedSession;
37 + (void)setSharedSession:(DBSession *)session;
38 
39 - (id)initWithAppKey:(NSString *)key appSecret:(NSString *)secret root:(NSString *)root;
40 - (BOOL)isLinked; // Session must be linked before creating any DBRestClient objects
41 
42 - (void)unlinkAll;
43 - (void)unlinkUserId:(NSString *)userId;
44 
45 - (MPOAuthCredentialConcreteStore *)credentialStoreForUserId:(NSString *)userId;
46 - (void)updateAccessToken:(NSString *)token accessTokenSecret:(NSString *)secret forUserId:(NSString *)userId;
47 
48 @property (nonatomic, readonly) NSString *root;
49 @property (nonatomic, readonly) NSArray *userIds;
50 @property (nonatomic, assign) id<DBSessionDelegate> delegate;
51 
52 @end
53 
54 
56 
57 - (void)sessionDidReceiveAuthorizationFailure:(DBSession *)session userId:(NSString *)userId;
58 
59 @end