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 #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 <vcl/dllapi.h>
28 #include <tools/bigint.hxx>
29 #include <vcl/toolkit/field.hxx>
30 
31 class LocaleDataWrapper;
32 
33 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) LongCurrencyFormatter : public FormatterBase
34 {
35 public:
36  virtual ~LongCurrencyFormatter() override;
37 
38  virtual void Reformat() override;
39  virtual void ReformatAll() override;
40 
41  OUString const & GetCurrencySymbol() const;
42 
43  void SetDecimalDigits( sal_uInt16 nDigits );
44  sal_uInt16 GetDecimalDigits() const { return mnDecimalDigits;}
45  void SetValue(const BigInt& rNewValue);
46  void SetUserValue( BigInt nNewValue );
47  BigInt GetValue() const;
48 
49 protected:
50  BigInt mnLastValue;
51  BigInt mnMin;
52  BigInt mnMax;
53 
54  LongCurrencyFormatter(Edit* pEdit);
55 private:
56  friend bool ImplLongCurrencyReformat( const OUString&, BigInt const &, BigInt const &, sal_uInt16, const LocaleDataWrapper&, OUString&, LongCurrencyFormatter const & );
57  SAL_DLLPRIVATE void ImpInit();
58 
59  sal_uInt16 mnDecimalDigits;
60 
61 };
62 
63 class UNLESS_MERGELIBS(VCL_DLLPUBLIC) LongCurrencyBox final : public ComboBox, public LongCurrencyFormatter
64 {
65 public:
66  LongCurrencyBox( vcl::Window* pParent, WinBits nWinStyle );
67 
68  virtual bool EventNotify( NotifyEvent& rNEvt ) override;
69 
70  void Modify() override;
71  void ReformatAll() override;
72 };
73 
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::string GetValue
sal_Int64 WinBits
Definition: edit.hxx:55
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:250
virtual void ReformatAll()
Definition: field.cxx:473
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: combobox.cxx:716
virtual void Reformat()
Definition: field.cxx:469
A widget used to choose from a list of items and which has an entry.
Definition: combobox.hxx:37
virtual void Modify() override
Definition: combobox.cxx:821