TUIChatCallingDataProvider.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. //
  2. // TUIChatCallingDataProvider.h
  3. // TUIChat
  4. //
  5. // Created by harvy on 2022/12/21.
  6. // Copyright © 2023 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <ImSDK_Plus/ImSDK_Plus.h>
  10. @class TUIMessageCellData;
  11. NS_ASSUME_NONNULL_BEGIN
  12. /**
  13. * The protocol type of calls
  14. */
  15. typedef NS_ENUM(NSInteger, TUICallProtocolType) {
  16. TUICallProtocolTypeUnknown = 0,
  17. TUICallProtocolTypeSend = 1,
  18. TUICallProtocolTypeAccept = 2,
  19. TUICallProtocolTypeReject = 3,
  20. TUICallProtocolTypeCancel = 4,
  21. TUICallProtocolTypeHangup = 5,
  22. TUICallProtocolTypeTimeout = 6,
  23. TUICallProtocolTypeLineBusy = 7,
  24. TUICallProtocolTypeSwitchToAudio = 8,
  25. TUICallProtocolTypeSwitchToAudioConfirm = 9,
  26. };
  27. /**
  28. * The stream media type of calls
  29. */
  30. typedef NS_ENUM(NSInteger, TUICallStreamMediaType) {
  31. TUICallStreamMediaTypeUnknown = 0,
  32. TUICallStreamMediaTypeVoice = 1,
  33. TUICallStreamMediaTypeVideo = 2,
  34. };
  35. /**
  36. * The participant style of calls
  37. */
  38. typedef NS_ENUM(NSInteger, TUICallParticipantType) {
  39. TUICallParticipantTypeUnknown = 0,
  40. TUICallParticipantTypeC2C = 1,
  41. TUICallParticipantTypeGroup = 2,
  42. };
  43. /**
  44. * The role of participant
  45. */
  46. typedef NS_ENUM(NSInteger, TUICallParticipantRole) {
  47. TUICallParticipantRoleUnknown = 0,
  48. TUICallParticipantRoleCaller = 1,
  49. TUICallParticipantRoleCallee = 2,
  50. };
  51. /**
  52. * The direction of voice-video-call message
  53. */
  54. typedef NS_ENUM(NSInteger, TUICallMessageDirection) {
  55. TUICallMessageDirectionIncoming = 0,
  56. TUICallMessageDirectionOutgoing = 1,
  57. };
  58. @protocol TUIChatCallingInfoProtocol <NSObject>
  59. /**
  60. * The protocol type of voice-video-call
  61. */
  62. @property(nonatomic, assign, readonly) TUICallProtocolType protocolType;
  63. /**
  64. * The stream media type of voice-video-call
  65. */
  66. @property(nonatomic, assign, readonly) TUICallStreamMediaType streamMediaType;
  67. /**
  68. * The participate type of voice-video-call, one-to-one and group are supported
  69. */
  70. @property(nonatomic, assign, readonly) TUICallParticipantType participantType;
  71. /**
  72. * The participate role type of voice-video-call, caller and callee are supported
  73. */
  74. @property(nonatomic, assign, readonly) TUICallParticipantRole participantRole;
  75. /**
  76. * Exclude from history of chat page,supported in TUIChat 7.1 and later
  77. */
  78. @property(nonatomic, assign, readonly) BOOL excludeFromHistory;
  79. /**
  80. * The display text of voice-video-call message
  81. */
  82. @property(nonatomic, copy, readonly, nonnull) NSString *content;
  83. /**
  84. *
  85. * The display direction of voice-video-call message
  86. */
  87. @property(nonatomic, assign, readonly) TUICallMessageDirection direction;
  88. /**
  89. *
  90. * Whether display unread point in call history
  91. */
  92. @property(nonatomic, assign, readonly) BOOL showUnreadPoint;
  93. /**
  94. * Whether to use the receiver's avatar
  95. */
  96. @property(nonatomic, assign, readonly) BOOL isUseReceiverAvatar;
  97. @property(nonatomic, strong, readonly) NSArray<NSString *> *participantIDList;
  98. @end
  99. /**
  100. * The style of voice-video-call message in TUIChat
  101. */
  102. typedef NS_ENUM(NSInteger, TUIChatCallingMessageAppearance) {
  103. TUIChatCallingMessageAppearanceDetails = 0,
  104. TUIChatCallingMessageAppearanceSimplify = 1,
  105. };
  106. @protocol TUIChatCallingDataProtocol <NSObject>
  107. /**
  108. * Seting styles of voice-video-call message in TUIChat
  109. */
  110. - (void)setCallingMessageStyle:(TUIChatCallingMessageAppearance)style;
  111. /**
  112. * Redial based on the current voice-video-call message (generally used to redial after clicking the call history on the chat page)
  113. */
  114. - (void)redialFromMessage:(V2TIMMessage *)innerMessage;
  115. /**
  116. * Parse voice-video-call message
  117. */
  118. - (BOOL)isCallingMessage:(V2TIMMessage *)innerMessage callingInfo:(id<TUIChatCallingInfoProtocol> __nullable *__nullable)callingInfo;
  119. @end
  120. @interface TUIChatCallingDataProvider : NSObject <TUIChatCallingDataProtocol>
  121. @end
  122. NS_ASSUME_NONNULL_END