forked from MattNewberry/ObjectiveRecord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActiveConnection.h
47 lines (34 loc) · 1.18 KB
/
ActiveConnection.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
//
// ActiveConnection.h
// Shopify_Mobile
//
// Created by Matthew Newberry on 7/22/10.
// Copyright 2010 Shopify. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ActiveRequest.h"
#import "ActiveResult.h"
const typedef enum{
ActiveConnectionNotificationDidFinish,
ActiveConnectionNotificationDidFailWithError
} ActiveConnectionNotificationType;
typedef void(^ActiveConnectionDidParseObjectBlock)(id object);
typedef void(^ActiveConnectionBlock)(ActiveResult *result);
@protocol ActiveConnection
@optional
- (void) setResponseDelegate:(id) delegate;
- (void) setDidFinishSelector:(SEL) selector;
- (void) setDidFailSelector:(SEL) selector;
- (void) setDidParseObjectSelector:(SEL) selector;
- (void) setDidFinishBlock:(ActiveConnectionBlock)block;
- (void) setDidFailBlock:(ActiveConnectionBlock)block;
- (void) setDidParseObjectBlock:(ActiveConnectionDidParseObjectBlock)block;
@required
- (void) send:(ActiveRequest *) activeRequest;
- (ActiveResult *) sendSyncronously:(ActiveRequest *) activeRequest;
@end
@protocol ActiveConnectionDelegate
@optional
- (void) connectionDidFinish:(ActiveResult *) result;
- (void) connectionDidFail:(ActiveResult *) result;
@end