00001 /** $Revision: 1.22 $ 00002 Last updated: $Date: 2002/09/25 21:18:01 $ 00003 00004 Copyright (C) 2000-2002 Vlad Mereuta <dizzy@users.sourceforge.net> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00019 00020 #ifndef __ACCOUNTS_FORM__ 00021 #define __ACCOUNTS_FORM__ 00022 00023 #include <PalmOS.h> 00024 00025 #include "Form.h" 00026 #include "AccountsTable.h" 00027 #include "TransactionsForm.h" 00028 #include "PreferencesForm.h" 00029 #include "PurgeTransForm.h" 00030 00031 /** contains function to manipulate the main form of the program 00032 the variables are defined in the .c file (due to visibility issues ;) */ 00033 class AccountsForm : public Form 00034 { 00035 public: 00036 /// constructor; does nothing 00037 AccountsForm() FORM_SECTION1; 00038 00039 private: 00040 ///object used to add transactions 00041 EditTransactionForm* _edit_trans_form; 00042 /// object handling the preferences form 00043 PreferencesForm _pref_form; 00044 /// object handling the form used to purge transactions 00045 PurgeTransForm _purge_form; 00046 ///object to handle transaction display 00047 TransactionsForm* _transactions_form; 00048 /// name of the current category 00049 Char cat_name[dmCategoryLength]; 00050 /** the normal way to do this would be to declare a pointer to the object here and allocate it when the form is opened 00051 unfortunatelly memory management is not that straight forward for the palm.*/ 00052 AccountsTable ac_tbl; 00053 /// store last known pen X position 00054 Int16 last_screenX; 00055 /// store last known pen Y position 00056 Int16 last_screenY; 00057 00058 /** calculates the totals (if necessary) and draws them on the screen */ 00059 void displayTotals() FORM_SECTION1; 00060 00061 /// reflect choice of visible accounts on popup trigger 00062 void updatePopupTrigger(void) FORM_SECTION1; 00063 00064 /** sets the balances of Income and Expense accounts to 0 */ 00065 void resetIEAccounts() FORM_SECTION1; 00066 00067 ///called when key down event occurs 00068 Boolean handleKeyDownEvent(WChar key_id, UInt16 modifiers) FORM_SECTION1; 00069 ///called when form open event occurs 00070 Boolean handleOpenEvent() FORM_SECTION1; 00071 /** called when ctl select event occurs 00072 @param control_id id of the control for which the event was generated */ 00073 Boolean handleCtlSelectEvent(UInt16 control_id) FORM_SECTION1; 00074 /** called when a table select event occurs 00075 @param tbl_select forwarded tblSelect event data */ 00076 Boolean handleTblSelectEvent(tblSelect& tbl_select) FORM_SECTION1; 00077 /** called when a menu event occurs */ 00078 Boolean handleMenuEvent(UInt16 menu_item_id) FORM_SECTION1; 00079 /** called when a form update event occurs 00080 @param update_code the update code signalled */ 00081 Boolean handleUpdateEvent(UInt16 update_code) FORM_SECTION1; 00082 ///this function is called when the form is closed 00083 Boolean handleCloseEvent() FORM_SECTION1; 00084 ///handles events generated by the pen up 00085 Boolean handlePenDownEvent (Int16 x_coord, Int16 y_coord) FORM_SECTION1; 00086 ///handles events generated by popups 00087 Boolean handlePopSelect (popSelect& pop_select) FORM_SECTION1; 00088 }; 00089 00090 #endif