123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- //
- // KMDropboxManager.h
- // PDF Reader Pro Edition
- //
- // Created by 万军 on 2020/2/18.
- // Copyright © 2020 WanJun. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import "KMServicesCloudFile.h"
- #import "KMCloudServer.h"
- #import "KMCloudOperation.h"
- NS_ASSUME_NONNULL_BEGIN
- @class KMCloudOperation;
- @interface KMDropboxManager : NSObject
- {
- NSString *_appKey;
- }
- //The user's unique Dropbox ID
- @property (nonatomic, readonly) NSString *accountId;
- @property (nonatomic, readonly) NSString *name;
- @property (nonatomic, copy, readonly) NSString *email;
- ////获取本地当前目录下文件列表(仅当前层)
- //@property (nonatomic, strong) NSMutableArray<KMDropboxFileMetadata *> *localFileList;
- //获取根目录对象
- @property (nonatomic, readonly) KMServicesCloudFile *localRootFolder;
- + (instancetype) shareInstance;
- /** Dropbox Whether to login. */
- - (BOOL)isSignedIn;
- /** Dropbox auth/login. */
- - (void) authorizedLoginCompletion:(CloudLoginCallBack)completion;
- /** Dropbox logout. */
- - (void) authorizedLogoutCompletion:(CloudLogoutCallBack)completion;
- /**
- Upload local content to Dropbox cloud disk space.
- @param cloudPath Dropbox cloud disk space.
- @param localPath local file path url.
- @return upload operation.
- */
- - (KMCloudOperation *)uploadCloudPath:(KMServicesCloudFile *)cloudPath
- localPath:(NSURL *)localPath
- currentConvetProgress:(CurrentProgressCallBack)currentProgress
- completion:(CompletionCallBack)completion;
- /**
- Dropbox cancel upload operation.
- @param operation upload operation
- */
- - (void) uploadCancel:(KMCloudOperation *)operation;
- /**
- Download files from Dropbox cloud disk to local space.
- @param cloudPath Dropbox cloud disk space.
- @param localPath local space path url.
- @return download operation.
- */
- - (KMCloudOperation *)downloadCloudPath:(KMServicesCloudFile *)cloudPath
- localPath:(NSURL *)localPath
- currentConvetProgress:(CurrentProgressCallBack)currentProgress
- completion:(CompletionCallBack)completion;
- /**
- Dropbox cancel download operation.
- @param operation download operation
- */
- - (void) downloadCancel:(KMCloudOperation *)operation;
- /**
- Delete Dropbox file based on file object.
- @param fileData dropbox file metadata
- */
- -(void) deleteFileWithPath:(KMServicesCloudFile *)fileData
- completion:(CloudDeleteFileCallBack)completion;
- /**
- Create Dropbox folder based on file object.
- @param fileData dropbox file metadata.
- @param folderName Created folder name.
- */
- -(void) createFolderWithPath:(KMServicesCloudFile *)fileData
- folderName:(NSString *)folderName
- completion:(CreateFolderCallBack)completion;
- /**
- Get Dropbox file list based on file object.
- @param fileData dropbox file metadata. Root folder is 'localRootFolder'
- @param responseBlock succeed block
- */
- - (void) getListWithFilePath:(KMServicesCloudFile *)fileData
- setResponseBlock:(GetFileListCallBack)responseBlock;
- - (KMServicesCloudFile *)cloudFolderCacheForDisPath:(NSString *)path;
- @end
- NS_ASSUME_NONNULL_END
|