LibreOffice Module vcl (master)  1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
MetricFormatter Class Referenceabstract

#include <field.hxx>

Inheritance diagram for MetricFormatter:
Collaboration diagram for MetricFormatter:

Public Member Functions

virtual ~MetricFormatter () override
virtual void CustomConvert ()=0
virtual void Reformat () override
virtual void SetUnit (FieldUnit meUnit)
FieldUnit GetUnit () const
void SetCustomUnitText (const OUString &rStr)
const OUString & GetCustomUnitText () const
const OUString & GetCurUnitText () const
void SetMax (sal_Int64 nNewMax, FieldUnit eInUnit)
sal_Int64 GetMax (FieldUnit eOutUnit) const
void SetMin (sal_Int64 nNewMin, FieldUnit eInUnit)
sal_Int64 GetMin (FieldUnit eOutUnit) const
void SetBaseValue (sal_Int64 nNewBase, FieldUnit eInUnit=FieldUnit::NONE)
sal_Int64 GetBaseValue () const
virtual void SetValue (sal_Int64 nNewValue, FieldUnit eInUnit)
virtual void SetValue (sal_Int64 nValue) override
void SetUserValue (sal_Int64 nNewValue, FieldUnit eInUnit)
sal_Int64 GetValue (FieldUnit eOutUnit) const
virtual OUString CreateFieldText (sal_Int64 nValue) const override
sal_Int64 GetCorrectedValue (FieldUnit eOutUnit) const
void SetCustomConvertHdl (const Link< MetricFormatter &, void > &rLink)
- Public Member Functions inherited from NumericFormatter
virtual ~NumericFormatter () override
void SetMin (sal_Int64 nNewMin)
sal_Int64 GetMin () const
void SetMax (sal_Int64 nNewMax)
sal_Int64 GetMax () const
sal_Int64 ClipAgainstMinMax (sal_Int64 nValue) const
void SetFirst (sal_Int64 nNewFirst)
sal_Int64 GetFirst () const
void SetLast (sal_Int64 nNewLast)
sal_Int64 GetLast () const
void SetSpinSize (sal_Int64 nNewSize)
sal_Int64 GetSpinSize () const
void SetDecimalDigits (sal_uInt16 nDigits)
sal_uInt16 GetDecimalDigits () const
void SetUseThousandSep (bool b)
bool IsUseThousandSep () const
void SetShowTrailingZeros (bool bShowTrailingZeros)
bool IsShowTrailingZeros () const
void SetUserValue (sal_Int64 nNewValue)
sal_Int64 GetValue () const
bool IsValueModified () const
sal_Int64 Normalize (sal_Int64 nValue) const
sal_Int64 Denormalize (sal_Int64 nValue) const
- Public Member Functions inherited from FormatterBase
 FormatterBase (Edit *pField)
virtual ~FormatterBase ()
const LocaleDataWrapperGetLocaleDataWrapper () const
bool MustBeReformatted () const
void MarkToBeReformatted (bool b)
void SetStrictFormat (bool bStrict)
bool IsStrictFormat () const
virtual void ReformatAll ()
const css::lang::Locale & GetLocale () const
const LanguageTagGetLanguageTag () const
void SetEmptyFieldValue ()
bool IsEmptyFieldValue () const
void EnableEmptyFieldValue (bool bEnable)
bool IsEmptyFieldValueEnabled () const

Static Public Member Functions

static FieldUnit StringToMetric (const OUString &rMetricString)
static bool TextToValue (const OUString &rStr, double &rValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits, const LocaleDataWrapper &rLocaleDataWrapper, FieldUnit eUnit)

Protected Member Functions

 MetricFormatter (Edit *pEdit)
SAL_DLLPRIVATE void ImplMetricReformat (const OUString &rStr, double &rValue, OUString &rOutStr)
virtual sal_Int64 GetValueFromString (const OUString &rStr) const override
virtual sal_Int64 GetValueFromStringUnit (const OUString &rStr, FieldUnit eOutUnit) const
- Protected Member Functions inherited from NumericFormatter
 NumericFormatter (Edit *pEdit)
void FieldUp ()
void FieldDown ()
void FieldFirst ()
void FieldLast ()
void FormatValue (Selection const *pNewSelection=nullptr)
SAL_DLLPRIVATE void ImplNumericReformat ()
SAL_DLLPRIVATE void ImplNewFieldValue (sal_Int64 nNewValue)
SAL_DLLPRIVATE void ImplSetUserValue (sal_Int64 nNewValue, Selection const *pNewSelection=nullptr)
- Protected Member Functions inherited from FormatterBase
SAL_DLLPRIVATE void ImplSetText (const OUString &rText, Selection const *pNewSel=nullptr)
SAL_DLLPRIVATE bool ImplGetEmptyFieldValue () const
void SetEmptyFieldValueData (bool bValue)
SAL_DLLPRIVATE LocaleDataWrapperImplGetLocaleDataWrapper () const
EditGetField () const
void ClearField ()

Protected Attributes

sal_Int64 mnBaseValue
FieldUnit meUnit
Link< MetricFormatter &, voidmaCustomConvertLink
- Protected Attributes inherited from NumericFormatter
sal_Int64 mnFieldValue
sal_Int64 mnLastValue
sal_Int64 mnMin
sal_Int64 mnMax
bool mbWrapOnLimits
bool mbFormatting
sal_Int64 mnSpinSize
sal_Int64 mnFirst
sal_Int64 mnLast

Private Member Functions

SAL_DLLPRIVATE void ImplInit ()

Private Attributes

OUString maCustomUnitText
OUString maCurUnitText

Detailed Description

Definition at line 195 of file field.hxx.

Constructor & Destructor Documentation

MetricFormatter::~MetricFormatter ( )

Definition at line 1342 of file field.cxx.

MetricFormatter::MetricFormatter ( Edit pEdit)

Definition at line 1336 of file field.cxx.

References ImplInit().

Member Function Documentation

OUString MetricFormatter::CreateFieldText ( sal_Int64  nValue) const
virtual void MetricFormatter::CustomConvert ( )
pure virtual

Implemented in MetricBox, and MetricField.

Referenced by Reformat().

sal_Int64 MetricFormatter::GetBaseValue ( ) const
sal_Int64 MetricFormatter::GetCorrectedValue ( FieldUnit  eOutUnit) const
const OUString& MetricFormatter::GetCurUnitText ( ) const

Definition at line 207 of file field.hxx.

const OUString& MetricFormatter::GetCustomUnitText ( ) const

Definition at line 206 of file field.hxx.

sal_Int64 MetricFormatter::GetMax ( FieldUnit  eOutUnit) const
sal_Int64 MetricFormatter::GetMin ( FieldUnit  eOutUnit) const
FieldUnit MetricFormatter::GetUnit ( ) const

Definition at line 204 of file field.hxx.

sal_Int64 MetricFormatter::GetValue ( FieldUnit  eOutUnit) const
sal_Int64 MetricFormatter::GetValueFromString ( const OUString &  rStr) const

Reimplemented from NumericFormatter.

Definition at line 1419 of file field.cxx.

References GetValueFromStringUnit().

sal_Int64 MetricFormatter::GetValueFromStringUnit ( const OUString &  rStr,
FieldUnit  eOutUnit 
) const
void MetricFormatter::ImplInit ( )

Definition at line 1330 of file field.cxx.

References MetricField::GetDefaultUnit(), meUnit, and mnBaseValue.

Referenced by MetricFormatter().

void MetricFormatter::ImplMetricReformat ( const OUString &  rStr,
double &  rValue,
OUString &  rOutStr 
void MetricFormatter::Reformat ( )
void MetricFormatter::SetBaseValue ( sal_Int64  nNewBase,
FieldUnit  eInUnit = FieldUnit::NONE 
void MetricFormatter::SetCustomConvertHdl ( const Link< MetricFormatter &, void > &  rLink)

Definition at line 229 of file field.hxx.

void MetricFormatter::SetCustomUnitText ( const OUString &  rStr)

Definition at line 1358 of file field.cxx.

References maCustomUnitText, and FormatterBase::ReformatAll().

Referenced by VclBuilder::makeObject().

void MetricFormatter::SetMax ( sal_Int64  nNewMax,
FieldUnit  eInUnit 
void MetricFormatter::SetMin ( sal_Int64  nNewMin,
FieldUnit  eInUnit 
void MetricFormatter::SetUnit ( FieldUnit  meUnit)
void MetricFormatter::SetUserValue ( sal_Int64  nNewValue,
FieldUnit  eInUnit 
void MetricFormatter::SetValue ( sal_Int64  nNewValue,
FieldUnit  eInUnit 
void MetricFormatter::SetValue ( sal_Int64  nValue)

Reimplemented from NumericFormatter.

Definition at line 1429 of file field.cxx.

References SetValue().

FieldUnit MetricFormatter::StringToMetric ( const OUString &  rMetricString)

Definition at line 994 of file field.cxx.

References ImplGetCleanedFieldUnits().

Referenced by ImplMetricGetUnit().

bool MetricFormatter::TextToValue ( const OUString &  rStr,
double &  rValue,
sal_Int64  nBaseValue,
sal_uInt16  nDecDigits,
const LocaleDataWrapper rLocaleDataWrapper,
FieldUnit  eUnit 

Member Data Documentation

OUString MetricFormatter::maCurUnitText

Definition at line 250 of file field.hxx.

Referenced by Reformat().

Link<MetricFormatter&,void> MetricFormatter::maCustomConvertLink

Definition at line 237 of file field.hxx.

Referenced by MetricField::CustomConvert(), and MetricBox::CustomConvert().

OUString MetricFormatter::maCustomUnitText

Definition at line 249 of file field.hxx.

Referenced by CreateFieldText(), and SetCustomUnitText().

FieldUnit MetricFormatter::meUnit
sal_Int64 MetricFormatter::mnBaseValue

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