1 // SPDX-FileCopyrightText: 2017 Konstantinos Sideris <siderisk@auth.gr> 2 // SPDX-FileCopyrightText: 2021 Nheko Contributors 3 // 4 // SPDX-License-Identifier: GPL-3.0-or-later 5 6 #pragma once 7 8 #include <QPixmap> 9 #include <functional> 10 11 using AvatarCallback = std::function<void(QPixmap)>; 12 13 class AvatarProxy : public QObject 14 { 15 Q_OBJECT 16 17 signals: 18 void avatarDownloaded(QPixmap pm); 19 }; 20 21 namespace AvatarProvider { 22 void 23 resolve(QString avatarUrl, int size, QObject *receiver, AvatarCallback cb); 24 void 25 resolve(const QString &room_id, 26 const QString &user_id, 27 int size, 28 QObject *receiver, 29 AvatarCallback cb); 30 } 31