// // YOUPAIUCIMP2PSessionVC.h // wolfman // // Created by 张灿 on 2017/6/3. // Copyright © 2017年 shareSmile. All rights reserved. // #import "ZCBaseVC.h" #import "NIMSessionConfig.h" #import "NIMMessageCellProtocol.h" #import "NIMSessionConfigurateProtocol.h" #import "YOUPAINIMInputView.h" #import "YOUPAIUCBaseTouchTableView.h" #import "YOUPAILCGiftAttachment.h" #import "YOUPAILCOneImageAttachment.h" #import "YOUPAILCMultiImageAttachment.h" #import "YOUPAILCMessageTxtAttachment.h" #import "YOUPAILPFollowAttachment.h" @class NIMSessionConfigurator; @interface YOUPAIUCIMP2PSessionVC : UIViewController @property (nonatomic, strong) YOUPAIUCBaseTouchTableView *tableView; @property (nonatomic,strong) YOUPAINIMInputView *sessionInputView; @property (nonatomic, strong) NIMSession *session; @property (nonatomic,weak) id interactor; @property (nonatomic,assign) BOOL disableCommandTyping; @property (nonatomic,strong) NIMSessionConfigurator *configurator; //@property (nonatomic,strong) NSMutableArray *imagesArray; //图片数组 //子类实现右上角头像点击的方法 - (void)youpaifprofileClick; /** * 当前当初的菜单所关联的消息 * * @discussion 在菜单点击方法中,想获取所点的消息,可以调用此接口 */ @property (nonatomic,readonly) NIMMessage *messageForMenu; /** * 初始化方法 * * @param session 所属会话 * * @return 会话页实例 */ - (instancetype)initWithSession:(NIMSession *)session; #pragma mark - 界面 /** * 会话页导航栏标题-这里指对方的名称 */ - (NSString *)youpaifsessionTitle; /** * 刷新导航栏标题-这里指对方的名称 */ - (void)youpaifrefreshNavTitle:(NSString *)title; - (void)youpaifrefreshNavSubTitle:(NSString *)title; //刷新导航栏显示的在线状态 - (void)youpaifrefreshNavOnline:(BOOL)online; /** * 会话页长按消息可以弹出的菜单 * * @param message 长按的消息 * * @return 菜单,为UIMenuItem的数组 */ - (NSArray *)youpaifmenusItems:(NIMMessage *)message; /** * 会话页详细配置 */ - (id)sessionConfig; #pragma mark - 消息接口 /** * 发送消息 * * @param message 消息 */ - (void)sendMessage:(NIMMessage *)message; #pragma mark - 录音接口 /** * 录音失败回调 * * @param error 失败原因 */ - (void)youpaifonRecordFailed:(NSError *)error; /** * 录音内容是否可以被发送 * * @param filepath 录音路径 * * @return 是否允许发送 * * @discussion 在此回调里检查录音时长是否满足要求发送的录音时长 */ - (BOOL)youpaifrecordFileCanBeSend:(NSString *)filepath; /** * 语音不能发送的原因 * * @discussion 可以显示录音时间不满足要求之类的文案 */ - (void)showRecordFileNotSendReason; #pragma mark - 操作接口 /** * 追加一条消息 * * @param messages 消息 * * @discussion 不会比较时间戳,直接加在消息列表末尾。不会触发 DB 操作,,请手动调用 SDK 里 saveMessage:forSession:completion: 接口。 */ - (void)youpaifuiAddMessages:(NSArray *)messages; /** * 插入多条消息 * * @param messages 消息 * * @discussion 会比较时间戳,加在合适的地方,不推荐聊天室这种大消息量场景使用。不会触发 DB 操作,,请手动调用 SDK 里 saveMessage:forSession:completion: 接口。 */ - (void)youpaifuiInsertMessages:(NSArray *)messages; /** * 删除一条消息 * * @param message 消息 * * @return 被删除的 MessageModel * * @discussion 不会触发 DB 操作,请手动调用 SDK 里 deleteMessage: 接口 */ - (NIMMessageModel *)youpaifuiDeleteMessage:(NIMMessage *)message; /** * 更新一条消息 * * @param message 消息 * * @discussion 不会触发 DB 操作,请手动调用 SDK 里 updateMessage:forSession:completion: 接口 */ - (void)youpaifuiUpdateMessage:(NIMMessage *)message; //子类需要调用 - (void)sendMessageReceipt:(NSArray *)messages; - (id)conversationManager; @end