// // UIDownloadBar.h // UIDownloadBar // // Created by John on 3/20/09. // Copyright 2009 Gojohnnyboi. All rights reserved. // #import @class UIProgressView; @protocol UIDownloadBarDelegate; @interface UIDownloadBar : UIProgressView { NSURLRequest* DownloadRequest; NSURLConnection* DownloadConnection; NSMutableData* receivedData; NSString* localFilename; id delegate; long long bytesReceived; long long expectedBytes; float percentComplete; } - (UIDownloadBar *)initWithURL:(NSURL *)fileURL progressBarFrame:(CGRect)frame timeout:(NSInteger)timeout delegate:(id)theDelegate; @property (nonatomic, readonly) NSMutableData* receivedData; @property (nonatomic, readonly, retain) NSURLRequest* DownloadRequest; @property (nonatomic, readonly, retain) NSURLConnection* DownloadConnection; @property (nonatomic, assign) id delegate; @property (nonatomic, readonly) float percentComplete; @end @protocol UIDownloadBarDelegate @optional - (void)downloadBar:(UIDownloadBar *)downloadBar didFinishWithData:(NSData *)fileData suggestedFilename:(NSString *)filename; - (void)downloadBar:(UIDownloadBar *)downloadBar didFailWithError:(NSError *)error; - (void)downloadBarUpdated:(UIDownloadBar *)downloadBar; @end