diff --git a/libraries/ui/src/ui/ToolbarScriptingInterface.h b/libraries/ui/src/ui/ToolbarScriptingInterface.h index 952d3cce95..a4746e4566 100644 --- a/libraries/ui/src/ui/ToolbarScriptingInterface.h +++ b/libraries/ui/src/ui/ToolbarScriptingInterface.h @@ -19,57 +19,16 @@ class QQuickItem; -/**jsdoc - * @class ToolbarButtonProxy - * - * @hifi-interface - * @hifi-client-entity - * @hifi-avatar - */ +// No JSDoc for ToolbarButtonProxy because oolbarProxy#addButton() doesn't work. class ToolbarButtonProxy : public QmlWrapper { Q_OBJECT public: ToolbarButtonProxy(QObject* qmlObject, QObject* parent = nullptr); - /**jsdoc - * @function ToolbarButtonProxy#editProperties - * @param {object} properties - */ Q_INVOKABLE void editProperties(const QVariantMap& properties); - - // QmlWrapper methods. - - /**jsdoc - * @function ToolbarButtonProxy#writeProperty - * @parm {string} propertyName - * @param {object} propertyValue - */ - - /**jsdoc - * @function ToolbarButtonProxy#writeProperties - * @param {object} properties - */ - - /**jsdoc - * @function ToolbarButtonProxy#readProperty - * @param {string} propertyName - * @returns {object} - */ - - /**jsdoc - * @function ToolbarButtonProxy#readProperties - * @param {string[]} propertyList - * @returns {object} - */ - signals: - - /**jsdoc - * @function ToolbarButtonProxy#clicked - * @returns {Signal} - */ void clicked(); protected: @@ -80,7 +39,12 @@ protected: Q_DECLARE_METATYPE(ToolbarButtonProxy*); /**jsdoc + * An instance of a toolbar. + * + *
Retrieve an existing toolbar or create a new toolbar using {@link Toolbars.getToolbar}.
+ * * @class ToolbarProxy + * @hideconstructor * * @hifi-interface * @hifi-client-entity @@ -92,15 +56,19 @@ public: ToolbarProxy(QObject* qmlObject, QObject* parent = nullptr); /**jsdoc + * Currently doesn't work. * @function ToolbarProxy#addButton - * @param {object} properties - * @returns {ToolbarButtonProxy} + * @param {object} properties - Button properties + * @returns {object} The button added. + * @deprecated This method is deprecated and will be removed. */ Q_INVOKABLE ToolbarButtonProxy* addButton(const QVariant& properties); /**jsdoc + * Currently doesn't work. * @function ToolbarProxy#removeButton - * @param {string} name + * @param {string} name - Button name. + * @deprecated This method is deprecated and will be removed. */ Q_INVOKABLE void removeButton(const QVariant& name); @@ -108,32 +76,46 @@ public: // QmlWrapper methods. /**jsdoc + * Sets the value of a toolbar property. A property is added to the toolbar if the named property doesn't already + * exist. * @function ToolbarProxy#writeProperty - * @parm {string} propertyName - * @param {object} propertyValue + * @parm {string} propertyName - The name of the property. Toolbar properties are those in the QML implementation of the + * toolbar. + * @param {object} propertyValue - The value of the property. */ /**jsdoc + * Sets the values of toolbar properties. A property is added to the toolbar if a named property doesn't already + * exist. * @function ToolbarProxy#writeProperties - * @param {object} properties + * @param {object} properties - The names and values of the properties to set. Toolbar properties are those in the QML + * implementation of the toolbar. */ /**jsdoc + * Gets the value of a toolbar property. * @function ToolbarProxy#readProperty - * @param {string} propertyName - * @returns {object} + * @param {string} propertyName - The property name. Toolbar properties are those in the QML implementation of the toolbar. + * @returns {object} The value of the property if the property name is valid, otherwiseundefined
.
*/
/**jsdoc
+ * Gets the values of toolbar properties.
* @function ToolbarProxy#readProperties
- * @param {string[]} propertyList
- * @returns {object}
+ * @param {string[]} propertyList - The names of the properties to get the values of. Toolbar properties are those in the
+ * QML implementation of the toolbar.
+ * @returns {object} The names and values of the specified properties. If the toolbar doesn't have a particular property
+ * then the result doesn't include that property.
*/
};
Q_DECLARE_METATYPE(ToolbarProxy*);
/**jsdoc
+ * The Toolbars
API provides facilities to work with the system or other toolbar.
+ *
+ * See also the {@link Tablet} API for use of the system tablet and toolbar in desktop and HMD modes.
+ * * @namespace Toolbars * * @hifi-interface @@ -145,13 +127,33 @@ class ToolbarScriptingInterface : public QObject, public Dependency { public: /**jsdoc + * Gets an instance of a toolbar. A new toolbar is created if one with the specified name doesn't already exist. * @function Toolbars.getToolbar - * @param {string} toolbarID - * @returns {ToolbarProxy} + * @param {string} name - A unique name that identifies the toolbar. + * @returns {ToolbarProxy} The toolbar instance. */ Q_INVOKABLE ToolbarProxy* getToolbar(const QString& toolbarId); signals: + /**jsdoc + * Triggered when the visibility of a toolbar changes. + * @function Toolbars.toolbarVisibleChanged + * @param {boolean} isVisible -true
if the toolbar is visible, false
if it is hidden.
+ * @param {string} toolbarName - The name of the toolbar.
+ * @returns {Signal}
+ * @example