No Description

EMImageMessageBody.h 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*!
  2. * \~chinese
  3. * @header EMImageMessageBody.h
  4. * @abstract 图片消息体
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMImageMessageBody.h
  10. * @abstract Image message body
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMFileMessageBody.h"
  16. /*!
  17. * \~chinese
  18. * 图片消息体,SDK发送消息前会根据compressRatio压缩通过-(instancetype)initWithData:displayName:或
  19. * -(instancetype)initWithData:thumbnailData:创建的消息体的图片
  20. *
  21. * \~english
  22. * Image message body
  23. */
  24. @interface EMImageMessageBody : EMFileMessageBody
  25. /*!
  26. * \~chinese
  27. * 图片附件的尺寸
  28. *
  29. * \~english
  30. * Size of image attachment
  31. */
  32. @property (nonatomic) CGSize size;
  33. /*!
  34. * \~chinese
  35. * 设置发送图片消息时的压缩率,1.0时不压缩,默认值是0.6,如果设置了小于等于0的值,则使用默认值
  36. *
  37. * \~english
  38. * Image compression ratio. 1.0 without compression, default value is 0.6. SDK uses the default value if the given value is less than zero.
  39. */
  40. @property (nonatomic) CGFloat compressRatio __deprecated_msg("Use - compressionRatio");
  41. @property (nonatomic) CGFloat compressionRatio;
  42. /*!
  43. * \~chinese
  44. * 缩略图的显示名
  45. *
  46. * \~english
  47. * Display name of thumbnail
  48. */
  49. @property (nonatomic, copy) NSString *thumbnailDisplayName;
  50. /*!
  51. * \~chinese
  52. * 缩略图的本地路径
  53. *
  54. * \~english
  55. * Local path of thumbnail
  56. */
  57. @property (nonatomic, copy) NSString *thumbnailLocalPath;
  58. /*!
  59. * \~chinese
  60. * 缩略图在服务器的路径
  61. *
  62. * \~english
  63. * Server path of thumbnail
  64. */
  65. @property (nonatomic, copy) NSString *thumbnailRemotePath;
  66. /*!
  67. * \~chinese
  68. * 缩略图的密钥, 下载缩略图时需要密匙做校验
  69. *
  70. * \~english
  71. * Secret key for downloading a thumbnail image
  72. */
  73. @property (nonatomic, copy) NSString *thumbnailSecretKey;
  74. /*!
  75. * \~chinese
  76. * 缩略图的尺寸
  77. *
  78. * \~english
  79. * Size of a thumbnail
  80. */
  81. @property (nonatomic) CGSize thumbnailSize;
  82. /*!
  83. * \~chinese
  84. * 缩略图文件的大小, 以字节为单位
  85. *
  86. * \~english
  87. * File length of a thumbnail, in bytes
  88. */
  89. @property (nonatomic) long long thumbnailFileLength;
  90. /*!
  91. * \~chinese
  92. * 缩略图下载状态
  93. *
  94. * \~english
  95. * Download status of a thumbnail
  96. */
  97. @property (nonatomic)EMDownloadStatus thumbnailDownloadStatus;
  98. /*!
  99. * \~chinese
  100. * 初始化图片消息体
  101. *
  102. * @param aData 图片数据
  103. * @param aThumbnailData 缩略图数据
  104. *
  105. * @result 图片消息体实例
  106. *
  107. * \~english
  108. * Initialize an image message body instance
  109. *
  110. * @param aData The data of image
  111. * @param aThumbnailData The data of thumbnail
  112. *
  113. * @result An image message body instance
  114. */
  115. - (instancetype)initWithData:(NSData *)aData
  116. thumbnailData:(NSData *)aThumbnailData;
  117. @end