LibreOffice Module vcl (master)  1
Public Member Functions | Static Public Member Functions | Protected 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 Attributes

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

Detailed Description

Definition at line 257 of file field.hxx.

Constructor & Destructor Documentation

DateFormatter::DateFormatter ( Edit pEdit)

Definition at line 1400 of file field2.cxx.

References SystemShort.

DateFormatter::~DateFormatter ( )

Definition at line 1413 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 330 of file field.hxx.

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

Definition at line 1682 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 296 of file field.hxx.

Referenced by ImplDateReformat().

const Date& DateFormatter::GetMin ( ) const

Definition at line 293 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 273 of file field.hxx.

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

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 331 of file field.hxx.

Referenced by ImplAllowMalformedInput().

bool DateFormatter::IsLongFormat ( ) const

Definition at line 303 of file field.hxx.

bool DateFormatter::IsShowDateCentury ( ) const

Definition at line 305 of file field.hxx.

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

Reimplemented from FormatterBase.

Reimplemented in DateBox.

Definition at line 1457 of file field2.cxx.

References Reformat().

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

void DateFormatter::ResetLastDate ( )

Definition at line 313 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 1541 of file field2.cxx.

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

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

void DateFormatter::SetEmptyDate ( )

Definition at line 1623 of file field2.cxx.

References FormatterBase::SetEmptyFieldValue().

void DateFormatter::SetExtDateFormat ( ExtDateFieldFormat  eFormat)

Definition at line 1428 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 1469 of file field2.cxx.

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

Referenced by VclBuilder::mungeAdjustment().

void DateFormatter::SetMin ( const Date rNewMin)

Definition at line 1462 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 261 of file field.hxx.

Referenced by SetDate().

Date DateFormatter::maLastDate

Definition at line 262 of file field.hxx.

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

Date DateFormatter::maMax

Definition at line 264 of file field.hxx.

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

Date DateFormatter::maMin

Definition at line 263 of file field.hxx.

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

bool DateFormatter::mbEnforceValidValue

Definition at line 268 of file field.hxx.

bool DateFormatter::mbLongFormat

Definition at line 265 of file field.hxx.

Referenced by SetLongFormat().

bool DateFormatter::mbShowDateCentury

Definition at line 266 of file field.hxx.

Referenced by SetShowDateCentury().

ExtDateFieldFormat DateFormatter::mnExtDateFormat

Definition at line 267 of file field.hxx.

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

std::unique_ptr<CalendarWrapper> DateFormatter::mxCalendarWrapper

Definition at line 260 of file field.hxx.

Referenced by GetCalendarWrapper().

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