Diffstat (limited to 'noncore/apps/checkbook/traninfo.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/traninfo.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/noncore/apps/checkbook/traninfo.h b/noncore/apps/checkbook/traninfo.h index f6c5cae..0abdc61 100644 --- a/noncore/apps/checkbook/traninfo.h +++ b/noncore/apps/checkbook/traninfo.h | |||
@@ -19,71 +19,82 @@ | |||
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef TRANINFO_H | 29 | #ifndef TRANINFO_H |
30 | #define TRANINFO_H | 30 | #define TRANINFO_H |
31 | 31 | ||
32 | #include <qdatetime.h> | 32 | #include <qdatetime.h> |
33 | #include <qlist.h> | 33 | #include <qlist.h> |
34 | 34 | ||
35 | class Config; | 35 | class Config; |
36 | 36 | ||
37 | class TranInfo | 37 | class TranInfo |
38 | { | 38 | { |
39 | public: | 39 | public: |
40 | TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(), | 40 | TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(), |
41 | bool = TRUE, const QString & = 0x0, const QString & = 0x0, | 41 | bool = TRUE, const QString & = 0x0, const QString & = 0x0, |
42 | float = 0.0, float = 0.0, | 42 | float = 0.0, float = 0.0, |
43 | const QString & = 0x0, const QString & = 0x0 ); | 43 | const QString & = 0x0, const QString & = 0x0, int =-1 ); |
44 | TranInfo( Config, int ); | 44 | TranInfo( Config, int ); |
45 | 45 | ||
46 | // getters | ||
46 | int id() const { return i; } | 47 | int id() const { return i; } |
48 | const QString &getIdStr(); | ||
49 | |||
47 | const QString &desc() const { return d; } | 50 | const QString &desc() const { return d; } |
48 | const QDate &date() const { return td; } | 51 | const QDate &date() const { return td; } |
49 | const QString &datestr(); | 52 | const QString &datestr(); |
50 | bool withdrawal()const { return w; } | 53 | bool withdrawal()const { return w; } |
51 | const QString &type() const { return t; } | 54 | const QString &type() const { return t; } |
52 | const QString &category()const { return c; } | 55 | const QString &category()const { return c; } |
53 | float amount() const { return a; } | 56 | float amount() const { return a; } |
54 | float fee() const { return f; } | 57 | float fee() const { return f; } |
55 | const QString &number()const { return cn; } | 58 | const QString &number()const { return cn; } |
56 | const QString ¬es() const { return n; } | 59 | const QString ¬es() const { return n; } |
60 | int getNext() { return(_next); } | ||
57 | 61 | ||
62 | // setters | ||
58 | void setDesc( const QString &desc ) { d = desc; } | 63 | void setDesc( const QString &desc ) { d = desc; } |
59 | void setDate( const QDate &date ) { td = date; } | 64 | void setDate( const QDate &date ) { td = date; } |
60 | void setWithdrawal( bool withdrawal ) { w = withdrawal; } | 65 | void setWithdrawal( bool withdrawal ) { w = withdrawal; } |
61 | void setType( const QString &type ) { t = type; } | 66 | void setType( const QString &type ) { t = type; } |
62 | void setCategory( const QString &cat ){ c = cat; } | 67 | void setCategory( const QString &cat ){ c = cat; } |
63 | void setAmount( float amount ) { a = amount; } | 68 | void setAmount( float amount ) { a = amount; } |
64 | void setFee( float fee ) { f = fee; } | 69 | void setFee( float fee ) { f = fee; } |
65 | void setNumber( const QString &num ) { cn = num; } | 70 | void setNumber( const QString &num ) { cn = num; } |
66 | void setNotes( const QString ¬es ) { n = notes; } | 71 | void setNotes( const QString ¬es ) { n = notes; } |
72 | void setNext(int next) { _next=next; } | ||
73 | |||
74 | // write | ||
75 | void write( Config * ); | ||
67 | 76 | ||
68 | void write( Config *, int ); | 77 | // toString |
78 | QString toString(); | ||
69 | 79 | ||
70 | private: | 80 | private: |
71 | int i; | 81 | int i; |
72 | QString d; | 82 | QString d; |
73 | QDate td; | 83 | QDate td; |
74 | bool w; | 84 | bool w; |
75 | QString t; | 85 | QString t; |
76 | QString c; | 86 | QString c; |
77 | float a; | 87 | float a; |
78 | float f; | 88 | float f; |
79 | QString cn; | 89 | QString cn; |
80 | QString n; | 90 | QString n; |
91 | int _next; | ||
81 | }; | 92 | }; |
82 | 93 | ||
83 | class TranInfoList : public QList<TranInfo> | 94 | class TranInfoList : public QList<TranInfo> |
84 | { | 95 | { |
85 | protected: | 96 | protected: |
86 | int compareItems( QCollection::Item, QCollection::Item ); | 97 | int compareItems( QCollection::Item, QCollection::Item ); |
87 | }; | 98 | }; |
88 | 99 | ||
89 | #endif | 100 | #endif |