Copy of rackspace-ios version 2.1.1
[pithos-ios] / Classes / ASIProgressDelegate.h
1 //
2 //  ASIProgressDelegate.h
3 //  Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRequest
4 //
5 //  Created by Ben Copsey on 13/04/2010.
6 //  Copyright 2010 All-Seeing Interactive. All rights reserved.
7 //
8
9 @class ASIHTTPRequest;
10
11 @protocol ASIProgressDelegate <NSObject>
12
13 @optional
14
15 // These methods are used to update UIProgressViews (iPhone OS) or NSProgressIndicators (Mac OS X)
16 // If you are using a custom progress delegate, you may find it easier to implement didReceiveBytes / didSendBytes instead
17 #if TARGET_OS_IPHONE
18 - (void)setProgress:(float)newProgress;
19 #else
20 - (void)setDoubleValue:(double)newProgress;
21 - (void)setMaxValue:(double)newMax;
22 #endif
23
24 // Called when the request receives some data - bytes is the length of that data
25 - (void)request:(ASIHTTPRequest *)request didReceiveBytes:(long long)bytes;
26
27 // Called when the request sends some data
28 // The first 32KB (128KB on older platforms) of data sent is not included in this amount because of limitations with the CFNetwork API
29 // bytes may be less than zero if a request needs to remove upload progress (probably because the request needs to run again)
30 - (void)request:(ASIHTTPRequest *)request didSendBytes:(long long)bytes;
31
32 // Called when a request needs to change the length of the content to download
33 - (void)request:(ASIHTTPRequest *)request incrementDownloadSizeBy:(long long)newLength;
34
35 // Called when a request needs to change the length of the content to upload
36 // newLength may be less than zero when a request needs to remove the size of the internal buffer from progress tracking
37 - (void)request:(ASIHTTPRequest *)request incrementUploadSizeBy:(long long)newLength;
38 @end