LibreOffice Module vcl (master)  1
field.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_VCL_FIELD_HXX
21 #define INCLUDED_VCL_FIELD_HXX
22 
23 #include <memory>
24 #include <vcl/dllapi.h>
25 #include <tools/link.hxx>
26 #include <tools/date.hxx>
27 #include <tools/time.hxx>
28 #include <vcl/spinfld.hxx>
29 #include <vcl/combobox.hxx>
30 #include <tools/fldunit.hxx>
31 
32 namespace com { namespace sun { namespace star { namespace lang { struct Locale; } } } }
33 
34 class CalendarWrapper;
35 class LocaleDataWrapper;
36 class LanguageTag;
37 
38 
40 {
41 private:
43  std::unique_ptr<LocaleDataWrapper>
45  bool mbReformat;
49 
50 protected:
51  SAL_DLLPRIVATE void ImplSetText( const OUString& rText, Selection const * pNewSel = nullptr );
52  SAL_DLLPRIVATE bool ImplGetEmptyFieldValue() const { return mbEmptyFieldValue; }
53 
54  void SetEmptyFieldValueData( bool bValue ) { mbEmptyFieldValue = bValue; }
55 
56  SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const;
57 
58  Edit* GetField() const { return mpField; }
59  void ClearField() { mpField.clear(); }
60 
61 public:
62  explicit FormatterBase(Edit* pField);
63  virtual ~FormatterBase();
64 
66 
67  bool MustBeReformatted() const { return mbReformat; }
68  void MarkToBeReformatted( bool b ) { mbReformat = b; }
69 
70  void SetStrictFormat( bool bStrict );
71  bool IsStrictFormat() const { return mbStrictFormat; }
72 
73  virtual void Reformat();
74  virtual void ReformatAll();
75 
76  const css::lang::Locale& GetLocale() const;
77  const LanguageTag& GetLanguageTag() const;
78 
79  void SetEmptyFieldValue();
80  bool IsEmptyFieldValue() const;
81 
82  void EnableEmptyFieldValue( bool bEnable ) { mbEmptyFieldValueEnabled = bEnable; }
83  bool IsEmptyFieldValueEnabled() const { return mbEmptyFieldValueEnabled; }
84 };
85 
86 #define PATTERN_FORMAT_EMPTYLITERALS (sal_uInt16(0x0001))
87 
89 {
90 private:
91  OString m_aEditMask;
92  OUString maLiteralMask;
93  bool mbSameMask;
95 
96 protected:
97  PatternFormatter(Edit* pEdit);
98 
99  SAL_DLLPRIVATE void ImplSetMask(const OString& rEditMask,
100  const OUString& rLiteralMask);
101  SAL_DLLPRIVATE bool ImplIsSameMask() const { return mbSameMask; }
102  SAL_DLLPRIVATE bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; }
103 
104 public:
105  virtual ~PatternFormatter() override;
106 
107  virtual void Reformat() override;
108 
109  void SetMask(const OString& rEditMask, const OUString& rLiteralMask );
110  const OString& GetEditMask() const { return m_aEditMask; }
111  const OUString& GetLiteralMask() const { return maLiteralMask; }
112 
113  void SetString( const OUString& rStr );
114  OUString GetString() const;
115 };
116 
117 
119 {
120 public:
121  virtual ~NumericFormatter() override;
122 
123  virtual void Reformat() override;
124 
125  void SetMin( sal_Int64 nNewMin );
126  sal_Int64 GetMin() const { return mnMin; }
127  void SetMax( sal_Int64 nNewMax );
128  sal_Int64 GetMax() const { return mnMax; }
129 
130  sal_Int64 ClipAgainstMinMax(sal_Int64 nValue) const;
131 
132  void SetFirst( sal_Int64 nNewFirst ) { mnFirst = nNewFirst; }
133  sal_Int64 GetFirst() const { return mnFirst; }
134  void SetLast( sal_Int64 nNewLast ) { mnLast = nNewLast; }
135  sal_Int64 GetLast() const { return mnLast; }
136  void SetSpinSize( sal_Int64 nNewSize ) { mnSpinSize = nNewSize; }
137  sal_Int64 GetSpinSize() const { return mnSpinSize; }
138 
139  void SetDecimalDigits( sal_uInt16 nDigits );
140  sal_uInt16 GetDecimalDigits() const { return mnDecimalDigits;}
141 
142  void SetUseThousandSep( bool b );
143  bool IsUseThousandSep() const { return mbThousandSep; }
144 
145  void SetShowTrailingZeros( bool bShowTrailingZeros );
146  bool IsShowTrailingZeros() const { return mbShowTrailingZeros; }
147 
148  void SetUserValue( sal_Int64 nNewValue );
149  virtual void SetValue( sal_Int64 nNewValue );
150  sal_Int64 GetValue() const;
151  virtual OUString CreateFieldText( sal_Int64 nValue ) const;
152 
153  sal_Int64 Normalize( sal_Int64 nValue ) const;
154  sal_Int64 Denormalize( sal_Int64 nValue ) const;
155 
156 protected:
157  sal_Int64 mnLastValue;
158  sal_Int64 mnMin;
159  sal_Int64 mnMax;
162 
163  // the members below are used in all derivatives of NumericFormatter
164  // not in NumericFormatter itself.
165  sal_Int64 mnSpinSize;
166  sal_Int64 mnFirst;
167  sal_Int64 mnLast;
168 
169  NumericFormatter(Edit* pEdit);
170 
171  void FieldUp();
172  void FieldDown();
173  void FieldFirst();
174  void FieldLast();
175  void FormatValue(Selection const * pNewSelection = nullptr);
176 
177  SAL_DLLPRIVATE void ImplNumericReformat();
178  SAL_DLLPRIVATE void ImplNewFieldValue( sal_Int64 nNewValue );
179  SAL_DLLPRIVATE void ImplSetUserValue( sal_Int64 nNewValue, Selection const * pNewSelection = nullptr );
180 
181  virtual sal_Int64 GetValueFromString(const OUString& rStr) const;
182 
183 private:
184  sal_uInt16 mnDecimalDigits;
187 
188 };
189 
190 
192 {
193 public:
194  virtual ~MetricFormatter() override;
195 
196  virtual void Reformat() override;
197 
198  virtual void SetUnit( FieldUnit meUnit );
199  FieldUnit GetUnit() const { return meUnit; }
200  void SetCustomUnitText( const OUString& rStr );
201  const OUString& GetCustomUnitText() const { return maCustomUnitText; }
202 
204  void SetMax( sal_Int64 nNewMax, FieldUnit eInUnit );
206  sal_Int64 GetMax( FieldUnit eOutUnit ) const;
208  void SetMin( sal_Int64 nNewMin, FieldUnit eInUnit );
210  sal_Int64 GetMin( FieldUnit eOutUnit ) const;
211  sal_Int64 GetBaseValue() const;
212 
213  virtual void SetValue( sal_Int64 nNewValue, FieldUnit eInUnit );
214  virtual void SetValue( sal_Int64 nValue ) override;
216  void SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit );
218  sal_Int64 GetValue( FieldUnit eOutUnit ) const;
219  virtual OUString CreateFieldText( sal_Int64 nValue ) const override;
220  sal_Int64 GetCorrectedValue( FieldUnit eOutUnit ) const;
221 
222  static FieldUnit StringToMetric(const OUString &rMetricString);
223  static bool TextToValue(const OUString& rStr, double& rValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, FieldUnit eUnit);
224 
225 protected:
227 
228  MetricFormatter(Edit* pEdit);
229 
230  SAL_DLLPRIVATE void ImplMetricReformat( const OUString& rStr, double& rValue, OUString& rOutStr );
231 
232  virtual sal_Int64 GetValueFromString(const OUString& rStr) const override;
233  virtual sal_Int64 GetValueFromStringUnit(const OUString& rStr, FieldUnit eOutUnit) const;
234 
235 private:
237 };
238 
239 
241 {
242 protected:
243  CurrencyFormatter(Edit* pEdit);
244  SAL_DLLPRIVATE void ImplCurrencyReformat( const OUString& rStr, OUString& rOutStr );
245  virtual sal_Int64 GetValueFromString(const OUString& rStr) const override;
246 
247 public:
248  virtual ~CurrencyFormatter() override;
249 
250  virtual void Reformat() override;
251 
252  virtual void SetValue( sal_Int64 nNewValue ) override;
253  virtual OUString CreateFieldText( sal_Int64 nValue ) const override;
254 };
255 
256 
258 {
259 private:
260  std::unique_ptr<CalendarWrapper> mxCalendarWrapper;
269 
270 protected:
271  DateFormatter(Edit* pEdit);
272 
273  SAL_DLLPRIVATE const Date& ImplGetFieldDate() const { return maFieldDate; }
274  SAL_DLLPRIVATE void ImplDateReformat( const OUString& rStr, OUString& rOutStr );
275  SAL_DLLPRIVATE void ImplSetUserDate( const Date& rNewDate,
276  Selection const * pNewSelection = nullptr );
277  SAL_DLLPRIVATE OUString ImplGetDateAsText( const Date& rDate ) const;
278  SAL_DLLPRIVATE void ImplNewFieldValue( const Date& rDate );
279  CalendarWrapper& GetCalendarWrapper() const;
280 
281  SAL_DLLPRIVATE bool ImplAllowMalformedInput() const;
282 
283 public:
284  virtual ~DateFormatter() override;
285 
286  virtual void Reformat() override;
287  virtual void ReformatAll() override;
288 
289  void SetExtDateFormat( ExtDateFieldFormat eFormat );
290  ExtDateFieldFormat GetExtDateFormat( bool bResolveSystemFormat = false ) const;
291 
292  void SetMin( const Date& rNewMin );
293  const Date& GetMin() const { return maMin; }
294 
295  void SetMax( const Date& rNewMax );
296  const Date& GetMax() const { return maMax; }
297 
298 
299  // MT: Remove these methods too, ExtDateFormat should be enough!
300  // What should happen if using DDMMYYYY, but ShowCentury=false?
301 
302  void SetLongFormat( bool bLong );
303  bool IsLongFormat() const { return mbLongFormat; }
304  void SetShowDateCentury( bool bShowCentury );
305  bool IsShowDateCentury() const { return mbShowDateCentury; }
306 
307 
308  void SetDate( const Date& rNewDate );
309  Date GetDate() const;
310  void SetEmptyDate();
311  bool IsEmptyDate() const;
312 
313  void ResetLastDate() { maLastDate = Date( Date::EMPTY ); }
314 
315  static void ExpandCentury( Date& rDate );
316  static void ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart );
317 
330  void EnforceValidValue( bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
331  bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
332 };
333 
334 
336 {
337 private:
345 
346 protected:
348 
349  TimeFormatter(Edit* pEdit);
350 
351  SAL_DLLPRIVATE void ImplTimeReformat( const OUString& rStr, OUString& rOutStr );
352  SAL_DLLPRIVATE void ImplNewFieldValue( const tools::Time& rTime );
353  SAL_DLLPRIVATE void ImplSetUserTime( const tools::Time& rNewTime, Selection const * pNewSelection = nullptr );
354  SAL_DLLPRIVATE bool ImplAllowMalformedInput() const;
355 
356 public:
357  static OUString FormatTime(const tools::Time& rNewTime, TimeFieldFormat eFormat, TimeFormat eHourFormat, bool bDuration, const LocaleDataWrapper& rLocaleData);
358  static bool TextToTime(const OUString& rStr, tools::Time& rTime, TimeFieldFormat eFormat, bool bDuration, const LocaleDataWrapper& rLocaleDataWrapper, bool _bSkipInvalidCharacters = true);
359  static int GetTimeArea(TimeFieldFormat eFormat, const OUString& rText, int nCursor,
360  const LocaleDataWrapper& rLocaleDataWrapper);
361  static tools::Time SpinTime(bool bUp, const tools::Time& rTime, TimeFieldFormat eFormat,
362  bool bDuration, const OUString& rText, int nCursor,
363  const LocaleDataWrapper& rLocaleDataWrapper);
364 
365  virtual ~TimeFormatter() override;
366 
367  virtual void Reformat() override;
368  virtual void ReformatAll() override;
369 
370  void SetMin( const tools::Time& rNewMin );
371  const tools::Time& GetMin() const { return maMin; }
372  void SetMax( const tools::Time& rNewMax );
373  const tools::Time& GetMax() const { return maMax; }
374 
375  void SetTimeFormat( TimeFormat eNewFormat );
376  TimeFormat GetTimeFormat() const { return mnTimeFormat;}
377 
378  void SetFormat( TimeFieldFormat eNewFormat );
379  TimeFieldFormat GetFormat() const { return meFormat; }
380 
381  void SetDuration( bool mbDuration );
382  bool IsDuration() const { return mbDuration; }
383 
384  void SetTime( const tools::Time& rNewTime );
385  void SetUserTime( const tools::Time& rNewTime );
386  tools::Time GetTime() const;
389 
402  void EnforceValidValue( bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
403  bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
404 };
405 
406 
408 {
409 public:
410  explicit PatternField( vcl::Window* pParent, WinBits nWinStyle );
411 
412  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
413  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
414  virtual void Modify() override;
415  virtual void dispose() override;
416 };
417 
418 
420 {
421 public:
422  explicit NumericField( vcl::Window* pParent, WinBits nWinStyle );
423 
424  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
425  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
426  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
427 
428  virtual Size CalcMinimumSize() const override;
429 
430  virtual void Modify() override;
431 
432  virtual void Up() override;
433  virtual void Down() override;
434  virtual void First() override;
435  virtual void Last() override;
436  virtual bool set_property(const OString &rKey, const OUString &rValue) override;
437  virtual void dispose() override;
438 
439  virtual boost::property_tree::ptree DumpAsPropertyTree() override;
440 };
441 
442 
444 {
445 public:
446  explicit MetricField( vcl::Window* pParent, WinBits nWinStyle );
447 
448  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
449  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
450  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
451 
452  virtual Size CalcMinimumSize() const override;
453 
454  virtual void Modify() override;
455 
456  virtual void Up() override;
457  virtual void Down() override;
458  virtual void First() override;
459  virtual void Last() override;
460 
461  virtual void SetUnit( FieldUnit meUnit ) override;
462 
463  void SetFirst( sal_Int64 nNewFirst, FieldUnit eInUnit );
464  void SetFirst(sal_Int64 first) { SetFirst(first, FieldUnit::NONE); }
465  sal_Int64 GetFirst( FieldUnit eOutUnit ) const;
466  void SetLast( sal_Int64 nNewLast, FieldUnit eInUnit );
467  void SetLast(sal_Int64 last) { SetLast(last, FieldUnit::NONE); }
468  sal_Int64 GetLast( FieldUnit eOutUnit ) const;
469 
470  static sal_Int64 ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
471  FieldUnit eInUnit, FieldUnit eOutUnit );
472  static sal_Int64 ConvertValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
473  MapUnit eInUnit, FieldUnit eOutUnit );
474 
475  // for backwards compatibility
476  // caution: conversion to double loses precision
477  static double ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
478  FieldUnit eInUnit, FieldUnit eOutUnit );
479  static double ConvertDoubleValue( double nValue, sal_uInt16 nDecDigits,
480  FieldUnit eInUnit, MapUnit eOutUnit );
481  static double ConvertDoubleValue( double nValue, sal_uInt16 nDecDigits,
482  MapUnit eInUnit, FieldUnit eOutUnit );
483 
484  // for backwards compatibility
485  // caution: conversion to double loses precision
486  static double ConvertDoubleValue( sal_Int64 nValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits,
487  FieldUnit eInUnit, FieldUnit eOutUnit )
488  { return ConvertDoubleValue( static_cast<double>(nValue), nBaseValue, nDecDigits, eInUnit, eOutUnit ); }
489  static double ConvertDoubleValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
490  FieldUnit eInUnit, MapUnit eOutUnit )
491  { return ConvertDoubleValue( static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit ); }
492  static double ConvertDoubleValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
493  MapUnit eInUnit, FieldUnit eOutUnit )
494  { return ConvertDoubleValue( static_cast<double>(nValue), nDecDigits, eInUnit, eOutUnit ); }
495 
496  virtual bool set_property(const OString &rKey, const OUString &rValue) override;
497  virtual void dispose() override;
498 
499  virtual boost::property_tree::ptree DumpAsPropertyTree() override;
500 };
501 
502 
504 {
505 public:
506  CurrencyField( vcl::Window* pParent, WinBits nWinStyle );
507 
508  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
509  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
510  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
511 
512  virtual void Modify() override;
513 
514  virtual void Up() override;
515  virtual void Down() override;
516  virtual void First() override;
517  virtual void Last() override;
518  virtual void dispose() override;
519 };
520 
521 
523 {
524 private:
527 
528 protected:
529  SAL_DLLPRIVATE void ImplDateSpinArea( bool bUp );
530 
531 public:
532  explicit DateField( vcl::Window* pParent, WinBits nWinStyle );
533 
534  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
535  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
536  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
537 
538  virtual void Modify() override;
539 
540  virtual void Up() override;
541  virtual void Down() override;
542  virtual void First() override;
543  virtual void Last() override;
544 
545  void SetFirst( const Date& rNewFirst ) { maFirst = rNewFirst; }
546  const Date& GetFirst() const { return maFirst; }
547  void SetLast( const Date& rNewLast ) { maLast = rNewLast; }
548  const Date& GetLast() const { return maLast; }
549  virtual void dispose() override;
550 };
551 
552 
553 class VCL_DLLPUBLIC TimeField final : public SpinField, public TimeFormatter
554 {
555 private:
558 
559  SAL_DLLPRIVATE void ImplTimeSpinArea( bool bUp );
560 
561 public:
562  explicit TimeField( vcl::Window* pParent, WinBits nWinStyle );
563 
564  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
565  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
566  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
567 
568  virtual void Modify() override;
569 
570  virtual void Up() override;
571  virtual void Down() override;
572  virtual void First() override;
573  virtual void Last() override;
574 
575  void SetFirst( const tools::Time& rNewFirst ) { maFirst = rNewFirst; }
576  const tools::Time& GetFirst() const { return maFirst; }
577  void SetLast( const tools::Time& rNewLast ) { maLast = rNewLast; }
578  const tools::Time& GetLast() const { return maLast; }
579 
580  void SetExtFormat( ExtTimeFieldFormat eFormat );
581  virtual void dispose() override;
582 };
583 
584 
585 class VCL_DLLPUBLIC PatternBox final : public ComboBox, public PatternFormatter
586 {
587 public:
588  PatternBox( vcl::Window* pParent, WinBits nWinStyle );
589 
590  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
591  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
592 
593  virtual void Modify() override;
594 
595  virtual void ReformatAll() override;
596  virtual void dispose() override;
597 };
598 
599 
601 {
602  SAL_DLLPRIVATE void ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, OUString& rOutStr );
603 public:
604  explicit NumericBox( vcl::Window* pParent, WinBits nWinStyle );
605 
606  virtual Size CalcMinimumSize() const override;
607 
608  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
609  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
610  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
611 
612  virtual void Modify() override;
613 
614  virtual void ReformatAll() override;
615 
616  void InsertValue( sal_Int64 nValue, sal_Int32 nPos = COMBOBOX_APPEND );
617  virtual void dispose() override;
618 };
619 
620 
622 {
623 public:
624  explicit MetricBox( vcl::Window* pParent, WinBits nWinStyle );
625 
626  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
627  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
628  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
629 
630  virtual Size CalcMinimumSize() const override;
631 
632  virtual void Modify() override;
633 
634  virtual void ReformatAll() override;
635 
636  void InsertValue( sal_Int64 nValue, FieldUnit eInUnit = FieldUnit::NONE,
637  sal_Int32 nPos = COMBOBOX_APPEND );
638 
639  // Needed, because GetValue() with nPos hide these functions
641 
642  virtual void dispose() override;
643 };
644 
645 
647 {
648 public:
649  explicit CurrencyBox( vcl::Window* pParent, WinBits nWinStyle );
650 
651  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
652  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
653  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
654 
655  virtual void Modify() override;
656 
657  virtual void ReformatAll() override;
658 
659  virtual void dispose() override;
660 };
661 
662 
663 class VCL_DLLPUBLIC DateBox final : public ComboBox, public DateFormatter
664 {
665 public:
666  explicit DateBox( vcl::Window* pParent, WinBits nWinStyle );
667 
668  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
669  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
670  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
671 
672  virtual void Modify() override;
673 
674  virtual void ReformatAll() override;
675  virtual void dispose() override;
676 };
677 
678 
679 class VCL_DLLPUBLIC TimeBox final : public ComboBox, public TimeFormatter
680 {
681 public:
682  explicit TimeBox( vcl::Window* pParent, WinBits nWinStyle );
683 
684  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
685  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
686  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
687 
688  virtual void Modify() override;
689 
690  virtual void ReformatAll() override;
691  virtual void dispose() override;
692 };
693 
694 #endif // INCLUDED_VCL_FIELD_HXX
695 
696 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Date maFirst
Definition: field.hxx:525
sal_Int64 GetFirst() const
Definition: field.hxx:133
OUString maLiteralMask
Definition: field.hxx:92
FieldUnit
bool mbInPattKeyInput
Definition: field.hxx:94
SAL_DLLPRIVATE const Date & ImplGetFieldDate() const
Definition: field.hxx:273
const tools::Time & GetFirst() const
Definition: field.hxx:576
OString m_aEditMask
Definition: field.hxx:91
void SetFirst(const Date &rNewFirst)
Definition: field.hxx:545
ExtTimeFieldFormat
Definition: vclenum.hxx:148
TimeFieldFormat
Definition: vclenum.hxx:28
void SetFirst(const tools::Time &rNewFirst)
Definition: field.hxx:575
void SetMax(sal_Int64 nNewMax)
Definition: field.cxx:569
bool mbFormatting
Definition: field.hxx:161
std::string GetValue
TimeFormat GetTimeFormat() const
Definition: field.hxx:376
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
tools::Time maMin
Definition: field.hxx:339
sal_Int64 GetSpinSize() const
Definition: field.hxx:137
bool mbThousandSep
Definition: field.hxx:185
tools::Time maFieldTime
Definition: field.hxx:347
Any GetTime(const OUString &val)
virtual OUString CreateFieldText(sal_Int64 nValue) const
Definition: field.cxx:604
void SetEmptyFieldValue()
Definition: field.cxx:513
tools::Time maFirst
Definition: field.hxx:556
Date maFieldDate
Definition: field.hxx:261
sal_Int64 mnLastValue
Definition: field.hxx:157
virtual void SetUnit(FieldUnit meUnit)
Definition: field.cxx:1395
bool IsEmptyFieldValueEnabled() const
Definition: field.hxx:83
virtual bool set_property(const OString &rKey, const OUString &rValue) override
Definition: edit.cxx:177
virtual void Up()
Definition: spinfld.cxx:359
std::unique_ptr< LocaleDataWrapper > mpLocaleDataWrapper
Definition: field.hxx:44
sal_Int64 GetValue() const
Definition: field.cxx:636
bool mbEmptyFieldValueEnabled
Definition: field.hxx:48
virtual void ReformatAll() override
Definition: field2.cxx:2307
bool mbEnforceValidValue
Definition: field.hxx:268
bool MustBeReformatted() const
Definition: field.hxx:67
bool IsShowDateCentury() const
Definition: field.hxx:305
Date maLast
Definition: field.hxx:526
void ClearField()
Definition: field.hxx:59
void SetSpinSize(sal_Int64 nNewSize)
Definition: field.hxx:136
void SetMin(sal_Int64 nNewMin)
Definition: field.cxx:562
void SetString(SwCursor &rCursor, const OUString &rString)
bool IsEmptyTime() const
Definition: field.hxx:388
tools::Time maMax
Definition: field.hxx:340
OUString GetString(int nId)
bool IsEnforceValidValue() const
Definition: field.hxx:403
bool mbSameMask
Definition: field.hxx:93
sal_Int64 WinBits
Edit * GetField() const
Definition: field.hxx:58
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: spinfld.cxx:352
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: combobox.cxx:122
TimeFormat mnTimeFormat
Definition: field.hxx:342
SAL_DLLPRIVATE bool ImplIsSameMask() const
Definition: field.hxx:101
TimeFormat
Definition: vclenum.hxx:143
FieldUnit GetUnit() const
Definition: field.hxx:199
OUString maCustomUnitText
Definition: field.hxx:236
bool mbEmptyFieldValue
Definition: field.hxx:47
sal_uInt16 GetDecimalDigits() const
Definition: field.hxx:140
sal_Int16 const nValue
void EnforceValidValue(bool _bEnforce)
enables or disables the enforcement of valid values
Definition: field.hxx:330
void SetLast(const Date &rNewLast)
Definition: field.hxx:547
bool IsEmptyFieldValue() const
Definition: field.cxx:520
bool IsLongFormat() const
Definition: field.hxx:303
Definition: edit.hxx:55
virtual void Down()
Definition: spinfld.cxx:364
sal_Int64 GetMin() const
Definition: field.hxx:126
ExtDateFieldFormat mnExtDateFormat
Definition: field.hxx:267
const Date & GetFirst() const
Definition: field.hxx:546
Date maMax
Definition: field.hxx:264
bool mbStrictFormat
Definition: field.hxx:46
SAL_DLLPRIVATE bool & ImplGetInPattKeyInput()
Definition: field.hxx:102
FieldUnit meUnit
Definition: field.hxx:226
virtual void ReformatAll()
Definition: field.cxx:466
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: combobox.cxx:684
virtual boost::property_tree::ptree DumpAsPropertyTree()
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: window.cxx:3353
tools::Time maLast
Definition: field.hxx:557
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: spinfld.cxx:490
void clear()
Definition: vclptr.hxx:190
const Date & GetMax() const
Definition: field.hxx:296
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:51
bool mbDuration
Definition: field.hxx:343
std::unique_ptr< CalendarWrapper > mxCalendarWrapper
Definition: field.hxx:260
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: combobox.cxx:706
virtual void Reformat()
Definition: field.cxx:462
bool mbReformat
Definition: field.hxx:45
bool IsStrictFormat() const
Definition: field.hxx:71
static double ConvertDoubleValue(sal_Int64 nValue, sal_uInt16 nDecDigits, MapUnit eInUnit, FieldUnit eOutUnit)
Definition: field.hxx:492
void SetEmptyFieldValueData(bool bValue)
Definition: field.hxx:54
void SetLast(sal_Int64 last)
Definition: field.hxx:467
virtual void Modify()
Definition: edit.cxx:2300
void EnableEmptyFieldValue(bool bEnable)
Definition: field.hxx:82
const OUString & GetLiteralMask() const
Definition: field.hxx:111
const LocaleDataWrapper & GetLocaleDataWrapper(LanguageType nLang)
const tools::Time & GetLast() const
Definition: field.hxx:578
bool mbShowDateCentury
Definition: field.hxx:266
bool mbShowTrailingZeros
Definition: field.hxx:186
SAL_DLLPRIVATE bool ImplGetEmptyFieldValue() const
Definition: field.hxx:52
const Date & GetLast() const
Definition: field.hxx:548
Date maLastDate
Definition: field.hxx:262
void ResetLastDate()
Definition: field.hxx:313
void SetEmptyTime()
Definition: field.hxx:387
const OString & GetEditMask() const
Definition: field.hxx:110
sal_Int64 mnLast
Definition: field.hxx:167
bool IsShowTrailingZeros() const
Definition: field.hxx:146
virtual void ReformatAll() override
Definition: field2.cxx:1457
bool mbEnforceValidValue
Definition: field.hxx:344
virtual void Reformat() override
Definition: field.cxx:671
ExtDateFieldFormat
Definition: vclenum.hxx:153
static double ConvertDoubleValue(sal_Int64 nValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
Definition: field.hxx:486
void MarkToBeReformatted(bool b)
Definition: field.hxx:68
sal_Int64 mnMax
Definition: field.hxx:159
virtual void First()
Definition: spinfld.cxx:369
virtual sal_Int64 GetValueFromString(const OUString &rStr) const
Definition: field.cxx:623
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: spinfld.cxx:813
void EnforceValidValue(bool _bEnforce)
enables or disables the enforcement of valid values
Definition: field.hxx:402
TimeFieldFormat GetFormat() const
Definition: field.hxx:379
bool IsEnforceValidValue() const
Definition: field.hxx:331
sal_Int64 GetMax() const
Definition: field.hxx:128
void SetFirst(sal_Int64 nNewFirst)
Definition: field.hxx:132
const tools::Time & GetMax() const
Definition: field.hxx:373
TimeFieldFormat meFormat
Definition: field.hxx:341
sal_Int64 GetLast() const
Definition: field.hxx:135
void SetFirst(sal_Int64 first)
Definition: field.hxx:464
virtual Size CalcMinimumSize() const override
Definition: spinfld.cxx:923
sal_Int64 mnSpinSize
Definition: field.hxx:165
sal_Int64 mnFirst
Definition: field.hxx:166
virtual void Last()
Definition: spinfld.cxx:374
SAL_DLLPRIVATE void ImplNumericReformat()
Definition: field.cxx:532
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: spinfld.cxx:835
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:34
bool IsUseThousandSep() const
Definition: field.hxx:143
MapUnit
const tools::Time & GetMin() const
Definition: field.hxx:371
sal_Int64 mnMin
Definition: field.hxx:158
bool mbWrapOnLimits
Definition: field.hxx:160
void SetLast(sal_Int64 nNewLast)
Definition: field.hxx:134
bool mbLongFormat
Definition: field.hxx:265
void SetLast(const tools::Time &rNewLast)
Definition: field.hxx:577
void SetUserValue(sal_Int64 nNewValue)
Definition: field.cxx:618
Size CalcMinimumSize() const override
Definition: combobox.cxx:1029
const Date & GetMin() const
Definition: field.hxx:293
bool IsDuration() const
Definition: field.hxx:382
sal_uInt16 mnDecimalDigits
Definition: field.hxx:184
virtual void SetValue(sal_Int64 nNewValue)
Definition: field.cxx:598
sal_uInt16 nPos
void SetFormat(LotusContext &rContext, SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt8 nFormat, sal_uInt8 nSt)
tools::Time maLastTime
Definition: field.hxx:338
#define COMBOBOX_APPEND
Definition: combobox.hxx:27
VclPtr< Edit > mpField
Definition: field.hxx:42
static double ConvertDoubleValue(sal_Int64 nValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, MapUnit eOutUnit)
Definition: field.hxx:489
virtual void Modify() override
Definition: combobox.cxx:811
const OUString & GetCustomUnitText() const
Definition: field.hxx:201
Date maMin
Definition: field.hxx:263