JXConnection.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // JXConnection.h
  3. // JXConnection
  4. //
  5. // Created by Hao Tan on 11-11-19.
  6. // Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class JXConnection;
  10. @protocol JXConnectionDelegate <NSObject>
  11. -(void)requestSuccess:(JXConnection*)task;
  12. -(void)requestError:(JXConnection *)task;
  13. @end
  14. @interface JXConnection : NSObject
  15. @property (nonatomic, strong) NSError *error;
  16. @property (nonatomic, strong) NSString *action;
  17. @property (nonatomic, strong) NSString *url;
  18. @property (nonatomic, strong) NSString *downloadFile;
  19. @property (nonatomic, assign) NSInteger timeout;
  20. @property (nonatomic, assign) long uploadDataSize;//只返回最后一个文件的大小
  21. @property (nonatomic, weak) id toView;
  22. @property (nonatomic, strong) id userData;
  23. @property (nonatomic, strong) id param;
  24. @property (nonatomic, strong) NSMutableDictionary *params;
  25. @property (nonatomic, weak) id<JXConnectionDelegate> delegate;
  26. @property (nonatomic, strong) id responseData;
  27. @property (nonatomic, strong) NSString *messageId;
  28. - (void)go; //开始下载
  29. - (void)stop; //停止下载
  30. - (BOOL)isImage;
  31. - (BOOL)isVideo;
  32. - (BOOL)isAudio;
  33. - (id)init;
  34. - (void)setPostValue:(id <NSObject>)value forKey:(NSString *)key;
  35. - (void)setData:(NSData *)data forKey:(NSString *)key messageId:(NSString *)messageId;
  36. - (NSString *)getSecret;
  37. @end