1 | /* |
2 | Copyright (C) 2009 Frederik Gladhorn <gladhorn@kde.org> |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either |
7 | version 2.1 of the License, or (at your option) version 3, or any |
8 | later version accepted by the membership of KDE e.V. (or its |
9 | successor approved by the membership of KDE e.V.), which shall |
10 | act as a proxy defined in Section 6 of version 3 of the license. |
11 | |
12 | This library is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | Lesser General Public License for more details. |
16 | |
17 | You should have received a copy of the GNU Lesser General Public |
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
19 | */ |
20 | |
21 | #ifndef ATTICA_ACCOUNTBALANCE_H |
22 | #define ATTICA_ACCOUNTBALANCE_H |
23 | |
24 | #include <QtCore/QSharedDataPointer> |
25 | #include <QtCore/QString> |
26 | |
27 | #include "atticaclient_export.h" |
28 | |
29 | |
30 | namespace Attica { |
31 | |
32 | |
33 | /** |
34 | * Represents the money in the account of the user |
35 | */ |
36 | class ATTICA_EXPORT AccountBalance |
37 | { |
38 | public: |
39 | typedef QList<AccountBalance> List; |
40 | class Parser; |
41 | |
42 | /** |
43 | * Creates an empty AccountBalance |
44 | */ |
45 | AccountBalance(); |
46 | |
47 | /** |
48 | * Copy constructor. |
49 | * @param other the AccountBalance to copy from |
50 | */ |
51 | AccountBalance(const AccountBalance& other); |
52 | |
53 | /** |
54 | * Assignment operator. |
55 | * @param other the AccountBalance to assign from |
56 | * @return pointer to this AccountBalance |
57 | */ |
58 | AccountBalance& operator=(const AccountBalance& other); |
59 | |
60 | /** |
61 | * Destructor. |
62 | */ |
63 | ~AccountBalance(); |
64 | |
65 | |
66 | /** |
67 | * Sets the currency in use. |
68 | * @param currency the new currency (Euro, US Dollar) |
69 | */ |
70 | void setCurrency(const QString & currency); |
71 | |
72 | /** |
73 | * Gets the currency. |
74 | * @return the currency |
75 | */ |
76 | QString currency() const; |
77 | |
78 | /** |
79 | * Sets the balance. |
80 | * @param balance |
81 | */ |
82 | void setBalance(const QString& name); |
83 | |
84 | /** |
85 | * Gets the balance. |
86 | * @return the amount of money in the account |
87 | */ |
88 | QString balance() const; |
89 | |
90 | private: |
91 | class Private; |
92 | QSharedDataPointer<Private> d; |
93 | }; |
94 | |
95 | } |
96 | |
97 | #endif // ACCOUNTBALANCE_H |
98 | |