floo2
bmx_message_attachment.h
1 //-------------------------------------------------------------------------------------------------
2 // File : bmx_message_attachment.h
3 // Author : Eric Liang <eric@bmxlabs.com>
4 // Purpose : bmx message 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_message_attachment_h
15 #define bmx_message_attachment_h
16 
17 #include <string>
18 #include <memory>
19 #include "bmx_base_object.h"
20 
21 namespace floo {
22 
26 class EXPORT_API BMXMessageAttachment : public BMXBaseObject
27 {
28 public:
29 
33  enum class Type
34  {
36  Image = 1,
38  Voice,
40  Video,
42  File,
44  Location,
46  Command,
48  Forward,
49  };
50 
54  enum class DownloadStatus
55  {
57  Downloaing,
59  Successed,
61  Failed,
63  NotStart,
65  Canceled,
66  };
67 
71  struct Size
72  {
73  Size(double width = 0.0, double height = 0.0) : mWidth(width), mHeight(height) {}
74  double mWidth;
75  double mHeight;
76  };
77 
82 
86  virtual ~BMXMessageAttachment() {}
87 
92  virtual Type type() const = 0;
93 
98  virtual std::shared_ptr<BMXMessageAttachment> clone() const = 0;
99 
100 private:
101  BMXMessageAttachment& operator=(const BMXMessageAttachment&);
102 };
103 
104 typedef std::shared_ptr<BMXMessageAttachment> BMXMessageAttachmentPtr;
105 
106 }
107 
108 #endif /* bmx_message_attachment_h */
消息附件
Definition: bmx_message_attachment.h:26
图片/视频大小
Definition: bmx_message_attachment.h:71
virtual ~BMXMessageAttachment()
析构函数
Definition: bmx_message_attachment.h:86
DownloadStatus
附件下载状态
Definition: bmx_message_attachment.h:54
BMXMessageAttachment()
构造函数
Definition: bmx_message_attachment.h:81
Definition: bmx_base_object.h:26
Type
附件类型
Definition: bmx_message_attachment.h:33