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