00001 /* 00002 This file is part of the OPIE Project 00003 =. 00004 .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 00005 .>+-= 00006 _;:, .> :=|. This file is free software; you can 00007 .> <`_, > . <= redistribute it and/or modify it under 00008 :`=1 )Y*s>-.-- : the terms of the GNU General Public 00009 .="- .-=="i, .._ License as published by the Free Software 00010 - . .-<_> .<> Foundation; either version 2 of the License, 00011 ._= =} : or (at your option) any later version. 00012 .%`+i> _;_. 00013 .i_,=:_. -<s. This file is distributed in the hope that 00014 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00015 : .. .:, . . . without even the implied warranty of 00016 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00017 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 00018 ..}^=.= = ; Public License for more details. 00019 ++= -. .` .: 00020 : = ...= . :.=- You should have received a copy of the GNU 00021 -. .:....=;==+<; General Public License along with this file; 00022 -_. . . )=. = see the file COPYING. If not, write to the 00023 -- :-=` Free Software Foundation, Inc., 00024 59 Temple Place - Suite 330, 00025 Boston, MA 02111-1307, USA. 00026 00027 */ 00028 00029 #ifndef CBINFO_H 00030 #define CBINFO_H 00031 00032 #include <qwidget.h> 00033 #include <qlist.h> 00034 #include <qstring.h> 00035 00036 class Config; 00037 class TranInfo; 00038 class TranInfoList; 00039 00040 class CBInfo 00041 { 00042 public: 00043 CBInfo(); 00044 CBInfo( const QString &, const QString & ); 00045 00046 const QString &name() const { return n; } 00047 const QString &filename() const { return fn; } 00048 const QString &password() const { return pw; } 00049 const QString &type() const { return t; } 00050 const QString &bank() const { return bn; } 00051 const QString &account() const { return a; } 00052 const QString &pin() const { return p; } 00053 const QString ¬es() const { return nt; } 00054 float startingBalance() const { return sb; } 00055 float balance(); 00056 00057 void setName( const QString &name ) { n = name; } 00058 void setFilename( const QString &filename ) { fn = filename; } 00059 void setPassword( const QString &password ) { pw = password; } 00060 void setType( const QString &type ) { t = type; } 00061 void setBank( const QString &bank ) { bn = bank; } 00062 void setAccount( const QString &account ) { a = account; } 00063 void setPin( const QString &pin ) { p = pin; } 00064 void setNotes( const QString ¬es ) { nt = notes; } 00065 void setStartingBalance( float startbal ) { sb = startbal; } 00066 00067 // write 00068 void write(); 00069 00070 // transactions 00071 TranInfoList *transactions() const { return tl; } 00072 TranInfo *findTransaction( const QString & ); 00073 void addTransaction( TranInfo * ); 00074 void removeTransaction( TranInfo * ); 00075 00076 // lastTab 00077 void setLastTab(const QString &sLastTab) { _sLastTab=sLastTab; } 00078 QString &getLastTab() { return(_sLastTab); } 00079 00080 // getNextNumber 00081 int getNextNumber() { return( ++_last ); } 00082 00083 // sortOrder 00084 void setSortOrder(const QString &sSortOrder) { _sSortOrder=sSortOrder; } 00085 QString &getSortOrder() { return(_sSortOrder); } 00086 00087 private: 00088 QString n; 00089 QString fn; 00090 QString pw; 00091 QString t; 00092 QString bn; 00093 QString a; 00094 QString p; 00095 QString nt; 00096 float sb; 00097 float b; 00098 QString _sLastTab; 00099 int _first; 00100 int _last; 00101 QString _sSortOrder; 00102 00103 TranInfoList *tl; 00104 00105 void loadTransactions(); 00106 void calcBalance(); 00107 }; 00108 00109 class CBInfoList : public QList<CBInfo> 00110 { 00111 protected: 00112 int compareItems( QCollection::Item, QCollection::Item ); 00113 }; 00114 00115 #endif
1.4.2