TUIBaseMessageControllerDelegate.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. // Created by Tencent on 2023/06/09.
  2. // Copyright © 2023 Tencent. All rights reserved.
  3. #import <Foundation/Foundation.h>
  4. @import ImSDK_Plus;
  5. @class TUIBaseMessageController;
  6. @class TUIMessageCellData;
  7. @class TUIMessageCell;
  8. NS_ASSUME_NONNULL_BEGIN
  9. /////////////////////////////////////////////////////////////////////////////////
  10. //
  11. // TUIBaseMessageControllerDelegate
  12. //
  13. /////////////////////////////////////////////////////////////////////////////////
  14. @protocol TUIBaseMessageControllerDelegate <NSObject>
  15. /**
  16. * Callback for clicking controller
  17. * You can use this callback to: reset the InputController, dismiss the keyboard.
  18. *
  19. * @param controller Delegator, Message Controller
  20. */
  21. - (void)didTapInMessageController:(TUIBaseMessageController *)controller;
  22. /**
  23. * Callback after hide long press menu button
  24. * You can customize the implementation of this delegate function according to your needs.
  25. *
  26. * @param controller Delegator, Message Controller
  27. */
  28. - (void)didHideMenuInMessageController:(TUIBaseMessageController *)controller;
  29. /**
  30. * Callback before hide long press menu button
  31. * You can customize the implementation of this delegate function according to your needs.
  32. *
  33. * @param controller Delegator, Message Controller
  34. * @param view The view where the controller is located
  35. */
  36. - (BOOL)messageController:(TUIBaseMessageController *)controller willShowMenuInCell:(UIView *)view;
  37. /**
  38. * Callback for receiving new message
  39. * You can use this callback to initialize a new message based on the incoming data and perform a new message reminder.
  40. *
  41. * @param controller Delegator, Message Controller
  42. * @param message Incoming new message
  43. *
  44. * @return Returns the new message unit that needs to be displayed.
  45. */
  46. - (TUIMessageCellData *)messageController:(TUIBaseMessageController *)controller onNewMessage:(V2TIMMessage *)message;
  47. /**
  48. * Callback for displaying new message
  49. * You can use this callback to initialize the message bubble based on the incoming data and display it
  50. *
  51. * @param controller Delegator, Message Controller
  52. * @param data Data needed to display
  53. *
  54. * @return Returns the new message unit that needs to be displayed.。
  55. */
  56. - (TUIMessageCell *)messageController:(TUIBaseMessageController *)controller onShowMessageData:(TUIMessageCellData *)data;
  57. /**
  58. * The callback the cell will be displayed with
  59. */
  60. - (void)messageController:(TUIBaseMessageController *)controller willDisplayCell:(TUIMessageCell *)cell withData:(TUIMessageCellData *)cellData;
  61. /**
  62. * Callback for clicking avatar in the message cell
  63. * You can use this callback to achieve: jump to the detailed information interface of the corresponding user.
  64. * 1. First pull user information, if the user is a friend of the current user, initialize the corresponding friend information interface and jump.
  65. * 2. If the user is not a friend of the current user, the corresponding interface for adding friends is initialized and a jump is performed.
  66. *
  67. */
  68. - (void)messageController:(TUIBaseMessageController *)controller onSelectMessageAvatar:(TUIMessageCell *)cell;
  69. /**
  70. * Callback for long pressing avatar in the message cell
  71. */
  72. - (void)messageController:(TUIBaseMessageController *)controller onLongSelectMessageAvatar:(TUIMessageCell *)cell;
  73. /**
  74. * Callback for clicking message content in the message cell
  75. */
  76. - (void)messageController:(TUIBaseMessageController *)controller onSelectMessageContent:(TUIMessageCell *)cell;
  77. /**
  78. * After long-pressing the message, the menu bar will pop up, and the callback after clicking the menu option
  79. * menuType: The type of menu that was clicked. 0 - multiple choice, 1 - forwarding.
  80. */
  81. - (void)messageController:(TUIBaseMessageController *)controller onSelectMessageMenu:(NSInteger)menuType withData:(TUIMessageCellData *)data;
  82. /**
  83. * Callback for about to reply to the message (usually triggered by long-pressing the message content and then clicking the reply button)
  84. */
  85. - (void)messageController:(TUIBaseMessageController *)controller onRelyMessage:(TUIMessageCellData *)data;
  86. /**
  87. * Callback for quoting message (triggered by long-pressing the message content and then clicking the quote button)
  88. */
  89. - (void)messageController:(TUIBaseMessageController *)controller onReferenceMessage:(TUIMessageCellData *)data;
  90. /**
  91. * Callback for re-editing message (usually for re-calling a message)
  92. */
  93. - (void)messageController:(TUIBaseMessageController *)controller onReEditMessage:(TUIMessageCellData *)data;
  94. /// Forward text.
  95. - (void)messageController:(TUIBaseMessageController *)controller onForwardText:(NSString *)text;
  96. /**
  97. * Get the height of custom Tips (such as safety tips in Demo)
  98. */
  99. - (CGFloat)getTopMarginByCustomView;
  100. @end
  101. NS_ASSUME_NONNULL_END