CSSocial
 All Classes Functions Properties Pages
/Users/marko/Documents/CSLib/CSSocial/CSTwitterPlugin.h
1 //
2 // CSTwitterPlugin.h
3 // CSSocial
4 //
5 // Created by Marko Hlebar on 11/26/12.
6 // Copyright (c) 2012 Clover Studio. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 
11 @class OAuth;
12 @class UIViewController;
13 @protocol CSTwitterPlugin <NSObject>
14 -(void) login:(CSVoidBlock)success error:(CSErrorBlock) error;
15 -(void) logout;
16 -(OAuth*) oAuth;
17 -(UIViewController*) presentingViewController;
18 -(BOOL) isAuthenticated;
19 -(void) authenticate;
20 -(id) showDialogWithMessage:(NSString*) message
21  photo:(UIImage*) photo
22  handler:(CSErrorBlock) handlerBlock;
23 @end
24 
25 @interface CSTwitterPlugin : NSObject <CSTwitterPlugin>
26 @property(nonatomic, copy) CSVoidBlock loginSuccessBlock;
27 @property(nonatomic, copy) CSErrorBlock loginFailedBlock;
28 @property(nonatomic, strong) OAuth *oAuth;
29 @property(nonatomic, readonly, strong) NSString *consumerKey;
30 @property(nonatomic, readonly, strong) NSString *consumerSecret;
31 
35 
36 -(void) saveOAuth:(OAuth*) oAuth;
37 -(void) loadOAuth:(OAuth*) oAuth;
38 -(void) resetOAuth;
39 
40 -(NSError*) errorWithLocalizedDescription:(NSString*) description errorCode:(NSInteger) errorCode;
41 -(NSError*) errorWithLocalizedDescription:(NSString*) description;
42 -(NSError*) errorInvalidReturnValue;
43 -(NSError*) errorAccountNotFound;
44 -(NSError*) errorUnsupportedSDK;
45 -(NSError*) errorTwitterLoginFailed;
46 -(NSError*) errorTwitterUserCancelled;
47 
48 @end