00001 #ifndef NEWTRANSACTION_H 00002 #define NEWTRANSACTION_H 00003 00004 #include <qlineedit.h> 00005 #include <qpushbutton.h> 00006 #include <qlayout.h> 00007 #include <qcheckbox.h> 00008 #include <qdialog.h> 00009 #include <qlabel.h> 00010 #include <qstringlist.h> 00011 #include <qhbox.h> 00012 #include <qcombobox.h> 00013 00014 #include "transaction.h" 00015 #include "preferences.h" 00016 00017 class NewTransaction : public QDialog 00018 { 00019 Q_OBJECT 00020 00021 public: 00022 00023 int year, month, day; 00024 00025 NewTransaction ( QWidget* parent ); 00026 ~NewTransaction(); 00027 00028 QLabel *namelabel; 00029 QHBox *transactionnamebox; 00030 QComboBox* transactionname; 00031 QPushButton* descriptionbutton; 00032 00033 QLabel *amountlabel; 00034 QHBox *transactionamountbox; 00035 QLineEdit* transactionamount; 00036 QPushButton* calculatorbutton; 00037 00038 QLabel *datelabel; 00039 QHBox *transactiondatebox; 00040 QLineEdit* transactiondate; 00041 QPushButton* datebutton; 00042 00043 QCheckBox *clearedcheckbox; 00044 00045 QLabel *numberlabel; 00046 QLineEdit *transactionnumber; 00047 00048 QLabel *budgetlabel; 00049 QComboBox *budgetbox; 00050 00051 QLabel *lineitemlabel; 00052 QComboBox *lineitembox; 00053 00054 QCheckBox *depositbox; 00055 00056 QGridLayout *layout; 00057 00058 int getDay (); 00059 int getMonth (); 00060 int getYear (); 00061 QString getDescription (); 00062 void setDescription ( QString ); 00063 void setComboBoxes ( int, int ); 00064 00065 // When a user edits an transaction and edits the date, this flag 00066 // is set to TRUE adding the new date to the transaction. Otherwise, 00067 // the old date is used for the edited transaction. This prevents a date 00068 // from reverting to 0/0/0 if the date is not edited 00069 bool getDateEdited (); 00070 00071 public slots: 00072 00073 void showCalculator(); 00074 void showCalendar (); 00075 void addTransactionDescription (); 00076 int getNameIndex ( QString name ); 00077 int getCurrentBudget (); 00078 int getCurrentLineItem (); 00079 int getBudgetIndex ( int budgetid ); 00080 int getLineItemIndex ( int lineitemid ); 00081 void setLineItems (); 00082 00083 private slots: 00084 void setCurrentBudget ( int index ); 00085 void setCurrentLineItem ( int index ); 00086 00087 private: 00088 bool dateedited; 00089 int index, currentbudget, currentlineitem; 00090 QString transactiondescription; 00091 QStringList *budgetnameslist, *budgetidslist; 00092 QStringList lineitemslist, lineitemidslist; 00093 00094 }; 00095 00096 #endif
1.4.2