123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- //
- // KMGoogleDriveManager.h
- // PDF Reader Pro Edition
- //
- // Created by 万军 on 2020/2/27.
- // Copyright © 2020 WanJun. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import <AppKit/AppKit.h>
- #import "KMServicesCloudFile.h"
- #import "GTLRDrive.h"
- #import "KMCloudServer.h"
- #import "KMCloudOperation.h"
- NS_ASSUME_NONNULL_BEGIN
- @class KMCloudOperation;
- @interface KMGoogleDriveManager : NSObject
- {
- NSMutableArray<KMCloudOperation *> *operationArr;
- }
- @property (nonatomic, strong) NSMutableArray<KMCloudOperation *> *operationArr;
- @property (nonatomic, readonly) GTLRDriveService *driveService;
- @property (nonatomic, readonly) KMServicesCloudFile *localRootFolder;//获取本读根文件夹
- + (instancetype) shareInstance;
- /** GoogleDrive Whether to login. */
- - (BOOL)isSignedIn;
- /** GoogleDrive auth/login. */
- - (void) authorizedLoginCompletion:(CloudLoginCallBack)completion;
- /** GoogleDrive logout. */
- - (void) authorizedLogoutCompletion:(CloudLogoutCallBack)completion;
- /**
- Upload local content to GoogleDrive cloud disk space.
- @param cloudPath GoogleDrive 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;
- /**
- GoogleDrive cancel upload operation.
- @param operation upload operation
- */
- - (void) uploadCancel:(KMCloudOperation *)operation;
- /**
- Download files from GoogleDrive cloud disk to local space.
- @param cloudPath GoogleDrive 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;
- /**
- GoogleDrive cancel download operation.
- @param operation download operation
- */
- - (void) downloadCancel:(KMCloudOperation *)operation;
- /**
- Delete GoogleDrive file based on file object.
- @param fileData GoogleDrive file metadata
- */
- -(void) deleteFileWithPath:(KMServicesCloudFile *)fileData
- completion:(CloudDeleteFileCallBack)completion;
- /**
- Create GoogleDrive folder based on file object.
- @param fileData GoogleDrive file metadata.
- @param folderName Created folder name.
- */
- -(void) createFolderWithPath:(KMServicesCloudFile * )fileData
- folderName:(NSString *)folderName
- completion:(CreateFolderCallBack)completion;
- /**
- Get GoogleDrive file list based on file object.
- @param fileData GoogleDrive file metadata. Root folder is 'localRootFolder'
- @param responseBlock succeed block
- */
- - (void)getListWithFilePath:(KMServicesCloudFile *)fileData
- setResponseBlock:(GetFileListCallBack)responseBlock;
- - (NSArray<KMCloudOperation *> *) operations;
- - (KMServicesCloudFile *)cloudFolderCacheForDisPath:(NSString *)path;
- @end
- NS_ASSUME_NONNULL_END
|