aboutsummaryrefslogtreecommitdiff
path: root/lib/avatar.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/avatar.h')
-rw-r--r--lib/avatar.h67
1 files changed, 34 insertions, 33 deletions
diff --git a/lib/avatar.h b/lib/avatar.h
index 2ca2c987..37991192 100644
--- a/lib/avatar.h
+++ b/lib/avatar.h
@@ -24,37 +24,38 @@
#include <functional>
#include <memory>
-namespace QMatrixClient {
- class Connection;
-
- class Avatar
- {
- public:
- explicit Avatar();
- explicit Avatar(QUrl url);
- Avatar(Avatar&&);
- ~Avatar();
- Avatar& operator=(Avatar&&);
-
- using get_callback_t = std::function<void()>;
- using upload_callback_t = std::function<void(QString)>;
-
- QImage get(Connection* connection, int dimension,
- get_callback_t callback) const;
- QImage get(Connection* connection, int w, int h,
- get_callback_t callback) const;
-
- bool upload(Connection* connection, const QString& fileName,
- upload_callback_t callback) const;
- bool upload(Connection* connection, QIODevice* source,
- upload_callback_t callback) const;
-
- QString mediaId() const;
- QUrl url() const;
- bool updateUrl(const QUrl& newUrl);
-
- private:
- class Private;
- std::unique_ptr<Private> d;
- };
+namespace QMatrixClient
+{
+class Connection;
+
+class Avatar
+{
+public:
+ explicit Avatar();
+ explicit Avatar(QUrl url);
+ Avatar(Avatar&&);
+ ~Avatar();
+ Avatar& operator=(Avatar&&);
+
+ using get_callback_t = std::function<void()>;
+ using upload_callback_t = std::function<void(QString)>;
+
+ QImage get(Connection* connection, int dimension,
+ get_callback_t callback) const;
+ QImage get(Connection* connection, int w, int h,
+ get_callback_t callback) const;
+
+ bool upload(Connection* connection, const QString& fileName,
+ upload_callback_t callback) const;
+ bool upload(Connection* connection, QIODevice* source,
+ upload_callback_t callback) const;
+
+ QString mediaId() const;
+ QUrl url() const;
+ bool updateUrl(const QUrl& newUrl);
+
+private:
+ class Private;
+ std::unique_ptr<Private> d;
+};
} // namespace QMatrixClient