Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

checkbook.h

Go to the documentation of this file.
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 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 // --- Checkbook --------------------------------------------------------------
00056 class Checkbook : public QDialog
00057 {
00058     Q_OBJECT
00059 
00060     public:
00061         Checkbook( QWidget *, CBInfo *, Cfg *cfg );
00062         ~Checkbook();
00063 
00064         // resort
00065         void resort();
00066 
00067         // members
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         // Info tab
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         // Transactions tab
00092         QWidget *initTransactions();
00093         QListView *tranTable;
00094         QComboBox *_cbSortType;
00095         QDate _dLastNew;
00096 
00097         // Charts tab
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 // --- CBListItem -------------------------------------------------------------
00125 class CBListItem :  public QListViewItem
00126 {
00127     //Q_OBJECT
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         // --- members
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

Generated on Sat Nov 5 16:16:47 2005 for OPIE by  doxygen 1.4.2