8 #include <QtCore/QFuture>
10 #include <QtGui/QIcon>
19 explicit Avatar(Connection* parent,
const QUrl& url = {});
21 #ifdef __cpp_lib_move_only_function
22 using get_callback_t = std::move_only_function<
void()>;
23 using upload_callback_t = std::move_only_function<
void(QUrl)>;
25 using get_callback_t = std::function<
void()>;
26 using upload_callback_t = std::function<
void(QUrl)>;
30 QImage get(
int dimension, get_callback_t callback)
const;
31 QImage get(
int width,
int height, get_callback_t callback)
const;
33 [[deprecated(
"Use the QFuture-returning overload instead")]]
34 bool upload(
const QString& fileName, upload_callback_t callback)
const;
35 [[deprecated(
"Use the QFuture-returning overload instead")]]
36 bool upload(QIODevice* source, upload_callback_t callback)
const;
37 QFuture<QUrl> upload(
const QString& fileName)
const;
38 QFuture<QUrl> upload(QIODevice* source)
const;
41 QString mediaId()
const;
43 bool updateUrl(
const QUrl& newUrl);
45 static bool isUrlValid(
const QUrl& u);