AccountServices, HifiAbout, and WalletScriptingInterface JSDoc review

This commit is contained in:
David Rowe 2019-02-24 13:23:20 +13:00
parent 4f0911bd29
commit 4e9d162172
5 changed files with 40 additions and 40 deletions

View file

@ -16,8 +16,8 @@
#include <QObject> #include <QObject>
/**jsdoc /**jsdoc
* The <code>HifiAbout</code> API provides information about the version of Interface that is currently running. It also * The <code>HifiAbout</code> API provides information about the version of Interface that is currently running. It also
* provides the ability to open a Web page in an Interface browser window. * has the functionality to open a web page in an Interface browser window.
* *
* @namespace HifiAbout * @namespace HifiAbout
* *
@ -30,9 +30,9 @@
* @property {string} qtVersion - The Qt version used in Interface that is currently running. <em>Read-only.</em> * @property {string} qtVersion - The Qt version used in Interface that is currently running. <em>Read-only.</em>
* *
* @example <caption>Report build information for the version of Interface currently running.</caption> * @example <caption>Report build information for the version of Interface currently running.</caption>
* print("HiFi build date: " + HifiAbout.buildDate); // 11 Feb 2019 * print("HiFi build date: " + HifiAbout.buildDate); // Returns the build date of the version of Interface currently running on your machine.
* print("HiFi version: " + HifiAbout.buildVersion); // 0.78.0 * print("HiFi version: " + HifiAbout.buildVersion); // Returns the build version of Interface currently running on your machine.
* print("Qt version: " + HifiAbout.qtVersion); // 5.10.1 * print("Qt version: " + HifiAbout.qtVersion); // Returns the Qt version details of the version of Interface currently running on your machine.
*/ */
class AboutUtil : public QObject { class AboutUtil : public QObject {
@ -52,9 +52,9 @@ public:
public slots: public slots:
/**jsdoc /**jsdoc
* Display a Web page in an Interface browser window. * Display a web page in an Interface browser window.
* @function HifiAbout.openUrl * @function HifiAbout.openUrl
* @param {string} url - The URL of the Web page to display. * @param {string} url - The URL of the web page you want to view in Interface.
*/ */
void openUrl(const QString &url) const; void openUrl(const QString &url) const;
private: private:

View file

@ -62,8 +62,8 @@ public:
* <tr><th>Value</th><th>Meaning</th><th>Description</th></tr> * <tr><th>Value</th><th>Meaning</th><th>Description</th></tr>
* </thead> * </thead>
* <tbody> * <tbody>
* <tr><td><code>0</code></td><td>Not logged in</td><td>The user isn't logged in.</td></tr> * <tr><td><code>0</code></td><td>Not logged in</td><td>The user is not logged in.</td></tr>
* <tr><td><code>1</code></td><td>Not set up</td><td>The user's wallet isn't set up.</td></tr> * <tr><td><code>1</code></td><td>Not set up</td><td>The user's wallet has not been set up.</td></tr>
* <tr><td><code>2</code></td><td>Pre-existing</td><td>There is a wallet present on the server but not one * <tr><td><code>2</code></td><td>Pre-existing</td><td>There is a wallet present on the server but not one
* locally.</td></tr> * locally.</td></tr>
* <tr><td><code>3</code></td><td>Conflicting</td><td>There is a wallet present on the server plus one present locally, * <tr><td><code>3</code></td><td>Conflicting</td><td>There is a wallet present on the server plus one present locally,
@ -73,8 +73,8 @@ public:
* <tr><td><code>5</code></td><td>Ready</td><td>The wallet is ready for use.</td></tr> * <tr><td><code>5</code></td><td>Ready</td><td>The wallet is ready for use.</td></tr>
* </tbody> * </tbody>
* </table> * </table>
* <p>Wallets used to be stored locally but now they're stored on the server, unless the computer once had a wallet stored * <p>Wallets used to be stored locally but now they're only stored on the server. A wallet is present in both places if
* locally in which case the wallet may be present in both places.</p> * your computer previously stored its information locally.</p>
* @typedef {number} WalletScriptingInterface.WalletStatus * @typedef {number} WalletScriptingInterface.WalletStatus
*/ */
enum WalletStatus { enum WalletStatus {

View file

@ -115,8 +115,8 @@ DownloadInfoResult::DownloadInfoResult() :
/**jsdoc /**jsdoc
* Information on the assets currently being downloaded and pending download. * Information on the assets currently being downloaded and pending download.
* @typedef {object} AccountServices.DownloadInfoResult * @typedef {object} AccountServices.DownloadInfoResult
* @property {number[]} downloading - The percentage complete for each asset currently being downloaded. * @property {number[]} downloading - The download percentage of each asset currently downloading.
* @property {number} pending - The number of assets waiting to be download. * @property {number} pending - The number of assets pending download.
*/ */
QScriptValue DownloadInfoResultToScriptValue(QScriptEngine* engine, const DownloadInfoResult& result) { QScriptValue DownloadInfoResultToScriptValue(QScriptEngine* engine, const DownloadInfoResult& result) {
QScriptValue object = engine->newObject(); QScriptValue object = engine->newObject();

View file

@ -38,19 +38,19 @@ class AccountServicesScriptingInterface : public QObject {
Q_OBJECT Q_OBJECT
/**jsdoc /**jsdoc
* The <code>AccountServices</code> API provides functions related to user connectivity, visibility, and asset download * The <code>AccountServices</code> API provides functions that give information on user connectivity, visibility, and
* progress. * asset download progress.
* *
* @hifi-interface * @hifi-interface
* @hifi-client-entity * @hifi-client-entity
* @hifi-avatar * @hifi-avatar
* *
* @namespace AccountServices * @namespace AccountServices
* @property {string} username - The user name if the user is logged in, otherwise <code>"Unknown user"</code>. * @property {string} username - The user name of the user logged in. If there is no user logged in, it is
* <em>Read-only.</em> * <code>"Unknown user"</code>. <em>Read-only.</em>
* @property {boolean} loggedIn - <code>true</code> if the user is logged in, otherwise <code>false</code>. * @property {boolean} loggedIn - <code>true</code> if the user is logged in, otherwise <code>false</code>.
* <em>Read-only.</em> * <em>Read-only.</em>
* @property {string} findableBy - The user's visibility to other people:<br /> * @property {string} findableBy - The user's visibility to other users:<br />
* <code>"none"</code> - user appears offline.<br /> * <code>"none"</code> - user appears offline.<br />
* <code>"friends"</code> - user is visible only to friends.<br /> * <code>"friends"</code> - user is visible only to friends.<br />
* <code>"connections"</code> - user is visible to friends and connections.<br /> * <code>"connections"</code> - user is visible to friends and connections.<br />
@ -74,23 +74,23 @@ public:
public slots: public slots:
/**jsdoc /**jsdoc
* Get information on the progress of downloading assets in the domain. * Gets information on the download progress of assets in the domain.
* @function AccountServices.getDownloadInfo * @function AccountServices.getDownloadInfo
* @returns {AccountServices.DownloadInfoResult} Information on the progress of assets download. * @returns {AccountServices.DownloadInfoResult} Information on the download progress of assets.
*/ */
DownloadInfoResult getDownloadInfo(); DownloadInfoResult getDownloadInfo();
/**jsdoc /**jsdoc
* Cause a {@link AccountServices.downloadInfoChanged|downloadInfoChanged} signal to be triggered with information on the * Triggers a {@link AccountServices.downloadInfoChanged|downloadInfoChanged} signal with information on the current
* current progress of the download of assets in the domain. * download progress of the assets in the domain.
* @function AccountServices.updateDownloadInfo * @function AccountServices.updateDownloadInfo
*/ */
void updateDownloadInfo(); void updateDownloadInfo();
/**jsdoc /**jsdoc
* Check whether the user is logged in. * Checks whether the user is logged in.
* @function AccountServices.isLoggedIn * @function AccountServices.isLoggedIn
* @returns {boolean} <code>true</code> if the user is logged in, <code>false</code> otherwise. * @returns {boolean} <code>true</code> if the user is logged in, <code>false</code> if not.
* @example <caption>Report whether you are logged in.</caption> * @example <caption>Report whether you are logged in.</caption>
* var isLoggedIn = AccountServices.isLoggedIn(); * var isLoggedIn = AccountServices.isLoggedIn();
* print("You are logged in: " + isLoggedIn); // true or false * print("You are logged in: " + isLoggedIn); // true or false
@ -100,7 +100,7 @@ public slots:
/**jsdoc /**jsdoc
* Prompts the user to log in (the login dialog is displayed) if they're not already logged in. * Prompts the user to log in (the login dialog is displayed) if they're not already logged in.
* @function AccountServices.checkAndSignalForAccessToken * @function AccountServices.checkAndSignalForAccessToken
* @returns {boolean} <code>true</code> if the user is already logged in, <code>false</code> otherwise. * @returns {boolean} <code>true</code> if the user is logged in, <code>false</code> if not.
*/ */
bool checkAndSignalForAccessToken(); bool checkAndSignalForAccessToken();
@ -140,7 +140,7 @@ signals:
/**jsdoc /**jsdoc
* Triggered when the username logged in with changes, i.e., when the user logs in or out. * Triggered when the username logged in with changes, i.e., when the user logs in or out.
* @function AccountServices.myUsernameChanged * @function AccountServices.myUsernameChanged
* @param {string} username - The username logged in with if the user is logged in, otherwise <code>""</code>. * @param {string} username - The user name of the user logged in. If there is no user logged in, it is <code>""</code>.
* @returns {Signal} * @returns {Signal}
* @example <caption>Report when your username changes.</caption> * @example <caption>Report when your username changes.</caption>
* AccountServices.myUsernameChanged.connect(function (username) { * AccountServices.myUsernameChanged.connect(function (username) {
@ -150,9 +150,9 @@ signals:
void myUsernameChanged(const QString& username); void myUsernameChanged(const QString& username);
/**jsdoc /**jsdoc
* Triggered when the progress of the download of assets for the domain changes. * Triggered when the download progress of the assets in the domain changes.
* @function AccountServices.downloadInfoChanged * @function AccountServices.downloadInfoChanged
* @param {AccountServices.DownloadInfoResult} downloadInfo - Information on the progress of assets download. * @param {AccountServices.DownloadInfoResult} downloadInfo - Information on the download progress of assets.
* @returns {Signal} * @returns {Signal}
*/ */
void downloadInfoChanged(DownloadInfoResult info); void downloadInfoChanged(DownloadInfoResult info);
@ -186,7 +186,7 @@ signals:
/**jsdoc /**jsdoc
* Triggered when the login status of the user changes. * Triggered when the login status of the user changes.
* @function AccountServices.loggedInChanged * @function AccountServices.loggedInChanged
* @param {boolean} loggedIn - <code>true</code> if the user is logged in, otherwise <code>false</code>. * @param {boolean} loggedIn - <code>true</code> if the user is logged in, <code>false</code> if not.
* @returns {Signal} * @returns {Signal}
* @example <caption>Report when your login status changes.</caption> * @example <caption>Report when your login status changes.</caption>
* AccountServices.loggedInChanged.connect(function(loggedIn) { * AccountServices.loggedInChanged.connect(function(loggedIn) {

View file

@ -41,8 +41,8 @@ public:
* *
* @property {WalletScriptingInterface.WalletStatus} walletStatus - The status of the user's wallet. <em>Read-only.</em> * @property {WalletScriptingInterface.WalletStatus} walletStatus - The status of the user's wallet. <em>Read-only.</em>
* @property {boolean} limitedCommerce - <code>true</code> if Interface is running in limited commerce mode. In limited commerce * @property {boolean} limitedCommerce - <code>true</code> if Interface is running in limited commerce mode. In limited commerce
* mode, certain Interface functionality is disabled, e.g., users can't buy non-free items from the Marketplace. The Oculus * mode, certain Interface functionalities are disabled, e.g., users can't buy items that are not free from the Marketplace.
* Store version of Interface runs in limited commerce mode. <em>Read-only.</em> * The Oculus Store version of Interface runs in limited commerce mode. <em>Read-only.</em>
*/ */
class WalletScriptingInterface : public QObject, public Dependency { class WalletScriptingInterface : public QObject, public Dependency {
Q_OBJECT Q_OBJECT
@ -55,16 +55,16 @@ public:
WalletScriptingInterface(); WalletScriptingInterface();
/**jsdoc /**jsdoc
* Check and update the user's wallet status. * Checks and updates the user's wallet status.
* @function WalletScriptingInterface.refreshWalletStatus * @function WalletScriptingInterface.refreshWalletStatus
*/ */
Q_INVOKABLE void refreshWalletStatus(); Q_INVOKABLE void refreshWalletStatus();
/**jsdoc /**jsdoc
* Get the current status of the user's wallet. * Gets the current status of the user's wallet.
* @function WalletScriptingInterface.getWalletStatus * @function WalletScriptingInterface.getWalletStatus
* @returns {WalletScriptingInterface.WalletStatus} * @returns {WalletScriptingInterface.WalletStatus}
* @example <caption>Two ways to report your wallet status.</caption> * @example <caption>Use two methods to report your wallet's status.</caption>
* print("Wallet status: " + WalletScriptingInterface.walletStatus); // Same value as next line. * print("Wallet status: " + WalletScriptingInterface.walletStatus); // Same value as next line.
* print("Wallet status: " + WalletScriptingInterface.getWalletStatus()); * print("Wallet status: " + WalletScriptingInterface.getWalletStatus());
*/ */
@ -74,11 +74,11 @@ public:
* Check that a certified avatar entity is owned by the avatar whose entity it is. The result of the check is provided via * Check that a certified avatar entity is owned by the avatar whose entity it is. The result of the check is provided via
* the {@link WalletScriptingInterface.ownershipVerificationSuccess|ownershipVerificationSuccess} and * the {@link WalletScriptingInterface.ownershipVerificationSuccess|ownershipVerificationSuccess} and
* {@link WalletScriptingInterface.ownershipVerificationFailed|ownershipVerificationFailed} signals.<br /> * {@link WalletScriptingInterface.ownershipVerificationFailed|ownershipVerificationFailed} signals.<br />
* <strong>Warning:</strong> Neither of these signals fire if the entity is not an avatar entity or it's not a certified * <strong>Warning:</strong> Neither of these signals are triggered if the entity is not an avatar entity or is not
* entity. * certified.
* @function WalletScriptingInterface.proveAvatarEntityOwnershipVerification * @function WalletScriptingInterface.proveAvatarEntityOwnershipVerification
* @param {Uuid} entityID - The ID of the avatar entity to check. * @param {Uuid} entityID - The avatar entity's ID.
* @example <caption>Check ownership of all nearby certified avatar entities.</caption> * @example <caption>Check the ownership of all nearby certified avatar entities.</caption>
* // Set up response handling. * // Set up response handling.
* function ownershipSuccess(entityID) { * function ownershipSuccess(entityID) {
* print("Ownership test succeeded for: " + entityID); * print("Ownership test succeeded for: " + entityID);
@ -118,7 +118,7 @@ public:
signals: signals:
/**jsdoc /**jsdoc
* Triggered when the status of the user's wallet changes. * Triggered when the user's wallet status changes.
* @function WalletScriptingInterface.walletStatusChanged * @function WalletScriptingInterface.walletStatusChanged
* @returns {Signal} * @returns {Signal}
* @example <caption>Report when your wallet status changes, e.g., when you log in and out.</caption> * @example <caption>Report when your wallet status changes, e.g., when you log in and out.</caption>
@ -136,7 +136,7 @@ signals:
void limitedCommerceChanged(); void limitedCommerceChanged();
/**jsdoc /**jsdoc
* Triggered when the user rezzes a certified entity but the user's wallet is not ready and so the certified location of the * Triggered when the user rezzes a certified entity but the user's wallet is not ready. So the certified location of the
* entity cannot be updated in the metaverse. * entity cannot be updated in the metaverse.
* @function WalletScriptingInterface.walletNotSetup * @function WalletScriptingInterface.walletNotSetup
* @returns {Signal} * @returns {Signal}