Chromium Updater
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.5 KiB

13 years ago
  1. //
  2. // MGMURLBasicHandler.h
  3. // MGMUsers
  4. //
  5. // Created by Mr. Gecko on 2/21/11.
  6. // Copyright (c) 2011 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class MGMURLConnectionManager;
  10. @interface MGMURLBasicHandler : NSObject {
  11. MGMURLConnectionManager *manager;
  12. NSURLConnection *connection;
  13. NSMutableURLRequest *request;
  14. NSHTTPURLResponse *response;
  15. NSString *file;
  16. NSFileHandle *fileHandle;
  17. NSMutableData *dataBuffer;
  18. unsigned long totalExpected;
  19. unsigned long totalDownloaded;
  20. id delegate;
  21. SEL receiveResponse;
  22. SEL sendRequest;
  23. SEL bytesUploaded;
  24. SEL bytesReceived;
  25. SEL failWithError;
  26. SEL finish;
  27. BOOL invisible;
  28. id object;
  29. BOOL synchronous;
  30. }
  31. + (id)handler;
  32. + (id)handlerWithRequest:(NSURLRequest *)theRequest delegate:(id)theDelegate;
  33. - (id)initWithRequest:(NSURLRequest *)theRequest delegate:(id)theDelegate;
  34. - (void)setDelegate:(id)theDelegate;
  35. - (id)delegate;
  36. // Arguments
  37. // MGMURLBasicHandler *theHandler
  38. // NSHTTPURLResponse *theResponse
  39. // Default
  40. // handler:didReceiveResponse:
  41. - (void)setReceiveResponse:(SEL)didReceiveResponse;
  42. - (SEL)receiveResponse;
  43. // Arguments
  44. // MGMURLBasicHandler *theHandler
  45. // NSURLRequest *theRequest
  46. // NSHTTPURLResponse *theResponse
  47. // Return
  48. // NSURLRequest *newRequest (nil for continue loading).
  49. // Default
  50. // handler:willSendRequest:redirectResponse:
  51. - (void)setSendRequest:(SEL)willSendRequest;
  52. - (SEL)sendRequest;
  53. // Arguments
  54. // MGMURLBasicHandler *theHandler
  55. // unsigned long theBytes
  56. // unsigned long theTotalBytes
  57. // unsigned long theExpectedBytes
  58. - (void)setBytesUploaded:(SEL)theBytesUploaded;
  59. - (SEL)bytesUploaded;
  60. // Arguments
  61. // MGMURLBasicHandler *theHandler
  62. // unsigned long theBytes
  63. // unsigned long theTotalBytes
  64. // unsigned long theExpectedBytes
  65. - (void)setBytesReceived:(SEL)theBytesReceived;
  66. - (SEL)bytesReceived;
  67. // Arguments
  68. // MGMURLBasicHandler *theHandler
  69. // NSError *theError
  70. // Default
  71. // handler:didFailWithError:
  72. - (void)setFailWithError:(SEL)didFailWithError;
  73. - (SEL)failWithError;
  74. // Arguments
  75. // MGMURLBasicHandler *theHandler
  76. // Default
  77. // handlerDidFinish:
  78. - (void)setFinish:(SEL)didFinish;
  79. - (SEL)finish;
  80. - (void)setInvisible:(BOOL)isInvisible;
  81. - (BOOL)invisible;
  82. - (void)setObject:(id)theObject;
  83. - (id)object;
  84. - (void)setSynchronous:(BOOL)isSynchronous;
  85. - (BOOL)synchronous;
  86. - (void)setFile:(NSString *)theFile;
  87. - (NSString *)file;
  88. - (void)setRequest:(NSURLRequest *)theRequest;
  89. - (NSMutableURLRequest *)request;
  90. - (NSHTTPURLResponse *)response;
  91. - (NSData *)data;
  92. - (NSString *)string;
  93. @end