Tome
A generic data editor for games supporting arbitrary input and output formats.
maximumintegervaluefacet.h
1 #ifndef MAXIMUMINTEGERVALUEFACET_H
2 #define MAXIMUMINTEGERVALUEFACET_H
3 
4 #include <QObject>
5 
6 #include "facet.h"
7 
8 
9 namespace Tome
10 {
11  class FacetContext;
12 
16  class MaximumIntegerValueFacet : public QObject, public Facet
17  {
18  Q_OBJECT
19 
20  public:
22 
23  QWidget* createWidget(const FacetContext& context) const Q_DECL_OVERRIDE;
24  const QVariant getDefaultValue() const Q_DECL_OVERRIDE;
25  const QString getDescriptionForValue(const QVariant facetValue) const Q_DECL_OVERRIDE;
26  const QString getDisplayName() const Q_DECL_OVERRIDE;
27  const QString getKey() const Q_DECL_OVERRIDE;
28  const QString getTargetType() const Q_DECL_OVERRIDE;
29  const QVariant getWidgetValue(QWidget* widget) const Q_DECL_OVERRIDE;
30  void setWidgetValue(QWidget* widget, const QVariant value) const Q_DECL_OVERRIDE;
31  QString validateValue(const FacetContext& context, const QVariant value, const QVariant facetValue) const Q_DECL_OVERRIDE;
32  };
33 }
34 
35 #endif // MAXIMUMINTEGERVALUEFACET_H
Definition: commandlineoptions.h:6
const QString getTargetType() const Q_DECL_OVERRIDE
Gets the custom type whose domain can be restricted by this facet.
Definition: maximumintegervaluefacet.cpp:48
const QString getKey() const Q_DECL_OVERRIDE
Gets the key of the restriction of the domain of the custom type used for serialization.
Definition: maximumintegervaluefacet.cpp:42
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: maximumintegervaluefacet.cpp:59
Specifies a maximum value for a custom Integer type.
Definition: maximumintegervaluefacet.h:16
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: maximumintegervaluefacet.cpp:53
Context to apply facets in.
Definition: facetcontext.h:11
Restricts the domain of a custom type.
Definition: facet.h:14
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: maximumintegervaluefacet.cpp:65
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: maximumintegervaluefacet.cpp:37
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: maximumintegervaluefacet.cpp:32
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: maximumintegervaluefacet.cpp:17
const QVariant getDefaultValue() const Q_DECL_OVERRIDE
Gets the default restriction of the domain of the custom type (e.g. default minimum value)...
Definition: maximumintegervaluefacet.cpp:27