Mercurial > hg > svcore
diff plugin/PluginInstance.h @ 55:6befca60ab4e
* added to- and from- XML methods to PluginInstance
author | Chris Cannam |
---|---|
date | Wed, 22 Mar 2006 13:23:50 +0000 |
parents | d397ea0a79f5 |
children | 2157fa46c1e7 |
line wrap: on
line diff
--- a/plugin/PluginInstance.h Tue Mar 21 18:05:28 2006 +0000 +++ b/plugin/PluginInstance.h Wed Mar 22 13:23:50 2006 +0000 @@ -19,6 +19,10 @@ #include <string> #include <vector> +#include "base/XmlExportable.h" + +class QXmlAttributes; + /** * A base class for plugins with optional configurable parameters, * programs, etc. @@ -30,7 +34,7 @@ * controls for the plugin to the user. */ -class PluginInstance +class PluginInstance : public XmlExportable { public: /** @@ -70,7 +74,8 @@ { /** * The name of the parameter, in computer-usable form. Should - * be reasonably short and without whitespace or punctuation. + * be reasonably short, and may only contain the characters + * [a-zA-Z0-9_]. */ std::string name; @@ -153,6 +158,21 @@ * available programs, do nothing.) */ virtual void selectProgram(std::string) { } + + /** + * Export plugin settings to XML. + */ + virtual QString toXmlString(QString indent = "", + QString extraAttributes = "") const; + + /** + * Set the parameters and program of a plugin from a set of XML + * attributes. This is a partial inverse of toXmlString. + */ + virtual void setParameters(const QXmlAttributes &); + +protected: + QString stripInvalidParameterNameCharacters(QString) const; }; #endif