LibreOffice Module vcl (master)  1
longcurr.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_LONGCURR_HXX
21 #define INCLUDED_VCL_LONGCURR_HXX
22 
23 #include <vcl/dllapi.h>
24 #include <tools/bigint.hxx>
25 #include <vcl/field.hxx>
26 
27 class LocaleDataWrapper;
28 
29 
31 {
32 public:
33  virtual ~LongCurrencyFormatter() override;
34 
35  virtual void Reformat() override;
36  virtual void ReformatAll() override;
37 
38  void SetUseThousandSep( bool b );
39  bool IsUseThousandSep() const { return mbThousandSep; }
40 
41  void SetCurrencySymbol( const OUString& rStr );
42  OUString const & GetCurrencySymbol() const;
43 
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; }
48 
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;
54 
55 protected:
59 
61 private:
62  friend bool ImplLongCurrencyReformat( const OUString&, BigInt const &, BigInt const &, sal_uInt16, const LocaleDataWrapper&, OUString&, LongCurrencyFormatter const & );
63  SAL_DLLPRIVATE void ImpInit();
64 
65  OUString maCurrencySymbol;
66  sal_uInt16 mnDecimalDigits;
68 
69 };
70 
71 
73 {
75 
76 private:
80 
81 public:
82  LongCurrencyField( vcl::Window* pParent, WinBits nWinStyle );
83 
84  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
85 
86  void Modify() override;
87  void Up() override;
88  void Down() override;
89  void First() override;
90  void Last() override;
91 
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; }
98 };
99 
100 
102 {
103 public:
104  LongCurrencyBox( vcl::Window* pParent, WinBits nWinStyle );
105 
106  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
107 
108  void Modify() override;
109  void ReformatAll() override;
110 };
111 
112 #endif // INCLUDED_VCL_LONGCURR_HXX
113 
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString maCurrencySymbol
Definition: longcurr.hxx:65
void ImplNewLongCurrencyFieldValue(LongCurrencyField *pField, const BigInt &rNewValue)
Definition: longcurr.cxx:379
void SetFirst(const BigInt &rNewFirst)
Definition: longcurr.hxx:92
std::string GetValue
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
void SetLast(const BigInt &rNewLast)
Definition: longcurr.hxx:94
virtual void Up()
Definition: spinfld.cxx:359
const BigInt & GetMax() const
Definition: longcurr.hxx:47
sal_Int64 WinBits
bool IsUseThousandSep() const
Definition: longcurr.hxx:39
Definition: edit.hxx:58
virtual void Down()
Definition: spinfld.cxx:364
bool ImplLongCurrencyReformat(const OUString &rStr, BigInt const &nMin, BigInt const &nMax, sal_uInt16 nDecDigits, const LocaleDataWrapper &rLocaleDataWrapper, OUString &rOutStr, LongCurrencyFormatter const &rFormatter)
Definition: longcurr.cxx:222
sal_uInt16 mnDecimalDigits
Definition: longcurr.hxx:66
virtual void ReformatAll()
Definition: field.cxx:397
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: spinfld.cxx:490
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: combobox.cxx:702
virtual void Reformat()
Definition: field.cxx:393
void SetSpinSize(const BigInt &rNewSize)
Definition: longcurr.hxx:96
const BigInt & GetFirst() const
Definition: longcurr.hxx:93
virtual void Modify()
Definition: edit.cxx:2320
const BigInt & GetSpinSize() const
Definition: longcurr.hxx:97
const BigInt & GetMin() const
Definition: longcurr.hxx:45
virtual void ReformatAll() override
Definition: longcurr.cxx:346
virtual void First()
Definition: spinfld.cxx:369
const BigInt & GetLast() const
Definition: longcurr.hxx:95
virtual void Last()
Definition: spinfld.cxx:374
sal_uInt16 GetDecimalDigits() const
Definition: longcurr.hxx:50
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:34
virtual void Modify() override
Definition: combobox.cxx:807