-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathGSTwitPicEngine.h
74 lines (48 loc) · 1.78 KB
/
GSTwitPicEngine.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
69
70
71
72
73
74
//
// GSTwitPicEngine.h
// TwitPic Uploader
//
// Created by Gurpartap Singh on 19/06/10.
// Copyright 2010 Gurpartap Singh. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "OAToken.h"
#import "ASIHTTPRequest.h"
// Define these API credentials as per your applicationss.
// Get here: http://twitter.com/apps
#define TWITTER_OAUTH_CONSUMER_KEY kTwitterOAuthConsumerKey
#define TWITTER_OAUTH_CONSUMER_SECRET kTwitterOAuthConsumerSecret
// Get here: http://dev.twitpic.com/apps/
#define TWITPIC_API_KEY kTwitPicAPIKey
// TwitPic API Version: http://dev.twitpic.com/docs/
#define TWITPIC_API_VERSION @"2"
// Enable one of the JSON Parsing libraries that the project has.
// Disable all to get raw string as response in delegate call to parse yourself.
#define TWITPIC_USE_YAJL 1
#define TWITPIC_USE_SBJSON 0
#define TWITPIC_USE_TOUCHJSON 0
#define TWITPIC_API_FORMAT @"json"
// Implement XML here if you wish to.
// #define TWITPIC_USE_LIBXML 0
// #if TWITPIC_USE_LIBXML
// #define TWITPIC_API_FORMAT @"xml"
// #endif
@protocol GSTwitPicEngineDelegate
- (void)twitpicDidFinishUpload:(NSDictionary *)response;
- (void)twitpicDidFailUpload:(NSDictionary *)error;
@end
@class ASINetworkQueue;
@interface GSTwitPicEngine : NSObject <ASIHTTPRequestDelegate, UIWebViewDelegate> {
__weak NSObject <GSTwitPicEngineDelegate> *_delegate;
OAToken *_accessToken;
ASINetworkQueue *_queue;
}
@property (retain) ASINetworkQueue *_queue;
+ (GSTwitPicEngine *)twitpicEngineWithDelegate:(NSObject *)theDelegate;
- (GSTwitPicEngine *)initWithDelegate:(NSObject *)theDelegate;
- (void)uploadPicture:(UIImage *)picture;
- (void)uploadPicture:(UIImage *)picture withMessage:(NSString *)message;
@end
@interface GSTwitPicEngine (OAuth)
- (void)setAccessToken:(OAToken *)token;
@end