EMSilentModeParam.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. //
  2. // EMSilentModeParam.h
  3. // HyphenateChat
  4. //
  5. // Created by hxq on 2022/3/30.
  6. // Copyright © 2022 easemob.com. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "EMSilentModeTime.h"
  10. /**
  11. * \~chinese
  12. * 免打扰设置的参数类型。
  13. *
  14. * \~english
  15. * Parameter type to no-disturbing mode.
  16. */
  17. typedef NS_ENUM(NSInteger, EMSilentModeParamType) {
  18. EMSilentModeParamTypeRemindType = 0 , /*!
  19. * \~chinese
  20. * 设置消息提醒类型
  21. *
  22. * \~english
  23. * Set push remind type, Single chat not support.
  24. */
  25. EMSilentModeParamTypeDuration , /*!
  26. * \~chinese
  27. * 设置免打扰时间值。
  28. *
  29. * \~english
  30. * Set silent message duraation.
  31. *
  32. */
  33. EMSilentModeParamTypeInterval,/*!
  34. * \~chinese
  35. * 设置免打扰时间段 仅全局设置有效。
  36. *
  37. * \~english
  38. * Set silent message time Interval.
  39. *
  40. */
  41. };
  42. /**
  43. * \~chinese
  44. * 离线推送的提醒类型。
  45. *
  46. * \~english
  47. * The remind type of push message.
  48. */
  49. typedef NS_ENUM(NSInteger, EMPushRemindType) {
  50. EMPushRemindTypeAll , /*!
  51. * \~chinese
  52. * 所有消息都提醒。
  53. *
  54. * \~english
  55. * All messages are remind.
  56. */
  57. EMPushRemindTypeMentionOnly,/*!
  58. * \~chinese
  59. * 只有@我的消息才提醒。
  60. *
  61. * \~english
  62. * Only @me messages are remind.
  63. */
  64. EMPushRemindTypeNone,/*!
  65. * \~chinese
  66. * 所有消息都不提醒。
  67. *
  68. * \~english
  69. * All messages are not remind.
  70. */
  71. } ;
  72. /**
  73. * \~chinese
  74. * 消息免打扰设置的参数设置类
  75. *
  76. * \~english
  77. * The silent message params object
  78. */
  79. @interface EMSilentModeParam : NSObject
  80. /**
  81. * \~chinese
  82. * 消息免打扰设置的参数类型。
  83. *
  84. * 如果parmType 为EMSilentModeParamTypeRemindType时,只需设置remindType这个参数。
  85. * 如果parmType 为EMSilentModeParamTypeDuration时,只需设置silentModeDuration这个参数。
  86. * 如果parmType 为EMSilentModeParamTypeInterval时,只需设置silentModeStartTime和silentModeEndTime这两个参数。这两个参数的hours和minutes都为0时候表明关闭时间段设置
  87. *
  88. * \~english
  89. * Parameter type for silent messages.
  90. *
  91. * If parmType is EMSilentModeParamTypeRemindType,only the remindType parameter is set.
  92. * If parmType is EMSilentModeParamTypeDuration,only the silentModeDuration parameter is set.
  93. * If parmType is EMSilentModeParamTypeInterval,only the silentModeStartTime and silentModeEndTime parameters are set.
  94. */
  95. @property (nonatomic, assign, readonly) EMSilentModeParamType paramType;
  96. /**
  97. * \~chinese
  98. * 消息免打扰时长(单位分钟)。
  99. * 为0表示关闭消息免打扰,最长只能设置7*24*60分钟。返回的是过期时间戳,关闭时候返回0。
  100. *
  101. * \~english
  102. * The duration for silent messages (in minute).
  103. * A value of 0 indicates that silent messages is disabled,A maximum of 7 x 24 x 60 minutes can be set.An expiration timestamp is returned, disabled return 0.
  104. */
  105. @property (nonatomic, assign) int silentModeDuration;
  106. /**
  107. * \~chinese
  108. * 离线推送提醒类型。
  109. *
  110. * \~english
  111. * The remind type for push messages.
  112. */
  113. @property (nonatomic, assign) EMPushRemindType remindType;
  114. /**
  115. * \~chinese
  116. * 消息免打扰时段的开始时间。
  117. *
  118. * 注意:开始时间和结束时间必须都有才可以设置。当开始时间和结束时间的hours和minutes都为0时候表示关闭免打扰时间段
  119. *
  120. * \~english
  121. * The start time of interval type for silent messages.
  122. *
  123. * Note: The start time and end time must be both specified.
  124. *
  125. */
  126. @property (nonatomic, strong) EMSilentModeTime *_Nullable silentModeStartTime;
  127. /**
  128. * \~chinese
  129. * 消息免打扰时段的结束时间。
  130. *
  131. * 注意:开始时间和结束时间必须都有才可以设置。
  132. *
  133. * \~english
  134. * The end time of interval type for silent messages.
  135. *
  136. * Note: The start time and end time must be both specified.
  137. *
  138. */
  139. @property (nonatomic, strong) EMSilentModeTime *_Nullable silentModeEndTime;
  140. - (instancetype _Nonnull)initWithParamType:(EMSilentModeParamType)aParamType;
  141. @end