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