NCChatFileController.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-License-Identifier: GPL-3.0-or-later
  4. */
  5. #import <Foundation/Foundation.h>
  6. #import "NCDatabaseManager.h"
  7. #import "NCMessageFileParameter.h"
  8. @class NCChatFileStatus;
  9. NS_ASSUME_NONNULL_BEGIN
  10. extern NSString * const NCChatFileControllerDidChangeIsDownloadingNotification;
  11. extern NSString * const NCChatFileControllerDidChangeDownloadProgressNotification;
  12. @class NCChatFileController;
  13. @protocol NCChatFileControllerDelegate<NSObject>
  14. - (void)fileControllerDidLoadFile:(NCChatFileController *)fileController withFileStatus:(NCChatFileStatus *)fileStatus;
  15. - (void)fileControllerDidFailLoadingFile:(NCChatFileController *)fileController withErrorDescription:(NSString *)errorDescription;
  16. @end
  17. @interface NCChatFileController : NSObject
  18. @property (nonatomic, weak) id<NCChatFileControllerDelegate> delegate;
  19. @property (nonatomic, strong) NSString *messageType;
  20. @property (nonatomic, strong) NSString *actionType;
  21. - (void)downloadFileFromMessage:(NCMessageFileParameter *)fileParameter;
  22. - (void)downloadFileWithFileId:(NSString *)fileId;
  23. - (void)deleteDownloadDirectoryForAccount:(TalkAccount *)account;
  24. - (void)clearDownloadDirectoryForAccount:(TalkAccount *)account;
  25. - (NSInteger)getDiskUsageForAccount:(TalkAccount *)account;
  26. @end
  27. NS_ASSUME_NONNULL_END