forked from mattgemmell/MGTwitterEngine
-
Notifications
You must be signed in to change notification settings - Fork 5
/
MGTwitterEngineDelegate.h
61 lines (47 loc) · 2.51 KB
/
MGTwitterEngineDelegate.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
//
// MGTwitterEngineDelegate.h
// MGTwitterEngine
//
// Created by Matt Gemmell on 16/02/2008.
// Copyright 2008 Instinctive Code.
//
#import "MGTwitterEngineGlobalHeader.h"
@class OAToken;
typedef enum _MGTwitterEngineDeliveryOptions {
// all results will be delivered as an array via statusesReceived: and similar delegate methods
MGTwitterEngineDeliveryAllResultsOption = 1 << 0,
// individual results will be delivered as a dictionary via the receivedObject: delegate method
MGTwitterEngineDeliveryIndividualResultsOption = 1 << 1,
// these options can be combined with the | operator
} MGTwitterEngineDeliveryOptions;
@protocol MGTwitterEngineDelegate
// These delegate methods are called after a connection has been established
- (void)requestSucceeded:(NSString *)connectionIdentifier;
- (void)requestFailed:(NSString *)connectionIdentifier withError:(NSError *)error;
@optional
#if YAJL_AVAILABLE || TOUCHJSON_AVAILABLE
// This delegate method is called each time a new result is parsed from the connection and
// the deliveryOption is configured for MGTwitterEngineDeliveryIndividualResults.
- (void)receivedObject:(NSDictionary *)dictionary forRequest:(NSString *)connectionIdentifier;
#endif
// These delegate methods are called after all results are parsed from the connection. If
// the deliveryOption is configured for MGTwitterEngineDeliveryAllResults (the default), a
// collection of all results is also returned.
- (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionIdentifier;
- (void)directMessagesReceived:(NSArray *)messages forRequest:(NSString *)connectionIdentifier;
- (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier;
- (void)miscInfoReceived:(NSArray *)miscInfo forRequest:(NSString *)connectionIdentifier;
#if YAJL_AVAILABLE || TOUCHJSON_AVAILABLE
- (void)searchResultsReceived:(NSArray *)searchResults forRequest:(NSString *)connectionIdentifier;
#endif
- (void)socialGraphInfoReceived:(NSArray *)socialGraphInfo forRequest:(NSString *)connectionIdentifier;
- (void)accessTokenReceived:(OAToken *)token forRequest:(NSString *)connectionIdentifier;
#if TARGET_OS_IPHONE
- (void)imageReceived:(UIImage *)image forRequest:(NSString *)connectionIdentifier;
#else
- (void)imageReceived:(NSImage *)image forRequest:(NSString *)connectionIdentifier;
#endif
// This delegate method is called whenever a connection has finished.
- (void)connectionStarted:(NSString *)connectionIdentifier;
- (void)connectionFinished:(NSString *)connectionIdentifier;
@end