KDELibs4Support

kcurrencycode.h
1 /*
2  Copyright (c) 2009 John Layt <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef KCURRENCYCODE_H
21 #define KCURRENCYCODE_H
22 
23 #include <kdelibs4support_export.h>
24 
25 #include <QSharedDataPointer>
26 #include <QString>
27 
28 class QDate;
29 class QStringList;
30 class QFileInfo;
31 
32 class KCurrencyCodePrivate;
33 
48 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KCurrencyCode
49 {
50 public:
58  ActiveCurrency = 0x01,
59  SuspendedCurrency = 0x02,
60  ObsoleteCurrency = 0x04
61  };
62  Q_DECLARE_FLAGS(CurrencyStatusFlags, CurrencyStatus)
63 
64 
73  KDELIBS4SUPPORT_DEPRECATED explicit KCurrencyCode(const QString &isoCurrencyCode, const QString &language = QString());
74 
86  KDELIBS4SUPPORT_DEPRECATED explicit KCurrencyCode(const QFileInfo &currencyCodeFile, const QString &language = QString());
87 
94  KCurrencyCode(const KCurrencyCode &rhs);
95 
99  virtual ~KCurrencyCode();
100 
107  KCurrencyCode &operator=(const KCurrencyCode &rhs);
108 
116  QString isoCurrencyCode() const;
117 
125  QString isoCurrencyCodeNumeric() const;
126 
135  QString name() const;
136 
147  QString isoName() const;
148 
156  CurrencyStatus status() const;
157 
167  QDate dateIntroduced() const;
168 
178  QDate dateSuspended() const;
179 
189  QDate dateWithdrawn() const;
190 
201  QStringList symbolList() const;
202 
211  QString defaultSymbol() const;
212 
221  QString unambiguousSymbol() const;
222 
234  bool hasSubunits() const;
235 
244  bool hasSubunitsInCirculation() const;
245 
254  QString subunitSymbol() const;
255 
263  int subunitsPerUnit() const;
264 
270  int decimalPlaces() const;
271 
277  QStringList countriesUsingCurrency() const;
278 
284  bool isValid() const;
285 
295  static bool isValid(const QString &currencyCode, CurrencyStatusFlags currencyStatus =
296  CurrencyStatusFlags(ActiveCurrency |
297  SuspendedCurrency |
298  ObsoleteCurrency));
299 
314  static QStringList allCurrencyCodesList(CurrencyStatusFlags currencyStatus =
315  CurrencyStatusFlags(ActiveCurrency |
316  SuspendedCurrency |
317  ObsoleteCurrency));
318 
334  static QString currencyCodeToName(const QString &currencyCode, const QString &language = QString());
335 
336 private:
337  QSharedDataPointer<KCurrencyCodePrivate> d;
338 };
339 
340 Q_DECLARE_OPERATORS_FOR_FLAGS(KCurrencyCode::CurrencyStatusFlags)
341 
342 #endif // KCURRENCYCODE_H
CurrencyStatus
The Status of the Currency.
Definition: kcurrencycode.h:57
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 22:59:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.