EaseMessageModel.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 <Foundation/Foundation.h>
  13. #import "IMessageModel.h"
  14. //#if ENABLE_LITE == 1
  15. #import <HyphenateLite/EMMessage.h>
  16. //#else
  17. //#import <Hyphenate/EMMessage.h>
  18. //#endif
  19. /** @brief 消息模型 */
  20. @interface EaseMessageModel : NSObject<IMessageModel>
  21. /** @brief 消息cell的高度 */
  22. @property (nonatomic) CGFloat cellHeight;
  23. /** @brief 消息对象 */
  24. @property (strong, nonatomic, readonly) EMMessage *message;
  25. /** @brief 消息体 */
  26. @property (strong, nonatomic, readonly) EMMessageBody *firstMessageBody;
  27. /** @brief 消息id */
  28. @property (strong, nonatomic, readonly) NSString *messageId;
  29. /** @brief 消息体类型 */
  30. @property (nonatomic, readonly) EMMessageBodyType bodyType;
  31. /** @brief 消息发送状态 */
  32. @property (nonatomic, readonly) EMMessageStatus messageStatus;
  33. /** @brief 聊天类型 */
  34. @property (nonatomic, readonly) EMChatType messageType;
  35. /** @brief 消息是否已读 */
  36. @property (nonatomic) BOOL isMessageRead;
  37. /** @brief 当前登录用户是否为消息的发送方 */
  38. @property (nonatomic) BOOL isSender;
  39. /** @brief 消息发送方的昵称 */
  40. @property (strong, nonatomic) NSString *nickname;
  41. /** @brief 消息发送方的头像url */
  42. @property (strong, nonatomic) NSString *avatarURLPath;
  43. /** @brief 消息发送方的头像 */
  44. @property (strong, nonatomic) UIImage *avatarImage;
  45. /** @brief 文本消息的文字 */
  46. @property (strong, nonatomic) NSString *text;
  47. /** @brief 文本消息的富文本属性 */
  48. @property (strong, nonatomic) NSAttributedString *attrBody;
  49. /** @brief 位置消息的地址信息 */
  50. @property (strong, nonatomic) NSString *address;
  51. /** @brief 地址消息的纬度 */
  52. @property (nonatomic) double latitude;
  53. /** @brief 地址消息的经度 */
  54. @property (nonatomic) double longitude;
  55. /** @brief 缩略图默认显示的图片名(防止缩略图下载失败后,无显示内容) */
  56. @property (strong, nonatomic) NSString *failImageName;
  57. /** @brief 图片消息原图的大小 */
  58. @property (nonatomic) CGSize imageSize;
  59. /** @brief 图片消息缩略图的大小 */
  60. @property (nonatomic) CGSize thumbnailImageSize;
  61. /** @brief 图片消息的原图 */
  62. @property (strong, nonatomic) UIImage *image;
  63. /** @brief 图片消息的缩略图 */
  64. @property (strong, nonatomic) UIImage *thumbnailImage;
  65. /** @brief 语音消息是否正在播放 */
  66. @property (nonatomic) BOOL isMediaPlaying;
  67. /** @brief 语音消息是否已经播放过 */
  68. @property (nonatomic) BOOL isMediaPlayed;
  69. /** @brief 语音消息(或视频消息)时长 */
  70. @property (nonatomic) CGFloat mediaDuration;
  71. /** @brief 附件显示的图标图片名 */
  72. @property (strong, nonatomic) NSString *fileIconName;
  73. /** @brief 文件消息的附件显示名 */
  74. @property (strong, nonatomic) NSString *fileName;
  75. /** @brief 文件消息的附件大小 */
  76. @property (strong, nonatomic) NSString *fileSizeDes;
  77. /** @brief 附件文件字节数 */
  78. @property (nonatomic) CGFloat fileSize;
  79. /** @brief 消息的附件下载进度 */
  80. @property (nonatomic) float progress;
  81. /** @brief 消息的附件本地存储路径 */
  82. @property (strong, nonatomic, readonly) NSString *fileLocalPath;
  83. /** @brief 图片消息(或视频消息)的缩略图本地存储路径 */
  84. @property (strong, nonatomic) NSString *thumbnailFileLocalPath;
  85. /** @brief 消息的附件远程地址 */
  86. @property (strong, nonatomic) NSString *fileURLPath;
  87. /** @brief 图片消息(或视频消息)的缩略图远程地址 */
  88. @property (strong, nonatomic) NSString *thumbnailFileURLPath;
  89. /*!
  90. @method
  91. @brief 初始化消息对象模型
  92. @param message 消息对象
  93. @return 消息对象模型
  94. */
  95. - (instancetype)initWithMessage:(EMMessage *)message;
  96. @end