TUIBubbleMessageCell.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // Created by Tencent on 2023/06/09.
  2. // Copyright © 2023 Tencent. All rights reserved.
  3. /**
  4. * This document declares the TUIBubbleMessageCell class.
  5. * Bubble messages, the most common type of messages that contain strings and emoticons.
  6. * Both TUIFileMessageCell and TUIVoiceMessageCell inherit from this class and implement the userinterface of bubble messages.
  7. * 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
  8. * bubble message unit.
  9. */
  10. #import "TUIBubbleMessageCellData.h"
  11. #import "TUIMessageCell.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. @interface TUIBubbleMessageCell : TUIMessageCell
  14. /**
  15. * The bubble image view, the message's bubble icon, wraps the message's content on the UI as a background panel for the bubble.
  16. */
  17. @property(nonatomic, strong) UIImageView *bubbleView;
  18. @property TUIBubbleMessageCellData *bubbleData;
  19. - (void)fillWithData:(TUIBubbleMessageCellData *)data;
  20. + (CGFloat)getBubbleTop:(TUIBubbleMessageCellData *)data;
  21. - (UIImage *)getBubble;
  22. - (UIImage *)getErrorBubble;
  23. @end
  24. #pragma mark - TUILayoutConfiguration
  25. @interface TUIBubbleMessageCell (TUILayoutConfiguration)
  26. /**
  27. * Send bubble icon (normal state)
  28. * - The send icon of the bubble, assigned to the @bubble when the bubble message was sent.
  29. */
  30. @property(nonatomic, class) UIImage *outgoingBubble;
  31. /**
  32. * Send bubble icon (highlighted state)
  33. * - The send icon (highlighted state) of the bubble, assigned to @highlightedBubble when the bubble message was sent.
  34. */
  35. @property(nonatomic, class) UIImage *outgoingHighlightedBubble;
  36. @property(nonatomic, class) UIImage *outgoingErrorBubble;
  37. /**
  38. *
  39. * Send bubble icon (highlighted state)
  40. */
  41. @property(nonatomic, class) UIImage *outgoingAnimatedHighlightedAlpha20;
  42. @property(nonatomic, class) UIImage *outgoingAnimatedHighlightedAlpha50;
  43. /**
  44. * Receive bubble icon (normal state)
  45. * - The receive icon of the bubble, assigned to the @bubble when the bubble message was received.
  46. */
  47. @property(nonatomic, class) UIImage *incommingBubble;
  48. /**
  49. * Receive bubble icon (highlighted state)
  50. * - The receive icon of the bubble, assigned to @highlightedBubble when the bubble message was received.
  51. */
  52. @property(nonatomic, class) UIImage *incommingHighlightedBubble;
  53. @property(nonatomic, class) UIImage *incommingErrorBubble;
  54. /**
  55. * Receive bubble icon (highlighted state)
  56. */
  57. @property(nonatomic, class) UIImage *incommingAnimatedHighlightedAlpha20;
  58. @property(nonatomic, class) UIImage *incommingAnimatedHighlightedAlpha50;
  59. /**
  60. * Spacing at the top of the send bubble
  61. * - It is used to locate the top of the sent bubble, and is assigned to @bubbleTop when the bubble message was sent.
  62. */
  63. @property(nonatomic, class) CGFloat outgoingBubbleTop;
  64. /**
  65. * Spacing at the top of the receiving bubble
  66. * - It is used to locate the top of the receive bubble, and is assigned to @bubbleTop when the bubble message was
  67. * received.
  68. */
  69. @property(nonatomic, class) CGFloat incommingBubbleTop;
  70. @end
  71. NS_ASSUME_NONNULL_END