#include <GweFactoryOption.h>
Inheritance diagram for GWE::GweFactoryOption:


Public Slots | |
| virtual void | updateTree () |
| virtual void | setValue (const QString &value) |
| virtual void | setDescription (const QString &description) |
| virtual void | loadFromXml (const QDomElement &options) |
| virtual void | saveToXml (QDomElement storage) |
| virtual void | setValueOfSubOption (const QString &sub_option_name, const QString &value) |
Signals | |
| void | valueChanged (const QString &new_value) |
| void | treeUpdated () |
Public Member Functions | |
| GweFactoryOption (const QString &option_name, const QString &value=0, const QString &description=0) | |
| virtual | ~GweFactoryOption () |
| QString | getOptionName () const |
| QString | getDescription () const |
| QString | getValue () const |
| bool | hasSubOptions () const |
| QList< GweFactoryOption * > | getSubOptions () const |
| GweFactoryOption * | getSubOption (const QString &option_name) |
| QString | getValueOfSubOption (const QString &option_name) |
| bool | hasPredefinedValues () const |
| virtual QStringList | getPredefinedValues () const |
Protected Member Functions | |
| void | deleteSubOption (const QString &option_name) |
| void | deleteAllSubOptions () |
Protected Attributes | |
| QString | OptionName |
| QString | Description |
| QString | Value |
| QMap< QString, GweFactoryOption * > | SubOptions |
This class defines the base class for options. All specialisations are implemented in the implementation file of the GWoldEngineFactory class.
To implement a specialised option class, only updateTree() needs to be reimplemented.
| GWE::GweFactoryOption::GweFactoryOption | ( | const QString & | option_name, | |
| const QString & | value = 0, |
|||
| const QString & | description = 0 | |||
| ) |
Constructor. All parameters except the name of the option are optional.
| GWE::GweFactoryOption::~GweFactoryOption | ( | ) | [virtual] |
Destructor. Deletes all children.
| void GWE::GweFactoryOption::deleteAllSubOptions | ( | ) | [protected] |
A useful method for clearing all suboptions. This essentially deletes all suboptions and empties the value list.
| void GWE::GweFactoryOption::deleteSubOption | ( | const QString & | option_name | ) | [protected] |
Deletes only the given sub option.
| QString GWE::GweFactoryOption::getDescription | ( | ) | const |
| QString GWE::GweFactoryOption::getOptionName | ( | ) | const |
| QStringList GWE::GweFactoryOption::getPredefinedValues | ( | ) | const [virtual] |
an empty stringlist if the value can be any string, which means no predefined set of values is available.
| GweFactoryOption * GWE::GweFactoryOption::getSubOption | ( | const QString & | option_name | ) |
| QList< GweFactoryOption * > GWE::GweFactoryOption::getSubOptions | ( | ) | const |
| QString GWE::GweFactoryOption::getValue | ( | ) | const |
| QString GWE::GweFactoryOption::getValueOfSubOption | ( | const QString & | option_name | ) |
| bool GWE::GweFactoryOption::hasPredefinedValues | ( | ) | const |
If this option has predefined values, you can get the list of values with getPredefinedValues.
| bool GWE::GweFactoryOption::hasSubOptions | ( | ) | const |
| void GWE::GweFactoryOption::loadFromXml | ( | const QDomElement & | options | ) | [virtual, slot] |
Loads the configuration for this option including all suboptions from given XML element (recursive).
| void GWE::GweFactoryOption::saveToXml | ( | QDomElement | storage | ) | [virtual, slot] |
Saves the configuration for this option including all suboptions to given XML element (recursive).
| void GWE::GweFactoryOption::setDescription | ( | const QString & | description | ) | [virtual, slot] |
Sets the value of the option.
| void GWE::GweFactoryOption::setValue | ( | const QString & | value | ) | [virtual, slot] |
Sets the value of the option.
| void GWE::GweFactoryOption::setValueOfSubOption | ( | const QString & | sub_option_name, | |
| const QString & | value | |||
| ) | [virtual, slot] |
Set the value of the given sub_option. if the given suboption does not exist, nothing is done.
| void GWE::GweFactoryOption::treeUpdated | ( | ) | [signal] |
Emitted everytime the options tree is updated.
| void GWE::GweFactoryOption::updateTree | ( | ) | [virtual, slot] |
Updates recursively the available suboptions based on the current value of this option. This slot should be reimplemented in the specialised option class.
| void GWE::GweFactoryOption::valueChanged | ( | const QString & | new_value | ) | [signal] |
Emitted every time the value of the option changes.
QString GWE::GweFactoryOption::Description [protected] |
Description and explaination for the option. Should be displayed in the UI if help is requested.
QString GWE::GweFactoryOption::OptionName [protected] |
Holds the name of the option. Thus it is possible to use a class for more than just one option.
QMap<QString,GweFactoryOption*> GWE::GweFactoryOption::SubOptions [protected] |
All suboptions in the options tree of this option. The content depends on the value of this option.
QString GWE::GweFactoryOption::Value [protected] |
The actual value of the option. This determines the initialization process of the GWE.
1.4.7