TUITextMessageCellData.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Created by Tencent on 2023/06/09.
  2. // Copyright © 2023 Tencent. All rights reserved.
  3. /**
  4. * This file declares the TUITextMessageCellData class.
  5. * This class inherits from TUIBubbleMessageCellData and is used to store a series of data and information required by the text message unit.
  6. */
  7. #import <TIMCommon/TUIBubbleMessageCellData.h>
  8. #import <TIMCommon/TUIMessageCellData.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. /**
  11. * 【Module name】 TUITextMessageCellData
  12. * 【Function description】The datasource of text message unit.
  13. * - Text message unit, which is the most common message unit in most message sending and receiving situations.
  14. * - The text message unit data source provides a series of required data and information for the text message unit.
  15. */
  16. @interface TUITextMessageCellData : TUIBubbleMessageCellData
  17. /**
  18. * Content of text message
  19. */
  20. @property(nonatomic, strong) NSString *content;
  21. @property(nonatomic, assign) BOOL isAudioCall;
  22. @property(nonatomic, assign) BOOL isVideoCall;
  23. @property(nonatomic, assign) BOOL isCaller;
  24. @property(nonatomic, assign) BOOL showUnreadPoint;
  25. /**
  26. *
  27. * Mutable strings.
  28. * After the text message receives the content string, it is necessary to convert the string expression (such as [smile]) that may exist in the string into a
  29. * picture expression. This string is responsible for storing the converted result of the above process.
  30. *
  31. */
  32. - (NSAttributedString *)getContentAttributedString:(UIFont *)textFont;
  33. /**
  34. *
  35. * Get the display size of content string
  36. */
  37. - (CGSize)getContentAttributedStringSize:(NSAttributedString *)attributeString maxTextSize:(CGSize)maxTextSize;
  38. /**
  39. * NSValue (NSRange) stores the converted string of emoji at the position of attributedString.
  40. * NSAttributedString stores the string before emoji conversion, such as "[呲牙]".
  41. * When the text is selected and copied, it is necessary to find the original string of emoji.
  42. */
  43. @property(nonatomic, strong) NSMutableArray<NSDictionary<NSValue *, NSAttributedString *> *> *emojiLocations;
  44. /**
  45. * The size of the label which displays the text message content.
  46. * Position the text message with the @textOrigin.
  47. */
  48. @property(nonatomic, assign) CGSize textSize;
  49. /**
  50. * The origin of label which displays the text message content.
  51. */
  52. @property(nonatomic, assign) CGPoint textOrigin;
  53. @end
  54. NS_ASSUME_NONNULL_END