-
Notifications
You must be signed in to change notification settings - Fork 0
/
OATokenManager.h
executable file
·68 lines (48 loc) · 1.92 KB
/
OATokenManager.h
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
67
68
//
// OATokenManager.h
// OAuthConsumer
//
// Created by Alberto García Hierro on 01/09/08.
// Copyright 2008 Alberto García Hierro. All rights reserved.
// bynotes.com
#import <Foundation/Foundation.h>
#import "OACall.h"
@class OATokenManager;
@protocol OATokenManagerDelegate
- (BOOL)tokenManager:(OATokenManager *)manager failedCall:(OACall *)call withError:(NSError *)error;
- (BOOL)tokenManager:(OATokenManager *)manager failedCall:(OACall *)call withProblem:(OAProblem *)problem;
@optional
- (BOOL)tokenManagerNeedsToken:(OATokenManager *)manager;
@end
@class OAConsumer;
@class OAToken;
@interface OATokenManager : NSObject<OACallDelegate> {
OAConsumer *consumer;
OAToken *acToken;
OAToken *reqToken;
OAToken *initialToken;
NSString *authorizedTokenKey;
NSString *oauthBase;
NSString *realm;
NSString *callback;
NSObject <OATokenManagerDelegate> *delegate;
NSMutableArray *calls;
NSMutableArray *selectors;
NSMutableDictionary *delegates;
BOOL isDispatching;
}
- (id)init;
- (id)initWithConsumer:(OAConsumer *)aConsumer token:(OAToken *)aToken oauthBase:(const NSString *)base
realm:(const NSString *)aRealm callback:(const NSString *)aCallback
delegate:(NSObject <OATokenManagerDelegate> *)aDelegate;
- (void)authorizedToken:(const NSString *)key;
- (void)fetchData:(NSString *)aURL finished:(SEL)didFinish;
- (void)fetchData:(NSString *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters
finished:(SEL)didFinish;
- (void)fetchData:(NSString *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters
files:(NSDictionary *)theFiles finished:(SEL)didFinish;
- (void)fetchData:(NSString *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters
files:(NSDictionary *)theFiles finished:(SEL)didFinish delegate:(NSObject*)aDelegate;
- (void)call:(OACall *)call failedWithError:(NSError *)error;
- (void)call:(OACall *)call failedWithProblem:(OAProblem *)problem;
@end