TUIBaseMessageController_Minimalist.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // Created by Tencent on 2023/06/09.
  2. // Copyright © 2023 Tencent. All rights reserved.
  3. /**
  4. * This file declares the controller class used to implement the messaging logic
  5. * The message controller is responsible for uniformly displaying the messages you send/receive, while providing response callbacks when you interact with
  6. * those messages (tap/long-press, etc.). The message controller is also responsible for unified data processing of the messages you send into a data format
  7. * that can be sent through the IM SDK and sent. That is to say, when you use this controller, you can save a lot of data processing work, so that you can
  8. * access the IM SDK more quickly and conveniently.
  9. */
  10. #import <TIMCommon/TUIMessageCell.h>
  11. #import <UIKit/UIKit.h>
  12. #import "TUIBaseMessageControllerDelegate_Minimalist.h"
  13. #import "TUIChatConversationModel.h"
  14. #import "TUIChatDefine.h"
  15. NS_ASSUME_NONNULL_BEGIN
  16. @class TUIConversationCellData_Minimalist;
  17. @class TUIBaseMessageController_Minimalist;
  18. @class TUIReplyMessageCell_Minimalist;
  19. /////////////////////////////////////////////////////////////////////////////////
  20. //
  21. // TUIBaseMessageController_Minimalist
  22. //
  23. /////////////////////////////////////////////////////////////////////////////////
  24. /**
  25. * 【Module name】TUIBaseMessageController_Minimalist
  26. * 【Function description】The message controller is responsible for implementing a series of business logic such as receiving, sending, and displaying
  27. * messages.
  28. * - This class provides callback interfaces for interactive operations such as receiving/displaying new messages, showing/hiding menus, and clicking on
  29. * message avatars.
  30. * - At the same time, this class provides the sending function of image, video, and file information, and directly integrates and calls the IM SDK to realize
  31. * the sending function.
  32. *
  33. */
  34. @interface TUIBaseMessageController_Minimalist : UITableViewController
  35. + (void)asyncGetDisplayString:(NSArray<V2TIMMessage *> *)messageList callback:(void(^)(NSDictionary<NSString *, NSString *> *))callback;
  36. + (nullable NSString *)getDisplayString:(V2TIMMessage *)message;
  37. @property(nonatomic, copy) void (^groupRoleChanged)(V2TIMGroupMemberRole role);
  38. @property(nonatomic, copy) void (^pinGroupMessageChanged)(NSArray *groupPinList);
  39. @property(nonatomic, weak) id<TUIBaseMessageControllerDelegate_Minimalist> delegate;
  40. @property(nonatomic, assign) BOOL isInVC;
  41. /**
  42. * Whether a read receipt is required to send a message, the default is NO
  43. */
  44. @property(nonatomic) BOOL isMsgNeedReadReceipt;
  45. - (void)sendMessage:(V2TIMMessage *)msg;
  46. - (void)sendMessage:(V2TIMMessage *)msg placeHolderCellData:(TUIMessageCellData *)placeHolderCellData;
  47. - (void)clearUImsg;
  48. - (void)sendPlaceHolderUIMessage:(TUIMessageCellData *)cellData;
  49. - (void)scrollToBottom:(BOOL)animate;
  50. - (void)setConversation:(TUIChatConversationModel *)conversationData;
  51. /**
  52. * After enabling multi-selection mode, get the currently selected result
  53. * Returns an empty array if multiple selection mode is off
  54. */
  55. - (NSArray<TUIMessageCellData *> *)multiSelectedResult:(TUIMultiResultOption)option;
  56. - (void)enableMultiSelectedMode:(BOOL)enable;
  57. - (void)deleteMessages:(NSArray<TUIMessageCellData *> *)uiMsgs;
  58. /**
  59. * Conversation read report
  60. *
  61. */
  62. - (void)readReport;
  63. /**
  64. * Subclass implements click-to-reply messages
  65. */
  66. - (void)showReplyMessage:(TUIReplyMessageCell_Minimalist *)cell;
  67. - (void)willShowMediaMessage:(TUIMessageCell *)cell;
  68. - (void)didCloseMediaMessage:(TUIMessageCell *)cell;
  69. /**
  70. * Subclass implements click-to-delete message
  71. */
  72. - (void)onDelete:(TUIMessageCell *)cell;
  73. // Reload the specific cell UI.
  74. - (void)reloadCellOfMessage:(NSString *)messageID;
  75. - (void)reloadAndScrollToBottomOfMessage:(NSString *)messageID;
  76. - (void)scrollCellToBottomOfMessage:(NSString *)messageID;
  77. - (void)loadGroupInfo;
  78. - (BOOL)isCurrentUserRoleSuperAdminInGroup;
  79. - (BOOL)isCurrentMessagePin:(NSString *)msgID;
  80. - (void)unPinGroupMessage:(V2TIMMessage *)innerMessage;
  81. - (CGFloat)getHeightFromMessageCellData:(TUIMessageCellData *)cellData;
  82. @end
  83. NS_ASSUME_NONNULL_END