Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 71 lines (64 sloc) 1.839 kb
76d2a5b @mstroeck
mstroeck authored
1 //
2 // AsyncConnection.h
3 // Vienna
4 //
5 // Created by Steve on 6/16/05.
6 // Copyright (c) 2005 Steve Palmer. All rights reserved.
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 // http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 //
20
21 #import <Cocoa/Cocoa.h>
22 #import "ActivityLog.h"
23
24 // Possible return values
25 typedef enum {
26 MA_Connect_Succeeded = 0,
27 MA_Connect_Failed,
28 MA_Connect_NeedCredentials,
29 MA_Connect_Stopped,
30 MA_Connect_PermanentRedirect,
31 MA_Connect_URLIsGone,
32 MA_Connect_Cancelled
33 } ConnectStatus;
34
35 @interface AsyncConnection : NSObject {
36 NSURLConnection * connector;
37 NSDictionary * httpHeaders;
38 NSDictionary * responseHeaders;
39 NSMutableData * receivedData;
40 NSString * username;
41 NSString * password;
42 ActivityItem * aItem;
43 NSString * URLString;
44 id contextData;
45 ConnectStatus status;
46 id delegate;
47 SEL handler;
48 BOOL isConnectionComplete;
49 }
50
51 // Public functions
52 -(BOOL)beginLoadDataFromURL:(NSURL *)url
53 username:(NSString *)theUsername
54 password:(NSString *)thePassword
55 delegate:(id)theDelegate
56 contextData:(id)theData
57 log:(ActivityItem *)theItem
58 didEndSelector:(SEL)endSelector;
59 -(void)cancel;
60 -(void)close;
61
62 -(ConnectStatus)status;
63 -(id)contextData;
64 -(ActivityItem *)aItem;
65 -(NSString *)URLString;
66
67 -(void)setHttpHeaders:(NSDictionary *)headerFields;
68 -(NSDictionary *)responseHeaders;
69 -(NSData *)receivedData;
70 @end
Something went wrong with that request. Please try again.