IMessageModel.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /************************************************************
  2. * * Hyphenate CONFIDENTIAL
  3. * __________________
  4. * Copyright (C) 2016 Hyphenate Inc. All rights reserved.
  5. *
  6. * NOTICE: All information contained herein is, and remains
  7. * the property of Hyphenate Inc.
  8. * Dissemination of this information or reproduction of this material
  9. * is strictly forbidden unless prior written permission is obtained
  10. * from Hyphenate Inc.
  11. */
  12. #import <UIKit/UIKit.h>
  13. #import <Foundation/Foundation.h>
  14. //#if ENABLE_LITE == 1
  15. #import <HyphenateLite/HyphenateLite.h>
  16. //#else
  17. //#import <Hyphenate/Hyphenate.h>
  18. //#endif
  19. @class EMMessage;
  20. /** @brief 消息模型协议 */
  21. @protocol IMessageModel <NSObject>
  22. /** @brief 消息cell的高度 */
  23. @property (nonatomic) CGFloat cellHeight;
  24. /** @brief 消息对象 */
  25. @property (strong, nonatomic, readonly) EMMessage *message;
  26. /** @brief 消息id */
  27. @property (strong, nonatomic, readonly) NSString *messageId;
  28. /** @brief 消息发送状态 */
  29. @property (nonatomic, readonly) EMMessageStatus messageStatus;
  30. /** @brief 消息体类型 */
  31. @property (nonatomic, readonly) EMMessageBodyType bodyType;
  32. /** @brief 消息是否已读 */
  33. @property (nonatomic) BOOL isMessageRead;
  34. /** @brief 当前登录用户是否为消息的发送方 */
  35. @property (nonatomic) BOOL isSender;
  36. /** @brief 消息发送方的昵称 */
  37. @property (strong, nonatomic) NSString *nickname;
  38. /** @brief 消息发送方的头像url */
  39. @property (strong, nonatomic) NSString *avatarURLPath;
  40. /** @brief 消息发送方的头像 */
  41. @property (strong, nonatomic) UIImage *avatarImage;
  42. /** @brief 文本消息的文字 */
  43. @property (strong, nonatomic) NSString *text;
  44. /** @brief 文本消息的富文本属性 */
  45. @property (strong, nonatomic) NSAttributedString *attrBody;
  46. /** @brief 缩略图默认显示的图片名(防止缩略图下载失败后,无显示内容) */
  47. @property (strong, nonatomic) NSString *failImageName;
  48. /** @brief 图片消息原图的大小 */
  49. @property (nonatomic) CGSize imageSize;
  50. /** @brief 图片消息缩略图的大小 */
  51. @property (nonatomic) CGSize thumbnailImageSize;
  52. /** @brief 图片消息的原图 */
  53. @property (strong, nonatomic) UIImage *image;
  54. /** @brief 图片消息的缩略图 */
  55. @property (strong, nonatomic) UIImage *thumbnailImage;
  56. /** @brief 位置消息的地址信息 */
  57. @property (strong, nonatomic) NSString *address;
  58. /** @brief 地址消息的纬度 */
  59. @property (nonatomic) double latitude;
  60. /** @brief 地址消息的经度 */
  61. @property (nonatomic) double longitude;
  62. /** @brief 语音消息是否正在播放 */
  63. @property (nonatomic) BOOL isMediaPlaying;
  64. /** @brief 语音消息是否已经播放过 */
  65. @property (nonatomic) BOOL isMediaPlayed;
  66. /** @brief 语音消息(或视频消息)时长 */
  67. @property (nonatomic) CGFloat mediaDuration;
  68. /** @brief 附件显示的图标图片名 */
  69. @property (strong, nonatomic) NSString *fileIconName;
  70. /** @brief 文件消息的附件显示名 */
  71. @property (strong, nonatomic) NSString *fileName;
  72. /** @brief 文件消息的附件大小 */
  73. @property (strong, nonatomic) NSString *fileSizeDes;
  74. /** @brief 消息的附件下载进度 */
  75. @property (nonatomic) float progress;
  76. /** @brief 消息的附件本地存储路径 */
  77. @property (strong, nonatomic, readonly) NSString *fileLocalPath;
  78. /** @brief 图片消息(或视频消息)的缩略图本地存储路径 */
  79. @property (strong, nonatomic) NSString *thumbnailFileLocalPath;
  80. /** @brief 消息的附件远程地址 */
  81. @property (strong, nonatomic) NSString *fileURLPath;
  82. /** @brief 图片消息(或视频消息)的缩略图远程地址 */
  83. @property (strong, nonatomic) NSString *thumbnailFileURLPath;
  84. /*!
  85. @method
  86. @brief 初始化消息对象模型
  87. @param message 消息对象
  88. @return 消息对象模型
  89. */
  90. - (instancetype)initWithMessage:(EMMessage *)message;
  91. @end