TUIBubbleMessageCell.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // Created by Tencent on 2023/06/09.
  2. // Copyright © 2023 Tencent. All rights reserved.
  3. /**
  4. *
  5. * 本文件声明了 TUIBubbleMessageCell 类。
  6. * 气泡消息,即最常见的包含字符串与小表情的字符的消息类型
  7. * TUIFileMessageCell 和 TUIVoiceMessageCell 均继承于本类,实现了气泡消息的 UI 视觉。
  8. * 如果开发者想要实现气泡消息的自定义,也可参照上述两个消息单元的实现方法,实现自己的气泡消息单元。
  9. *
  10. * This document declares the TUIBubbleMessageCell class.
  11. * Bubble messages, the most common type of messages that contain strings and emoticons.
  12. * Both TUIFileMessageCell and TUIVoiceMessageCell inherit from this class and implement the userinterface of bubble messages.
  13. * If developers want to customize the bubble message, they can also refer to the implementation methods of the above two message units to implement their own
  14. * bubble message unit.
  15. */
  16. #import "TUIBubbleMessageCellData.h"
  17. #import "TUIMessageCell.h"
  18. NS_ASSUME_NONNULL_BEGIN
  19. @interface TUIBubbleMessageCell : TUIMessageCell
  20. /**
  21. * 气泡图像视图,即消息的气泡图标,在 UI 上作为气泡的背景板包裹消息的内容。
  22. * The bubble image view, the message's bubble icon, wraps the message's content on the UI as a background panel for the bubble.
  23. */
  24. @property(nonatomic, strong) UIImageView *bubbleView;
  25. @property TUIBubbleMessageCellData *bubbleData;
  26. - (void)fillWithData:(TUIBubbleMessageCellData *)data;
  27. + (CGFloat)getBubbleTop:(TUIBubbleMessageCellData *)data;
  28. @end
  29. #pragma mark - TUILayoutConfiguration
  30. @interface TUIBubbleMessageCell (TUILayoutConfiguration)
  31. /**
  32. * 发送气泡图标(正常)
  33. * - 气泡的发送图标,当气泡消息单元为发送时赋值给 bubble。
  34. *
  35. * Send bubble icon (normal state)
  36. * - The send icon of the bubble, assigned to the @bubble when the bubble message was sent.
  37. */
  38. @property(nonatomic, class) UIImage *outgoingBubble;
  39. /**
  40. * 发送气泡图标(高亮)
  41. * - 气泡的发送图标(高亮),当气泡消息单元为发送时赋值给 highlightedBubble。
  42. *
  43. * Send bubble icon (highlighted state)
  44. * - The send icon (highlighted state) of the bubble, assigned to @highlightedBubble when the bubble message was sent.
  45. */
  46. @property(nonatomic, class) UIImage *outgoingHighlightedBubble;
  47. /**
  48. * 发送气泡图标动画过渡
  49. * Send bubble icon (highlighted state)
  50. */
  51. @property(nonatomic, class) UIImage *outgoingAnimatedHighlightedAlpha20;
  52. @property(nonatomic, class) UIImage *outgoingAnimatedHighlightedAlpha50;
  53. /**
  54. * 接收气泡图标(正常)
  55. * - 气泡的接收图标,当气泡消息单元为接收时赋值给 bubble。
  56. *
  57. * Receive bubble icon (normal state)
  58. * - The receive icon of the bubble, assigned to the @bubble when the bubble message was received.
  59. */
  60. @property(nonatomic, class) UIImage *incommingBubble;
  61. /**
  62. * 接收气泡图标(高亮)
  63. * - 气泡的接收图标,当气泡消息单元为接收时赋值给 highlightedBubble。
  64. *
  65. * Receive bubble icon (highlighted state)
  66. * - The receive icon of the bubble, assigned to @highlightedBubble when the bubble message was received.
  67. */
  68. @property(nonatomic, class) UIImage *incommingHighlightedBubble;
  69. /**
  70. * 接收气泡图标动画过渡
  71. * Receive bubble icon (highlighted state)
  72. */
  73. @property(nonatomic, class) UIImage *incommingAnimatedHighlightedAlpha20;
  74. @property(nonatomic, class) UIImage *incommingAnimatedHighlightedAlpha50;
  75. /**
  76. * 发送气泡顶部的间距
  77. * - 用于定位发送气泡的顶部,当气泡消息单元为发送时赋值给 bubbleTop。
  78. *
  79. * Spacing at the top of the send bubble
  80. * - It is used to locate the top of the sent bubble, and is assigned to @bubbleTop when the bubble message was sent.
  81. */
  82. @property(nonatomic, class) CGFloat outgoingBubbleTop;
  83. /**
  84. * 接收气泡顶部的间距
  85. * - 用于定位接收气泡的顶部,当气泡消息单元为接收时赋值给 bubbleTop。
  86. *
  87. * Spacing at the top of the receiving bubble
  88. * - It is used to locate the top of the receive bubble, and is assigned to @bubbleTop when the bubble message was
  89. * received.
  90. */
  91. @property(nonatomic, class) CGFloat incommingBubbleTop;
  92. @end
  93. NS_ASSUME_NONNULL_END