TUIChatMediaDataProvider.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // TUIChatMediaDataProvider.h
  3. // TUIChat
  4. //
  5. // Created by harvy on 2022/12/20.
  6. // Copyright © 2023 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. #import <TIMCommon/TUIMessageCellData.h>
  11. #import "TUIChatMediaSendingManager.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. typedef void (^TUIChatMediaDataProviderResultCallback)(BOOL success, NSString *__nullable message, NSString *__nullable path);
  14. @protocol TUIChatMediaDataProtocol <NSObject>
  15. - (void)selectPhoto;
  16. - (void)takePicture;
  17. - (void)takeVideo;
  18. - (void)multimediaRecord;
  19. - (void)selectFile;
  20. @end
  21. @protocol TUIChatMediaDataListener <NSObject>
  22. - (void)onProvideImage:(NSString *)imageUrl;
  23. - (void)onProvideImageError:(NSString *)errorMessage;
  24. - (void)onProvideVideo:(NSString *)videoUrl
  25. snapshot:(NSString *)snapshotUrl
  26. duration:(NSInteger)duration
  27. placeHolderCellData:(TUIMessageCellData *)placeHolderCellData;
  28. - (void)onProvidePlaceholderVideoSnapshot:(NSString *)snapshotUrl
  29. SnapImage:(UIImage *)img
  30. Completion:(void (^__nullable)(BOOL finished, TUIMessageCellData *placeHolderCellData))completion;
  31. - (void)onProvideVideoError:(NSString *)errorMessage;
  32. - (void)onProvideFile:(NSString *)fileUrl filename:(NSString *)filename fileSize:(NSInteger)fileSize;
  33. - (void)onProvideFileError:(NSString *)errorMessage;
  34. - (NSString *)currentConversationID;
  35. - (BOOL)isPageAppears;
  36. - (void)sendPlaceHolderUIMessage:(TUIMessageCellData *)cellData;
  37. - (void)sendMessage:(V2TIMMessage *)message placeHolderCellData:(TUIMessageCellData *)placeHolderCellData;
  38. @end
  39. @interface TUIChatMediaDataProvider : NSObject <TUIChatMediaDataProtocol>
  40. @property(nonatomic, weak) UIViewController *presentViewController;
  41. @property(nonatomic, weak) id<TUIChatMediaDataListener> listener;
  42. @property(nonatomic, copy) NSString *conversationID;
  43. @end
  44. NS_ASSUME_NONNULL_END