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 #pragma once
21 
22 #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS)
23 #error "don't use this in new code"
24 #endif
25 
26 #include <sal/config.h>
27 
28 #include <string_view>
29 
30 #include <config_options.h>
31 #include <tools/date.hxx>
32 #include <tools/fldunit.hxx>
33 #include <tools/time.hxx>
34 #include <vcl/toolkit/combobox.hxx>
35 #include <vcl/toolkit/spinfld.hxx>
36 #include <vcl/formatter.hxx>
37 
38 namespace com::sun::star::lang { struct Locale; }
39 
40 class CalendarWrapper;
41 class LocaleDataWrapper;
42 class LanguageTag;
43 
45 {
46 private:
48  mutable std::unique_ptr<LocaleDataWrapper>
50  bool mbReformat;
54 
55 protected:
56  SAL_DLLPRIVATE void ImplSetText( const OUString& rText, Selection const * pNewSel = nullptr );
57  SAL_DLLPRIVATE bool ImplGetEmptyFieldValue() const { return mbEmptyFieldValue; }
58 
59  void SetEmptyFieldValueData( bool bValue ) { mbEmptyFieldValue = bValue; }
60 
61  SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const;
63  SAL_DLLPRIVATE void ImplResetLocaleDataWrapper() const;
64 
65  Edit* GetField() const { return mpField; }
66  void ClearField() { mpField.clear(); }
67 
68 public:
69  explicit FormatterBase(Edit* pField);
70  virtual ~FormatterBase();
71 
73 
74  bool MustBeReformatted() const { return mbReformat; }
75  void MarkToBeReformatted( bool b ) { mbReformat = b; }
76 
77  void SetStrictFormat( bool bStrict );
78  bool IsStrictFormat() const { return mbStrictFormat; }
79 
80  virtual void Reformat();
81  virtual void ReformatAll();
82 
83  const css::lang::Locale& GetLocale() const;
84  const LanguageTag& GetLanguageTag() const;
85 
86  void SetEmptyFieldValue();
87  bool IsEmptyFieldValue() const;
88 
89  void EnableEmptyFieldValue( bool bEnable ) { mbEmptyFieldValueEnabled = bEnable; }
90  bool IsEmptyFieldValueEnabled() const { return mbEmptyFieldValueEnabled; }
91 };
92 
94 {
95 public:
96  virtual ~NumericFormatter() override;
97 
98  virtual void Reformat() override;
99 
100  void SetMin( sal_Int64 nNewMin );
101  sal_Int64 GetMin() const { return mnMin; }
102  void SetMax( sal_Int64 nNewMax );
103  sal_Int64 GetMax() const { return mnMax; }
104 
105  sal_Int64 ClipAgainstMinMax(sal_Int64 nValue) const;
106 
107  void SetFirst( sal_Int64 nNewFirst ) { mnFirst = nNewFirst; }
108  sal_Int64 GetFirst() const { return mnFirst; }
109  void SetLast( sal_Int64 nNewLast ) { mnLast = nNewLast; }
110  sal_Int64 GetLast() const { return mnLast; }
111  void SetSpinSize( sal_Int64 nNewSize ) { mnSpinSize = nNewSize; }
112  sal_Int64 GetSpinSize() const { return mnSpinSize; }
113 
114  void SetDecimalDigits( sal_uInt16 nDigits );
115  sal_uInt16 GetDecimalDigits() const { return mnDecimalDigits;}
116 
117  void SetUseThousandSep( bool b );
118  bool IsUseThousandSep() const { return mbThousandSep; }
119 
120  void SetUserValue( sal_Int64 nNewValue );
121  virtual void SetValue( sal_Int64 nNewValue );
122  sal_Int64 GetValue() const;
123  virtual OUString CreateFieldText( sal_Int64 nValue ) const;
124 
125  sal_Int64 Normalize( sal_Int64 nValue ) const;
126  sal_Int64 Denormalize( sal_Int64 nValue ) const;
127 
128  OUString GetValueString() const;
129  void SetValueFromString(const OUString& rStr);
130 
131 protected:
132  sal_Int64 mnLastValue;
133  sal_Int64 mnMin;
134  sal_Int64 mnMax;
136 
137  // the members below are used in all derivatives of NumericFormatter
138  // not in NumericFormatter itself.
139  sal_Int64 mnSpinSize;
140  sal_Int64 mnFirst;
141  sal_Int64 mnLast;
142 
143  NumericFormatter(Edit* pEdit);
144 
145  void FieldUp();
146  void FieldDown();
147  void FieldFirst();
148  void FieldLast();
149  void FormatValue(Selection const * pNewSelection = nullptr);
150 
151  SAL_DLLPRIVATE void ImplNumericReformat();
152  SAL_DLLPRIVATE void ImplNewFieldValue( sal_Int64 nNewValue );
153  SAL_DLLPRIVATE void ImplSetUserValue( sal_Int64 nNewValue, Selection const * pNewSelection = nullptr );
154 
155  virtual sal_Int64 GetValueFromString(const OUString& rStr) const;
156 
157 private:
158  sal_uInt16 mnDecimalDigits;
160 
161 };
162 
164 {
165 public:
166  virtual ~MetricFormatter() override;
167 
168  virtual void Reformat() override;
169 
170  virtual void SetUnit( FieldUnit meUnit );
171  FieldUnit GetUnit() const { return meUnit; }
172  void SetCustomUnitText( const OUString& rStr );
173  const OUString& GetCustomUnitText() const { return maCustomUnitText; }
174 
176  void SetMax( sal_Int64 nNewMax, FieldUnit eInUnit );
178  sal_Int64 GetMax( FieldUnit eOutUnit ) const;
180  void SetMin( sal_Int64 nNewMin, FieldUnit eInUnit );
182  sal_Int64 GetMin( FieldUnit eOutUnit ) const;
183 
184  void SetValue( sal_Int64 nNewValue, FieldUnit eInUnit );
185  virtual void SetValue( sal_Int64 nValue ) override;
187  void SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit );
189  sal_Int64 GetValue( FieldUnit eOutUnit ) const;
190  virtual OUString CreateFieldText( sal_Int64 nValue ) const override;
191  sal_Int64 GetCorrectedValue( FieldUnit eOutUnit ) const;
192 
193 protected:
195 
196  MetricFormatter(Edit* pEdit);
197 
198  SAL_DLLPRIVATE void ImplMetricReformat( const OUString& rStr, double& rValue, OUString& rOutStr );
199 
200  virtual sal_Int64 GetValueFromString(const OUString& rStr) const override;
201  sal_Int64 GetValueFromStringUnit(const OUString& rStr, FieldUnit eOutUnit) const;
202 
203 private:
205 };
206 
208 {
209 public:
210  explicit MetricField( vcl::Window* pParent, WinBits nWinStyle );
211 
212  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
213  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
214  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
215 
216  virtual Size CalcMinimumSize() const override;
217 
218  virtual void Modify() override;
219 
220  virtual void Up() override;
221  virtual void Down() override;
222  virtual void First() override;
223  virtual void Last() override;
224 
225  virtual void SetUnit( FieldUnit meUnit ) override;
226 
227  void SetFirst( sal_Int64 nNewFirst, FieldUnit eInUnit );
228  sal_Int64 GetFirst( FieldUnit eOutUnit ) const;
229  void SetLast( sal_Int64 nNewLast, FieldUnit eInUnit );
230  sal_Int64 GetLast( FieldUnit eOutUnit ) const;
231 
232  virtual bool set_property(const OString &rKey, const OUString &rValue) override;
233  virtual void dispose() override;
234 
235  virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
236  virtual FactoryFunction GetUITestFactory() const override;
237 };
238 
239 class VCL_DLLPUBLIC MetricBox final : public ComboBox, public MetricFormatter
240 {
241 public:
242  explicit MetricBox( vcl::Window* pParent, WinBits nWinStyle );
243 
244  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
245  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
246  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
247 
248  virtual Size CalcMinimumSize() const override;
249 
250  virtual void Modify() override;
251 
252  virtual void ReformatAll() override;
253 
254  // Needed, because GetValue() with nPos hide these functions
256 
257  virtual void dispose() override;
258 };
259 
260 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) CurrencyFormatter : public NumericFormatter
261 {
262 protected:
263  CurrencyFormatter(Edit* pEdit);
264  SAL_DLLPRIVATE void ImplCurrencyReformat( const OUString& rStr, OUString& rOutStr );
265  virtual sal_Int64 GetValueFromString(const OUString& rStr) const override;
266 
267 public:
268  virtual ~CurrencyFormatter() override;
269 
270  virtual void Reformat() override;
271 
272  virtual void SetValue( sal_Int64 nNewValue ) override;
273  virtual OUString CreateFieldText( sal_Int64 nValue ) const override;
274 };
275 
276 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) CurrencyField final : public SpinField, public CurrencyFormatter
277 {
278 public:
279  CurrencyField( vcl::Window* pParent, WinBits nWinStyle );
280 
281  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
282  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
283  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
284 
285  virtual void Modify() override;
286 
287  virtual void Up() override;
288  virtual void Down() override;
289  virtual void First() override;
290  virtual void Last() override;
291  virtual void dispose() override;
292 };
293 
294 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) TimeFormatter : public FormatterBase
295 {
296 private:
297  tools::Time maLastTime;
298  tools::Time maMin;
299  tools::Time maMax;
300  TimeFieldFormat meFormat;
301  TimeFormat mnTimeFormat;
302  bool mbDuration;
303  bool mbEnforceValidValue;
304 
305 protected:
306  tools::Time maFieldTime;
307 
308  TimeFormatter(Edit* pEdit);
309 
310  SAL_DLLPRIVATE void ImplTimeReformat( std::u16string_view rStr, OUString& rOutStr );
311  SAL_DLLPRIVATE void ImplNewFieldValue( const tools::Time& rTime );
312  SAL_DLLPRIVATE void ImplSetUserTime( const tools::Time& rNewTime, Selection const * pNewSelection = nullptr );
313  SAL_DLLPRIVATE bool ImplAllowMalformedInput() const;
314 
315 public:
316  static OUString FormatTime(const tools::Time& rNewTime, TimeFieldFormat eFormat, TimeFormat eHourFormat, bool bDuration, const LocaleDataWrapper& rLocaleData);
317  static bool TextToTime(std::u16string_view rStr, tools::Time& rTime, TimeFieldFormat eFormat, bool bDuration, const LocaleDataWrapper& rLocaleDataWrapper, bool _bSkipInvalidCharacters = true);
318  static int GetTimeArea(TimeFieldFormat eFormat, const OUString& rText, int nCursor,
319  const LocaleDataWrapper& rLocaleDataWrapper);
320  static tools::Time SpinTime(bool bUp, const tools::Time& rTime, TimeFieldFormat eFormat,
321  bool bDuration, const OUString& rText, int nCursor,
322  const LocaleDataWrapper& rLocaleDataWrapper);
323 
324  virtual ~TimeFormatter() override;
325 
326  virtual void Reformat() override;
327  virtual void ReformatAll() override;
328 
329  void SetMin( const tools::Time& rNewMin );
330  const tools::Time& GetMin() const { return maMin; }
331  void SetMax( const tools::Time& rNewMax );
332  const tools::Time& GetMax() const { return maMax; }
333 
334  void SetTimeFormat( TimeFormat eNewFormat );
335  TimeFormat GetTimeFormat() const { return mnTimeFormat;}
336 
337  void SetFormat( TimeFieldFormat eNewFormat );
338  TimeFieldFormat GetFormat() const { return meFormat; }
339 
340  void SetDuration( bool mbDuration );
341  bool IsDuration() const { return mbDuration; }
342 
343  void SetTime( const tools::Time& rNewTime );
344  void SetUserTime( const tools::Time& rNewTime );
345  tools::Time GetTime() const;
346  void SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); }
347  bool IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
348 
361  void EnforceValidValue( bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
362  bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
363 };
364 
365 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) TimeField final : public SpinField, public TimeFormatter
366 {
367 private:
368  tools::Time maFirst;
369  tools::Time maLast;
370 
371  SAL_DLLPRIVATE void ImplTimeSpinArea( bool bUp );
372 
373 public:
374  explicit TimeField( vcl::Window* pParent, WinBits nWinStyle );
375 
376  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
377  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
378  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
379 
380  virtual void Modify() override;
381 
382  virtual void Up() override;
383  virtual void Down() override;
384  virtual void First() override;
385  virtual void Last() override;
386 
387  void SetFirst( const tools::Time& rNewFirst ) { maFirst = rNewFirst; }
388  const tools::Time& GetFirst() const { return maFirst; }
389  void SetLast( const tools::Time& rNewLast ) { maLast = rNewLast; }
390  const tools::Time& GetLast() const { return maLast; }
391 
392  void SetExtFormat( ExtTimeFieldFormat eFormat );
393  virtual void dispose() override;
394 };
395 
396 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) DateFormatter : public FormatterBase
397 {
398 private:
399  Formatter::StaticFormatter maStaticFormatter;
400  std::unique_ptr<CalendarWrapper> mxCalendarWrapper;
401  Date maFieldDate;
402  Date maLastDate;
403  Date maMin;
404  Date maMax;
405  bool mbLongFormat;
406  bool mbShowDateCentury;
407  ExtDateFieldFormat mnExtDateFormat;
408  bool mbEnforceValidValue;
409 
410 protected:
411  DateFormatter(Edit* pEdit);
412 
413  SAL_DLLPRIVATE const Date& ImplGetFieldDate() const { return maFieldDate; }
414  SAL_DLLPRIVATE void ImplDateReformat( const OUString& rStr, OUString& rOutStr );
415  SAL_DLLPRIVATE void ImplSetUserDate( const Date& rNewDate,
416  Selection const * pNewSelection = nullptr );
417  SAL_DLLPRIVATE OUString ImplGetDateAsText( const Date& rDate ) const;
418  SAL_DLLPRIVATE void ImplNewFieldValue( const Date& rDate );
419  CalendarWrapper& GetCalendarWrapper() const;
420 
421  SAL_DLLPRIVATE bool ImplAllowMalformedInput() const;
422 
423 public:
424  static OUString FormatDate(const Date& rNewDate, ExtDateFieldFormat eFormat, const LocaleDataWrapper& rLocaleData, const Formatter::StaticFormatter& rStaticFormatter);
425  static bool TextToDate(const OUString& rStr, Date& rTime, ExtDateFieldFormat eFormat, const LocaleDataWrapper& rLocaleDataWrapper, const CalendarWrapper& rCalendarWrapper);
426  static int GetDateArea(ExtDateFieldFormat eFormat, const OUString& rText, int nCursor, const LocaleDataWrapper& rLocaleDataWrapper);
427 
428  virtual ~DateFormatter() override;
429 
430  virtual void Reformat() override;
431  virtual void ReformatAll() override;
432 
433  void SetExtDateFormat( ExtDateFieldFormat eFormat );
434  ExtDateFieldFormat GetExtDateFormat( bool bResolveSystemFormat = false ) const;
435 
436  void SetMin( const Date& rNewMin );
437  const Date& GetMin() const { return maMin; }
438 
439  void SetMax( const Date& rNewMax );
440  const Date& GetMax() const { return maMax; }
441 
442 
443  // MT: Remove these methods too, ExtDateFormat should be enough!
444  // What should happen if using DDMMYYYY, but ShowCentury=false?
445 
446  void SetLongFormat( bool bLong );
447  bool IsLongFormat() const { return mbLongFormat; }
448  void SetShowDateCentury( bool bShowCentury );
449  bool IsShowDateCentury() const { return mbShowDateCentury; }
450 
451 
452  void SetDate( const Date& rNewDate );
453  Date GetDate() const;
454  void SetEmptyDate();
455  bool IsEmptyDate() const;
456 
457  void ResetLastDate() { maLastDate = Date( Date::EMPTY ); }
458 
459  static void ExpandCentury( Date& rDate );
460  static void ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart );
461 
474  void EnforceValidValue( bool _bEnforce ) { mbEnforceValidValue = _bEnforce; }
475  bool IsEnforceValidValue( ) const { return mbEnforceValidValue; }
476 };
477 
478 class SAL_DLLPUBLIC_RTTI DateField : public SpinField, public DateFormatter
479 {
480 private:
483 
484 protected:
485  void ImplDateSpinArea( bool bUp );
486 
487 public:
488  explicit DateField( vcl::Window* pParent, WinBits nWinStyle );
489 
490  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
491  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
492  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
493 
494  virtual void Modify() override;
495 
496  virtual void Up() override;
497  virtual void Down() override;
498  virtual void First() override;
499  virtual void Last() override;
500 
501  void SetFirst( const Date& rNewFirst ) { maFirst = rNewFirst; }
502  const Date& GetFirst() const { return maFirst; }
503  void SetLast( const Date& rNewLast ) { maLast = rNewLast; }
504  const Date& GetLast() const { return maLast; }
505  virtual void dispose() override;
506 };
507 
508 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) NumericBox final : public ComboBox, public NumericFormatter
509 {
510  SAL_DLLPRIVATE void ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, OUString& rOutStr );
511 public:
512  explicit NumericBox( vcl::Window* pParent, WinBits nWinStyle );
513 
514  virtual Size CalcMinimumSize() const override;
515 
516  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
517  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
518  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
519 
520  virtual void Modify() override;
521 
522  virtual void ReformatAll() override;
523 
524  virtual void dispose() override;
525 };
526 
527 #define PATTERN_FORMAT_EMPTYLITERALS (sal_uInt16(0x0001))
528 
529 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) PatternFormatter : public FormatterBase
530 {
531 private:
532  OString m_aEditMask;
533  OUString maLiteralMask;
534  bool mbSameMask;
535  bool mbInPattKeyInput;
536 
537 protected:
538  PatternFormatter(Edit* pEdit);
539 
540  SAL_DLLPRIVATE bool ImplIsSameMask() const { return mbSameMask; }
541  SAL_DLLPRIVATE bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; }
542 
543 public:
544  virtual ~PatternFormatter() override;
545 
546  virtual void Reformat() override;
547 
548  void SetMask(const OString& rEditMask, const OUString& rLiteralMask );
549  const OString& GetEditMask() const { return m_aEditMask; }
550  const OUString& GetLiteralMask() const { return maLiteralMask; }
551 
552  void SetString( const OUString& rStr );
553  OUString GetString() const;
554 };
555 
556 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) PatternField final : public SpinField, public PatternFormatter
557 {
558 public:
559  explicit PatternField( vcl::Window* pParent, WinBits nWinStyle );
560 
561  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
562  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
563  virtual void Modify() override;
564  virtual void dispose() override;
565 };
566 
567 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) PatternBox final : public ComboBox, public PatternFormatter
568 {
569 public:
570  PatternBox( vcl::Window* pParent, WinBits nWinStyle );
571 
572  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
573  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
574 
575  virtual void Modify() override;
576 
577  virtual void ReformatAll() override;
578  virtual void dispose() override;
579 };
580 
581 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) CurrencyBox final : public ComboBox, public CurrencyFormatter
582 {
583 public:
584  explicit CurrencyBox( vcl::Window* pParent, WinBits nWinStyle );
585 
586  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
587  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
588  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
589 
590  virtual void Modify() override;
591 
592  virtual void ReformatAll() override;
593 
594  virtual void dispose() override;
595 };
596 
597 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) DateBox final : public ComboBox, public DateFormatter
598 {
599 public:
600  explicit DateBox( vcl::Window* pParent, WinBits nWinStyle );
601 
602  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
603  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
604  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
605 
606  virtual void Modify() override;
607 
608  virtual void ReformatAll() override;
609  virtual void dispose() override;
610 };
611 
612 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) TimeBox final : public ComboBox, public TimeFormatter
613 {
614 public:
615  explicit TimeBox( vcl::Window* pParent, WinBits nWinStyle );
616 
617  virtual bool PreNotify( NotifyEvent& rNEvt ) override;
618  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
619  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
620 
621  virtual void Modify() override;
622 
623  virtual void ReformatAll() override;
624  virtual void dispose() override;
625 };
626 
627 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Date maFirst
Definition: field.hxx:481
sal_Int64 GetFirst() const
Definition: field.hxx:108
FieldUnit
void SetFirst(const Date &rNewFirst)
Definition: field.hxx:501
ExtTimeFieldFormat
Definition: vclenum.hxx:146
TimeFieldFormat
Definition: vclenum.hxx:28
void SetMax(sal_Int64 nNewMax)
Definition: field.cxx:582
bool mbFormatting
Definition: field.hxx:135
std::string GetValue
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
sal_Int64 GetSpinSize() const
Definition: field.hxx:112
bool mbThousandSep
Definition: field.hxx:159
Any GetTime(const OUString &val)
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual OUString CreateFieldText(sal_Int64 nValue) const
Definition: field.cxx:607
void SetEmptyFieldValue()
Definition: field.cxx:528
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
Definition: edit.cxx:2916
sal_Int64 mnLastValue
Definition: field.hxx:132
virtual void SetUnit(FieldUnit meUnit)
Definition: field.cxx:1242
bool IsEmptyFieldValueEnabled() const
Definition: field.hxx:90
virtual bool set_property(const OString &rKey, const OUString &rValue) override
Definition: edit.cxx:181
virtual void Up()
Definition: spinfld.cxx:357
std::unique_ptr< LocaleDataWrapper > mpLocaleDataWrapper
Definition: field.hxx:49
sal_Int64 GetValue() const
Definition: field.cxx:661
bool mbEmptyFieldValueEnabled
Definition: field.hxx:53
bool MustBeReformatted() const
Definition: field.hxx:74
Date maLast
Definition: field.hxx:482
void ClearField()
Definition: field.hxx:66
void SetSpinSize(sal_Int64 nNewSize)
Definition: field.hxx:111
void SetMin(sal_Int64 nNewMin)
Definition: field.cxx:575
void SetString(SwCursor &rCursor, const OUString &rString)
OUString GetString(int nId)
sal_Int64 WinBits
Edit * GetField() const
Definition: field.hxx:65
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: spinfld.cxx:350
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: combobox.cxx:124
TimeFormat
Definition: vclenum.hxx:141
FieldUnit GetUnit() const
Definition: field.hxx:171
OUString maCustomUnitText
Definition: field.hxx:204
bool mbEmptyFieldValue
Definition: field.hxx:52
sal_uInt16 GetDecimalDigits() const
Definition: field.hxx:115
void SetLast(const Date &rNewLast)
Definition: field.hxx:503
bool IsEmptyFieldValue() const
Definition: field.cxx:535
Definition: edit.hxx:55
virtual FactoryFunction GetUITestFactory() const override
Definition: spinfld.cxx:1002
virtual void Down()
Definition: spinfld.cxx:362
sal_Int64 GetMin() const
Definition: field.hxx:101
const Date & GetFirst() const
Definition: field.hxx:502
bool mbStrictFormat
Definition: field.hxx:51
FieldUnit meUnit
Definition: field.hxx:194
virtual void ReformatAll()
Definition: field.cxx:481
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: combobox.cxx:693
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: spinfld.cxx:483
void clear()
Definition: vclptr.hxx:190
virtual bool PreNotify(NotifyEvent &rNEvt)
Definition: event.cxx:52
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: combobox.cxx:715
virtual void Reformat()
Definition: field.cxx:477
bool mbReformat
Definition: field.hxx:50
bool IsStrictFormat() const
Definition: field.hxx:78
void SetEmptyFieldValueData(bool bValue)
Definition: field.hxx:59
virtual void Modify()
Definition: edit.cxx:2312
void EnableEmptyFieldValue(bool bEnable)
Definition: field.hxx:89
const LocaleDataWrapper & GetLocaleDataWrapper(LanguageType nLang)
SAL_DLLPRIVATE bool ImplGetEmptyFieldValue() const
Definition: field.hxx:57
const Date & GetLast() const
Definition: field.hxx:504
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
sal_Int64 mnLast
Definition: field.hxx:141
virtual void Reformat() override
Definition: field.cxx:696
ExtDateFieldFormat
Definition: vclenum.hxx:154
void MarkToBeReformatted(bool b)
Definition: field.hxx:75
sal_Int64 mnMax
Definition: field.hxx:134
virtual void First()
Definition: spinfld.cxx:367
virtual sal_Int64 GetValueFromString(const OUString &rStr) const
Definition: field.cxx:626
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: spinfld.cxx:809
sal_Int64 GetMax() const
Definition: field.hxx:103
void SetFirst(sal_Int64 nNewFirst)
Definition: field.hxx:107
sal_Int64 GetLast() const
Definition: field.hxx:110
virtual Size CalcMinimumSize() const override
Definition: spinfld.cxx:918
sal_Int64 mnSpinSize
Definition: field.hxx:139
sal_Int64 mnFirst
Definition: field.hxx:140
virtual void Last()
Definition: spinfld.cxx:372
SAL_DLLPRIVATE void ImplNumericReformat()
Definition: field.cxx:547
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: spinfld.cxx:831
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:38
bool IsUseThousandSep() const
Definition: field.hxx:118
sal_Int64 mnMin
Definition: field.hxx:133
void SetLast(sal_Int64 nNewLast)
Definition: field.hxx:109
void dispose()
void SetUserValue(sal_Int64 nNewValue)
Definition: field.cxx:621
Size CalcMinimumSize() const override
Definition: combobox.cxx:1022
sal_uInt16 mnDecimalDigits
Definition: field.hxx:158
virtual void SetValue(sal_Int64 nNewValue)
Definition: field.cxx:601
void SetFormat(LotusContext &rContext, SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt8 nFormat, sal_uInt8 nSt)
VclPtr< Edit > mpField
Definition: field.hxx:47
virtual void Modify() override
Definition: combobox.cxx:820
const OUString & GetCustomUnitText() const
Definition: field.hxx:173
virtual void SetValue(tools::Long nNew) override