Tome
A generic data editor for games supporting arbitrary input and output formats.
minimumrealvaluefacet.h
1 #ifndef MINIMUMREALVALUEFACET_H
2 #define MINIMUMREALVALUEFACET_H
3 
4 #include <QObject>
5 
6 #include "facet.h"
7 
8 namespace Tome
9 {
10  class FacetContext;
11 
15  class MinimumRealValueFacet : 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  };
32 }
33 
34 #endif // MINIMUMREALVALUEFACET_H
Definition: commandlineoptions.h:6
const QString getKey() const Q_DECL_OVERRIDE
Gets the key of the restriction of the domain of the custom type used for serialization.
Definition: minimumrealvaluefacet.cpp:44
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: minimumrealvaluefacet.cpp:60
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: minimumrealvaluefacet.cpp:54
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: minimumrealvaluefacet.cpp:18
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: minimumrealvaluefacet.cpp:39
const QVariant getDefaultValue() const Q_DECL_OVERRIDE
Gets the default restriction of the domain of the custom type (e.g. default minimum value)...
Definition: minimumrealvaluefacet.cpp:29
Specifies a minimum value for a custom Real type.
Definition: minimumrealvaluefacet.h:15
Context to apply facets in.
Definition: facetcontext.h:11
Restricts the domain of a custom type.
Definition: facet.h:14
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: minimumrealvaluefacet.cpp:34
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: minimumrealvaluefacet.cpp:66
const QString getTargetType() const Q_DECL_OVERRIDE
Gets the custom type whose domain can be restricted by this facet.
Definition: minimumrealvaluefacet.cpp:49