BGBaseChatController.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //
  2. // BGBaseChatController.h
  3. // BuguLive
  4. //
  5. // Created by 朱庆彬 on 2017/8/18.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "ChatBarTextView.h"
  9. #import "ChatBottomBarView.h"
  10. #import "ConversationModel.h"
  11. #import <UIKit/UIKit.h>
  12. #define MorePanH 234
  13. @protocol FWChatVCDelegate <NSObject>
  14. @optional
  15. - (void)faceAndMoreKeyboardBtnClickWith:(BOOL)isFace isNotHaveBothKeyboard:(BOOL)isHave keyBoardHeight:(CGFloat)height;
  16. @end
  17. @interface BGBaseChatController : BGBaseViewController
  18. {
  19. UITextField *_coinTextField;
  20. }
  21. @property (assign, nonatomic) id<FWChatVCDelegate> delegate;
  22. @property (weak, nonatomic) UIView *mtopview;
  23. @property (weak, nonatomic) UITableView *mtableview;
  24. @property (nonatomic, weak) ChatBottomBarView *chatBar;
  25. @property (nonatomic, assign) BOOL mbhalf; //只有一半的情况
  26. @property (nonatomic, assign) BOOL haveLiveExist; //当前有直播。关闭键盘中的相机
  27. @property (nonatomic, strong) NSMutableArray *userMsgArray; //用于保存最新消息
  28. @property (nonatomic, strong) NSDictionary *dic; //用于保存对方id和头像
  29. @property (strong, nonatomic) UIButton *maskBtn;
  30. @property (nonatomic, strong) NSString *userID;
  31. //下面的东西用于继承者用...
  32. //消息数据
  33. #pragma mark 注意消息顺序
  34. //整个代码 所有消息顺序都是 按照时间排序 0---> 9
  35. //这玩意一般不要去动,,,,
  36. @property (nonatomic, strong) NSMutableArray *mmsgdata;
  37. //顶部的显示
  38. @property (strong, nonatomic) UILabel *mtoptitle;
  39. //不要一进入界面就自动加载
  40. @property (nonatomic, assign) BOOL mDontAutoLoadFrist; //默认 NO ,就是要加载的意思
  41. @property(nonatomic, copy) void (^clickBGBlock)(BOOL isRefresh);
  42. //加载之前的消息
  43. - (void)headerStartRefresh;
  44. //加载之后的消息
  45. - (void)footerStartRefresh;
  46. - (void)clickedtophead:(UIButton *)sender;
  47. #pragma mark 继承主要看这里开始
  48. @property (nonatomic, strong) UIView *mGiftView; //234的高度
  49. @property (nonatomic, strong) UIView *mrechargeView; //充值view
  50. @property (nonatomic, assign) BOOL mCannotLoadHistoryMsg; //不能加载历史消息,就没有顶部的刷新,
  51. @property (nonatomic, assign) BOOL mCannotLoadNewestMsg; //不能加载最新消息,就是没有底部的刷新,
  52. //获取 msg 之前的消息,,,子类实现
  53. - (void)getMsgBefor:(ConversationModel *)msg block:(void (^)(NSArray *all))block;
  54. //获取 msg 之后的消息,,子类实现
  55. - (void)getMsgAfter:(ConversationModel *)msg block:(void (^)(NSArray *all))block;
  56. //这几个 will 函数,自己实现了,,发送消息 ..异步发送开始就 addOneMsg ,,,然后 异步发送动作完成就 didSendThisMsg 调用这个
  57. //将要发送一个文字了,,,,..子类实现了
  58. - (void)willSendThisText:(NSString *)txt;
  59. //将要发送图片 ,,,,..子类实现了
  60. - (void)willSendThisImg:(UIImage *)img;
  61. //将要发送一个语音...,,
  62. - (void)willSendThisVoice:(NSURL *)voicepath duration:(NSTimeInterval)duration;
  63. //发送完成,,当异步发送完成之后,调用该函数
  64. - (void)didSendThisMsg:(ConversationModel *)msg;
  65. //重新发送
  66. - (void)willReSendThisMsg:(ConversationModel *)msg;
  67. //添加条消息到后面
  68. - (void)addOneMsg:(ConversationModel *)sendMsg;
  69. //删除一条消息
  70. - (void)delOneMsg:(ConversationModel *)delMsg;
  71. //更新一条消息
  72. - (void)updateOneMsg:(ConversationModel *)updMsg;
  73. //想要填充消息数据,比如,语音下载,图片下载,这种需要子类自己管理下载数据的问题
  74. //如果不实现 会自动调用 [msg fetchMsgData],,,子类如果继承了 ZWMsgObj 也可以实现 ZWMsgObj fetchMsgData,,
  75. - (void)wantFetchMsg:(ConversationModel *)msg block:(void (^)(NSString *errmsg, ConversationModel *msg))block;
  76. //失败按钮点击了
  77. - (void)failedIconTouched:(NSIndexPath *)indexPath iconhiden:(BOOL)iconhiden;
  78. //消息点击了
  79. - (void)msgClicked:(ConversationModel *)msgobj;
  80. //赠送金币
  81. - (void)sendCoin;
  82. - (void)sendDiamonds;
  83. - (void)clickedfacemore:(BOOL)bface;
  84. #pragma mark 继承主要看这里结束
  85. @end