aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/capabilities.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-03 17:29:52 +0900
committerGitHub <noreply@github.com>2019-08-03 17:29:52 +0900
commit66e116b7b1e848e80577a0229c8995db0a54932e (patch)
tree763340439a0f4034e9c829d76cb1ffe9766b83c5 /lib/csapi/capabilities.h
parent5b236dfe895c7766002559570aa29c9033009228 (diff)
parentc05ade838f0fce81f2bbe80a3295618a8a26ff52 (diff)
downloadlibquotient-66e116b7b1e848e80577a0229c8995db0a54932e.tar.gz
libquotient-66e116b7b1e848e80577a0229c8995db0a54932e.zip
Merge pull request #295 from marcdeop/140_impose_coding_standard
140 impose coding standard
Diffstat (limited to 'lib/csapi/capabilities.h')
-rw-r--r--lib/csapi/capabilities.h137
1 files changed, 71 insertions, 66 deletions
diff --git a/lib/csapi/capabilities.h b/lib/csapi/capabilities.h
index 06a8bf0d..f6e7ad06 100644
--- a/lib/csapi/capabilities.h
+++ b/lib/csapi/capabilities.h
@@ -4,79 +4,84 @@
#pragma once
+#include "converters.h"
+
#include "jobs/basejob.h"
-#include <QtCore/QJsonObject>
-#include "converters.h"
#include <QtCore/QHash>
+#include <QtCore/QJsonObject>
namespace QMatrixClient
{
- // Operations
- /// Gets information about the server's capabilities.
- ///
- /// Gets information about the server's supported feature set
- /// and other relevant capabilities.
- class GetCapabilitiesJob : public BaseJob
+// Operations
+
+/// Gets information about the server's capabilities.
+/*!
+ * Gets information about the server's supported feature set
+ * and other relevant capabilities.
+ */
+class GetCapabilitiesJob : public BaseJob
+{
+public:
+ // Inner data structures
+
+ /// Capability to indicate if the user can change their password.
+ struct ChangePasswordCapability
+ {
+ /// True if the user can change their password, false otherwise.
+ bool enabled;
+ };
+
+ /// The room versions the server supports.
+ struct RoomVersionsCapability
{
- public:
- // Inner data structures
-
- /// Capability to indicate if the user can change their password.
- struct ChangePasswordCapability
- {
- /// True if the user can change their password, false otherwise.
- bool enabled;
- };
-
- /// The room versions the server supports.
- struct RoomVersionsCapability
- {
- /// The default room version the server is using for new rooms.
- QString defaultVersion;
- /// A detailed description of the room versions the server supports.
- QHash<QString, QString> available;
- };
-
- /// The custom capabilities the server supports, using the
- /// Java package naming convention.
- struct Capabilities
- {
- /// Capability to indicate if the user can change their password.
- Omittable<ChangePasswordCapability> changePassword;
- /// The room versions the server supports.
- Omittable<RoomVersionsCapability> roomVersions;
- /// The custom capabilities the server supports, using the
- /// Java package naming convention.
- QHash<QString, QJsonObject> additionalProperties;
- };
-
- // Construction/destruction
-
- explicit GetCapabilitiesJob();
-
- /*! Construct a URL without creating a full-fledged job object
- *
- * This function can be used when a URL for
- * GetCapabilitiesJob is necessary but the job
- * itself isn't.
- */
- static QUrl makeRequestUrl(QUrl baseUrl);
-
- ~GetCapabilitiesJob() override;
-
- // Result properties
-
- /// The custom capabilities the server supports, using the
- /// Java package naming convention.
- const Capabilities& capabilities() const;
-
- protected:
- Status parseJson(const QJsonDocument& data) override;
-
- private:
- class Private;
- QScopedPointer<Private> d;
+ /// The default room version the server is using for new rooms.
+ QString defaultVersion;
+ /// A detailed description of the room versions the server supports.
+ QHash<QString, QString> available;
};
+
+ /// The custom capabilities the server supports, using theJava package
+ /// naming convention.
+ struct Capabilities
+ {
+ /// Capability to indicate if the user can change their password.
+ Omittable<ChangePasswordCapability> changePassword;
+ /// The room versions the server supports.
+ Omittable<RoomVersionsCapability> roomVersions;
+
+ /// The custom capabilities the server supports, using theJava package
+ /// naming convention.
+ QHash<QString, QJsonObject> additionalProperties;
+ };
+
+ // Construction/destruction
+
+ explicit GetCapabilitiesJob();
+
+ /*! Construct a URL without creating a full-fledged job object
+ *
+ * This function can be used when a URL for
+ * GetCapabilitiesJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl);
+
+ ~GetCapabilitiesJob() override;
+
+ // Result properties
+
+ /// The custom capabilities the server supports, using the
+ /// Java package naming convention.
+ const Capabilities& capabilities() const;
+
+protected:
+ Status parseJson(const QJsonDocument& data) override;
+
+private:
+ class Private;
+ QScopedPointer<Private> d;
+};
+
} // namespace QMatrixClient