KMCloudOperation.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // KMCloudOperation.h
  3. // PDF Reader
  4. //
  5. // Created by wanjun on 2020/7/14.
  6. // Copyright © 2020 Kdan Mobile. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "KMServicesCloudFile.h"
  10. #import "KMCloudServer.h"
  11. typedef NS_ENUM(NSUInteger, KMCloudLoadState) {
  12. KMCloudLoadState_Upload = 0,
  13. KMCloudLoadState_Download
  14. };
  15. typedef NS_ENUM(NSInteger, KMCloudDownLoadOperationState) {
  16. KMCloudDownLoadOperationStateReady = 0,
  17. KMCloudDownLoadOperationStateStart,
  18. KMCloudDownLoadOperationStateProgress,
  19. KMCloudDownLoadOperationStateFail,
  20. KMCloudDownLoadOperationStateSuccess,
  21. KMCloudDownLoadOperationStateCancel
  22. };
  23. @interface KMCloudOperation : NSOperation
  24. @property (nonatomic, retain) KMServicesCloudFile *fromPath;
  25. @property (nonatomic, strong) NSString *toPath;
  26. @property (nonatomic, strong) NSString *filePath;
  27. @property (nonatomic, assign) KMServerType serverType;
  28. @property (nonatomic, assign) CGFloat loadProgress;
  29. @property (nonatomic, strong) NSMutableDictionary *loadingOperations;
  30. @property (nonatomic, assign) KMCloudLoadState cloudLoadState;
  31. @property (nonatomic, assign) KMCloudDownLoadOperationState state;
  32. @property (nonatomic,readonly) long long downloadSize;
  33. @property (nonatomic,readonly) long long downloadTotalSize;
  34. - (instancetype)initWithLoadCloudPath:(KMServicesCloudFile *)cloudPath
  35. serverType:(KMServerType)serverType
  36. localPath:(NSURL *)localPath
  37. loadState:(KMCloudLoadState)state
  38. currentConvetProgress:(CurrentProgressCallBack)currentProgress
  39. completion:(CompletionCallBack)completion;
  40. @end