2 * Copyright 2015, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
5 #ifndef VALUE_FORMATTER_H
6 #define VALUE_FORMATTER_H
9 #include <Referenceable.h>
16 class ValueFormatter
: public BReferenceable
{
18 virtual ~ValueFormatter();
20 virtual Settings
* GetSettings() const = 0;
21 // returns NULL, if no settings
23 virtual status_t
FormatValue(Value
* value
, BString
& _output
)
26 virtual bool SupportsValidation() const;
27 virtual bool ValidateFormattedValue(
29 type_code type
) const;
30 // checks if the passed in string
31 // would be considered a valid value
32 // according to the current format
33 // configuration and the size constraints
34 // imposed by the passed in type.
35 virtual status_t
GetValueFromFormattedInput(
36 const BString
& input
, type_code type
,
37 Value
*& _output
) const;
42 #endif // VALUE_FORMATTER_H