// // KMCloudOperation.h // PDF Reader // // Created by wanjun on 2020/7/14. // Copyright © 2020 Kdan Mobile. All rights reserved. // #import #import "KMServicesCloudFile.h" #import "KMCloudServer.h" typedef NS_ENUM(NSUInteger, KMCloudLoadState) { KMCloudLoadState_Upload = 0, KMCloudLoadState_Download }; typedef NS_ENUM(NSInteger, KMCloudDownLoadOperationState) { KMCloudDownLoadOperationStateReady = 0, KMCloudDownLoadOperationStateStart, KMCloudDownLoadOperationStateProgress, KMCloudDownLoadOperationStateFail, KMCloudDownLoadOperationStateSuccess, KMCloudDownLoadOperationStateCancel }; @interface KMCloudOperation : NSOperation @property (nonatomic, retain) KMServicesCloudFile *fromPath; @property (nonatomic, strong) NSString *toPath; @property (nonatomic, strong) NSString *filePath; @property (nonatomic, assign) KMServerType serverType; @property (nonatomic, assign) CGFloat loadProgress; @property (nonatomic, strong) NSMutableDictionary *loadingOperations; @property (nonatomic, assign) KMCloudLoadState cloudLoadState; @property (nonatomic, assign) KMCloudDownLoadOperationState state; @property (nonatomic,readonly) long long downloadSize; @property (nonatomic,readonly) long long downloadTotalSize; - (instancetype)initWithLoadCloudPath:(KMServicesCloudFile *)cloudPath serverType:(KMServerType)serverType localPath:(NSURL *)localPath loadState:(KMCloudLoadState)state currentConvetProgress:(CurrentProgressCallBack)currentProgress completion:(CompletionCallBack)completion; @end