00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef CHECKBOOK_H
00030 #define CHECKBOOK_H
00031
00032 #include <opie2/otabwidget.h>
00033
00034 #include <qdatetime.h>
00035 #include <qdialog.h>
00036 #include <qlistview.h>
00037
00038
00039 class CBInfo;
00040 class Graph;
00041 class GraphInfo;
00042 class QCheckBox;
00043 class QComboBox;
00044 class QLabel;
00045 class QLineEdit;
00046 class QListView;
00047 class QMultiLineEdit;
00048 class QString;
00049 class TranInfo;
00050 class TranInfoList;
00051 class Cfg;
00052 class QMouseEvent;
00053
00054
00055
00056 class Checkbook : public QDialog
00057 {
00058 Q_OBJECT
00059
00060 public:
00061 Checkbook( QWidget *, CBInfo *, Cfg *cfg );
00062 ~Checkbook();
00063
00064
00065 void resort();
00066
00067
00068 TranInfoList *getTranList() { return(tranList); }
00069
00070 private:
00071 CBInfo *info;
00072 TranInfoList *tranList;
00073 Cfg *_pCfg;
00074
00075 Opie::Ui::OTabWidget *mainWidget;
00076 void loadCheckbook();
00077 void adjustBalance();
00078
00079
00080 QWidget *initInfo();
00081 QCheckBox *passwordCB;
00082 QLineEdit *nameEdit;
00083 QComboBox *typeList;
00084 QLineEdit *bankEdit;
00085 QLineEdit *acctNumEdit;
00086 QLineEdit *pinNumEdit;
00087 QLineEdit *balanceEdit;
00088 QMultiLineEdit *notesEdit;
00089 int _sortCol;
00090
00091
00092 QWidget *initTransactions();
00093 QListView *tranTable;
00094 QComboBox *_cbSortType;
00095 QDate _dLastNew;
00096
00097
00098 QWidget *initCharts();
00099 GraphInfo *graphInfo;
00100 QComboBox *graphList;
00101 Graph *graphWidget;
00102
00103 void drawBalanceChart();
00104 void drawCategoryChart( bool = TRUE );
00105
00106
00107 protected slots:
00108 void accept();
00109 void slotTab(QWidget *tab);
00110
00111 private slots:
00112 void slotPasswordClicked();
00113 void slotNameChanged( const QString & );
00114 void slotStartingBalanceChanged( const QString & );
00115 void slotNewTran();
00116 void slotEditTran();
00117 void slotMenuTran(QListViewItem *, const QPoint &);
00118 void slotDeleteTran();
00119 void slotDrawGraph();
00120 void slotSortChanged( const QString & );
00121 };
00122
00123
00124
00125 class CBListItem : public QListViewItem
00126 {
00127
00128
00129 public:
00130 CBListItem( TranInfo *, QListView *, QString = QString::null, QString = QString::null,
00131 QString = QString::null, QString = QString::null, QString = QString::null,
00132 QString = QString::null, QString = QString::null, QString = QString::null );
00133
00134 void paintCell( QPainter *, const QColorGroup &, int, int, int );
00135
00136
00137 TranInfo *getTranInfo() { return(_pTran); }
00138
00139 private:
00140 TranInfo *_pTran;
00141 QListView *owner;
00142 bool m_known;
00143 bool m_odd;
00144
00145 bool isAltBackground();
00146 };
00147
00148
00149 #endif