#include <modules.h>
Classes | |
struct | SettingItem |
Represents one setting value in a module. More... | |
struct | SettingType |
Represents the type of one module's setting - without label and description. More... | |
struct | SettingTypeItem |
Represents the type of one setting - including label, description, etc. More... | |
union | SettingValue |
Represents one setting - one number, real or integer. More... | |
struct | TypeInfo |
Information about one module-type. More... | |
Public Types | |
enum | CloneMethod |
Two types of cloning, used in clone. | |
enum | ChoiceType { Stop, Int, IntLog2, Float, ModuleCombo, Combo } |
Types of a setting. More... | |
Public Member Functions | |
template<class M > | |
M * | concreteClone (CloneMethod method) const |
Concrete cloning method - templated by the actual type of the module. | |
virtual | ~Module () |
Deletes the settings, destroying child modules as well. | |
virtual const TypeInfo & | info () const =0 |
Returns reference to module-type's information, like count and types of settings, etc. Implemented in all modules via macros. | |
Protected Member Functions | |
Module () | |
Initializes an empty module. | |
virtual Module * | abstractClone (CloneMethod method) const =0 |
Cloning method, implemented in all modules via macros. | |
void | file_saveAllSettings (std::ostream &stream) |
Saves all the settings, icluding child modules. | |
void | file_loadAllSettings (std::istream &stream) |
Loads all the settings, icluding child modules (and their settings). | |
void | file_saveModuleType (std::ostream &os, int which) |
Puts a module-identifier in a stream (which is the index in settings). | |
void | file_loadModuleType (std::istream &is, int which) |
Gets an module-identifier from the stream, initializes the pointer in settings with a new empty instance and does some checking (bounds,Iface). | |
int & | settingsInt (int index) |
A shortcut method for working with integer settings. | |
Static Protected Member Functions | |
SettingType construction methods | |
| |
static SettingType | settingInt (int min, int defaults, int max, ChoiceType type=Int) |
Creates a bounded integer setting, optionally shown as a power of two. | |
static SettingType | settingFloat (float min, float defaults, float max) |
Creates a bounded real-number setting. | |
static SettingType | settingCombo (const char *text, int defaults) |
Creates a choose-one-of setting shown as a combo-box. | |
template<class Iface > | |
static SettingType | settingModule (int defaultID) |
Creates a connection to another module (type specified as a template parameter). | |
template<class Iface > | |
static SettingType | settingModule () |
A shortcut to set the first compatible module as the default one. | |
Protected Attributes | |
SettingItem * | settings |
The current setting values of this Module. | |
Private Member Functions | |
Construction, destruction and related methods | |
SettingItem * | copySettings (CloneMethod method) const |
Creates a copy of module's settings (includes the whole module subtree). | |
void | initDefaultModuleLinks () |
Called for prototypes to initialize the default links to other modules. | |
void | nullModuleLinks () |
Called for prototypes to null links to other modules. | |
void | createDefaultSettings () |
Called for prototypes to create the settings and inicialize them with defaults. | |
Module & | operator= (const Module &) |
Denial of assigment. | |
Module (const Module &) | |
Denial of copying. | |
Friends | |
class | ModuleFactory |
Permission for the ModuleFactory to manipulate Modules. | |
Settings visualization and related methods | |
| |
void | widget2settings (const QWidget *widget, int which) |
Reads a setting value from a widget. | |
void | settings2widget (QWidget *widget, int which) |
Writes a setting value into a widget. | |
void | settingsType2widget (QWidget *widget, const SettingTypeItem &typeItem) |
Initializes a widget according to a setting-item type. | |
virtual void | adjustSettings (int which, QTreeWidgetItem *myTree, QGroupBox *setBox) |
Creates or updates settings-box and/or settings-tree. if overridden in derived modules, it is recommended to call this one at first. |
Definition at line 12 of file modules.h.
enum Module::ChoiceType |
virtual Module* Module::abstractClone | ( | CloneMethod | method | ) | const [protected, pure virtual] |
Cloning method, implemented in all modules via macros.
method | determines creation of a deep or a shallow copy (zeroed children) |
Referenced by Interface< ISquareRanges >::clone(), copySettings(), and ModuleFactory::newModule().
static SettingType Module::settingModule | ( | int | defaultID | ) | [inline, static, protected] |
Creates a connection to another module (type specified as a template parameter).
It will be shown as a combo-box and automatically filled by compatible modules. The default possibility can be specified
Definition at line 188 of file modules.h.
References ModuleCombo.