NIMCellConfig.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // NIMCellConfig.h
  3. // NIMKit
  4. //
  5. // Created by chris.
  6. // Copyright (c) 2015年 NetEase. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class NIMSessionMessageContentView;
  10. @class NIMMessageModel;
  11. @protocol NIMCellLayoutConfig <NSObject>
  12. @optional
  13. /**
  14. * @return 返回message的内容大小
  15. */
  16. - (CGSize)contentSize:(NIMMessageModel *)model cellWidth:(CGFloat)width;
  17. /**
  18. * 需要构造的cellContent类名
  19. */
  20. - (NSString *)cellContent:(NIMMessageModel *)model;
  21. /**
  22. * 左对齐的气泡,cell气泡距离整个cell的内间距
  23. */
  24. - (UIEdgeInsets)cellInsets:(NIMMessageModel *)model;
  25. /**
  26. * 左对齐的气泡,cell内容距离气泡的内间距,
  27. */
  28. - (UIEdgeInsets)contentViewInsets:(NIMMessageModel *)model;
  29. /**
  30. * 是否显示头像
  31. */
  32. - (BOOL)shouldShowAvatar:(NIMMessageModel *)model;
  33. /**
  34. * 左对齐的气泡,头像控件的 origin 点
  35. */
  36. - (CGPoint)avatarMargin:(NIMMessageModel *)model;
  37. /**
  38. * 左对齐的气泡,头像控件的 size
  39. */
  40. - (CGSize)avatarSize:(NIMMessageModel *)model;
  41. /**
  42. * 是否显示姓名
  43. */
  44. - (BOOL)shouldShowNickName:(NIMMessageModel *)model;
  45. /**
  46. * 左对齐的气泡,昵称控件的 origin 点
  47. */
  48. - (CGPoint)nickNameMargin:(NIMMessageModel *)model;
  49. /**
  50. * 消息显示在左边
  51. */
  52. - (BOOL)shouldShowLeft:(NIMMessageModel *)model;
  53. /**
  54. * 需要添加到Cell上的自定义视图
  55. */
  56. - (NSArray *)customViews:(NIMMessageModel *)model;
  57. /**
  58. * 是否开启重试叹号开关
  59. */
  60. - (BOOL)disableRetryButton:(NIMMessageModel *)model;
  61. @end