![]() |
Tome
A generic data editor for games supporting arbitrary input and output formats.
|
Controller for adding, updating and removing custom types. More...
#include <typescontroller.h>
Signals | |
| void | typeAdded (const Tome::CustomType &type) |
| A new custom type has been added to the project. More... | |
| void | typeRenamed (const QString &oldName, const QString &newName) |
| A custom type has ben renamed. More... | |
| void | typeRemoved (const Tome::CustomType &type) |
| A custom type has been removed from the project. More... | |
| void | typeUpdated (const Tome::CustomType &type) |
| The properties of a custom type have been updated. More... | |
Public Member Functions | |
| void | addCustomTypeSet (const CustomTypeSet &customTypeSet) |
| Adds the passed custom type set to the project. More... | |
| const CustomType | addDerivedType (const QString &name, const QString &baseType, const QVariantMap &facets, const QString &customTypeSetName) |
| Adds a new derived type to the specified set. More... | |
| const CustomType | addEnumeration (const QString &name, const QStringList &enumeration, const QString &customTypeSetName) |
| Adds a new enumeration type to the specified set. More... | |
| const CustomType | addList (const QString &name, const QString &itemType, const QString &customTypeSetName) |
| Adds a new list type to the specified set. More... | |
| const CustomType | addMap (const QString &name, const QString &keyType, const QString &valueType, const QString &customTypeSetName) |
| Adds a new map type to the specified set. More... | |
| const QStringList | getBuiltInTypes () const |
| Gets a list of built-in (i.e. non-custom) types of Tome. More... | |
| const CustomType & | getCustomType (const QString &name) const |
| Gets the custom type with the specified name. More... | |
| const CustomTypeList | getCustomTypes () const |
| Gets a list of all custom types in the project. More... | |
| const CustomTypeSetList & | getCustomTypeSets () const |
| Gets a list of all custom type sets in the project. More... | |
| const QStringList | getCustomTypeSetNames () const |
| Gets a list of the names of all custom type sets in the project. More... | |
| const QStringList | getTypeNames () const |
| Gets a list of all type names of this project, including built-in types. More... | |
| bool | isBuiltInType (const QString &name) const |
| Checks whether the specified name denotes a built-in type of Tome. More... | |
| bool | isCustomType (const QString &name) const |
| Checks whether the project has a custom type with the specified name. More... | |
| bool | isTypeOrDerivedFromType (const QString &lhs, const QString &rhs) const |
| Checks whether the first specified type is equal to or derived from the second specified type. More... | |
| void | removeCustomType (const QString &typeName) |
| Removes the custom type with the specified name from the project. More... | |
| void | removeCustomTypeSet (const QString &name) |
| Removes the custom type set with the specified name from the project, including all custom types. More... | |
| void | setCustomTypes (CustomTypeSetList &model) |
| Uses the specified list of custom type sets as model for this controller. More... | |
| void | updateDerivedType (const QString &oldName, const QString &newName, const QString &baseType, const QVariantMap facets, const QString &typeSetName) |
| Updates the properties of the specified derived type. More... | |
| void | updateEnumeration (const QString &oldName, const QString &newName, const QStringList &enumeration, const QString &typeSetName) |
| Updates the properties of the specified enumeration. More... | |
| void | updateList (const QString &oldName, const QString &newName, const QString &itemType, const QString &typeSetName) |
| Updates the properties of the specified list type. More... | |
| void | updateMap (const QString &oldName, const QString &newName, const QString &keyType, const QString &valueType, const QString &typeSetName) |
| Updates the properties of the specified map type. More... | |
| QString | valueToString (const QVariant &value, const QString &typeName) const |
| Converts the specified value to a human-readable string. More... | |
Controller for adding, updating and removing custom types.
| void TypesController::addCustomTypeSet | ( | const CustomTypeSet & | customTypeSet | ) |
Adds the passed custom type set to the project.
| customTypeSet | Custom type set to add. |
| const CustomType TypesController::addDerivedType | ( | const QString & | name, |
| const QString & | baseType, | ||
| const QVariantMap & | facets, | ||
| const QString & | customTypeSetName | ||
| ) |
Adds a new derived type to the specified set.
| std::out_of_range | if the custom type set could not be found. |
| name | Name of the type to add. |
| baseType | Name of the base type of the type to add. |
| facets | Facet values of the type to add. |
| customTypeSetName | Name of the type set to add the new type to. |
| const CustomType TypesController::addEnumeration | ( | const QString & | name, |
| const QStringList & | enumeration, | ||
| const QString & | customTypeSetName | ||
| ) |
Adds a new enumeration type to the specified set.
| std::out_of_range | if the custom type set could not be found. |
| name | Name of the enumeration to add. |
| enumeration | Items of the enumeration to add. |
| customTypeSetName | Name of the type set to add the new enumeration to. |
| const CustomType TypesController::addList | ( | const QString & | name, |
| const QString & | itemType, | ||
| const QString & | customTypeSetName | ||
| ) |
Adds a new list type to the specified set.
| std::out_of_range | if the custom type set could not be found. |
| name | Name of the list type to add. |
| itemType | Type of the items of the list type to add. |
| customTypeSetName | Name of the type set to add the new list type to. |
| const CustomType TypesController::addMap | ( | const QString & | name, |
| const QString & | keyType, | ||
| const QString & | valueType, | ||
| const QString & | customTypeSetName | ||
| ) |
Adds a new map type to the specified set.
| std::out_of_range | if the custom type set could not be found. |
| name | Name of the map type to add. |
| keyType | Type of the keys of the map type to add. |
| valueType | Type of the values of the map type to add. |
| customTypeSetName | Name of the type set to add the new map type to. |
| const QStringList TypesController::getBuiltInTypes | ( | ) | const |
Gets a list of built-in (i.e. non-custom) types of Tome.
| const CustomType & TypesController::getCustomType | ( | const QString & | name | ) | const |
Gets the custom type with the specified name.
| std::out_of_range | if the custom type with the specified name could not be found. |
| name | Name of the type to get. |
| const CustomTypeList TypesController::getCustomTypes | ( | ) | const |
Gets a list of all custom types in the project.
| const QStringList TypesController::getCustomTypeSetNames | ( | ) | const |
Gets a list of the names of all custom type sets in the project.
| const CustomTypeSetList & TypesController::getCustomTypeSets | ( | ) | const |
Gets a list of all custom type sets in the project.
| const QStringList TypesController::getTypeNames | ( | ) | const |
Gets a list of all type names of this project, including built-in types.
| bool TypesController::isBuiltInType | ( | const QString & | name | ) | const |
Checks whether the specified name denotes a built-in type of Tome.
| name | Name of the type to check. |
| bool TypesController::isCustomType | ( | const QString & | name | ) | const |
Checks whether the project has a custom type with the specified name.
| name | Name of the custom type to look for. |
| bool TypesController::isTypeOrDerivedFromType | ( | const QString & | lhs, |
| const QString & | rhs | ||
| ) | const |
Checks whether the first specified type is equal to or derived from the second specified type.
| lhs | Name of the type to check. |
| rhs | Possible equal or base type. |
| void TypesController::removeCustomType | ( | const QString & | typeName | ) |
Removes the custom type with the specified name from the project.
| typeName | Name of the custom type to remove. |
| void TypesController::removeCustomTypeSet | ( | const QString & | name | ) |
Removes the custom type set with the specified name from the project, including all custom types.
| name | Name of the custom type set to remove. |
| void TypesController::setCustomTypes | ( | CustomTypeSetList & | model | ) |
Uses the specified list of custom type sets as model for this controller.
| model | New list of custom type sets to use as model for this controller. |
|
signal |
A new custom type has been added to the project.
| type | New custom type. |
|
signal |
A custom type has been removed from the project.
| type | Custom type that has been removed from the project. |
|
signal |
A custom type has ben renamed.
| oldName | Previous name of the custom type. |
| newName | New name of the custom type. |
|
signal |
The properties of a custom type have been updated.
| type | Custom type that has been updated. |
| void TypesController::updateDerivedType | ( | const QString & | oldName, |
| const QString & | newName, | ||
| const QString & | baseType, | ||
| const QVariantMap | facets, | ||
| const QString & | typeSetName | ||
| ) |
Updates the properties of the specified derived type.
| std::out_of_range | if the custom type with the specified name could not be found. |
| oldName | Current name of the derived type to update. |
| newName | New name of the derived type to update. |
| baseType | Name of the new base type of the type to update. |
| facets | New facet values of the type to update. |
| typeSetName | Name of the new type set the derived type should belong to. |
| void TypesController::updateEnumeration | ( | const QString & | oldName, |
| const QString & | newName, | ||
| const QStringList & | enumeration, | ||
| const QString & | typeSetName | ||
| ) |
Updates the properties of the specified enumeration.
| std::out_of_range | if the custom type with the specified name could not be found. |
| oldName | Current name of the enumeration to update. |
| newName | New name of the enumeration to update. |
| enumeration | New items of the enumeration to update. |
| typeSetName | Name of the new type set the enumeration should belong to. |
| void TypesController::updateList | ( | const QString & | oldName, |
| const QString & | newName, | ||
| const QString & | itemType, | ||
| const QString & | typeSetName | ||
| ) |
Updates the properties of the specified list type.
| std::out_of_range | if the custom type with the specified name could not be found. |
| oldName | Current name of the list type to update. |
| newName | New name of the list type to update. |
| itemType | New type of the items of the list type to update. |
| typeSetName | Name of the new type set the list type should belong to. |
| void TypesController::updateMap | ( | const QString & | oldName, |
| const QString & | newName, | ||
| const QString & | keyType, | ||
| const QString & | valueType, | ||
| const QString & | typeSetName | ||
| ) |
Updates the properties of the specified map type.
| std::out_of_range | if the custom type with the specified name could not be found. |
| oldName | Current name of the map type to update. |
| newName | New name of the map type to update. |
| keyType | New type of the keys of the map type to update. |
| valueType | New type of the values of the map type to update. |
| typeSetName | Name of the new type set the map type should belong to. |
| QString TypesController::valueToString | ( | const QVariant & | value, |
| const QString & | typeName | ||
| ) | const |
Converts the specified value to a human-readable string.
| value | Value to convert. |
| typeName | Name of the type of the value. |
1.8.13