aboutsummaryrefslogtreecommitdiff
path: root/events/roommessageevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'events/roommessageevent.h')
-rw-r--r--events/roommessageevent.h117
1 files changed, 60 insertions, 57 deletions
diff --git a/events/roommessageevent.h b/events/roommessageevent.h
index b0d5a1cb..219f74f0 100644
--- a/events/roommessageevent.h
+++ b/events/roommessageevent.h
@@ -30,13 +30,14 @@ namespace QMatrixClient
Text, Emote, Notice, Image, File, Location, Video, Audio, Unknown
};
- class MessageEventContent
+ namespace MessageEventContent
{
- public:
- virtual ~MessageEventContent() {}
-
- QString body;
- };
+ class Base
+ {
+ public:
+ QString body;
+ };
+ }
class RoomMessageEvent: public Event
{
@@ -49,7 +50,7 @@ namespace QMatrixClient
QString body() const;
QDateTime hsob_ts() const;
- MessageEventContent* content() const;
+ MessageEventContent::Base* content() const;
static RoomMessageEvent* fromJson( const QJsonObject& obj );
@@ -58,61 +59,63 @@ namespace QMatrixClient
Private* d;
};
- class ImageEventContent: public MessageEventContent
+ namespace MessageEventContent
{
- public:
- QUrl url;
- int height;
- int width;
- int size;
- QString mimetype;
- };
-
- class FileEventContent: public MessageEventContent
- {
- public:
- QString filename;
- QString mimetype;
- int size;
- QUrl url;
- };
+ class ImageContent: public Base
+ {
+ public:
+ QUrl url;
+ int height;
+ int width;
+ int size;
+ QString mimetype;
+ };
- class LocationEventContent: public MessageEventContent
- {
- public:
- QString geoUri;
- int thumbnailHeight;
- int thumbnailWidth;
- QString thumbnailMimetype;
- int thumbnailSize;
- QUrl thumbnailUrl;
- };
+ class FileContent: public Base
+ {
+ public:
+ QString filename;
+ QString mimetype;
+ int size;
+ QUrl url;
+ };
- class VideoEventContent: public MessageEventContent
- {
- public:
- QUrl url;
- int duration;
- int width;
- int height;
- int size;
- QString mimetype;
- int thumbnailWidth;
- int thumbnailHeight;
- int thumbnailSize;
- QString thumbnailMimetype;
- QUrl thumbnailUrl;
- };
+ class LocationContent: public Base
+ {
+ public:
+ QString geoUri;
+ int thumbnailHeight;
+ int thumbnailWidth;
+ QString thumbnailMimetype;
+ int thumbnailSize;
+ QUrl thumbnailUrl;
+ };
- class AudioEventContent: public MessageEventContent
- {
- public:
- QUrl url;
- int size;
- int duration;
- QString mimetype;
- };
+ class VideoContent: public Base
+ {
+ public:
+ QUrl url;
+ int duration;
+ int width;
+ int height;
+ int size;
+ QString mimetype;
+ int thumbnailWidth;
+ int thumbnailHeight;
+ int thumbnailSize;
+ QString thumbnailMimetype;
+ QUrl thumbnailUrl;
+ };
+ class AudioContent: public Base
+ {
+ public:
+ QUrl url;
+ int size;
+ int duration;
+ QString mimetype;
+ };
+ }
}
#endif // QMATRIXCLIENT_ROOMMESSAGEEVENT_H