aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/profile.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/profile.h')
-rw-r--r--lib/csapi/profile.h158
1 files changed, 80 insertions, 78 deletions
diff --git a/lib/csapi/profile.h b/lib/csapi/profile.h
index 23094aff..9a6ab56b 100644
--- a/lib/csapi/profile.h
+++ b/lib/csapi/profile.h
@@ -6,25 +6,25 @@
#include "jobs/basejob.h"
-
-namespace QMatrixClient
-{
+namespace QMatrixClient {
// Operations
/// Set the user's display name.
///
/// This API sets the given user's display name. You must have permission to
- /// set this user's display name, e.g. you need to have their ``access_token``.
+ /// set this user's display name, e.g. you need to have their
+ /// ``access_token``.
class SetDisplayNameJob : public BaseJob
{
public:
- /*! Set the user's display name.
- * \param userId
- * The user whose display name to set.
- * \param displayname
- * The new display name for this user.
- */
- explicit SetDisplayNameJob(const QString& userId, const QString& displayname = {});
+ /*! Set the user's display name.
+ * \param userId
+ * The user whose display name to set.
+ * \param displayname
+ * The new display name for this user.
+ */
+ explicit SetDisplayNameJob(const QString& userId,
+ const QString& displayname = {});
};
/// Get the user's display name.
@@ -35,49 +35,51 @@ namespace QMatrixClient
class GetDisplayNameJob : public BaseJob
{
public:
- /*! Get the user's display name.
- * \param userId
- * The user whose display name to get.
- */
- explicit GetDisplayNameJob(const QString& userId);
+ /*! Get the user's display name.
+ * \param userId
+ * The user whose display name to get.
+ */
+ explicit GetDisplayNameJob(const QString& userId);
- /*! Construct a URL without creating a full-fledged job object
- *
- * This function can be used when a URL for
- * GetDisplayNameJob is necessary but the job
- * itself isn't.
- */
- static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);
+ /*! Construct a URL without creating a full-fledged job object
+ *
+ * This function can be used when a URL for
+ * GetDisplayNameJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);
- ~GetDisplayNameJob() override;
+ ~GetDisplayNameJob() override;
- // Result properties
+ // Result properties
- /// The user's display name if they have set one, otherwise not present.
- const QString& displayname() const;
+ /// The user's display name if they have set one, otherwise not present.
+ const QString& displayname() const;
protected:
- Status parseJson(const QJsonDocument& data) override;
+ Status parseJson(const QJsonDocument& data) override;
private:
- class Private;
- QScopedPointer<Private> d;
+ class Private;
+ QScopedPointer<Private> d;
};
/// Set the user's avatar URL.
///
/// This API sets the given user's avatar URL. You must have permission to
- /// set this user's avatar URL, e.g. you need to have their ``access_token``.
+ /// set this user's avatar URL, e.g. you need to have their
+ /// ``access_token``.
class SetAvatarUrlJob : public BaseJob
{
public:
- /*! Set the user's avatar URL.
- * \param userId
- * The user whose avatar URL to set.
- * \param avatarUrl
- * The new avatar URL for this user.
- */
- explicit SetAvatarUrlJob(const QString& userId, const QString& avatarUrl = {});
+ /*! Set the user's avatar URL.
+ * \param userId
+ * The user whose avatar URL to set.
+ * \param avatarUrl
+ * The new avatar URL for this user.
+ */
+ explicit SetAvatarUrlJob(const QString& userId,
+ const QString& avatarUrl = {});
};
/// Get the user's avatar URL.
@@ -88,33 +90,33 @@ namespace QMatrixClient
class GetAvatarUrlJob : public BaseJob
{
public:
- /*! Get the user's avatar URL.
- * \param userId
- * The user whose avatar URL to get.
- */
- explicit GetAvatarUrlJob(const QString& userId);
+ /*! Get the user's avatar URL.
+ * \param userId
+ * The user whose avatar URL to get.
+ */
+ explicit GetAvatarUrlJob(const QString& userId);
- /*! Construct a URL without creating a full-fledged job object
- *
- * This function can be used when a URL for
- * GetAvatarUrlJob is necessary but the job
- * itself isn't.
- */
- static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);
+ /*! Construct a URL without creating a full-fledged job object
+ *
+ * This function can be used when a URL for
+ * GetAvatarUrlJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);
- ~GetAvatarUrlJob() override;
+ ~GetAvatarUrlJob() override;
- // Result properties
+ // Result properties
- /// The user's avatar URL if they have set one, otherwise not present.
- const QString& avatarUrl() const;
+ /// The user's avatar URL if they have set one, otherwise not present.
+ const QString& avatarUrl() const;
protected:
- Status parseJson(const QJsonDocument& data) override;
+ Status parseJson(const QJsonDocument& data) override;
private:
- class Private;
- QScopedPointer<Private> d;
+ class Private;
+ QScopedPointer<Private> d;
};
/// Get this user's profile information.
@@ -126,34 +128,34 @@ namespace QMatrixClient
class GetUserProfileJob : public BaseJob
{
public:
- /*! Get this user's profile information.
- * \param userId
- * The user whose profile information to get.
- */
- explicit GetUserProfileJob(const QString& userId);
+ /*! Get this user's profile information.
+ * \param userId
+ * The user whose profile information to get.
+ */
+ explicit GetUserProfileJob(const QString& userId);
- /*! Construct a URL without creating a full-fledged job object
- *
- * This function can be used when a URL for
- * GetUserProfileJob is necessary but the job
- * itself isn't.
- */
- static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);
+ /*! Construct a URL without creating a full-fledged job object
+ *
+ * This function can be used when a URL for
+ * GetUserProfileJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);
- ~GetUserProfileJob() override;
+ ~GetUserProfileJob() override;
- // Result properties
+ // Result properties
- /// The user's avatar URL if they have set one, otherwise not present.
- const QString& avatarUrl() const;
- /// The user's display name if they have set one, otherwise not present.
- const QString& displayname() const;
+ /// The user's avatar URL if they have set one, otherwise not present.
+ const QString& avatarUrl() const;
+ /// The user's display name if they have set one, otherwise not present.
+ const QString& displayname() const;
protected:
- Status parseJson(const QJsonDocument& data) override;
+ Status parseJson(const QJsonDocument& data) override;
private:
- class Private;
- QScopedPointer<Private> d;
+ class Private;
+ QScopedPointer<Private> d;
};
} // namespace QMatrixClient