Easemob Windows SDK
emfilemessagebody.h
1 /************************************************************
2  * * EaseMob CONFIDENTIAL
3  * __________________
4  * Copyright (C) 2015 EaseMob Technologies. All rights reserved.
5  *
6  * NOTICE: All information contained herein is, and remains
7  * the property of EaseMob Technologies.
8  * Dissemination of this information or reproduction of this material
9  * is strictly forbidden unless prior written permission is obtained
10  * from EaseMob Technologies.
11  */
12 //
13 // EMFileMessageBody.h
14 //
15 // Copyright (c) 2015 EaseMob Inc. All rights reserved.
16 //
17 
18 #ifndef __easemob__EMFileMessageBody__
19 #define __easemob__EMFileMessageBody__
20 
21 #include <string>
22 #include "message/emmessagebody.h"
23 
24 namespace easemob {
25 
26 class EASEMOB_API EMFileMessageBody : public EMMessageBody
27 {
28 public:
29 
33  typedef enum
34  {
35  DOWNLOADING, //Download is in progress.
36  SUCCESSED, //Download successed.
37  FAILED, //Download failed.
38  PENDING //Download has not begun.
40 
47  EMFileMessageBody(EMMessageBodyType = FILE);
48 
56  EMFileMessageBody(const std::string &localPath, EMMessageBodyType = FILE);
57 
64  virtual ~EMFileMessageBody();
65 
72  std::string displayName() const;
73 
80  void setDisplayName(const std::string &);
81 
88  const std::string& localPath() const;
89 
97  void setLocalPath(const std::string &);
98 
105  const std::string& remotePath() const;
106 
114  void setRemotePath(const std::string &);
115 
122  const std::string& secretKey() const;
123 
131  void setSecretKey(const std::string &);
132 
139  int64_t fileLength() const;
140 
148  void setFileLength(int64_t);
149 
156  EMDownloadStatus downloadStatus() const;
157 
165  void setDownloadStatus(EMDownloadStatus);
166 
167 private:
174  void init();
175 
176 private:
178  EMFileMessageBody& operator=(const EMFileMessageBody&);
179  virtual void dummy() const{}
180  std::string mDisplayName;
181  std::string mLocalPath;
182  std::string mRemotePath;
183  std::string mSecretKey;
184  int64_t mFileLength;
185  EMDownloadStatus mDownloadStatus;
186 };
187 
188 typedef std::shared_ptr<EMFileMessageBody> EMFileMessageBodyPtr;
189 
190 }
191 
192 #endif /* defined(__easemob__EMFileMessageBody__) */
Definition: emmessagebody.h:31
Definition: emfilemessagebody.h:26
Definition: emattributevalue.h:28
EMDownloadStatus
Definition: emfilemessagebody.h:33