LibreOffice Module vcl (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
NumericFormatter Class Reference

#include <field.hxx>

Inheritance diagram for NumericFormatter:
[legend]
Collaboration diagram for NumericFormatter:
[legend]

Public Member Functions

virtual ~NumericFormatter () override
 
virtual void Reformat () 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 SetUserValue (sal_Int64 nNewValue)
 
virtual void SetValue (sal_Int64 nNewValue)
 
sal_Int64 GetValue () const
 
virtual OUString CreateFieldText (sal_Int64 nValue) const
 
sal_Int64 Normalize (sal_Int64 nValue) const
 
sal_Int64 Denormalize (sal_Int64 nValue) const
 
OUString GetValueString () const
 
void SetValueFromString (const OUString &rStr)
 
- 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 Reformat ()
 
virtual void ReformatAll ()
 
const css::lang::Locale & GetLocale () const
 
const LanguageTagGetLanguageTag () const
 
void SetEmptyFieldValue ()
 
bool IsEmptyFieldValue () const
 
void EnableEmptyFieldValue (bool bEnable)
 
bool IsEmptyFieldValueEnabled () const
 

Protected Member Functions

 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)
 
virtual sal_Int64 GetValueFromString (const OUString &rStr) const
 
- 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
 
SAL_DLLPRIVATE void ImplResetLocaleDataWrapper () const
 reset the LocaleDataWrapper when the language tag changes More...
 
EditGetField () const
 
void ClearField ()
 

Protected Attributes

sal_Int64 mnLastValue
 
sal_Int64 mnMin
 
sal_Int64 mnMax
 
bool mbFormatting
 
sal_Int64 mnSpinSize
 
sal_Int64 mnFirst
 
sal_Int64 mnLast
 

Private Attributes

sal_uInt16 mnDecimalDigits
 
bool mbThousandSep
 

Detailed Description

Definition at line 93 of file field.hxx.

Constructor & Destructor Documentation

◆ ~NumericFormatter()

NumericFormatter::~NumericFormatter ( )
overridevirtual

Definition at line 573 of file field.cxx.

◆ NumericFormatter()

NumericFormatter::NumericFormatter ( Edit pEdit)
protected

Definition at line 555 of file field.cxx.

References FormatterBase::ReformatAll(), and SAL_MAX_INT32.

Member Function Documentation

◆ ClipAgainstMinMax()

sal_Int64 NumericFormatter::ClipAgainstMinMax ( sal_Int64  nValue) const

Definition at line 780 of file field.cxx.

References mnMax, mnMin, and nValue.

Referenced by FieldDown(), FieldUp(), GetValueFromString(), and ImplSetUserValue().

◆ CreateFieldText()

OUString NumericFormatter::CreateFieldText ( sal_Int64  nValue) const
virtual

◆ Denormalize()

sal_Int64 NumericFormatter::Denormalize ( sal_Int64  nValue) const

Definition at line 676 of file field.cxx.

References GetDecimalDigits(), nValue, SAL_MAX_INT64, and SAL_MIN_INT64.

Referenced by MetricField::SetUnit().

◆ FieldDown()

void NumericFormatter::FieldDown ( )
protected

Definition at line 723 of file field.cxx.

References ClipAgainstMinMax(), GetValue(), ImplNewFieldValue(), mnSpinSize, and nValue.

Referenced by MetricField::Down().

◆ FieldFirst()

void NumericFormatter::FieldFirst ( )
protected

Definition at line 737 of file field.cxx.

References ImplNewFieldValue(), and mnFirst.

Referenced by MetricField::First().

◆ FieldLast()

void NumericFormatter::FieldLast ( )
protected

Definition at line 742 of file field.cxx.

References ImplNewFieldValue(), and mnLast.

Referenced by MetricField::Last().

◆ FieldUp()

void NumericFormatter::FieldUp ( )
protected

Definition at line 709 of file field.cxx.

References ClipAgainstMinMax(), GetValue(), ImplNewFieldValue(), mnSpinSize, and nValue.

Referenced by MetricField::Up().

◆ FormatValue()

void NumericFormatter::FormatValue ( Selection const *  pNewSelection = nullptr)
protected

◆ GetDecimalDigits()

sal_uInt16 NumericFormatter::GetDecimalDigits ( ) const
inline

◆ GetFirst()

sal_Int64 NumericFormatter::GetFirst ( ) const
inline

Definition at line 108 of file field.hxx.

Referenced by MetricField::SetUnit().

◆ GetLast()

sal_Int64 NumericFormatter::GetLast ( ) const
inline

Definition at line 110 of file field.hxx.

Referenced by MetricField::SetUnit().

◆ GetMax()

sal_Int64 NumericFormatter::GetMax ( ) const
inline

Definition at line 103 of file field.hxx.

Referenced by MetricFormatter::GetMax().

◆ GetMin()

sal_Int64 NumericFormatter::GetMin ( ) const
inline

Definition at line 101 of file field.hxx.

Referenced by MetricFormatter::GetMin().

◆ GetSpinSize()

sal_Int64 NumericFormatter::GetSpinSize ( ) const
inline

Definition at line 112 of file field.hxx.

◆ GetValue()

sal_Int64 NumericFormatter::GetValue ( ) const

◆ GetValueFromString()

sal_Int64 NumericFormatter::GetValueFromString ( const OUString &  rStr) const
protectedvirtual

Reimplemented in MetricFormatter.

Definition at line 628 of file field.cxx.

References ClipAgainstMinMax(), GetDecimalDigits(), FormatterBase::ImplGetLocaleDataWrapper(), and mnLastValue.

Referenced by GetValue().

◆ GetValueString()

OUString NumericFormatter::GetValueString ( ) const

◆ ImplNewFieldValue()

void NumericFormatter::ImplNewFieldValue ( sal_Int64  nNewValue)
protected

◆ ImplNumericReformat()

void NumericFormatter::ImplNumericReformat ( )
protected

Definition at line 549 of file field.cxx.

References FormatValue(), GetValue(), and mnLastValue.

Referenced by Reformat().

◆ ImplSetUserValue()

void NumericFormatter::ImplSetUserValue ( sal_Int64  nNewValue,
Selection const *  pNewSelection = nullptr 
)
protected

Definition at line 614 of file field.cxx.

References ClipAgainstMinMax(), FormatValue(), FormatterBase::GetField(), and mnLastValue.

Referenced by ImplNewFieldValue(), and SetUserValue().

◆ IsUseThousandSep()

bool NumericFormatter::IsUseThousandSep ( ) const
inline

Definition at line 118 of file field.hxx.

Referenced by CreateFieldText(), MetricField::PreNotify(), and MetricBox::PreNotify().

◆ Normalize()

sal_Int64 NumericFormatter::Normalize ( sal_Int64  nValue) const

Definition at line 671 of file field.cxx.

References GetDecimalDigits(), and nValue.

Referenced by MetricField::SetUnit().

◆ Reformat()

void NumericFormatter::Reformat ( )
overridevirtual

Reimplemented from FormatterBase.

Reimplemented in MetricFormatter.

Definition at line 698 of file field.cxx.

References FormatterBase::GetField(), FormatterBase::ImplGetEmptyFieldValue(), and ImplNumericReformat().

◆ SetDecimalDigits()

void NumericFormatter::SetDecimalDigits ( sal_uInt16  nDigits)

Definition at line 597 of file field.cxx.

References mnDecimalDigits, and FormatterBase::ReformatAll().

Referenced by MetricField::set_property(), and MetricFormatter::SetUnit().

◆ SetFirst()

void NumericFormatter::SetFirst ( sal_Int64  nNewFirst)
inline

Definition at line 107 of file field.hxx.

◆ SetLast()

void NumericFormatter::SetLast ( sal_Int64  nNewLast)
inline

Definition at line 109 of file field.hxx.

◆ SetMax()

void NumericFormatter::SetMax ( sal_Int64  nNewMax)

◆ SetMin()

void NumericFormatter::SetMin ( sal_Int64  nNewMin)

◆ SetSpinSize()

void NumericFormatter::SetSpinSize ( sal_Int64  nNewSize)
inline

Definition at line 111 of file field.hxx.

Referenced by MetricField::set_property().

◆ SetUserValue()

void NumericFormatter::SetUserValue ( sal_Int64  nNewValue)

Definition at line 623 of file field.cxx.

References ImplSetUserValue().

Referenced by MetricFormatter::SetUserValue(), and SetValue().

◆ SetUseThousandSep()

void NumericFormatter::SetUseThousandSep ( bool  b)

Definition at line 591 of file field.cxx.

References mbThousandSep, and FormatterBase::ReformatAll().

◆ SetValue()

void NumericFormatter::SetValue ( sal_Int64  nNewValue)
virtual

Reimplemented in MetricFormatter.

Definition at line 603 of file field.cxx.

References FormatterBase::SetEmptyFieldValueData(), and SetUserValue().

◆ SetValueFromString()

void NumericFormatter::SetValueFromString ( const OUString &  rStr)

Member Data Documentation

◆ mbFormatting

bool NumericFormatter::mbFormatting
protected

Definition at line 135 of file field.hxx.

Referenced by FormatValue(), and GetValue().

◆ mbThousandSep

bool NumericFormatter::mbThousandSep
private

Definition at line 159 of file field.hxx.

Referenced by SetUseThousandSep().

◆ mnDecimalDigits

sal_uInt16 NumericFormatter::mnDecimalDigits
private

Definition at line 158 of file field.hxx.

Referenced by SetDecimalDigits().

◆ mnFirst

sal_Int64 NumericFormatter::mnFirst
protected

Definition at line 140 of file field.hxx.

Referenced by FieldFirst(), MetricField::GetFirst(), and MetricField::SetFirst().

◆ mnLast

sal_Int64 NumericFormatter::mnLast
protected

Definition at line 141 of file field.hxx.

Referenced by FieldLast(), MetricField::GetLast(), and MetricField::SetLast().

◆ mnLastValue

sal_Int64 NumericFormatter::mnLastValue
protected

◆ mnMax

sal_Int64 NumericFormatter::mnMax
protected

Definition at line 134 of file field.hxx.

Referenced by ClipAgainstMinMax(), MetricFormatter::GetValueFromStringUnit(), and SetMax().

◆ mnMin

sal_Int64 NumericFormatter::mnMin
protected

Definition at line 133 of file field.hxx.

Referenced by ClipAgainstMinMax(), MetricFormatter::GetValueFromStringUnit(), and SetMin().

◆ mnSpinSize

sal_Int64 NumericFormatter::mnSpinSize
protected

Definition at line 139 of file field.hxx.

Referenced by FieldDown(), and FieldUp().


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