NIMKitConfig.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. //
  2. // NIMKitConfig.h
  3. // NIMKit
  4. //
  5. // Created by chris on 2017/10/25.
  6. // Copyright © 2017年 NetEase. All rights reserved.
  7. //
  8. #import "NIMKitSetting.h"
  9. @class NIMKitSettings;
  10. @class NIMMessage;
  11. typedef NS_ENUM(NSInteger,NIMKitAvatarType) {
  12. /*矩形直角头像*/
  13. NIMKitAvatarTypeNone,
  14. /*圆形头像*/
  15. NIMKitAvatarTypeRounded,
  16. /*圆角头像*/
  17. NIMKitAvatarTypeRadiusCorner,
  18. };
  19. @interface NIMKitConfig : NSObject
  20. /*全局设置*/
  21. /**
  22. * 每隔多久显示一条消息
  23. */
  24. @property (nonatomic, assign) NSTimeInterval messageInterval;
  25. /**
  26. * 每次抓取的消息个数
  27. */
  28. @property (nonatomic, assign) NSInteger messageLimit;
  29. /**
  30. * 录音的最大时长
  31. */
  32. @property (nonatomic, assign) NSTimeInterval recordMaxDuration;
  33. /**
  34. * 输入框的占位符
  35. */
  36. @property (nonatomic, copy) NSString *placeholder;
  37. /**
  38. * 输入框能容纳的最大字符长度
  39. */
  40. @property (nonatomic, assign) NSInteger inputMaxLength;
  41. /**
  42. * cell 的背景色
  43. */
  44. @property (nonatomic, strong) UIColor *cellBackgroundColor;
  45. /**
  46. * 头像类型
  47. */
  48. @property (nonatomic, assign) NIMKitAvatarType avatarType;
  49. /**
  50. * 昵称字体
  51. */
  52. @property (nonatomic, strong) UIFont *nickFont;
  53. /**
  54. * 已读回执字体
  55. */
  56. @property (nonatomic, strong) UIFont *receiptFont;
  57. /**
  58. * 昵称颜色
  59. */
  60. @property (nonatomic, strong) UIColor *nickColor;
  61. /**
  62. * 已读回执颜色
  63. */
  64. @property (nonatomic, strong) UIColor *receiptColor;
  65. /**
  66. * 送达回执字体
  67. */
  68. @property (nonatomic, strong) UIFont *sendSuccessFont;
  69. /**
  70. * 送达回执颜色
  71. */
  72. @property (nonatomic, strong) UIColor *sendSuccessColor;
  73. /**
  74. * 发送失败回执字体
  75. */
  76. @property (nonatomic, strong) UIFont *sendFailFont;
  77. /**
  78. * 发送失败回执颜色
  79. */
  80. @property (nonatomic, strong) UIColor *sendFailColor;
  81. /**
  82. * 左侧气泡设置
  83. */
  84. @property (nonatomic, strong) NIMKitSettings *leftBubbleSettings;
  85. /**
  86. * 右侧气泡设置
  87. */
  88. @property (nonatomic, strong) NIMKitSettings *rightBubbleSettings;
  89. /*默认内置配置*/
  90. - (NSArray *)defaultMediaItems;
  91. - (CGFloat)maxNotificationTipPadding;
  92. /*根据消息取到配置*/
  93. - (NIMKitSetting *)setting:(NIMMessage *)message;
  94. @end
  95. /**
  96. * 组件 UI 设置
  97. */
  98. @interface NIMKitSettings : NSObject
  99. /**
  100. * 文本类型消息设置
  101. */
  102. @property (nonatomic, strong) NIMKitSetting *textSetting;
  103. /**
  104. * 音频类型消息设置
  105. */
  106. @property (nonatomic, strong) NIMKitSetting *audioSetting;
  107. /**
  108. * 视频类型消息设置
  109. */
  110. @property (nonatomic, strong) NIMKitSetting *videoSetting;
  111. /**
  112. * 文件类型消息设置
  113. */
  114. @property (nonatomic, strong) NIMKitSetting *fileSetting;
  115. /**
  116. * 图片类型消息设置
  117. */
  118. @property (nonatomic, strong) NIMKitSetting *imageSetting;
  119. /**
  120. * 地理位置类型消息设置
  121. */
  122. @property (nonatomic, strong) NIMKitSetting *locationSetting;
  123. /**
  124. * 提示类型消息设置
  125. */
  126. @property (nonatomic, strong) NIMKitSetting *tipSetting;
  127. /**
  128. * 机器人类型消息设置
  129. */
  130. @property (nonatomic, strong) NIMKitSetting *robotSetting;
  131. /**
  132. * 无法识别类型消息设置
  133. */
  134. @property (nonatomic, strong) NIMKitSetting *unsupportSetting;
  135. /**
  136. * 群组通知类型通知消息设置
  137. */
  138. @property (nonatomic, strong) NIMKitSetting *teamNotificationSetting;
  139. /**
  140. * 聊天室类型类型通知消息设置
  141. */
  142. @property (nonatomic, strong) NIMKitSetting *chatroomNotificationSetting;
  143. /**
  144. * 网络电话类型类型通知消息设置
  145. */
  146. @property (nonatomic, strong) NIMKitSetting *netcallNotificationSetting;
  147. @end