TIMElem+ShowDescription.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // TIMElem+ShowDescription.h
  3. // TIMChat
  4. //
  5. // Created by AlexiChen on 16/5/9.
  6. // Copyright © 2016年 AlexiChen. All rights reserved.
  7. //
  8. #import <ImSDK/ImSDK.h>
  9. // 界面上TIMElem显示相关的一些常用方法
  10. // 因最初的版本只支持一个Message里面只有一个单个Elem,增加此套逻辑
  11. // 后因增加富文本逻辑,部份消息(除TimeTip,GroupTip外的)均使用TIMElem
  12. // 可通过IMAMsg的isMultiMsg方法,直接返回No,或修改kTestChatAttachment为0,即可看效果
  13. @class IMAMsg;
  14. @interface TIMElem (ShowDescription)
  15. // 显示描述
  16. - (NSString *)showDescriptionOf:(IMAMsg *)msg;
  17. // 是否是系统表情
  18. - (BOOL)isSystemFace;
  19. @end
  20. @interface TIMTextElem (ShowDescription)
  21. @end
  22. typedef void (^AsyncGetThumbImageBlock)(NSString *path, UIImage *image, BOOL succ, BOOL isAsync);
  23. @interface TIMImageElem (ShowDescription)
  24. - (void)asyncThumbImage:(AsyncGetThumbImageBlock)block inMsg:(IMAMsg *)msg;
  25. // 获取消息的缓存图片
  26. - (UIImage *)getThumbImageInMsg:(IMAMsg *)msg;
  27. @end
  28. @interface TIMFileElem (ShowDescription)
  29. @end
  30. @interface TIMSoundElem (ShowDescription)
  31. @end
  32. @interface TIMFaceElem (ShowDescription)
  33. // 是否是系统表情
  34. - (BOOL)isSystemFace;
  35. @end
  36. @interface TIMLocationElem (ShowDescription)
  37. @end
  38. @interface TIMGroupTipsElem (ShowDescription)
  39. @property (nonatomic, strong) NSString *groupType;
  40. // 群提醒消息
  41. @property (nonatomic, strong) NSString *groupTip;
  42. // 提示的文本
  43. - (NSString *)tipText;
  44. @end
  45. @interface TIMUGCElem (ShowDescription)
  46. @end
  47. @interface TIMCustomElem (ShowDescription)
  48. // 目前聊天界面用的时间戮是用TIMCustomElem
  49. // 将要显示的时间转成Data
  50. - (void)setFollowTime:(NSDate *)date;
  51. // 显示的时间戮
  52. - (NSString *)timeTip;
  53. - (NSString *)revokedTip;
  54. @end
  55. @interface TIMGroupSystemElem (ShowDescription)
  56. @end
  57. @interface TIMSNSSystemElem (ShowDescription)
  58. @end
  59. @interface TIMProfileSystemElem (ShowDescription)
  60. @end