diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-05-05 19:36:15 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-05-05 19:36:15 +0900 |
commit | a8d2a73c771f188fc0fdc6351b4923af788317d5 (patch) | |
tree | b2795b93149f7c0ae3cd5005331b650a8eb6fd1e /lib/csapi/list_public_rooms.h | |
parent | da16225dfbec9b155c2c299757203f7676ac6ccf (diff) | |
parent | a63838235134b066c092ad98e1f18ff7991c91c1 (diff) | |
download | libquotient-a8d2a73c771f188fc0fdc6351b4923af788317d5.tar.gz libquotient-a8d2a73c771f188fc0fdc6351b4923af788317d5.zip |
Merge branch 'kitsune-gtad'
Diffstat (limited to 'lib/csapi/list_public_rooms.h')
-rw-r--r-- | lib/csapi/list_public_rooms.h | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/lib/csapi/list_public_rooms.h b/lib/csapi/list_public_rooms.h new file mode 100644 index 00000000..76d78577 --- /dev/null +++ b/lib/csapi/list_public_rooms.h @@ -0,0 +1,138 @@ +/****************************************************************************** + * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN + */ + +#pragma once + +#include "jobs/basejob.h" + +#include <QtCore/QVector> +#include <QtCore/QStringList> + +#include "converters.h" + +namespace QMatrixClient +{ + // Operations + + class GetRoomVisibilityOnDirectoryJob : public BaseJob + { + public: + explicit GetRoomVisibilityOnDirectoryJob(const QString& roomId); + + /** Construct a URL out of baseUrl and usual parameters passed to + * GetRoomVisibilityOnDirectoryJob. This function can be used when + * a URL for GetRoomVisibilityOnDirectoryJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId); + + ~GetRoomVisibilityOnDirectoryJob() override; + + // Result properties + + const QString& visibility() const; + + protected: + Status parseJson(const QJsonDocument& data) override; + + private: + class Private; + QScopedPointer<Private> d; + }; + + class SetRoomVisibilityOnDirectoryJob : public BaseJob + { + public: + explicit SetRoomVisibilityOnDirectoryJob(const QString& roomId, const QString& visibility = {}); + }; + + class GetPublicRoomsJob : public BaseJob + { + public: + // Inner data structures + + struct PublicRoomsChunk + { + QStringList aliases; + QString canonicalAlias; + QString name; + qint64 numJoinedMembers; + QString roomId; + QString topic; + bool worldReadable; + bool guestCanJoin; + QString avatarUrl; + }; + + // Construction/destruction + + explicit GetPublicRoomsJob(int limit = {}, const QString& since = {}, const QString& server = {}); + + /** Construct a URL out of baseUrl and usual parameters passed to + * GetPublicRoomsJob. This function can be used when + * a URL for GetPublicRoomsJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, int limit = {}, const QString& since = {}, const QString& server = {}); + + ~GetPublicRoomsJob() override; + + // Result properties + + const QVector<PublicRoomsChunk>& chunk() const; + const QString& nextBatch() const; + const QString& prevBatch() const; + qint64 totalRoomCountEstimate() const; + + protected: + Status parseJson(const QJsonDocument& data) override; + + private: + class Private; + QScopedPointer<Private> d; + }; + + class QueryPublicRoomsJob : public BaseJob + { + public: + // Inner data structures + + struct Filter + { + QString genericSearchTerm; + }; + + struct PublicRoomsChunk + { + QStringList aliases; + QString canonicalAlias; + QString name; + qint64 numJoinedMembers; + QString roomId; + QString topic; + bool worldReadable; + bool guestCanJoin; + QString avatarUrl; + }; + + // Construction/destruction + + explicit QueryPublicRoomsJob(const QString& server = {}, int limit = {}, const QString& since = {}, const Filter& filter = {}); + ~QueryPublicRoomsJob() override; + + // Result properties + + const QVector<PublicRoomsChunk>& chunk() const; + const QString& nextBatch() const; + const QString& prevBatch() const; + qint64 totalRoomCountEstimate() const; + + protected: + Status parseJson(const QJsonDocument& data) override; + + private: + class Private; + QScopedPointer<Private> d; + }; +} // namespace QMatrixClient |