aboutsummaryrefslogtreecommitdiff
path: root/lib/events/eventcontent.h
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-12-29 15:59:58 +0100
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-12-29 18:07:21 +0100
commit7350fe82953cf6274b8845a890eafb21a09b9931 (patch)
treee802f22bd64b9cdd83b48e257629787a57352be3 /lib/events/eventcontent.h
parent02fdd08b98d878168eb81376a44586176dfd9576 (diff)
downloadlibquotient-7350fe82953cf6274b8845a890eafb21a09b9931.tar.gz
libquotient-7350fe82953cf6274b8845a890eafb21a09b9931.zip
Add QUOTIENT_API throughout non-generated code
This include all (hopefully) classes/structures and functions that have non-inline definitions, as well as namespaces with Q_NAMESPACE since those have non-inline (as of Qt 5.15) QMetaObject - for that a new macro, QUO_NAMESPACE, has been devised to accommodate the lack of Q_NAMESPACE_EXPORT in Qt before 5.14.
Diffstat (limited to 'lib/events/eventcontent.h')
-rw-r--r--lib/events/eventcontent.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/events/eventcontent.h b/lib/events/eventcontent.h
index f609a603..bfa7d926 100644
--- a/lib/events/eventcontent.h
+++ b/lib/events/eventcontent.h
@@ -6,14 +6,15 @@
// This file contains generic event content definitions, applicable to room
// message events as well as other events (e.g., avatars).
+#include "encryptedfile.h"
+#include "quotient_export.h"
+
#include <QtCore/QJsonObject>
#include <QtCore/QMimeType>
#include <QtCore/QSize>
#include <QtCore/QUrl>
#include <QtCore/QMetaType>
-#include "encryptedfile.h"
-
class QFileInfo;
namespace Quotient {
@@ -28,7 +29,7 @@ namespace EventContent {
* assumed but not required that a content object can also be created
* from plain data.
*/
- class Base {
+ class QUOTIENT_API Base {
public:
explicit Base(QJsonObject o = {}) : originalJson(std::move(o)) {}
virtual ~Base() = default;
@@ -76,7 +77,7 @@ namespace EventContent {
*
* This class is not polymorphic.
*/
- class FileInfo {
+ class QUOTIENT_API FileInfo {
public:
FileInfo() = default;
explicit FileInfo(const QFileInfo& fi);
@@ -121,7 +122,7 @@ namespace EventContent {
/**
* A content info class for image content types: image, thumbnail, video
*/
- class ImageInfo : public FileInfo {
+ class QUOTIENT_API ImageInfo : public FileInfo {
public:
ImageInfo() = default;
explicit ImageInfo(const QFileInfo& fi, QSize imageSize = {});
@@ -146,7 +147,7 @@ namespace EventContent {
* the JSON representation of event content; namely,
* "info/thumbnail_url" and "info/thumbnail_info" fields are used.
*/
- class Thumbnail : public ImageInfo {
+ class QUOTIENT_API Thumbnail : public ImageInfo {
public:
Thumbnail() = default; // Allow empty thumbnails
Thumbnail(const QJsonObject& infoJson, const Omittable<EncryptedFile> &file = none);
@@ -160,7 +161,7 @@ namespace EventContent {
void fillInfoJson(QJsonObject* infoJson) const;
};
- class TypedBase : public Base {
+ class QUOTIENT_API TypedBase : public Base {
public:
virtual QMimeType type() const = 0;
virtual const FileInfo* fileInfo() const { return nullptr; }
@@ -183,7 +184,7 @@ namespace EventContent {
* \tparam InfoT base info class
*/
template <class InfoT>
- class UrlBasedContent : public TypedBase, public InfoT {
+ class QUOTIENT_API UrlBasedContent : public TypedBase, public InfoT {
public:
using InfoT::InfoT;
explicit UrlBasedContent(const QJsonObject& json)
@@ -215,7 +216,7 @@ namespace EventContent {
};
template <typename InfoT>
- class UrlWithThumbnailContent : public UrlBasedContent<InfoT> {
+ class QUOTIENT_API UrlWithThumbnailContent : public UrlBasedContent<InfoT> {
public:
// NB: when using inherited constructors, thumbnail has to be
// initialised separately