![]() |
Tome
A generic data editor for games supporting arbitrary input and output formats.
|
Controller for adding, updating and removing field definitions. More...
#include <fielddefinitionscontroller.h>
Signals | |
| void | fieldDefinitionAdded (const Tome::FieldDefinition &fieldDefinition) |
| A new field definition has been added to the project. More... | |
| void | fieldDefinitionRemoved (const Tome::FieldDefinition &fieldDefinition) |
| A field definition has been removed from the project. More... | |
| void | fieldDefinitionUpdated (const Tome::FieldDefinition &oldFieldDefinition, const Tome::FieldDefinition &newFieldDefinition) |
| The properties of a field definition have been updated. More... | |
Public Member Functions | |
| FieldDefinitionsController (const ComponentsController &componentsController, const TypesController &typesController) | |
| Constructs a new controller for adding, updating and removing field definitions. More... | |
| void | addFieldDefinition (const QString &id, const QString &displayName, const QString &fieldType, const QVariant &defaultValue, const QString &component, const QString &description, const QString &fieldDefinitionSetName) |
| Adds a new field definition to the specified set. More... | |
| void | addFieldDefinitionSet (const FieldDefinitionSet &fieldDefinitionSet) |
| Adds the passed field definition set to the project. More... | |
| const FieldDefinition & | getFieldDefinition (const QString &id) const |
| Gets the field definition with the specified id. More... | |
| const FieldDefinitionList | getFieldDefinitions () const |
| Gets a list of all field definitions in the project. More... | |
| const FieldDefinitionList | getFieldDefinitionsOfComponent (const QString &component) const |
| Gets a list of all field definitions belonging to the specified component. More... | |
| const FieldDefinitionSetList & | getFieldDefinitionSets () const |
| Gets a list of all field definition sets in the project. More... | |
| const QStringList | getFieldDefinitionSetNames () const |
| Gets a list of the names of all field definition sets in the project. More... | |
| bool | hasFieldDefinition (const QString &id) const |
| Checks whether the project has a field definition with the specified id. More... | |
| void | removeFieldDefinition (const QString &fieldId) |
| Removes the field definition with the specified id from the project. More... | |
| void | removeFieldDefinitionSet (const QString &name) |
| Removes the field definition set with the specified name from the project, including all fields. More... | |
| void | setFieldDefinitionSets (FieldDefinitionSetList &model) |
| Uses the specified list of field definition sets as model for this controller. More... | |
| void | updateFieldDefinition (const QString oldId, const QString newId, const QString &displayName, const QString &fieldType, const QVariant &defaultValue, const QString &component, const QString &description, const QString &fieldDefinitionSetName) |
| Updates the properties of the specified field definition. More... | |
Controller for adding, updating and removing field definitions.
| FieldDefinitionsController::FieldDefinitionsController | ( | const ComponentsController & | componentsController, |
| const TypesController & | typesController | ||
| ) |
Constructs a new controller for adding, updating and removing field definitions.
| componentsController | Controller for adding and removing components. |
| typesController | Controller for adding, updating and removing custom types. |
| void FieldDefinitionsController::addFieldDefinition | ( | const QString & | id, |
| const QString & | displayName, | ||
| const QString & | fieldType, | ||
| const QVariant & | defaultValue, | ||
| const QString & | component, | ||
| const QString & | description, | ||
| const QString & | fieldDefinitionSetName | ||
| ) |
Adds a new field definition to the specified set.
| std::out_of_range | if a field with the specified id already exists. |
| std::out_of_range | if the field definition set could not be found. |
| id | Id of the field to add. |
| displayName | Display name of the field to add. |
| fieldType | Type of the field to add. |
| defaultValue | Default value of the field to add. |
| component | Component to add the field to. |
| description | Textual description of the field to add. |
| fieldDefinitionSetName | Name of the field definition set to add the field to. |
| void FieldDefinitionsController::addFieldDefinitionSet | ( | const FieldDefinitionSet & | fieldDefinitionSet | ) |
Adds the passed field definition set to the project.
| fieldDefinitionSet | Field definition set to add. |
|
signal |
A new field definition has been added to the project.
| fieldDefinition | New field defintion that has been added to the project. |
|
signal |
A field definition has been removed from the project.
| fieldDefinition | Field definition that has been removed from the project. |
|
signal |
The properties of a field definition have been updated.
| oldFieldDefinition | Old properties of the field definition. |
| newFieldDefinition | New properties of the field definition. |
| const FieldDefinition & FieldDefinitionsController::getFieldDefinition | ( | const QString & | id | ) | const |
Gets the field definition with the specified id.
| std::out_of_range | if the field definition with the specified id could not be found. |
| id | Id of the field definition to get. |
| const FieldDefinitionList FieldDefinitionsController::getFieldDefinitions | ( | ) | const |
Gets a list of all field definitions in the project.
| const QStringList FieldDefinitionsController::getFieldDefinitionSetNames | ( | ) | const |
Gets a list of the names of all field definition sets in the project.
| const FieldDefinitionSetList & FieldDefinitionsController::getFieldDefinitionSets | ( | ) | const |
Gets a list of all field definition sets in the project.
| const FieldDefinitionList FieldDefinitionsController::getFieldDefinitionsOfComponent | ( | const QString & | component | ) | const |
Gets a list of all field definitions belonging to the specified component.
| component | Component to get all fields of. |
| bool FieldDefinitionsController::hasFieldDefinition | ( | const QString & | id | ) | const |
Checks whether the project has a field definition with the specified id.
| id | Id of the field definition to look for. |
| void FieldDefinitionsController::removeFieldDefinition | ( | const QString & | fieldId | ) |
Removes the field definition with the specified id from the project.
| fieldId | Id of the field to remove. |
| void FieldDefinitionsController::removeFieldDefinitionSet | ( | const QString & | name | ) |
Removes the field definition set with the specified name from the project, including all fields.
| name | Name of the field definition set to remove. |
| void FieldDefinitionsController::setFieldDefinitionSets | ( | FieldDefinitionSetList & | model | ) |
Uses the specified list of field definition sets as model for this controller.
| model | New list of field definition sets to use as model for this controller. |
| void FieldDefinitionsController::updateFieldDefinition | ( | const QString | oldId, |
| const QString | newId, | ||
| const QString & | displayName, | ||
| const QString & | fieldType, | ||
| const QVariant & | defaultValue, | ||
| const QString & | component, | ||
| const QString & | description, | ||
| const QString & | fieldDefinitionSetName | ||
| ) |
Updates the properties of the specified field definition.
| std::out_of_range | if the field definition with the specified id could not be found. |
| std::out_of_range | if a field with the new id already exists. |
| oldId | Current id of the field to update. |
| newId | New id of the field to update. |
| displayName | New display name of the field. |
| fieldType | New type of the field. |
| defaultValue | New default value of the field. |
| component | New component the field should belong to. |
| description | New textual description of the field. |
| fieldDefinitionSetName | Name of the new field definition set the field should belong to. |
1.8.13