TUIInputController_Minimalist.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. // Created by Tencent on 2023/06/09.
  2. // Copyright © 2023 Tencent. All rights reserved.
  3. /**
  4. * This document declares the relevant components to implement the input area.
  5. * The input area includes the emoticon view input area (TUIFaceView+TUIMoreView), the "more" functional area (TUIMoreView) and the text input area
  6. * (TUIInputBar). This file contains the TUIInputControllerDelegate protocol and the TInputController class. In the input bar (TUIInputBar), button response
  7. * callbacks for expressions, voices, and more views are provided. In this class, the InputBar is actually combined with the above three views to realize the
  8. * display and switching logic of each view.
  9. */
  10. #import <TIMCommon/TUIMessageCell.h>
  11. #import <UIKit/UIKit.h>
  12. #import "TUIChatDefine.h"
  13. #import "TUIFaceView.h"
  14. #import "TUIInputBar_Minimalist.h"
  15. #import "TUIMenuView_Minimalist.h"
  16. #import "TUIReplyPreviewBar_Minimalist.h"
  17. #import "TUIFaceSegementScrollView.h"
  18. @class TUIInputController_Minimalist;
  19. /////////////////////////////////////////////////////////////////////////////////
  20. //
  21. // TUIInputControllerDelegate
  22. //
  23. /////////////////////////////////////////////////////////////////////////////////
  24. @protocol TUIInputControllerDelegate_Minimalist <NSObject>
  25. /**
  26. * Callback when the current InputController height changes.
  27. * You can use this callback to adjust the UI layout of each component in the controller according to the changed height.
  28. */
  29. - (void)inputController:(TUIInputController_Minimalist *)inputController didChangeHeight:(CGFloat)height;
  30. /**
  31. * Callback when the current InputController sends a message.
  32. */
  33. - (void)inputController:(TUIInputController_Minimalist *)inputController didSendMessage:(V2TIMMessage *)msg;
  34. /**
  35. * Callback when the more button in the bottom of input controller was clicked
  36. */
  37. - (void)inputControllerDidSelectMoreButton:(TUIInputController_Minimalist *)inputController;
  38. /**
  39. * Callback when the take-photo button in the bottom of input controller was clicked
  40. */
  41. - (void)inputControllerDidSelectCamera:(TUIInputController_Minimalist *)inputController;
  42. /**
  43. * Callback when @ character is entered
  44. */
  45. - (void)inputControllerDidInputAt:(TUIInputController_Minimalist *)inputController;
  46. /**
  47. * Callback when there are @xxx characters removed
  48. */
  49. - (void)inputController:(TUIInputController_Minimalist *)inputController didDeleteAt:(NSString *)atText;
  50. - (void)inputControllerBeginTyping:(TUIInputController_Minimalist *)inputController;
  51. - (void)inputControllerEndTyping:(TUIInputController_Minimalist *)inputController;
  52. @end
  53. /////////////////////////////////////////////////////////////////////////////////
  54. //
  55. // TUIInputControllerDelegate
  56. //
  57. /////////////////////////////////////////////////////////////////////////////////
  58. @interface TUIInputController_Minimalist : UIViewController
  59. /**
  60. * A preview view above the input box for message reply scenarios
  61. */
  62. @property(nonatomic, strong) TUIReplyPreviewBar_Minimalist *replyPreviewBar;
  63. /**
  64. * The preview view below the input box, with the message reference scene
  65. *
  66. */
  67. @property(nonatomic, strong) TUIReferencePreviewBar_Minimalist *referencePreviewBar;
  68. /**
  69. * Message currently being replied to
  70. */
  71. @property(nonatomic, strong) TUIReplyPreviewData *replyData;
  72. @property(nonatomic, strong) TUIReferencePreviewData *referenceData;
  73. /**
  74. * Input bar
  75. * The input bar contains a series of interactive components such as text input box, voice button, "more" button, emoticon button, etc., and provides
  76. * corresponding callbacks for these components.
  77. */
  78. @property(nonatomic, strong) TUIInputBar_Minimalist *inputBar;
  79. /**
  80. * Emoticon view
  81. * The emoticon view generally appears after clicking the "Smiley" button. Responsible for displaying each expression group and the expressions within the
  82. * group.
  83. *
  84. */
  85. @property(nonatomic, strong) TUIFaceSegementScrollView *faceSegementScrollView;
  86. /**
  87. * Menu view
  88. * The menu view is located below the emoticon view and is responsible for providing the emoticon grouping unit and the send button.
  89. */
  90. @property(nonatomic, strong) TUIMenuView_Minimalist *menuView;
  91. @property(nonatomic, weak) id<TUIInputControllerDelegate_Minimalist> delegate;
  92. /**
  93. * Reset the current input controller.
  94. * If there is currently an emoji view or a "more" view being displayed, collapse the corresponding view and set the current status to Input_Status_Input.
  95. * That is, no matter what state the current InputController is in, reset it to its initialized state.
  96. */
  97. - (void)reset;
  98. /**
  99. * Show/hide preview bar of message reply input box
  100. */
  101. - (void)showReplyPreview:(TUIReplyPreviewData *)data;
  102. - (void)showReferencePreview:(TUIReferencePreviewData *)data;
  103. - (void)exitReplyAndReference:(void (^__nullable)(void))finishedCallback;
  104. /**
  105. * Current input box state
  106. */
  107. @property(nonatomic, assign, readonly) InputStatus status;
  108. @end