WFCUChatInputBar.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //
  2. // ChatInputBar.h
  3. // WFChat UIKit
  4. //
  5. // Created by WF Chat on 2017/10/28.
  6. // Copyright © 2017年 WildFireChat. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <CoreLocation/CoreLocation.h>
  10. #import <WFChatClient/WFCChatClient.h>
  11. #define CHAT_INPUT_BAR_HEIGHT 48
  12. #define TYPING_INTERVAL 10
  13. @interface WFCUMetionInfo : NSObject
  14. - (instancetype)initWithType:(int)type target:(NSString *)target range:(NSRange)range;
  15. @property (nonatomic, assign)NSRange range;
  16. //提醒类型,1,提醒部分对象(mentinedTarget)。2,提醒全部。其他不提醒
  17. @property (nonatomic, assign)int mentionType;
  18. @property (nonatomic, strong)NSString *target;
  19. @end
  20. //@interface TextInfo : NSObject
  21. //@property (nonatomic, strong)NSString *text;
  22. //@property (nonatomic, strong)NSMutableArray<MetionInfo *> *mentionInfos;
  23. //@end
  24. @protocol WFCUChatInputBarDelegate <NSObject>
  25. @optional
  26. - (void)didTouchSend:(NSString *)stringContent withMentionInfos:(NSMutableArray<WFCUMetionInfo *> *)mentionInfos withQuoteInfo:(WFCCQuoteInfo *)quoteInfo;
  27. - (void)recordDidBegin;
  28. - (void)recordDidCancel;
  29. - (void)recordDidEnd:(NSString *)dataUri duration:(long)duration error:(NSError *)error;
  30. - (void)imageDidCapture:(UIImage *)image fullImage:(BOOL)fullImage;
  31. - (void)videoDidCapture:(NSString *) videoPath thumbnail:(UIImage *)image duration:(long)duration;
  32. - (void)sightDidFinishRecord:(NSString*)url thumbnail:(UIImage*)image duration:(NSUInteger)duration;
  33. - (void)locationDidSelect:(CLLocationCoordinate2D)location locationName:(NSString *)locationName mapScreenShot:(UIImage *)mapScreenShot;
  34. - (void)imageDataDidSelect:(NSArray<UIImage *> *)selectedImages isFullImage:(BOOL)fullImage;
  35. - (void)didTapChannelMenu:(WFCCChannelMenu *)channelMenu;
  36. - (void)didSelectFiles:(NSArray *)files;
  37. #if WFCU_SUPPORT_VOIP
  38. - (void)didTouchVideoBtn:(BOOL)isAudioOnly;
  39. #endif
  40. - (void)didSelectSticker:(NSString *)stickerPath;
  41. - (void)willChangeFrame:(CGRect)newFrame withDuration:(CGFloat)duration keyboardShowing:(BOOL)keyboardShowing;
  42. - (UINavigationController *)requireNavi;
  43. - (void)onTyping:(WFCCTypingType)type;
  44. - (void)needSaveDraft;
  45. @optional
  46. - (void)gifDidCapture:(NSData *)gifData;
  47. @end
  48. typedef NS_ENUM(NSInteger, ChatInputBarStatus) {
  49. ChatInputBarDefaultStatus = 0,
  50. ChatInputBarKeyboardStatus,
  51. ChatInputBarPluginStatus,
  52. ChatInputBarEmojiStatus,
  53. ChatInputBarRecordStatus,
  54. ChatInputBarPublicStatus,
  55. ChatInputBarMuteStatus,
  56. #ifdef WFC_PTT
  57. ChatInputBarPttStatus
  58. #endif
  59. };
  60. @class WFCCConversation;
  61. @interface WFCUChatInputBar : UIView
  62. - (instancetype)initWithSuperView:(UIView *)parentView conversation:(WFCCConversation *)conversation delegate:(id<WFCUChatInputBarDelegate>)delegate;
  63. @property(nonatomic, assign)ChatInputBarStatus inputBarStatus;
  64. - (void)resetInputBarStatue;
  65. @property(nonatomic, strong)NSString *draft;
  66. - (BOOL)appendMention:(NSString *)userId name:(NSString *)userName;
  67. - (BOOL)appendQuote:(WFCCMessage *)message;
  68. - (void)paste:(id)sender;
  69. - (void)willAppear;
  70. - (void)appendText:(NSString *)text;
  71. - (NSString *)getDraftText:(NSString *)draft;
  72. - (void)resetTyping;
  73. @end