TUIChatPopMenu.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // TUIChatPopMenu.h
  3. // TUIChat
  4. //
  5. // Created by harvy on 2021/11/30.
  6. // Copyright © 2023 Tencent. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "TUIChatConfig.h"
  10. #import "TUIChatPopMenuDefine.h"
  11. #import <TIMCommon/TUIMessageCellData.h>
  12. #import <TIMCommon/TUIMessageCell.h>
  13. NS_ASSUME_NONNULL_BEGIN
  14. typedef void (^TUIChatPopMenuActionCallback)(void);
  15. @interface TUIChatPopMenuAction : NSObject
  16. @property(nonatomic, copy) NSString *title;
  17. @property(nonatomic, strong) UIImage *image;
  18. @property(nonatomic, copy) TUIChatPopMenuActionCallback callback;
  19. /**
  20. * The higher the weight, the more prominent it is: audioPlayback 11000 Copy 10000, Forward 9000, Multiple Choice 8000, Quote 7000, Reply 5000, Withdraw 4000, Delete 3000.
  21. */
  22. @property(nonatomic, assign) NSInteger weight;
  23. - (instancetype)initWithTitle:(NSString *)title image:(UIImage *)image weight:(NSInteger)weight callback:(TUIChatPopMenuActionCallback)callback;
  24. @end
  25. typedef void (^TUIChatPopMenuHideCallback)(void);
  26. @interface TUIChatPopMenu : UIView
  27. @property(nonatomic, copy) TUIChatPopMenuHideCallback hideCallback;
  28. @property(nonatomic, copy) void (^reactClickCallback)(NSString *faceName);
  29. @property(nonatomic, weak) TUIMessageCellData *targetCellData;
  30. @property(nonatomic, weak) TUIMessageCell *targetCell;
  31. /**
  32. * TUIChatPopMenu has no emojiView by default. If you need a chatPopMenu with emojiView, use this initializer.
  33. */
  34. - (instancetype)initWithEmojiView:(BOOL)hasEmojiView frame:(CGRect)frame;
  35. @property(nonatomic, strong, readonly) UIView *emojiContainerView;
  36. @property(nonatomic, strong, readonly) UIView *containerView;
  37. - (void)addAction:(TUIChatPopMenuAction *)action;
  38. - (void)removeAllAction;
  39. - (void)setArrawPosition:(CGPoint)point adjustHeight:(CGFloat)adjustHeight;
  40. - (void)showInView:(UIView *__nullable)window;
  41. - (void)layoutSubview;
  42. - (void)hideWithAnimation;
  43. @end
  44. NS_ASSUME_NONNULL_END