// SPDX-FileCopyrightText: 2017 Kitsune Ral // SPDX-License-Identifier: LGPL-2.1-or-later #pragma once #include "quotient_export.h" #include #include #include #include namespace Quotient { class Connection; class QUOTIENT_API Avatar { public: explicit Avatar(); explicit Avatar(QUrl url); Avatar(Avatar&&); ~Avatar(); Avatar& operator=(Avatar&&); using get_callback_t = std::function; using upload_callback_t = std::function; 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 d; }; } // namespace Quotient