floo2
bmx_image_attachment.h
1 //-------------------------------------------------------------------------------------------------
2 // File : bmx_image_attachment.h
3 // Author : Eric Liang <eric@bmxlabs.com>
4 // Purpose : bmx message image attachment define file.
5 // Created : 12 Nov 2018 by Eric Liang <eric@bmxlabs.com>
6 //-------------------------------------------------------------------------------------------------
7 //
8 // Copyright (C) 2018-2019 MaxIM.Top
9 //
10 // You may obtain a copy of the licence at http://www.maxim.top/LICENCE-MAXIM.md
11 //
12 //-------------------------------------------------------------------------------------------------
13 
14 #ifndef bmx_image_attachment_h
15 #define bmx_image_attachment_h
16 
17 #include "bmx_file_attachment.h"
18 
19 namespace floo {
20 
21 template <typename T> class Encoder;
22 template <typename T> class Decoder;
23 
27 class EXPORT_API BMXImageAttachment : public BMXFileAttachment
28 {
29 public:
30 
37  BMXImageAttachment(const std::string& path, const Size& size, const std::string& displayName = "");
38 
46  BMXImageAttachment(const std::string& ratelUrl, const Size& size, const std::string& displayName, int64_t fileLength);
47 
51  virtual ~BMXImageAttachment() {}
52 
57  virtual Type type() const { return Type::Image; }
58 
63  virtual BMXMessageAttachmentPtr clone() const;
64 
69  const Size& size() const;
70 
75  const std::string& thumbnailUrl() const;
76 
81  void setThumbnail(const std::string& path);
82 
87  const std::string& thumbnailPath() const;
88 
93  DownloadStatus thumbnailDownloadStatus() const;
94 
95 private:
97  BMXImageAttachment& operator=(const BMXImageAttachment&);
98  //Image size
99  Size mSize;
100 
101  //Thumbnail
102  std::string mThumbnailUrl;
103  std::string mThumbnailPath;
104  DownloadStatus mThumbnailDownloadStatus;
105  friend class Encoder<BMXImageAttachment>;
106  friend class Decoder<BMXImageAttachment>;
107 };
108 typedef std::shared_ptr<BMXImageAttachment> BMXImageAttachmentPtr;
109 }
110 
111 #endif /* bmx_image_attachment_h */
消息文件附件
Definition: bmx_file_attachment.h:27
图片消息附件
Definition: bmx_image_attachment.h:27
virtual Type type() const
返回图片附件类型
Definition: bmx_image_attachment.h:57
Definition: bmx_file_attachment.h:22
virtual ~BMXImageAttachment()
析构函数
Definition: bmx_image_attachment.h:51
Type
附件类型
Definition: bmx_message_attachment.h:33
Definition: bmx_file_attachment.h:21