Aucune description

EMFileMessageBody.h 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*!
  2. * \~chinese
  3. * @header EMFileMessageBody.h
  4. * @abstract 文件消息体
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMFileMessageBody.h
  10. * @abstract File message body
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMMessageBody.h"
  16. /*!
  17. * \~chinese
  18. * 附件下载状态
  19. *
  20. * \~english
  21. * Message attachment download status
  22. */
  23. typedef enum{
  24. EMDownloadStatusDownloading = 0, /*! \~chinese 正在下载 \~english Downloading */
  25. EMDownloadStatusSuccessed, /*! \~chinese 下载成功 \~english Successed */
  26. EMDownloadStatusFailed, /*! \~chinese 下载失败 \~english Failed */
  27. EMDownloadStatusPending, /*! \~chinese 准备下载 \~english Pending */
  28. }EMDownloadStatus;
  29. /*!
  30. * \~chinese
  31. * 文件消息体
  32. *
  33. * \~english
  34. * File message body
  35. */
  36. @interface EMFileMessageBody : EMMessageBody
  37. /*!
  38. * \~chinese
  39. * 附件的显示名
  40. *
  41. * \~english
  42. * Display name of attachment
  43. */
  44. @property (nonatomic, copy) NSString *displayName;
  45. /*!
  46. * \~chinese
  47. * 附件的本地路径
  48. *
  49. * \~english
  50. * Local path of attachment
  51. */
  52. @property (nonatomic, copy) NSString *localPath;
  53. /*!
  54. * \~chinese
  55. * 附件在服务器上的路径
  56. *
  57. * \~english
  58. * Server path of attachment
  59. */
  60. @property (nonatomic, copy) NSString *remotePath;
  61. /*!
  62. * \~chinese
  63. * 附件的密钥, 下载附件时需要密匙做校验
  64. *
  65. * \~english
  66. * Secret key for downloading the message attachment
  67. */
  68. @property (nonatomic, copy) NSString *secretKey;
  69. /*!
  70. * \~chinese
  71. * 附件的大小, 以字节为单位
  72. *
  73. * \~english
  74. * Length of attachment, in bytes
  75. */
  76. @property (nonatomic) long long fileLength;
  77. /*!
  78. * \~chinese
  79. * 附件的下载状态
  80. *
  81. * \~english
  82. * Download status of attachment
  83. */
  84. @property (nonatomic) EMDownloadStatus downloadStatus;
  85. /*!
  86. * \~chinese
  87. * 初始化文件消息体
  88. *
  89. * @param aLocalPath 附件本地路径
  90. * @param aDisplayName 附件显示名(不包含路径)
  91. *
  92. * @result 消息体实例
  93. *
  94. * \~english
  95. * Initialize a file message body instance
  96. *
  97. * @param aLocalPath Local path of the attachment
  98. * @param aDisplayName Display name of the attachment
  99. *
  100. * @result File message body instance
  101. */
  102. - (instancetype)initWithLocalPath:(NSString *)aLocalPath
  103. displayName:(NSString *)aDisplayName;
  104. /*!
  105. * \~chinese
  106. * 初始化文件消息体
  107. *
  108. * @param aData 附件数据
  109. * @param aDisplayName 附件显示名(不包含路径)
  110. *
  111. * @result 消息体实例
  112. *
  113. * \~english
  114. * Initialize a file message body instance
  115. *
  116. * @param aData The data of attachment file
  117. * @param aDisplayName Display name of the attachment
  118. *
  119. * @result File message body instance
  120. */
  121. - (instancetype)initWithData:(NSData *)aData
  122. displayName:(NSString *)aDisplayName;
  123. @end