Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

EditTransactionForm Class Reference

the form is used to create a new transaction or to modify an existing one, depending on the record_is_new member. More...

#include <EditTransactionForm.h>

Inheritance diagram for EditTransactionForm:

Form Collaboration diagram for EditTransactionForm:

Collaboration graph
[legend]
List of all members.

Public Methods

 EditTransactionForm () FORM_SECTION2
 constructor. More...

virtual ~EditTransactionForm () FORM_SECTION2
 destructor - disposes of allocated memory. More...

UInt16 getTransId ()
 
Returns:
value of member trans_id.
More...


void setTransId (UInt16 i)
 sets value of memeber trans_id. More...

void setTransIsSched (Boolean b)
 sets value of trans_is_sched. More...

void setRecordIsNew (Boolean b)
 sets value of records_is_new. More...

bool getRecordIsNew ()
 
Returns:
value of record_is_new.
More...



Static Public Methods

EditTransactionForm * instance () FORM_SECTION2
 returns singleton reference to this object. More...


Private Methods

Boolean checkData () FORM_SECTION2
 pre-save data check, returns true if data is good, false otherwise. More...

void save () FORM_SECTION2
 saves the transaction data and updates all the accounts involved. More...

void setDefaults () FORM_SECTION2
 set the values for some of the fields in the form (from the transaction record). More...

void saveToSplits () FORM_SECTION2
 reflect peer account and transaction amount in underlying splits array. More...

void readFromSplits () FORM_SECTION2
 update amount and peer account according to the underlying splits array. More...

void setPeerAccount (UInt32 account) FORM_SECTION2
 displays the name for the given account. More...

bool handleAutocompletion () FORM_SECTION2
 handle keystrokes and optionally autocomplete. More...

Boolean handleOpenEvent () FORM_SECTION2
 draws form and table. More...

Boolean handleCloseEvent () FORM_SECTION2
 form close. More...

Boolean handleKeyDownEvent (WChar key_id, UInt16 modifiers) FORM_SECTION2
 autocompletion hook. More...

Boolean handleCtlSelectEvent (UInt16 control_id) FORM_SECTION2
 handles form controls. More...

Boolean handleUpdateEvent (UInt16 update_code) FORM_SECTION2
 handles update events. More...


Private Attributes

Boolean _record_is_new
 this is set to true if we want to create a new account and to false if we want the 'details' functionality. More...

Boolean _trans_is_sched
 set to true when creating/editing a scheduled transaction. More...

Boolean _is_debit
 true if the current transaction is a debit. More...

UInt16 _trans_id
 id of the transaction being manipulated. More...

transactionStructure t
 structure used to hold data entered by user. More...

UInt32 _peer_acc
Char _acc_name [60]
 name of the account chosen as peer. More...

Char _date_txt [dateStringLength]
 date text. More...

Char _debit_label [32]
 label for debit button. More...

Char _credit_label [32]
 label for credit button. More...

char _matched_payee [32]
 last matched payee; null if none. More...

char _last_unmatched_payee [32]
 last unmatched payee. used to avoid screen updates and db checks whenever possible. More...

EditScheduledTransForm _edit_scheduled_trans_form
 transaction scheduling form is accessed through this object. More...

UInt8 _trans_class
 classify current split configuration. More...

UInt8 _this_split
 index of the split that affects the current account. More...

UInt8 _peer_split
 index of the split that affects the peer account, if applicable. More...

UInt32 _prev_acc_uid
 remember which account was selected when form was opened. More...

NoteForm_note_form
 form to handle notes. More...

SplitsForm_splits_form
 form handlind split management. More...

CalculatorForm_calculator_form
 generic calculator. More...

EditRateForm_edit_rate_form
 form to handle currency conversion rates. More...

bool _show_rate
 handle possiblity of currency exchange; Show the button accessing the currency form iff there are only two accounts involved and they use different currencies. More...


Static Private Attributes

EditTransactionForm * _instance
 reference to this object. More...


Detailed Description

the form is used to create a new transaction or to modify an existing one, depending on the record_is_new member.

Copyright (C) 2000-2002 Vlad Mereuta <dizzy@users.sourceforge.net>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Definition at line 34 of file EditTransactionForm.h.


Constructor & Destructor Documentation

EditTransactionForm::EditTransactionForm  
 

constructor.

virtual EditTransactionForm::~EditTransactionForm   [virtual]
 

destructor - disposes of allocated memory.


Member Function Documentation

Boolean EditTransactionForm::checkData   [private]
 

pre-save data check, returns true if data is good, false otherwise.

bool EditTransactionForm::getRecordIsNew   [inline]
 

Returns:
value of record_is_new.

Definition at line 56 of file EditTransactionForm.h.

References _record_is_new.

UInt16 EditTransactionForm::getTransId   [inline]
 

Returns:
value of member trans_id.

Definition at line 48 of file EditTransactionForm.h.

References _trans_id.

bool EditTransactionForm::handleAutocompletion   [private]
 

handle keystrokes and optionally autocomplete.

Autocompletion follows the following steps: intercept all keystrokes except virtual ones (from handleKeyDownEvent) Cache the following cases:

  • previously matched the input against a longer payee. If keystrokes continue to fit the previous match, do not re-check DB or update screen
  • previously could not find any payee starting with the text in the input. Any other input starting with that text is considered un-matchable
attempt to find a transaction from the current account matching the payee if one is found, copy splits, full text and method otherwise just try to match a transaction with the same payee and fill in the payee and method
Returns:
true if something updated, false otherwise

Boolean EditTransactionForm::handleCloseEvent   [private, virtual]
 

form close.

Reimplemented from Form.

Boolean EditTransactionForm::handleCtlSelectEvent UInt16    control_id [private, virtual]
 

handles form controls.

Reimplemented from Form.

Boolean EditTransactionForm::handleKeyDownEvent WChar    key_id,
UInt16    modifiers
[private, virtual]
 

autocompletion hook.

Reimplemented from Form.

Boolean EditTransactionForm::handleOpenEvent   [private, virtual]
 

draws form and table.

Reimplemented from Form.

Boolean EditTransactionForm::handleUpdateEvent UInt16    update_code [private, virtual]
 

handles update events.

Reimplemented from Form.

EditTransactionForm* EditTransactionForm::instance   [static]
 

returns singleton reference to this object.

void EditTransactionForm::readFromSplits   [private]
 

update amount and peer account according to the underlying splits array.

void EditTransactionForm::save   [private]
 

saves the transaction data and updates all the accounts involved.

void EditTransactionForm::saveToSplits   [private]
 

reflect peer account and transaction amount in underlying splits array.

void EditTransactionForm::setDefaults   [private]
 

set the values for some of the fields in the form (from the transaction record).

void EditTransactionForm::setPeerAccount UInt32    account [private]
 

displays the name for the given account.

void EditTransactionForm::setRecordIsNew Boolean    b [inline]
 

sets value of records_is_new.

Definition at line 54 of file EditTransactionForm.h.

References _record_is_new.

void EditTransactionForm::setTransId UInt16    i [inline]
 

sets value of memeber trans_id.

Definition at line 50 of file EditTransactionForm.h.

References _trans_id.

void EditTransactionForm::setTransIsSched Boolean    b [inline]
 

sets value of trans_is_sched.

Definition at line 52 of file EditTransactionForm.h.

References _trans_is_sched.


Member Data Documentation

Char EditTransactionForm::_acc_name[60] [private]
 

name of the account chosen as peer.

Definition at line 74 of file EditTransactionForm.h.

CalculatorForm* EditTransactionForm::_calculator_form [private]
 

generic calculator.

Definition at line 103 of file EditTransactionForm.h.

Char EditTransactionForm::_credit_label[32] [private]
 

label for credit button.

Definition at line 80 of file EditTransactionForm.h.

Char EditTransactionForm::_date_txt[dateStringLength] [private]
 

date text.

Definition at line 76 of file EditTransactionForm.h.

Char EditTransactionForm::_debit_label[32] [private]
 

label for debit button.

Definition at line 78 of file EditTransactionForm.h.

EditRateForm* EditTransactionForm::_edit_rate_form [private]
 

form to handle currency conversion rates.

Definition at line 105 of file EditTransactionForm.h.

EditScheduledTransForm EditTransactionForm::_edit_scheduled_trans_form [private]
 

transaction scheduling form is accessed through this object.

As scheduling is only accessed from this form, the scheduling form is an object contained within this class

Definition at line 88 of file EditTransactionForm.h.

EditTransactionForm* EditTransactionForm::_instance [static, private]
 

reference to this object.

Definition at line 60 of file EditTransactionForm.h.

Boolean EditTransactionForm::_is_debit [private]
 

true if the current transaction is a debit.

Definition at line 66 of file EditTransactionForm.h.

char EditTransactionForm::_last_unmatched_payee[32] [private]
 

last unmatched payee. used to avoid screen updates and db checks whenever possible.

Definition at line 84 of file EditTransactionForm.h.

char EditTransactionForm::_matched_payee[32] [private]
 

last matched payee; null if none.

Definition at line 82 of file EditTransactionForm.h.

NoteForm* EditTransactionForm::_note_form [private]
 

form to handle notes.

Definition at line 99 of file EditTransactionForm.h.

UInt32 EditTransactionForm::_peer_acc [private]
 

Definition at line 72 of file EditTransactionForm.h.

UInt8 EditTransactionForm::_peer_split [private]
 

index of the split that affects the peer account, if applicable.

Definition at line 94 of file EditTransactionForm.h.

UInt32 EditTransactionForm::_prev_acc_uid [private]
 

remember which account was selected when form was opened.

Definition at line 96 of file EditTransactionForm.h.

Boolean EditTransactionForm::_record_is_new [private]
 

this is set to true if we want to create a new account and to false if we want the 'details' functionality.

Definition at line 62 of file EditTransactionForm.h.

Referenced by getRecordIsNew, and setRecordIsNew.

bool EditTransactionForm::_show_rate [private]
 

handle possiblity of currency exchange; Show the button accessing the currency form iff there are only two accounts involved and they use different currencies.

Definition at line 109 of file EditTransactionForm.h.

SplitsForm* EditTransactionForm::_splits_form [private]
 

form handlind split management.

Definition at line 101 of file EditTransactionForm.h.

UInt8 EditTransactionForm::_this_split [private]
 

index of the split that affects the current account.

Definition at line 92 of file EditTransactionForm.h.

UInt8 EditTransactionForm::_trans_class [private]
 

classify current split configuration.

Definition at line 90 of file EditTransactionForm.h.

UInt16 EditTransactionForm::_trans_id [private]
 

id of the transaction being manipulated.

Definition at line 68 of file EditTransactionForm.h.

Referenced by getTransId, and setTransId.

Boolean EditTransactionForm::_trans_is_sched [private]
 

set to true when creating/editing a scheduled transaction.

Definition at line 64 of file EditTransactionForm.h.

Referenced by setTransIsSched.

transactionStructure EditTransactionForm::t [private]
 

structure used to hold data entered by user.

Definition at line 70 of file EditTransactionForm.h.


The documentation for this class was generated from the following file:
Generated on Thu Jan 16 23:11:14 2003 for FreeCoins by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002