Tome
A generic data editor for games supporting arbitrary input and output formats.
facetscontroller.h
1 #ifndef FACETSCONTROLLER_H
2 #define FACETSCONTROLLER_H
3 
4 #include <QList>
5 #include <QVariant>
6 
7 namespace Tome
8 {
9  class Facet;
10  class RecordsController;
11  class TypesController;
12 
17  {
18  public:
24  FacetsController(const RecordsController& recordsController, const TypesController& typesController);
26 
32  QList<Facet*> getFacets(const QString& targetType) const;
33 
40  QVariant getFacetValue(const QString& fieldType, const QString& facetKey) const;
41 
46  void registerFacet(Facet* facet);
47 
54  QString validateFieldValue(const QString& fieldType, const QVariant& fieldValue) const;
55 
56  private:
57  const RecordsController& recordsController;
58  const TypesController& typesController;
59 
60  QList<Facet*> facets;
61  };
62 }
63 
64 #endif // FACETSCONTROLLER_H
Definition: commandlineoptions.h:6
Controller for adding, updating and removing records.
Definition: recordscontroller.h:21
QVariant getFacetValue(const QString &fieldType, const QString &facetKey) const
Gets the restriction of the specified domain of the specified type (e.g. minimum value of an integer)...
Definition: facetscontroller.cpp:57
void registerFacet(Facet *facet)
Adds a new facet to be applied to custom types.
Definition: facetscontroller.cpp:98
QList< Facet * > getFacets(const QString &targetType) const
Gets a list of all facets that may apply to the specified type.
Definition: facetscontroller.cpp:29
Controller for adding, updating and removing custom types.
Definition: typescontroller.h:14
QString validateFieldValue(const QString &fieldType, const QVariant &fieldValue) const
Validates the specified field value against the domain restrictions imposed by the facets of its type...
Definition: facetscontroller.cpp:103
Controller for validating type facets.
Definition: facetscontroller.h:16
Restricts the domain of a custom type.
Definition: facet.h:14
FacetsController(const RecordsController &recordsController, const TypesController &typesController)
Constructs a new controller for validating type facets.
Definition: facetscontroller.cpp:13