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

#include <field.hxx>

Inheritance diagram for DateFormatter:
Collaboration diagram for DateFormatter:

Public Member Functions

virtual ~DateFormatter () override
virtual void Reformat () override
virtual void ReformatAll () override
void SetExtDateFormat (ExtDateFieldFormat eFormat)
ExtDateFieldFormat GetExtDateFormat (bool bResolveSystemFormat=false) const
void SetMin (const Date &rNewMin)
const DateGetMin () const
void SetMax (const Date &rNewMax)
const DateGetMax () const
void SetLongFormat (bool bLong)
bool IsLongFormat () const
void SetShowDateCentury (bool bShowCentury)
bool IsShowDateCentury () const
void SetDate (const Date &rNewDate)
Date GetDate () const
void SetEmptyDate ()
bool IsEmptyDate () const
void ResetLastDate ()
void EnforceValidValue (bool _bEnforce)
 enables or disables the enforcement of valid values More...
bool IsEnforceValidValue () 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
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 void ExpandCentury (Date &rDate)
static void ExpandCentury (Date &rDate, sal_uInt16 nTwoDigitYearStart)

Protected Member Functions

 DateFormatter (Edit *pEdit)
SAL_DLLPRIVATE const DateImplGetFieldDate () const
SAL_DLLPRIVATE void ImplDateReformat (const OUString &rStr, OUString &rOutStr)
SAL_DLLPRIVATE void ImplSetUserDate (const Date &rNewDate, Selection const *pNewSelection=nullptr)
SAL_DLLPRIVATE OUString ImplGetDateAsText (const Date &rDate) const
SAL_DLLPRIVATE void ImplNewFieldValue (const Date &rDate)
CalendarWrapperGetCalendarWrapper () const
SAL_DLLPRIVATE bool ImplAllowMalformedInput () 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
EditGetField () const
void ClearField ()

Private Member Functions

SAL_DLLPRIVATE void ImplInit ()

Private Attributes

std::unique_ptr< CalendarWrappermpCalendarWrapper
Date maFieldDate
Date maLastDate
Date maMin
Date maMax
bool mbLongFormat
bool mbShowDateCentury
ExtDateFieldFormat mnExtDateFormat
bool mbEnforceValidValue

Detailed Description

Definition at line 271 of file field.hxx.

Constructor & Destructor Documentation

DateFormatter::DateFormatter ( Edit pEdit)

Definition at line 1408 of file field2.cxx.

References ImplInit().

DateFormatter::~DateFormatter ( )

Definition at line 1419 of file field2.cxx.

Member Function Documentation

void DateFormatter::EnforceValidValue ( bool  _bEnforce)

enables or disables the enforcement of valid values

If this is set to true (which is the default), then GetDate will always return a valid date, no matter whether the current text can really be interpreted as date. (Note: this is the compatible behavior).

If this is set to false, the GetDate will return GetInvalidDate, in case the current text cannot be interpreted as date.

In addition, if this is set to false, the text in the field will not be corrected when the control loses the focus - instead, the invalid input will be preserved.

Definition at line 346 of file field.hxx.

void DateFormatter::ExpandCentury ( Date rDate)
void DateFormatter::ExpandCentury ( Date rDate,
sal_uInt16  nTwoDigitYearStart 

Definition at line 1688 of file field2.cxx.

References Date::GetYear(), and Date::SetYear().

CalendarWrapper & DateFormatter::GetCalendarWrapper ( ) const
Date DateFormatter::GetDate ( ) const
ExtDateFieldFormat DateFormatter::GetExtDateFormat ( bool  bResolveSystemFormat = false) const
const Date& DateFormatter::GetMax ( ) const

Definition at line 312 of file field.hxx.

Referenced by ImplDateReformat().

const Date& DateFormatter::GetMin ( ) const

Definition at line 309 of file field.hxx.

Referenced by ImplDateReformat().

bool DateFormatter::ImplAllowMalformedInput ( ) const

Definition at line 1306 of file field2.cxx.

References IsEnforceValidValue().

Referenced by DateField::EventNotify(), and GetDate().

void DateFormatter::ImplDateReformat ( const OUString &  rStr,
OUString &  rOutStr 
OUString DateFormatter::ImplGetDateAsText ( const Date rDate) const
SAL_DLLPRIVATE const Date& DateFormatter::ImplGetFieldDate ( ) const

Definition at line 289 of file field.hxx.

Referenced by DateBox::DateBox(), and DateField::DateField().

void DateFormatter::ImplInit ( )

Definition at line 1400 of file field2.cxx.

References mbLongFormat, mbShowDateCentury, mnExtDateFormat, mpCalendarWrapper, and SystemShort.

Referenced by DateFormatter().

void DateFormatter::ImplNewFieldValue ( const Date rDate)
void DateFormatter::ImplSetUserDate ( const Date rNewDate,
Selection const *  pNewSelection = nullptr 
bool DateFormatter::IsEmptyDate ( ) const
bool DateFormatter::IsEnforceValidValue ( ) const

Definition at line 347 of file field.hxx.

Referenced by ImplAllowMalformedInput().

bool DateFormatter::IsLongFormat ( ) const

Definition at line 319 of file field.hxx.

bool DateFormatter::IsShowDateCentury ( ) const

Definition at line 321 of file field.hxx.

void DateFormatter::Reformat ( )
void DateFormatter::ReformatAll ( )

Reimplemented from FormatterBase.

Reimplemented in DateBox.

Definition at line 1463 of file field2.cxx.

References Reformat().

Referenced by DateField::DataChanged(), SetExtDateFormat(), SetLongFormat(), SetMax(), SetMin(), and SetShowDateCentury().

void DateFormatter::ResetLastDate ( )

Definition at line 329 of file field.hxx.

References Date::EMPTY.

Referenced by DateField::DateField(), DateField::EventNotify(), and DateBox::EventNotify().

void DateFormatter::SetDate ( const Date rNewDate)

Definition at line 1547 of file field2.cxx.

References GetDate(), ImplSetUserDate(), maFieldDate, and maLastDate.

Referenced by VclBuilder::mungeAdjustment(), and Reformat().

void DateFormatter::SetEmptyDate ( )

Definition at line 1629 of file field2.cxx.

References FormatterBase::SetEmptyFieldValue().

void DateFormatter::SetExtDateFormat ( ExtDateFieldFormat  eFormat)

Definition at line 1434 of file field2.cxx.

References mnExtDateFormat, and ReformatAll().

Referenced by SetLongFormat(), and SetShowDateCentury().

void DateFormatter::SetLongFormat ( bool  bLong)
void DateFormatter::SetMax ( const Date rNewMax)

Definition at line 1475 of file field2.cxx.

References FormatterBase::IsEmptyFieldValue(), maMax, and ReformatAll().

Referenced by VclBuilder::mungeAdjustment().

void DateFormatter::SetMin ( const Date rNewMin)

Definition at line 1468 of file field2.cxx.

References FormatterBase::IsEmptyFieldValue(), maMin, and ReformatAll().

Referenced by VclBuilder::mungeAdjustment().

void DateFormatter::SetShowDateCentury ( bool  bShowCentury)

Member Data Documentation

Date DateFormatter::maFieldDate

Definition at line 275 of file field.hxx.

Referenced by SetDate().

Date DateFormatter::maLastDate

Definition at line 276 of file field.hxx.

Referenced by GetDate(), ImplNewFieldValue(), ImplSetUserDate(), IsEmptyDate(), Reformat(), and SetDate().

Date DateFormatter::maMax

Definition at line 278 of file field.hxx.

Referenced by GetDate(), ImplSetUserDate(), and SetMax().

Date DateFormatter::maMin

Definition at line 277 of file field.hxx.

Referenced by GetDate(), ImplSetUserDate(), and SetMin().

bool DateFormatter::mbEnforceValidValue

Definition at line 282 of file field.hxx.

bool DateFormatter::mbLongFormat

Definition at line 279 of file field.hxx.

Referenced by ImplInit(), and SetLongFormat().

bool DateFormatter::mbShowDateCentury

Definition at line 280 of file field.hxx.

Referenced by ImplInit(), and SetShowDateCentury().

ExtDateFieldFormat DateFormatter::mnExtDateFormat

Definition at line 281 of file field.hxx.

Referenced by GetExtDateFormat(), ImplInit(), SetExtDateFormat(), and SetLongFormat().

std::unique_ptr<CalendarWrapper> DateFormatter::mpCalendarWrapper

Definition at line 274 of file field.hxx.

Referenced by GetCalendarWrapper(), and ImplInit().

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