diff options
Diffstat (limited to 'room.h')
-rw-r--r-- | room.h | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -25,6 +25,7 @@ #include <QtCore/QStringList> #include <QtCore/QObject> #include <QtCore/QJsonObject> +#include <QtGui/QPixmap> #include "jobs/syncjob.h" #include "events/roommessageevent.h" @@ -79,7 +80,7 @@ namespace QMatrixClient using rev_iter_t = Timeline::const_reverse_iterator; Room(Connection* connection, QString id, JoinState initialJoinState); - virtual ~Room(); + ~Room() override; Connection* connection() const; User* localUser() const; @@ -96,8 +97,15 @@ namespace QMatrixClient Q_INVOKABLE QList<User*> users() const; Q_INVOKABLE QStringList memberNames() const; Q_INVOKABLE int memberCount() const; + Q_INVOKABLE int timelineSize() const; /** + * Returns a room avatar and requests it from the network if needed + * @return a pixmap with the avatar or a placeholder if there's none + * available yet + */ + Q_INVOKABLE QPixmap avatar(int width, int height); + /** * @brief Produces a disambiguated name for a given user in * the context of the room */ @@ -108,9 +116,6 @@ namespace QMatrixClient */ Q_INVOKABLE QString roomMembername(const QString& userId) const; - void updateData(SyncRoomData&& data ); - Q_INVOKABLE void setJoinState( JoinState state ); - const Timeline& messageEvents() const; /** * A convenience method returning the read marker to the before-oldest @@ -147,6 +152,8 @@ namespace QMatrixClient MemberSorter memberSorter() const; QJsonObject toJson() const; + void updateData(SyncRoomData&& data ); + void setJoinState( JoinState state ); public slots: void postMessage(const QString& plainText, @@ -181,6 +188,7 @@ namespace QMatrixClient /** @brief The room displayname changed */ void displaynameChanged(Room* room); void topicChanged(); + void avatarChanged(); void userAdded(User* user); void userRemoved(User* user); void memberRenamed(User* user); |