Ananas Library  0.9.5
amoney.h
1 /****************************************************************************
2 ** $Id: amoney.h,v 1.1 2007/03/31 13:12:27 app Exp $
3 **
4 ** Service functions header file of
5 ** Ananas application library
6 **
7 ** Copyright (C) 2007 Andrey Paskal.
8 **
9 ** This file is part of the Designer application of the Ananas
10 ** automation accounting system.
11 **
12 ** This file may be distributed and/or modified under the terms of the
13 ** GNU General Public License version 2 as published by the Free Software
14 ** Foundation and appearing in the file LICENSE.GPL included in the
15 ** packaging of this file.
16 **
17 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 **
20 **
21 **********************************************************************/
22 #ifndef AMONEY_H_
23 #define AMONEY_H_
24 #include "ananas.h"
25 #include "qstring.h"
26 
27 class Degree;
28 class Currency;
29 
35 class ANANAS_EXPORT AMoney{
36  public:
37  AMoney();
38  AMoney( double amount, QString currency = "RUR");
39 
40  double getAmount();
41  void setAmount( double );
42  void setAmount( double, QString currency);
43  QString getCurrency();
44  void setCurrency( QString );
45  QString toString();
46  QString toText();
47  bool equal( AMoney &sum );
48 
49  private:
50  double amount;
51  Currency* currency;
52  Degree* degree;
53 
54  QString degreeText( QString , int );
55  QString valueToText( Q_ULLONG );
56  QString decimalValueToText( Q_ULLONG );
57  QString singleToText( QString );
58  QString coupleToText( QString );
59  QString tripleToText( QString );
60  QString integerCurrencyName( QString );
61  QString decimalCurrencyName( QString );
62  QString firstUp( QString );
63 
64 };
65 
66 
67 
75 class Degree {
76  public:
77  Degree( int = 0 );
78  int getValue();
79  void setValue( int value);
80  bool isMale();
81 
82  private:
83  int value;
84  bool male;
85 };
86 
95 class Currency {
96  public:
97  Currency( QString currensyId = "RUR");
98 
99  QString getId();
100  void setId( QString );
101  bool isMale();
102  bool is( QString );
103 
104  private:
105  QString id;
106  bool male;
107 };
108 
109 
110 #endif /*AMONEY_H_*/
Definition: amoney.h:75
Definition: amoney.h:95
Definition: amoney.h:35