TUIConversationCellData.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. // Created by Tencent on 2023/06/09.
  2. // Copyright © 2023 Tencent. All rights reserved.
  3. /**
  4. *
  5. * This file declares the modules used to implement the conversation unit data source.
  6. * The conversation unit data source (hereinafter referred to as the "data source") contains a series of information and data required for the display of the
  7. * conversation unit, which will be described further below. The data source also contains some business logic, such as getting and generating message overview
  8. * (subTitle), updating conversation information (group message or user message update) and other logic.
  9. */
  10. #import <TIMCommon/TIMCommonModel.h>
  11. #import <TIMCommon/TIMDefine.h>
  12. NS_ASSUME_NONNULL_BEGIN
  13. typedef NS_ENUM(NSInteger, TUIConversationOnlineStatus) {
  14. TUIConversationOnlineStatusUnknown = 0,
  15. TUIConversationOnlineStatusOnline = 1,
  16. TUIConversationOnlineStatusOffline = 2,
  17. };
  18. /**
  19. *
  20. *
  21. * 【Module name】Conversation unit data source (TUIConversationCellData)
  22. * 【Function description】Store a series of information and data required by the conversation unit.
  23. * The conversation unit data source contains the following information and data:
  24. * 1. Conversation ID.
  25. * 2. Conversation type.
  26. * 3. Avatar URL and avatar image.
  27. * 4. Conversation title and information overview (subtitle).
  28. * 5. Conversation time (receive/send time of the latest message).
  29. * 6. Conversation unread count.
  30. * 7. Conversation top logo.
  31. * The data source also contains some business logic, such as getting and generating message overview (subTitle), updating conversation information (group
  32. * message or user message update) and other logic.
  33. */
  34. @interface TUIConversationCellData : TUICommonCellData
  35. @property(nonatomic, strong) NSString *conversationID;
  36. @property(nonatomic, strong) NSString *groupID;
  37. @property(nonatomic, strong) NSString *groupType;
  38. @property(nonatomic, strong) NSString *userID;
  39. @property(nonatomic, strong) NSString *title;
  40. @property(nonatomic, strong) NSString *faceUrl;
  41. @property(nonatomic, strong) UIImage *avatarImage;
  42. @property(nonatomic, strong) NSString *draftText;
  43. @property(nonatomic, assign) int unreadCount;
  44. @property (nonatomic, strong) NSString *headdress;//头饰链接
  45. @property (nonatomic, assign) double headgearType;//头饰 - 头饰类型(0=无资源文件,1=动态webp,2=SVGA,3=VAP)
  46. @property (nonatomic, strong) NSAttributedString *nameAttrString; // 头衔元素
  47. @property (nonatomic, assign) CGFloat nameAttWidth;//头衔元素所需要的宽度
  48. /**
  49. * Overview of conversation messages (sub title)
  50. * The overview is responsible for displaying the content/type of the latest message for the corresponding conversation.
  51. * When the latest message is a text message/system message, the content of the overview is the text content of the message
  52. * When the latest message is a multimedia message, the content of the overview is in the corresponding multimedia form, such as: "[Animation Expression]" /
  53. * "[File]" / "[Voice]" / "[Picture]" / "[Video]", etc. If there is a draft in the current conversation, the overview content is: "[Draft]XXXXX", where XXXXX is
  54. * the draft content.
  55. */
  56. @property(nonatomic, strong) NSMutableAttributedString *subTitle;
  57. /**
  58. * Group@ message tips string
  59. */
  60. @property(nonatomic, strong) NSString *atTipsStr;
  61. /**
  62. * Sequence list of group-at message
  63. */
  64. @property(nonatomic, strong) NSMutableArray<NSNumber *> *atMsgSeqs;
  65. /**
  66. *
  67. * The time of the latest message
  68. * Recording the receive/send time of the latest message in the conversation.
  69. */
  70. @property(nonatomic, strong) NSDate *time;
  71. /**
  72. *
  73. * The flag indicating whether the session is pinned
  74. * YES: Conversation is pinned; NO: Conversation not pinned
  75. */
  76. @property(nonatomic, assign) BOOL isOnTop;
  77. /**
  78. *
  79. * Indicates whether to display the message checkbox
  80. * In the conversation list, the message checkbox is not displayed by default.
  81. * In the message forwarding scenario, the list cell is multiplexed to the select conversation page. When the "Multiple Choice" button is clicked, the
  82. * conversation list becomes multi-selectable. YES: Multiple selection is enable, multiple selection views are displayed; NO: Multiple selection is disable, the
  83. * default view is displayed
  84. */
  85. @property(nonatomic, assign) BOOL showCheckBox;
  86. /**
  87. * Indicates whether the current message is disable selected, the default is NO
  88. */
  89. @property(nonatomic, assign) BOOL disableSelected;
  90. /**
  91. * Indicates whether the current message is selected, the default is NO
  92. */
  93. @property(nonatomic, assign) BOOL selected;
  94. /**
  95. * Indicates whether the cell is displayed in lite mode, the default is NO
  96. */
  97. @property(nonatomic, assign) BOOL isLiteMode;
  98. /**
  99. * Whether the current conversation is marked as do-not-disturb for new messages
  100. */
  101. @property(nonatomic, assign) BOOL isNotDisturb;
  102. /**
  103. * key by which to sort the conversation list
  104. */
  105. @property(nonatomic, assign) NSUInteger orderKey;
  106. /**
  107. * conversation group list
  108. */
  109. @property(nonatomic, strong) NSArray *conversationGroupList;
  110. /**
  111. * conversation mark list
  112. */
  113. @property(nonatomic, strong) NSArray *conversationMarkList;
  114. /**
  115. * The user's online status
  116. */
  117. @property(nonatomic, assign) TUIConversationOnlineStatus onlineStatus;
  118. /**
  119. * Conversation Mark - The current conversation is marked as unread
  120. */
  121. @property(nonatomic, assign) BOOL isMarkAsUnread;
  122. /**
  123. * Conversation Mark - The current conversation is marked as hidden
  124. */
  125. @property(nonatomic, assign) BOOL isMarkAsHide;
  126. /**
  127. * Conversation Mark - The current conversation is marked as folded
  128. */
  129. @property(nonatomic, assign) BOOL isMarkAsFolded;
  130. /**
  131. * Conversation Mark - Conversation folded, when there are folded conversations, a folded group will be generated locally to accommodate them, this tag is the
  132. * folded group tag
  133. */
  134. @property(nonatomic, assign) BOOL isLocalConversationFoldList;
  135. /**
  136. * Conversation collapsed subtitle: in the format "group name: last message"
  137. */
  138. @property(nonatomic, strong) NSMutableAttributedString *foldSubTitle;
  139. @property(nonatomic, strong) V2TIMMessage *lastMessage;
  140. @property(nonatomic, strong) V2TIMConversation *innerConversation;
  141. + (BOOL)isMarkedByHideType:(NSArray *)markList;
  142. + (BOOL)isMarkedByUnReadType:(NSArray *)markList;
  143. + (BOOL)isMarkedByFoldType:(NSArray *)markList;
  144. @end
  145. NS_ASSUME_NONNULL_END