1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_LONGCURR_HXX
21 #define INCLUDED_VCL_LONGCURR_HXX
23 #include <vcl/dllapi.h>
24 #include <tools/bigint.hxx>
25 #include <vcl/field.hxx>
27 class LocaleDataWrapper
;
30 class VCL_DLLPUBLIC LongCurrencyFormatter
: public FormatterBase
33 virtual ~LongCurrencyFormatter() override
;
35 virtual void Reformat() override
;
36 virtual void ReformatAll() override
;
38 void SetUseThousandSep( bool b
);
39 bool IsUseThousandSep() const { return mbThousandSep
; }
41 void SetCurrencySymbol( const OUString
& rStr
);
42 OUString
const & GetCurrencySymbol() const;
44 void SetMin(const BigInt
& rNewMin
);
45 const BigInt
& GetMin() const { return mnMin
; }
46 void SetMax(const BigInt
& rNewMax
);
47 const BigInt
& GetMax() const { return mnMax
; }
49 void SetDecimalDigits( sal_uInt16 nDigits
);
50 sal_uInt16
GetDecimalDigits() const { return mnDecimalDigits
;}
51 void SetValue(const BigInt
& rNewValue
);
52 void SetUserValue( BigInt nNewValue
);
53 BigInt
GetValue() const;
60 LongCurrencyFormatter(Edit
* pEdit
);
62 friend bool ImplLongCurrencyReformat( const OUString
&, BigInt
const &, BigInt
const &, sal_uInt16
, const LocaleDataWrapper
&, OUString
&, LongCurrencyFormatter
const & );
63 SAL_DLLPRIVATE
void ImpInit();
65 OUString maCurrencySymbol
;
66 sal_uInt16 mnDecimalDigits
;
72 class VCL_DLLPUBLIC LongCurrencyField final
: public SpinField
, public LongCurrencyFormatter
74 friend void ImplNewLongCurrencyFieldValue(LongCurrencyField
*, const BigInt
&);
82 LongCurrencyField( vcl::Window
* pParent
, WinBits nWinStyle
);
84 virtual bool EventNotify( NotifyEvent
& rNEvt
) override
;
86 void Modify() override
;
89 void First() override
;
92 void SetFirst(const BigInt
& rNewFirst
) { mnFirst
= rNewFirst
; }
93 const BigInt
& GetFirst() const { return mnFirst
; }
94 void SetLast(const BigInt
& rNewLast
) { mnLast
= rNewLast
; }
95 const BigInt
& GetLast() const { return mnLast
; }
96 void SetSpinSize(const BigInt
& rNewSize
) { mnSpinSize
= rNewSize
; }
97 const BigInt
& GetSpinSize() const { return mnSpinSize
; }
101 class VCL_DLLPUBLIC LongCurrencyBox final
: public ComboBox
, public LongCurrencyFormatter
104 LongCurrencyBox( vcl::Window
* pParent
, WinBits nWinStyle
);
106 virtual bool EventNotify( NotifyEvent
& rNEvt
) override
;
108 void Modify() override
;
109 void ReformatAll() override
;
112 #endif // INCLUDED_VCL_LONGCURR_HXX
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */