NIMSessionListViewController.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //
  2. // NIMSessionListViewController.h
  3. // NIMKit
  4. //
  5. // Created by NetEase.
  6. // Copyright (c) 2015年 NetEase. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "NIMCellConfig.h"
  10. #import <NIMSDK/NIMSDK.h>
  11. @interface NIMSessionListViewController : UIViewController<UITableViewDataSource,UITableViewDelegate,NIMLoginManagerDelegate,NIMConversationManagerDelegate>
  12. /**
  13. * 会话列表tableView
  14. */
  15. @property (nonatomic,strong) UITableView *tableView;
  16. /// 是否为亲密列表
  17. @property (nonatomic, assign) BOOL isIntimateList;
  18. /**
  19. * 最近会话集合
  20. */
  21. @property (nonatomic,strong) NSMutableArray * recentSessions;
  22. /**
  23. * 删除会话时是不是也同时删除服务器会话 (防止漫游)
  24. */
  25. @property (nonatomic,assign) BOOL autoRemoveRemoteSession;
  26. /**
  27. * 选中某一条最近会话时触发的事件回调
  28. *
  29. * @param recent 最近会话
  30. * @param indexPath 最近会话cell所在的位置
  31. * @discussion 默认将进入会话界面
  32. */
  33. - (void)onSelectedRecent:(NIMRecentSession *)recent
  34. atIndexPath:(NSIndexPath *)indexPath;
  35. /**
  36. * 选中某一条最近会话的头像控件,触发的事件回调
  37. *
  38. * @param recent 最近会话
  39. * @param indexPath 最近会话cell所在的位置
  40. * @discussion 默认将进入会话界面
  41. */
  42. - (void)onSelectedAvatar:(NIMRecentSession *)recent
  43. atIndexPath:(NSIndexPath *)indexPath;
  44. /**
  45. * cell显示的会话名
  46. *
  47. * @param recent 最近会话
  48. *
  49. * @return 会话名
  50. *
  51. * @discussion 默认实现为:点对点会话,显示聊天对象的昵称(没有昵称则显示账号);群聊会话,显示群名称。
  52. */
  53. - (NSString *)nameForRecentSession:(NIMRecentSession *)recent;
  54. /**
  55. * cell显示的最近会话具体内容
  56. *
  57. * @param recent 最近会话
  58. *
  59. * @return 具体内容名
  60. *
  61. * @discussion 默认实现为:显示最近一条消息的内容,文本消息则显示文本信息,其他类型消息详见本类中 - (NSAttributedString *)messageContent:(NIMMessage *)lastMessage 方法的实现。
  62. */
  63. - (NSAttributedString *)contentForRecentSession:(NIMRecentSession *)recent;
  64. /**
  65. * cell显示的最近会话时间戳
  66. *
  67. * @param recent 最近会话
  68. *
  69. * @return 时间戳格式化后的字符串
  70. *
  71. * @discussion 默认实现为:最后一条消息的时间戳,具体时间戳消息格式详见NIMKitUtil中, + (NSString*)showTime:(NSTimeInterval) msglastTime showDetail:(BOOL)showDetail 方法的实现。
  72. */
  73. - (NSString *)timestampDescriptionForRecentSession:(NIMRecentSession *)recent;
  74. /**
  75. * 重新加载所有数据,调用时必须先调用父类方法
  76. */
  77. - (void)refresh;
  78. /**
  79. * 自定义最近会话排序,上层可以重写这个方法对最近会话重新排序
  80. */
  81. - (NSMutableArray *)customSortRecents:(NSMutableArray *)recentSessions;
  82. - (NSString *)messageContent:(NIMMessage*)lastMessage;
  83. /**
  84. * 显示无数据提示
  85. */
  86. - (void)showEmptyView;
  87. - (BOOL)isNotDataSource;
  88. @end