author | drw <drw> | 2002-12-04 02:12:25 (UTC) |
---|---|---|
committer | drw <drw> | 2002-12-04 02:12:25 (UTC) |
commit | d000538b68b3411a409e829c4e68f42f9646b940 (patch) (unidiff) | |
tree | 72abee0785a595ef9d5edf9ecd20743a9ff16559 /noncore/apps/checkbook/cbinfo.h | |
parent | 9b23bf789c15bcc84dabc400f16fa38ff3a34ebd (diff) | |
download | opie-d000538b68b3411a409e829c4e68f42f9646b940.zip opie-d000538b68b3411a409e829c4e68f42f9646b940.tar.gz opie-d000538b68b3411a409e829c4e68f42f9646b940.tar.bz2 |
Abstracted checkbook storage, added new main window display/configuration options.
Diffstat (limited to 'noncore/apps/checkbook/cbinfo.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/cbinfo.h | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/noncore/apps/checkbook/cbinfo.h b/noncore/apps/checkbook/cbinfo.h new file mode 100644 index 0000000..5e65db2 --- a/dev/null +++ b/noncore/apps/checkbook/cbinfo.h | |||
@@ -0,0 +1,97 @@ | |||
1 | /* | ||
2 | This file is part of the OPIE Project | ||
3 | =. | ||
4 | .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> | ||
5 | .>+-= | ||
6 | _;:, .> :=|. This file is free software; you can | ||
7 | .> <`_, > . <= redistribute it and/or modify it under | ||
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
9 | .="- .-=="i, .._ License as published by the Free Software | ||
10 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
11 | ._= =} : or (at your option) any later version. | ||
12 | .%`+i> _;_. | ||
13 | .i_,=:_. -<s. This file is distributed in the hope that | ||
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
15 | : .. .:, . . . without even the implied warranty of | ||
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | ||
18 | ..}^=.= = ; Public License for more details. | ||
19 | ++= -. .` .: | ||
20 | : = ...= . :.=- You should have received a copy of the GNU | ||
21 | -. .:....=;==+<; General Public License along with this file; | ||
22 | -_. . . )=. = see the file COPYING. If not, write to the | ||
23 | -- :-=` Free Software Foundation, Inc., | ||
24 | 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
28 | |||
29 | #ifndef CBINFO_H | ||
30 | #define CBINFO_H | ||
31 | |||
32 | #include <qlist.h> | ||
33 | #include <qstring.h> | ||
34 | |||
35 | class Config; | ||
36 | class TranInfo; | ||
37 | class TranInfoList; | ||
38 | |||
39 | class CBInfo | ||
40 | { | ||
41 | public: | ||
42 | CBInfo(); | ||
43 | CBInfo( const QString &, const QString & ); | ||
44 | |||
45 | const QString &name() const { return n; } | ||
46 | const QString &filename() const { return fn; } | ||
47 | const QString &password() const { return pw; } | ||
48 | const QString &type() const { return t; } | ||
49 | const QString &bank() const { return bn; } | ||
50 | const QString &account() const { return a; } | ||
51 | const QString &pin() const { return p; } | ||
52 | const QString ¬es() const { return nt; } | ||
53 | float startingBalance()const { return sb; } | ||
54 | float balance(); | ||
55 | |||
56 | void setName( const QString &name ) { n = name; } | ||
57 | void setFilename( const QString &filename ){ fn = filename; } | ||
58 | void setPassword( const QString &password ){ pw = password; } | ||
59 | void setType( const QString &type ) { t = type; } | ||
60 | void setBank( const QString &bank ) { bn = bank; } | ||
61 | void setAccount( const QString &account ) { a = account; } | ||
62 | void setPin( const QString &pin ) { p = pin; } | ||
63 | void setNotes( const QString ¬es ) { nt = notes; } | ||
64 | void setStartingBalance( float startbal ) { sb = startbal; } | ||
65 | |||
66 | void write(); | ||
67 | |||
68 | TranInfoList *transactions() const { return tl; } | ||
69 | TranInfo *findTransaction( const QString &, const QString &, const QString & ); | ||
70 | void addTransaction( TranInfo * ); | ||
71 | void removeTransaction( TranInfo * ); | ||
72 | |||
73 | private: | ||
74 | QString n; | ||
75 | QString fn; | ||
76 | QString pw; | ||
77 | QString t; | ||
78 | QString bn; | ||
79 | QString a; | ||
80 | QString p; | ||
81 | QString nt; | ||
82 | float sb; | ||
83 | float b; | ||
84 | |||
85 | TranInfoList *tl; | ||
86 | |||
87 | void loadTransactions(); | ||
88 | void calcBalance(); | ||
89 | }; | ||
90 | |||
91 | class CBInfoList : public QList<CBInfo> | ||
92 | { | ||
93 | protected: | ||
94 | int compareItems( QCollection::Item, QCollection::Item ); | ||
95 | }; | ||
96 | |||
97 | #endif | ||