more documentation

This commit is contained in:
Marco Martin 2013-09-10 11:58:55 +02:00
parent bde39854d3
commit 075395e6d1

View File

@ -176,6 +176,11 @@ public:
//QML API-------------------------------------------------------------------
/**
* Set this to true if the plasmoid needs to be configured in order to work. The containment will display reason as a message to ask the user to configure.
* @param needsConfiguring If the plasmoid needs configuration
* @param reason The user readable (and localized) reason the plasmoid needs
*/
Q_INVOKABLE void setConfigurationRequired(bool needsConfiguring, const QString &reason = QString());
Q_INVOKABLE void setActionSeparator(const QString &name);
@ -186,17 +191,45 @@ public:
Q_INVOKABLE QAction *action(QString name) const;
Q_INVOKABLE QVariant readConfig(const QString &entry) const;
/**
* Retrieve the path of a file from the Plasmoid package
* @param fileName the package-recognized name, such as "mainscript"
* @returns the full absolute path of the file, if found, an empty string if not
*/
Q_INVOKABLE QString file(const QString &fileName);
Q_INVOKABLE void writeConfig(const QString &entry, const QVariant &value);
Q_INVOKABLE QString file(const QString &fileType);
/**
* Retrieve the path of a file from the Plasmoid package
* @param fileType the type supported from the package, such as "ui", "config" or "image"
* @param filePath the name of the file, such as "foo.qml" or "bar.png"
* @returns the full absolute path of the file, if found, an empty string if not
*/
Q_INVOKABLE QString file(const QString &fileType, const QString &filePath);
//FIXME-API: remove?
/**
* @returns A path where is safe to write on disk downloaded files
*/
Q_INVOKABLE QString downloadPath(const QString &file);
/**
* @returns The list of files that have been downloaded
*/
Q_INVOKABLE QStringList downloadedFiles() const;
/**
* FIXME: remove?
* Read a value from the configuration
* DEPRECATED: use plasmoid.configuration instead
*/
Q_INVOKABLE QVariant readConfig(const QString &entry) const;
/**
* FIXME: remove?
* Write a value in the configuration
* DEPRECATED: use plasmoid.configuration instead
*/
Q_INVOKABLE void writeConfig(const QString &entry, const QVariant &value);
//PROPERTY ACCESSORS-------------------------------------------------------------------
QString icon() const;