Tome
A generic data editor for games supporting arbitrary input and output formats.
requiredreferenceancestorfacet.h
1 #ifndef REQUIREDREFERENCEANCESTORFACET_H
2 #define REQUIREDREFERENCEANCESTORFACET_H
3 
4 #include <QObject>
5 
6 #include "facet.h"
7 
8 namespace Tome
9 {
10  class FacetContext;
11 
15  class RequiredReferenceAncestorFacet : public QObject, public Facet
16  {
17  Q_OBJECT
18 
19  public:
21 
22  QWidget* createWidget(const FacetContext& context) const Q_DECL_OVERRIDE;
23  const QVariant getDefaultValue() const Q_DECL_OVERRIDE;
24  const QString getDescriptionForValue(const QVariant facetValue) const Q_DECL_OVERRIDE;
25  const QString getDisplayName() const Q_DECL_OVERRIDE;
26  const QString getKey() const Q_DECL_OVERRIDE;
27  const QString getTargetType() const Q_DECL_OVERRIDE;
28  const QVariant getWidgetValue(QWidget* widget) const Q_DECL_OVERRIDE;
29  void setWidgetValue(QWidget* widget, const QVariant value) const Q_DECL_OVERRIDE;
30  QString validateValue(const FacetContext& context, const QVariant value, const QVariant facetValue) const Q_DECL_OVERRIDE;
31 
35  static const QString FacetKey;
36  };
37 }
38 
39 #endif // REQUIREDREFERENCEANCESTORFACET_H
Definition: commandlineoptions.h:6
const QString getDescriptionForValue(const QVariant facetValue) const Q_DECL_OVERRIDE
Gets the text to add to the description of a field, explaining the restriction of the domain of the c...
Definition: requiredreferenceancestorfacet.cpp:40
const QString getKey() const Q_DECL_OVERRIDE
Gets the key of the restriction of the domain of the custom type used for serialization.
Definition: requiredreferenceancestorfacet.cpp:53
const QString getTargetType() const Q_DECL_OVERRIDE
Gets the custom type whose domain can be restricted by this facet.
Definition: requiredreferenceancestorfacet.cpp:58
const QVariant getWidgetValue(QWidget *widget) const Q_DECL_OVERRIDE
Gets the current value of the widget for specifying the restriction of the domain of the custom type ...
Definition: requiredreferenceancestorfacet.cpp:63
const QString getDisplayName() const Q_DECL_OVERRIDE
Gets the name of the restriction of the domain of the custom type (e.g. "Minimum Value").
Definition: requiredreferenceancestorfacet.cpp:48
const QVariant getDefaultValue() const Q_DECL_OVERRIDE
Gets the default restriction of the domain of the custom type (e.g. default minimum value)...
Definition: requiredreferenceancestorfacet.cpp:35
Specifies a required record ancestor for all values of a custom Reference type.
Definition: requiredreferenceancestorfacet.h:15
QWidget * createWidget(const FacetContext &context) const Q_DECL_OVERRIDE
Creates a widget for specifying the restriction of the domain of the custom type (e.g. QSpinBox).
Definition: requiredreferenceancestorfacet.cpp:19
Context to apply facets in.
Definition: facetcontext.h:11
void setWidgetValue(QWidget *widget, const QVariant value) const Q_DECL_OVERRIDE
Sets the current value of the widget for specifying the restriction of the domain of the custom type ...
Definition: requiredreferenceancestorfacet.cpp:69
Restricts the domain of a custom type.
Definition: facet.h:14
static const QString FacetKey
Key of the restriction of the domain of the custom type used for serialization.
Definition: requiredreferenceancestorfacet.h:35
QString validateValue(const FacetContext &context, const QVariant value, const QVariant facetValue) const Q_DECL_OVERRIDE
Validates the specified field value against the domain restrictions imposed by this facet...
Definition: requiredreferenceancestorfacet.cpp:83