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.

51 lines
1.8 KiB

13 years ago
  1. //
  2. // MGMURLConnectionManager.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. @protocol MGMURLConnectionHandler <NSObject>
  11. - (void)setManager:(MGMURLConnectionManager *)theManager;
  12. - (void)setConnection:(NSURLConnection *)theConnection;
  13. - (NSURLConnection *)connection;
  14. - (void)setRequest:(NSMutableURLRequest *)theRequest;
  15. - (NSMutableURLRequest *)request;
  16. - (BOOL)synchronous;
  17. - (NSURLCredential *)credentailsForChallenge:(NSURLAuthenticationChallenge *)theChallenge;
  18. - (void)uploaded:(unsigned long)theBytes totalBytes:(unsigned long)theTotalBytes totalBytesExpected:(unsigned long)theExpectedBytes;
  19. - (NSURLRequest *)willSendRequest:(NSURLRequest *)theRequest redirectResponse:(NSHTTPURLResponse *)theResponse;
  20. - (void)didReceiveResponse:(NSHTTPURLResponse *)theResponse;
  21. - (void)didReceiveData:(NSData *)theData;
  22. - (void)didFailWithError:(NSError *)theError;
  23. - (void)didFinishLoading;
  24. @end
  25. @interface MGMURLConnectionManager : NSObject {
  26. NSHTTPCookieStorage *cookieStorage;
  27. NSString *userAgent;
  28. NSURLCredential *credentials;
  29. NSMutableArray *handlers;
  30. BOOL runningSynchronousConnection;
  31. }
  32. + (id)manager;
  33. + (id)managerWithCookieStorage:(id)theCookieStorage;
  34. - (id)initWithCookieStorage:(id)theCookieStorage;
  35. - (void)setCookieStorage:(id)theCookieStorage;
  36. - (NSHTTPCookieStorage *)cookieStorage;
  37. - (void)setUserAgent:(NSString *)theUserAgent;
  38. - (NSString *)userAgent;
  39. - (void)setCredentials:(NSURLCredential *)theCredentials;
  40. - (void)setUser:(NSString *)theUser password:(NSString *)thePassword;
  41. - (NSURLCredential *)credentials;
  42. - (void)addHandler:(id)theHandler;
  43. - (void)cancelHandler:(id)theHandler;
  44. - (void)cancelAll;
  45. @end