JXBaseChatCell.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. //
  2. // JXBaseChatCell.h
  3. // shiku_im
  4. //
  5. // Created by Apple on 16/10/11.
  6. // Copyright © 2016年 Reese. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "JXConnection.h"
  10. #import "JXMessageObject.h"
  11. #import "QBPopupMenuItem.h"
  12. #import "QBPlasticPopupMenu.h"
  13. #import "QCheckBox.h"
  14. @class JXEmoji;
  15. @class JXImageView;
  16. @class JXLabel;
  17. @class SCGIFImageView;
  18. @class JXBaseChatCell;
  19. @class FLAnimatedImageView;
  20. #define kSystemImageCellWidth (JX_SCREEN_WIDTH - 15 * 2 - CHAT_WIDTH_ICON-HEAD_SIZE)
  21. typedef enum : NSUInteger {
  22. CollectTypeDefult = 0,// 默认
  23. CollectTypeEmoji = 6,//表情
  24. CollectTypeImage = 1,//图片
  25. CollectTypeVideo = 2,//视频
  26. CollectTypeFile = 3,//文件
  27. CollectTypeVoice = 4,//语音
  28. CollectTypeText = 5,//文本
  29. } CollectType;
  30. @protocol JXChatCellDelegate <NSObject>
  31. // 长按复制
  32. - (void)chatCell:(JXBaseChatCell *)chatCell myCopyIndexNum:(int)indexNum;
  33. // 长按回复
  34. - (void)chatCell:(JXBaseChatCell *)chatCell replyIndexNum:(int)indexNum;
  35. // 长按删除
  36. - (void)chatCell:(JXBaseChatCell *)chatCell deleteIndexNum:(int)indexNum;
  37. // 长按转发
  38. - (void)chatCell:(JXBaseChatCell *)chatCell RelayIndexNum:(int)indexNum;
  39. // 长按收藏
  40. - (void)chatCell:(JXBaseChatCell *)chatCell favoritIndexNum:(int)indexNum type:(CollectType)collectType;
  41. // 长按撤回
  42. - (void)chatCell:(JXBaseChatCell *)chatCell withdrawIndexNum:(int)indexNum;
  43. // 开启、关闭多选
  44. - (void)chatCell:(JXBaseChatCell *)chatCell selectMoreIndexNum:(int)indexNum;
  45. // 多选,选择
  46. - (void)chatCell:(JXBaseChatCell *)chatCell checkBoxSelectIndexNum:(int)indexNum isSelect:(BOOL)isSelect;
  47. // 开始录制
  48. - (void)chatCell:(JXBaseChatCell *)chatCell startRecordIndexNum:(int)indexNum;
  49. // 结束录制
  50. - (void)chatCell:(JXBaseChatCell *)chatCell stopRecordIndexNum:(int)indexNum;
  51. // 重发消息
  52. - (void)chatCell:(JXBaseChatCell *)chatCell resendIndexNum:(int)indexNum;
  53. // 语音播放转换
  54. - (void)chatCell:(JXBaseChatCell *)chatCell audioPlayChangeIndexNum:(int)indexNum;
  55. // 语音播放转换
  56. - (void)chatCellHeadIMG:(JXMessageObject *)msgCell audioPlayChangeIndexNum:(NSInteger )indexNum;
  57. // 获取录制状态
  58. - (BOOL) getRecording;
  59. // 获取开始录制num
  60. - (NSInteger) getRecordStarNum;
  61. @end
  62. @interface JXBaseChatCell : UITableViewCell<LXActionSheetDelegate>
  63. @property (nonatomic,strong) UIImageView *bubbleBgImageView;
  64. @property (nonatomic,strong) UIButton * bubbleBg;
  65. @property (nonatomic,strong) UIButton * readImage;
  66. @property (nonatomic,strong) UILabel* tempChatL;
  67. @property (nonatomic,strong) JXImageView * burnImage;
  68. @property (nonatomic,strong) JXImageView * sendFailed;
  69. @property (nonatomic,strong) JXLabel * readView;
  70. @property (nonatomic,strong) JXLabel * readNum;
  71. @property (nonatomic,strong) UIActivityIndicatorView * wait;
  72. @property (nonatomic,strong) JXMessageObject * msg22;
  73. @property (nonatomic,strong) JXMessageObject * msg;
  74. @property (nonatomic,strong) UIImageView * headImage;
  75. @property (nonatomic,strong) UIImageView * cerImgView; // 认证图标
  76. @property (nonatomic,strong) UILabel* timeLabel;
  77. @property (nonatomic,strong) UILabel *nicknameLabel;
  78. @property (nonatomic,strong) UIImageView *gradeIcon; //群成员等级图标
  79. @property (nonatomic,strong) UIImageView *chujiIMG; //群成员等级图标
  80. @property (nonatomic,strong) UILabel *groupNameLabel; //群头衔
  81. @property (nonatomic,assign) BOOL isOpenIntegral; //是否开启群头衔
  82. @property (nonatomic,assign) SEL didTouch;
  83. @property (nonatomic,assign) int indexNum;
  84. @property (nonatomic, strong) QBPlasticPopupMenu *plasticPopupMenu;
  85. @property (nonatomic, strong) QBPopupMenu *popupMenu;
  86. @property (nonatomic, weak) id<JXChatCellDelegate>chatCellDelegate;
  87. @property (nonatomic, weak) NSObject* delegate;
  88. @property (nonatomic, assign) SEL readDele;
  89. @property (nonatomic, assign) BOOL isCourse;
  90. @property (nonatomic, assign) BOOL isShowRecordCourse;
  91. @property (nonatomic, assign) BOOL isShowHead;
  92. @property (nonatomic, assign) BOOL isWithdraw; // 是否显示撤回
  93. @property (nonatomic, assign) BOOL isSelectMore;
  94. @property (nonatomic, strong) QCheckBox *checkBox;
  95. @property (nonatomic, strong) roomData *room;
  96. @property (nonatomic, strong) NSArray *groupLevelNameArray;
  97. @property (nonatomic, assign) double loadProgress;
  98. @property (nonatomic, strong) NSString *fileDict;
  99. -(void)creatUI;
  100. -(void)drawIsRead;
  101. -(void)drawIsSend;
  102. -(void)drawIsReceive;
  103. - (void)drawReadPersons:(int)num;
  104. - (void)setBackgroundImage;
  105. - (void)setCellData;
  106. -(void)setHeaderImage;
  107. -(void)isShowSendTime;
  108. //-(void)downloadFile:(JXImageView*)iv;
  109. - (void)setMaskLayer:(UIImageView *)imageView;
  110. - (void)sendMessageToUser;
  111. - (void)setAgreeRefuseBtnStatusAfterReply; //回应交换电话后更新按钮状态(子类实现)
  112. - (void)updateFileLoadProgress;
  113. // 获取cell 高度
  114. + (float) getChatCellHeight:(JXMessageObject *)msg;
  115. - (void)drawReadDelView:(BOOL)isSelected;
  116. - (void)encodeWithCoder:(nonnull NSCoder *)coder;
  117. + (nonnull instancetype)appearance;
  118. + (nonnull instancetype)appearanceForTraitCollection:(nonnull UITraitCollection *)trait;
  119. + (nonnull instancetype)appearanceForTraitCollection:(nonnull UITraitCollection *)trait whenContainedIn:(nullable Class<UIAppearanceContainer>)ContainerClass, ...;
  120. + (nonnull instancetype)appearanceWhenContainedIn:(nullable Class<UIAppearanceContainer>)ContainerClass, ...;
  121. - (void)traitCollectionDidChange:(nullable UITraitCollection *)previousTraitCollection;
  122. - (CGPoint)convertPoint:(CGPoint)point fromCoordinateSpace:(nonnull id<UICoordinateSpace>)coordinateSpace;
  123. - (CGPoint)convertPoint:(CGPoint)point toCoordinateSpace:(nonnull id<UICoordinateSpace>)coordinateSpace;
  124. - (CGRect)convertRect:(CGRect)rect fromCoordinateSpace:(nonnull id<UICoordinateSpace>)coordinateSpace;
  125. - (CGRect)convertRect:(CGRect)rect toCoordinateSpace:(nonnull id<UICoordinateSpace>)coordinateSpace;
  126. - (void)didUpdateFocusInContext:(nonnull UIFocusUpdateContext *)context withAnimationCoordinator:(nonnull UIFocusAnimationCoordinator *)coordinator;
  127. - (void)setNeedsFocusUpdate;
  128. - (BOOL)shouldUpdateFocusInContext:(nonnull UIFocusUpdateContext *)context;
  129. - (void)updateFocusIfNeeded;
  130. - (nonnull NSArray<id<UIFocusItem>> *)focusItemsInRect:(CGRect)rect;
  131. @end