summaryrefslogtreecommitdiff
path: root/src/apiuseraccount.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/apiuseraccount.h')
-rw-r--r--src/apiuseraccount.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/apiuseraccount.h b/src/apiuseraccount.h
index 8a238d71..ac8931cf 100644
--- a/src/apiuseraccount.h
+++ b/src/apiuseraccount.h
@@ -18,6 +18,8 @@ enum class APIUserAccountTypes
Premium
};
+QString localizedUserAccountType(APIUserAccountTypes t);
+
/**
* current limits imposed on the user account
@@ -49,17 +51,28 @@ struct APIStats
/**
-* represents a user account on the mod provier website
+* represents a user account on the mod provider website
*/
class APIUserAccount
{
public:
- // when the number of remanining requests is under this number, further
+ // when the number of remaining requests is under this number, further
// requests will be throttled by avoiding non-critical ones
static const int ThrottleThreshold = 200;
APIUserAccount();
+
+ /**
+ * whether the user is logged in
+ */
+ bool isValid() const;
+
+ /**
+ * api key
+ */
+ const QString& apiKey() const;
+
/**
* user id
*/
@@ -82,6 +95,11 @@ public:
/**
+ * sets the api key
+ */
+ APIUserAccount& apiKey(const QString& key);
+
+ /**
* sets the user id
*/
APIUserAccount& id(const QString& id);
@@ -92,7 +110,7 @@ public:
APIUserAccount& name(const QString& name);
/**
- * sets the acount type
+ * sets the account type
*/
APIUserAccount& type(APIUserAccountTypes type);
@@ -120,10 +138,9 @@ public:
bool exhausted() const;
private:
- QString m_id, m_name;
+ QString m_key, m_id, m_name;
APIUserAccountTypes m_type;
APILimits m_limits;
- APIStats m_stats;
};
#endif // APIUSERACCOUNT_H