UIDownloadBar.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // UIDownloadBar.h
  3. // UIDownloadBar
  4. //
  5. // Created by John on 3/20/09.
  6. // Copyright 2009 Gojohnnyboi. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class UIProgressView;
  10. @protocol UIDownloadBarDelegate;
  11. @interface UIDownloadBar : UIProgressView {
  12. NSURLRequest* DownloadRequest;
  13. NSURLConnection* DownloadConnection;
  14. NSMutableData* receivedData;
  15. NSString* localFilename;
  16. id<UIDownloadBarDelegate> delegate;
  17. long long bytesReceived;
  18. long long expectedBytes;
  19. float percentComplete;
  20. }
  21. - (UIDownloadBar *)initWithURL:(NSURL *)fileURL progressBarFrame:(CGRect)frame timeout:(NSInteger)timeout delegate:(id<UIDownloadBarDelegate>)theDelegate;
  22. @property (nonatomic, readonly) NSMutableData* receivedData;
  23. @property (nonatomic, readonly, retain) NSURLRequest* DownloadRequest;
  24. @property (nonatomic, readonly, retain) NSURLConnection* DownloadConnection;
  25. @property (nonatomic, assign) id<UIDownloadBarDelegate> delegate;
  26. @property (nonatomic, readonly) float percentComplete;
  27. @end
  28. @protocol UIDownloadBarDelegate<NSObject>
  29. @optional
  30. - (void)downloadBar:(UIDownloadBar *)downloadBar didFinishWithData:(NSData *)fileData suggestedFilename:(NSString *)filename;
  31. - (void)downloadBar:(UIDownloadBar *)downloadBar didFailWithError:(NSError *)error;
  32. - (void)downloadBarUpdated:(UIDownloadBar *)downloadBar;
  33. @end