TUIConversationConfig.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // TUIConversationConfig.h
  3. // TUIConversation
  4. //
  5. // Created by Tencent on 2024/9/6.
  6. // Copyright © 2024 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @class TUIConversationCellData;
  11. typedef NS_OPTIONS(NSInteger, TUIConversationItemInMoreMenu) {
  12. TUIConversationItemInMoreMenu_None = 0,
  13. TUIConversationItemInMoreMenu_Delete = 1 << 0,
  14. TUIConversationItemInMoreMenu_MarkRead = 1 << 1,
  15. TUIConversationItemInMoreMenu_Hide = 1 << 2,
  16. TUIConversationItemInMoreMenu_Pin = 1 << 1,
  17. TUIConversationItemInMoreMenu_Clear = 1 << 2,
  18. };
  19. @protocol TUIConversationConfigDataSource <NSObject>
  20. @optional
  21. /**
  22. * Implement this method to hide items in more menu.
  23. */
  24. - (TUIConversationItemInMoreMenu)conversationShouldHideItemsInMoreMenu:(TUIConversationCellData *)data;
  25. /**
  26. * Implement this method to add new items.
  27. */
  28. - (NSArray *)conversationShouldAddNewItemsToMoreMenu:(TUIConversationCellData *)data;
  29. @end
  30. @interface TUIConversationConfig : NSObject
  31. + (TUIConversationConfig *)sharedConfig;
  32. /**
  33. * DataSource of more menu.
  34. */
  35. @property (nonatomic, weak) id<TUIConversationConfigDataSource> moreMenuDataSource;
  36. /**
  37. * Background color of conversation list.
  38. */
  39. @property (nonatomic, strong) UIColor *listBackgroundColor;
  40. /**
  41. * Background color of cell in conversation list.
  42. * This configuration takes effect in all cells.
  43. */
  44. @property (nonatomic, strong) UIColor *cellBackgroundColor;
  45. /**
  46. * Background color of pinned cell in conversation list.
  47. * This configuration takes effect in all pinned cells.
  48. */
  49. @property (nonatomic, strong) UIColor *pinnedCellBackgroundColor;
  50. /**
  51. * Font of title label of cell in conversation list.
  52. * This configuration takes effect in all cells.
  53. */
  54. @property (nonatomic, strong) UIFont *cellTitleLabelFont;
  55. /**
  56. * Font of subtitle label of cell in conversation list.
  57. * This configuration takes effect in all cells.
  58. */
  59. @property (nonatomic, strong) UIFont *cellSubtitleLabelFont;
  60. /**
  61. * Font of time label of cell in conversation list.
  62. * This configuration takes effect in all cells.
  63. */
  64. @property (nonatomic, strong) UIFont *cellTimeLabelFont;
  65. /**
  66. * Corner radius of the avatar.
  67. * This configuration takes effect in all avatars.
  68. */
  69. @property(nonatomic, assign) CGFloat avatarCornerRadius;
  70. /**
  71. * Display user's online status icon in conversation and contact list.
  72. * The default value is NO.
  73. */
  74. @property(nonatomic, assign) BOOL showUserOnlineStatusIcon;
  75. /**
  76. * Display unread count icon in each conversation cell.
  77. * The default value is YES.
  78. */
  79. @property(nonatomic, assign) BOOL showCellUnreadCount;
  80. @end
  81. NS_ASSUME_NONNULL_END