From aacc4bcb4a487871daae6717f77605aaba444341 Mon Sep 17 00:00:00 2001 From: Marc Deop Date: Sat, 2 Mar 2019 12:26:57 +0100 Subject: style: apply .clang-format to all .cpp and .h files --- lib/csapi/list_public_rooms.h | 233 ++++++++++++++++++++++-------------------- 1 file changed, 121 insertions(+), 112 deletions(-) (limited to 'lib/csapi/list_public_rooms.h') diff --git a/lib/csapi/list_public_rooms.h b/lib/csapi/list_public_rooms.h index a6498745..1a0af880 100644 --- a/lib/csapi/list_public_rooms.h +++ b/lib/csapi/list_public_rooms.h @@ -6,169 +6,178 @@ #include "jobs/basejob.h" -#include "csapi/definitions/public_rooms_response.h" #include "converters.h" +#include "csapi/definitions/public_rooms_response.h" -namespace QMatrixClient -{ +namespace QMatrixClient { // Operations /// Gets the visibility of a room in the directory /// - /// Gets the visibility of a given room on the server's public room directory. + /// Gets the visibility of a given room on the server's public room + /// directory. class GetRoomVisibilityOnDirectoryJob : public BaseJob { public: - /*! Gets the visibility of a room in the directory - * \param roomId - * The room ID. - */ - explicit GetRoomVisibilityOnDirectoryJob(const QString& roomId); + /*! Gets the visibility of a room in the directory + * \param roomId + * The room ID. + */ + explicit GetRoomVisibilityOnDirectoryJob(const QString& roomId); - /*! Construct a URL without creating a full-fledged job object - * - * 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); + /*! Construct a URL without creating a full-fledged job object + * + * 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; + ~GetRoomVisibilityOnDirectoryJob() override; - // Result properties + // Result properties - /// The visibility of the room in the directory. - const QString& visibility() const; + /// The visibility of the room in the directory. + const QString& visibility() const; protected: - Status parseJson(const QJsonDocument& data) override; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; /// Sets the visibility of a room in the room directory /// /// Sets the visibility of a given room in the server's public room /// directory. - /// + /// /// Servers may choose to implement additional access control checks - /// here, for instance that room visibility can only be changed by + /// here, for instance that room visibility can only be changed by /// the room creator or a server administrator. class SetRoomVisibilityOnDirectoryJob : public BaseJob { public: - /*! Sets the visibility of a room in the room directory - * \param roomId - * The room ID. - * \param visibility - * The new visibility setting for the room. - * Defaults to 'public'. - */ - explicit SetRoomVisibilityOnDirectoryJob(const QString& roomId, const QString& visibility = {}); + /*! Sets the visibility of a room in the room directory + * \param roomId + * The room ID. + * \param visibility + * The new visibility setting for the room. + * Defaults to 'public'. + */ + explicit SetRoomVisibilityOnDirectoryJob( + const QString& roomId, const QString& visibility = {}); }; /// Lists the public rooms on the server. /// /// Lists the public rooms on the server. - /// - /// This API returns paginated responses. The rooms are ordered by the number - /// of joined members, with the largest rooms first. + /// + /// This API returns paginated responses. The rooms are ordered by the + /// number of joined members, with the largest rooms first. class GetPublicRoomsJob : public BaseJob { public: - /*! Lists the public rooms on the server. - * \param limit - * Limit the number of results returned. - * \param since - * A pagination token from a previous request, allowing clients to - * get the next (or previous) batch of rooms. - * The direction of pagination is specified solely by which token - * is supplied, rather than via an explicit flag. - * \param server - * The server to fetch the public room lists from. Defaults to the - * local server. - */ - explicit GetPublicRoomsJob(Omittable limit = none, const QString& since = {}, const QString& server = {}); - - /*! Construct a URL without creating a full-fledged job object - * - * This function can be used when a URL for - * GetPublicRoomsJob is necessary but the job - * itself isn't. - */ - static QUrl makeRequestUrl(QUrl baseUrl, Omittable limit = none, const QString& since = {}, const QString& server = {}); - - ~GetPublicRoomsJob() override; - - // Result properties - - /// A list of the rooms on the server. - const PublicRoomsResponse& data() const; + /*! Lists the public rooms on the server. + * \param limit + * Limit the number of results returned. + * \param since + * A pagination token from a previous request, allowing clients to + * get the next (or previous) batch of rooms. + * The direction of pagination is specified solely by which token + * is supplied, rather than via an explicit flag. + * \param server + * The server to fetch the public room lists from. Defaults to the + * local server. + */ + explicit GetPublicRoomsJob(Omittable limit = none, + const QString& since = {}, + const QString& server = {}); + + /*! Construct a URL without creating a full-fledged job object + * + * This function can be used when a URL for + * GetPublicRoomsJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, Omittable limit = none, + const QString& since = {}, + const QString& server = {}); + + ~GetPublicRoomsJob() override; + + // Result properties + + /// A list of the rooms on the server. + const PublicRoomsResponse& data() const; protected: - Status parseJson(const QJsonDocument& data) override; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; /// Lists the public rooms on the server with optional filter. /// /// Lists the public rooms on the server, with optional filter. - /// - /// This API returns paginated responses. The rooms are ordered by the number - /// of joined members, with the largest rooms first. + /// + /// This API returns paginated responses. The rooms are ordered by the + /// number of joined members, with the largest rooms first. class QueryPublicRoomsJob : public BaseJob { public: - // Inner data structures - - /// Filter to apply to the results. - struct Filter - { - /// A string to search for in the room metadata, e.g. name, - /// topic, canonical alias etc. (Optional). - QString genericSearchTerm; - }; - - // Construction/destruction - - /*! Lists the public rooms on the server with optional filter. - * \param server - * The server to fetch the public room lists from. Defaults to the - * local server. - * \param limit - * Limit the number of results returned. - * \param since - * A pagination token from a previous request, allowing clients - * to get the next (or previous) batch of rooms. The direction - * of pagination is specified solely by which token is supplied, - * rather than via an explicit flag. - * \param filter - * Filter to apply to the results. - * \param includeAllNetworks - * Whether or not to include all known networks/protocols from - * application services on the homeserver. Defaults to false. - * \param thirdPartyInstanceId - * The specific third party network/protocol to request from the - * homeserver. Can only be used if ``include_all_networks`` is false. - */ - explicit QueryPublicRoomsJob(const QString& server = {}, Omittable limit = none, const QString& since = {}, const Omittable& filter = none, Omittable includeAllNetworks = none, const QString& thirdPartyInstanceId = {}); - ~QueryPublicRoomsJob() override; - - // Result properties - - /// A list of the rooms on the server. - const PublicRoomsResponse& data() const; + // Inner data structures + + /// Filter to apply to the results. + struct Filter { + /// A string to search for in the room metadata, e.g. name, + /// topic, canonical alias etc. (Optional). + QString genericSearchTerm; + }; + + // Construction/destruction + + /*! Lists the public rooms on the server with optional filter. + * \param server + * The server to fetch the public room lists from. Defaults to the + * local server. + * \param limit + * Limit the number of results returned. + * \param since + * A pagination token from a previous request, allowing clients + * to get the next (or previous) batch of rooms. The direction + * of pagination is specified solely by which token is supplied, + * rather than via an explicit flag. + * \param filter + * Filter to apply to the results. + * \param includeAllNetworks + * Whether or not to include all known networks/protocols from + * application services on the homeserver. Defaults to false. + * \param thirdPartyInstanceId + * The specific third party network/protocol to request from the + * homeserver. Can only be used if ``include_all_networks`` is false. + */ + explicit QueryPublicRoomsJob(const QString& server = {}, + Omittable limit = none, + const QString& since = {}, + const Omittable& filter = none, + Omittable includeAllNetworks = none, + const QString& thirdPartyInstanceId = {}); + ~QueryPublicRoomsJob() override; + + // Result properties + + /// A list of the rooms on the server. + const PublicRoomsResponse& data() const; protected: - Status parseJson(const QJsonDocument& data) override; + Status parseJson(const QJsonDocument& data) override; private: - class Private; - QScopedPointer d; + class Private; + QScopedPointer d; }; } // namespace QMatrixClient -- cgit v1.2.3 From 27ca32a1e5a56e09b9cc1d94224d2831004dcf3d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 7 Jul 2019 19:32:34 +0900 Subject: Namespace: QMatrixClient -> Quotient (with back comp alias) --- lib/csapi/list_public_rooms.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/csapi/list_public_rooms.h') diff --git a/lib/csapi/list_public_rooms.h b/lib/csapi/list_public_rooms.h index da68416d..e68030ad 100644 --- a/lib/csapi/list_public_rooms.h +++ b/lib/csapi/list_public_rooms.h @@ -10,7 +10,7 @@ #include "jobs/basejob.h" -namespace QMatrixClient +namespace Quotient { // Operations @@ -189,4 +189,4 @@ private: QScopedPointer d; }; -} // namespace QMatrixClient +} // namespace Quotient -- cgit v1.2.3