Tome
A generic data editor for games supporting arbitrary input and output formats.
Public Member Functions | List of all members
Tome::MaximumRealValueFacet Class Reference

Specifies a maximum value for a custom Real type. More...

#include <maximumrealvaluefacet.h>

Inheritance diagram for Tome::MaximumRealValueFacet:
Tome::Facet

Public Member Functions

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). More...
 
const QVariant getDefaultValue () const Q_DECL_OVERRIDE
 Gets the default restriction of the domain of the custom type (e.g. default minimum value). More...
 
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 custom type (e.g. "Minimum value is 0."). More...
 
const QString getDisplayName () const Q_DECL_OVERRIDE
 Gets the name of the restriction of the domain of the custom type (e.g. "Minimum Value"). More...
 
const QString getKey () const Q_DECL_OVERRIDE
 Gets the key of the restriction of the domain of the custom type used for serialization. More...
 
const QString getTargetType () const Q_DECL_OVERRIDE
 Gets the custom type whose domain can be restricted by this facet. More...
 
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 (e.g. value of a QSpinBox). More...
 
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 (e.g. value of a QSpinBox). More...
 
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. More...
 
- Public Member Functions inherited from Tome::Facet
 Facet ()
 Constructs a new facet for restricting the domain of a custom type.
 

Detailed Description

Specifies a maximum value for a custom Real type.

Member Function Documentation

◆ createWidget()

QWidget * MaximumRealValueFacet::createWidget ( const FacetContext context) const
virtual

Creates a widget for specifying the restriction of the domain of the custom type (e.g. QSpinBox).

Parameters
contextAdditional information for creating the widget.
Returns
Widget for specifying the restriction of the domain of the custom type.

Implements Tome::Facet.

◆ getDefaultValue()

const QVariant MaximumRealValueFacet::getDefaultValue ( ) const
virtual

Gets the default restriction of the domain of the custom type (e.g. default minimum value).

Returns
Default restriction of the domain of the custom type (e.g. default minimum value).

Implements Tome::Facet.

◆ getDescriptionForValue()

const QString MaximumRealValueFacet::getDescriptionForValue ( const QVariant  facetValue) const
virtual

Gets the text to add to the description of a field, explaining the restriction of the domain of the custom type (e.g. "Minimum value is 0.").

Parameters
facetValueRestriction of the domain of the custom type.
Returns
Text to add to the description of a field, explaining the restriction of the domain of the custom type.

Implements Tome::Facet.

◆ getDisplayName()

const QString MaximumRealValueFacet::getDisplayName ( ) const
virtual

Gets the name of the restriction of the domain of the custom type (e.g. "Minimum Value").

Returns
Name of the restriction of the domain of the custom type.

Implements Tome::Facet.

◆ getKey()

const QString MaximumRealValueFacet::getKey ( ) const
virtual

Gets the key of the restriction of the domain of the custom type used for serialization.

Returns
Key of the restriction of the domain of the custom type used for serialization.

Implements Tome::Facet.

◆ getTargetType()

const QString MaximumRealValueFacet::getTargetType ( ) const
virtual

Gets the custom type whose domain can be restricted by this facet.

Returns
Custom type whose domain can be restricted by this facet.

Implements Tome::Facet.

◆ getWidgetValue()

const QVariant MaximumRealValueFacet::getWidgetValue ( QWidget *  widget) const
virtual

Gets the current value of the widget for specifying the restriction of the domain of the custom type (e.g. value of a QSpinBox).

Parameters
widgetWidget to get the current value of.
Returns
Current value of the widget for specifying the restriction of the domain of the custom type.

Implements Tome::Facet.

◆ setWidgetValue()

void MaximumRealValueFacet::setWidgetValue ( QWidget *  widget,
const QVariant  value 
) const
virtual

Sets the current value of the widget for specifying the restriction of the domain of the custom type (e.g. value of a QSpinBox).

Parameters
widgetWidget to set the current value of.
valueValue to set.

Implements Tome::Facet.

◆ validateValue()

QString MaximumRealValueFacet::validateValue ( const FacetContext context,
const QVariant  value,
const QVariant  facetValue 
) const
virtual

Validates the specified field value against the domain restrictions imposed by this facet.

Parameters
contextContext to validate the field value in.
valueField value to validate.
facetValueRestriction of the domain of the custom type (e.g. minimum value).
Returns
Translated error message, if any validation errors occur, and an empty string otherwise.

Implements Tome::Facet.


The documentation for this class was generated from the following files: