22 #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS)
23 #error "don't use this in new code"
26 #include <config_options.h>
43 std::unique_ptr<LocaleDataWrapper>
51 SAL_DLLPRIVATE
void ImplSetText(
const OUString& rText,
Selection const * pNewSel =
nullptr );
70 void SetStrictFormat(
bool bStrict );
73 virtual void Reformat();
74 virtual void ReformatAll();
76 const css::lang::Locale& GetLocale()
const;
79 void SetEmptyFieldValue();
80 bool IsEmptyFieldValue()
const;
93 void SetMin( sal_Int64 nNewMin );
94 sal_Int64
GetMin()
const {
return mnMin; }
95 void SetMax( sal_Int64 nNewMax );
96 sal_Int64
GetMax()
const {
return mnMax; }
98 sal_Int64 ClipAgainstMinMax(sal_Int64 nValue)
const;
100 void SetFirst( sal_Int64 nNewFirst ) { mnFirst = nNewFirst; }
102 void SetLast( sal_Int64 nNewLast ) { mnLast = nNewLast; }
107 void SetDecimalDigits( sal_uInt16 nDigits );
110 void SetUseThousandSep(
bool b );
113 void SetUserValue( sal_Int64 nNewValue );
114 virtual void SetValue( sal_Int64 nNewValue );
116 virtual OUString CreateFieldText( sal_Int64 nValue )
const;
118 sal_Int64 Normalize( sal_Int64 nValue )
const;
119 sal_Int64 Denormalize( sal_Int64 nValue )
const;
121 OUString GetValueString()
const;
122 void SetValueFromString(
const OUString& rStr);
142 void FormatValue(
Selection const * pNewSelection =
nullptr);
144 SAL_DLLPRIVATE
void ImplNumericReformat();
145 SAL_DLLPRIVATE
void ImplNewFieldValue( sal_Int64 nNewValue );
146 SAL_DLLPRIVATE
void ImplSetUserValue( sal_Int64 nNewValue,
Selection const * pNewSelection =
nullptr );
148 virtual sal_Int64 GetValueFromString(
const OUString& rStr)
const;
163 virtual void SetUnit(
FieldUnit meUnit );
165 void SetCustomUnitText(
const OUString& rStr );
178 virtual void SetValue( sal_Int64 nValue )
override;
184 sal_Int64 GetCorrectedValue(
FieldUnit eOutUnit )
const;
191 SAL_DLLPRIVATE
void ImplMetricReformat(
const OUString& rStr,
double& rValue, OUString& rOutStr );
194 sal_Int64 GetValueFromStringUnit(
const OUString& rStr,
FieldUnit eOutUnit)
const;
211 virtual void Modify()
override;
213 virtual void Up()
override;
214 virtual void Down()
override;
215 virtual void First()
override;
216 virtual void Last()
override;
226 virtual void dispose()
override;
243 virtual void Modify()
override;
250 virtual void dispose()
override;
253 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) CurrencyFormatter :
public NumericFormatter
256 CurrencyFormatter(
Edit* pEdit);
257 SAL_DLLPRIVATE
void ImplCurrencyReformat(
const OUString& rStr, OUString& rOutStr );
261 virtual ~CurrencyFormatter()
override;
265 virtual void SetValue( sal_Int64 nNewValue )
override;
269 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) CurrencyField final :
public SpinField,
public CurrencyFormatter
278 virtual void Modify()
override;
280 virtual void Up()
override;
281 virtual void Down()
override;
282 virtual void First()
override;
283 virtual void Last()
override;
284 virtual void dispose()
override;
287 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) TimeFormatter :
public FormatterBase
296 bool mbEnforceValidValue;
301 TimeFormatter(
Edit* pEdit);
303 SAL_DLLPRIVATE
void ImplTimeReformat(
const OUString& rStr, OUString& rOutStr );
304 SAL_DLLPRIVATE
void ImplNewFieldValue(
const tools::Time& rTime );
305 SAL_DLLPRIVATE
void ImplSetUserTime(
const tools::Time& rNewTime,
Selection const * pNewSelection =
nullptr );
306 SAL_DLLPRIVATE
bool ImplAllowMalformedInput()
const;
311 static int GetTimeArea(
TimeFieldFormat eFormat,
const OUString& rText,
int nCursor,
314 bool bDuration,
const OUString& rText,
int nCursor,
317 virtual ~TimeFormatter()
override;
323 const tools::Time& GetMin()
const {
return maMin; }
325 const tools::Time& GetMax()
const {
return maMax; }
328 TimeFormat GetTimeFormat()
const {
return mnTimeFormat;}
333 void SetDuration(
bool mbDuration );
334 bool IsDuration()
const {
return mbDuration; }
354 void EnforceValidValue(
bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
355 bool IsEnforceValidValue( )
const {
return mbEnforceValidValue; }
358 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) TimeField final :
public SpinField,
public TimeFormatter
364 SAL_DLLPRIVATE
void ImplTimeSpinArea(
bool bUp );
373 virtual void Modify()
override;
375 virtual void Up()
override;
376 virtual void Down()
override;
377 virtual void First()
override;
378 virtual void Last()
override;
380 void SetFirst(
const tools::Time& rNewFirst ) { maFirst = rNewFirst; }
381 const tools::Time& GetFirst()
const {
return maFirst; }
382 void SetLast(
const tools::Time& rNewLast ) { maLast = rNewLast; }
383 const tools::Time& GetLast()
const {
return maLast; }
386 virtual void dispose()
override;
389 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) DateFormatter :
public FormatterBase
392 std::unique_ptr<CalendarWrapper> mxCalendarWrapper;
398 bool mbShowDateCentury;
400 bool mbEnforceValidValue;
403 DateFormatter(
Edit* pEdit);
405 SAL_DLLPRIVATE
const Date& ImplGetFieldDate()
const {
return maFieldDate; }
406 SAL_DLLPRIVATE
void ImplDateReformat(
const OUString& rStr, OUString& rOutStr );
407 SAL_DLLPRIVATE
void ImplSetUserDate(
const Date& rNewDate,
408 Selection const * pNewSelection =
nullptr );
409 SAL_DLLPRIVATE OUString ImplGetDateAsText(
const Date& rDate )
const;
410 SAL_DLLPRIVATE
void ImplNewFieldValue(
const Date& rDate );
413 SAL_DLLPRIVATE
bool ImplAllowMalformedInput()
const;
420 virtual ~DateFormatter()
override;
428 void SetMin(
const Date& rNewMin );
429 const Date& GetMin()
const {
return maMin; }
431 void SetMax(
const Date& rNewMax );
432 const Date& GetMax()
const {
return maMax; }
438 void SetLongFormat(
bool bLong );
439 bool IsLongFormat()
const {
return mbLongFormat; }
440 void SetShowDateCentury(
bool bShowCentury );
441 bool IsShowDateCentury()
const {
return mbShowDateCentury; }
444 void SetDate(
const Date& rNewDate );
445 Date GetDate()
const;
447 bool IsEmptyDate()
const;
451 static void ExpandCentury(
Date& rDate );
452 static void ExpandCentury(
Date& rDate, sal_uInt16 nTwoDigitYearStart );
466 void EnforceValidValue(
bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
467 bool IsEnforceValidValue( )
const {
return mbEnforceValidValue; }
477 void ImplDateSpinArea(
bool bUp );
482 virtual bool PreNotify(
NotifyEvent& rNEvt )
override;
483 virtual bool EventNotify(
NotifyEvent& rNEvt )
override;
486 virtual void Modify()
override;
488 virtual void Up()
override;
489 virtual void Down()
override;
490 virtual void First()
override;
491 virtual void Last()
override;
497 virtual void dispose()
override;
502 SAL_DLLPRIVATE
void ImplNumericReformat(
const OUString& rStr, sal_Int64& rValue, OUString& rOutStr );
512 virtual void Modify()
override;
516 virtual void dispose()
override;
519 #define PATTERN_FORMAT_EMPTYLITERALS (sal_uInt16(0x0001))
521 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) PatternFormatter :
public FormatterBase
525 OUString maLiteralMask;
527 bool mbInPattKeyInput;
530 PatternFormatter(
Edit* pEdit);
532 SAL_DLLPRIVATE
bool ImplIsSameMask()
const {
return mbSameMask; }
533 SAL_DLLPRIVATE
bool& ImplGetInPattKeyInput() {
return mbInPattKeyInput; }
536 virtual ~PatternFormatter()
override;
540 void SetMask(
const OString& rEditMask,
const OUString& rLiteralMask );
541 const OString& GetEditMask()
const {
return m_aEditMask; }
542 const OUString& GetLiteralMask()
const {
return maLiteralMask; }
548 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) PatternField final :
public SpinField,
public PatternFormatter
555 virtual void Modify()
override;
556 virtual void dispose()
override;
559 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) PatternBox final :
public ComboBox,
public PatternFormatter
567 virtual void Modify()
override;
569 virtual void ReformatAll()
override;
570 virtual void dispose()
override;
573 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) CurrencyBox final :
public ComboBox,
public CurrencyFormatter
582 virtual void Modify()
override;
584 virtual void ReformatAll()
override;
586 virtual void dispose()
override;
589 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) DateBox final :
public ComboBox,
public DateFormatter
598 virtual void Modify()
override;
600 virtual void ReformatAll()
override;
601 virtual void dispose()
override;
604 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) TimeBox final :
public ComboBox,
public TimeFormatter
613 virtual void Modify()
override;
615 virtual void ReformatAll()
override;
616 virtual void dispose()
override;
void SetFirst(const Date &rNewFirst)
Any GetTime(const OUString &val)
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
virtual bool set_property(const OString &rKey, const OUString &rValue) override
void SetString(SwCursor &rCursor, const OUString &rString)
OUString GetString(int nId)
css::uno::Any const & rValue
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
void SetLast(const Date &rNewLast)
virtual FactoryFunction GetUITestFactory() const override
const Date & GetFirst() const
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual bool EventNotify(NotifyEvent &rNEvt) override
virtual bool PreNotify(NotifyEvent &rNEvt)
virtual bool EventNotify(NotifyEvent &rNEvt) override
const LocaleDataWrapper & GetLocaleDataWrapper(LanguageType nLang)
const Date & GetLast() const
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual Size CalcMinimumSize() const override
virtual bool PreNotify(NotifyEvent &rNEvt) override
A widget used to choose from a list of items and which has an entry.
Size CalcMinimumSize() const override
virtual void Modify() override