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

SplitsForm Class Reference

Class used to handle Split managment. More...

#include <SplitsForm.h>

Inheritance diagram for SplitsForm:

Form Collaboration diagram for SplitsForm:

Collaboration graph
[legend]
List of all members.

Public Methods

 SplitsForm () FORM_SECTION2
 constructor - initializes variables. More...

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

UInt16 getCount () FORM_SECTION2
 
Returns:
value of splits_count.
More...


void setCount (UInt8 count) FORM_SECTION2
 sets the value of splits_count; also updates the total_debits and credits variables. More...

UInt32 getAccount (UInt8 index) FORM_SECTION2
 returns the account associated with a given split. More...

void setAccount (UInt8 index, UInt32 acc_uid) FORM_SECTION2
 sets the account associated with a given split index. More...

Int32 getAmount (UInt8 index) FORM_SECTION2
 returns the amount associated with a given split index. More...

void setAmount (UInt8 index, Int32 amount) FORM_SECTION2
 sets the amount associated with a given split index. More...

void deleteSplit (UInt8 index) FORM_SECTION2
 deletes a given split. More...

void deleteAllSplits () FORM_SECTION2
 deletes all splits. More...

Boolean handleUpdateEvent (UInt16 update_code) FORM_SECTION2
 handles update events (public in order to be able to force updates). More...


Static Public Methods

SplitsForm * instance () FORM_SECTION2
 returns reference to SplitsForm instance. More...


Private Methods

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

Boolean handleKeyDownEvent (WChar key_id, UInt16 modifiers) FORM_SECTION2
 handles pgup/down keys. More...

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

Boolean checkIndex (UInt8 index) FORM_SECTION2
 checks whether the given split index is valid. More...

Boolean handleTblSelectEvent (tblSelect &tbl_select) FORM_SECTION2
 handles table events. More...


Private Attributes

SplitsTable splits_tbl
 table used to display and select splits. More...

UInt8 splits_count
 total number of splits for current transaction. More...

MemHandle splits_data
 handle to memory area containing the array of splits. More...

UInt32 total_debits
 total for debit splits. More...

UInt32 total_credits
 total for credit splits. More...

EditSplitForm edit_split_form
 object handling particular split editing. More...


Static Private Attributes

SplitsForm * _instance
 singleton reference to this form. More...


Detailed Description

Class used to handle Split managment.

Definition at line 29 of file SplitsForm.h.


Constructor & Destructor Documentation

SplitsForm::SplitsForm  
 

constructor - initializes variables.

SplitsForm::~SplitsForm  
 

destructor - disposes of allocated memory.


Member Function Documentation

Boolean SplitsForm::checkIndex UInt8    index [private]
 

checks whether the given split index is valid.

Parameters:
index  split index to check
Returns:
true if valid, false otherwise

void SplitsForm::deleteAllSplits  
 

deletes all splits.

Warning:
for some reason this method breaks horribly if placed in FORM_SECTION2!

void SplitsForm::deleteSplit UInt8    index
 

deletes a given split.

Parameters:
index  of the split to delete

UInt32 SplitsForm::getAccount UInt8    index
 

returns the account associated with a given split.

Parameters:
index  split index to get the account for
Returns:
uid of the account for given split

Int32 SplitsForm::getAmount UInt8    index
 

returns the amount associated with a given split index.

Parameters:
index  split index to get the amount for
Returns:
amount for given split index

UInt16 SplitsForm::getCount  
 

Returns:
value of splits_count.

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

handles form controls.

Reimplemented from Form.

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

handles pgup/down keys.

Reimplemented from Form.

Boolean SplitsForm::handleOpenEvent   [private, virtual]
 

draws form and table.

Reimplemented from Form.

Boolean SplitsForm::handleTblSelectEvent tblSelect &    tbl_select [private, virtual]
 

handles table events.

Reimplemented from Form.

Boolean SplitsForm::handleUpdateEvent UInt16    update_code [virtual]
 

handles update events (public in order to be able to force updates).

Reimplemented from Form.

SplitsForm* SplitsForm::instance   [static]
 

returns reference to SplitsForm instance.

Only allowed way to use the class

void SplitsForm::setAccount UInt8    index,
UInt32    acc_uid
 

sets the account associated with a given split index.

Parameters:
index  split index to modify the account for
acc_uid  new account uid

void SplitsForm::setAmount UInt8    index,
Int32    amount
 

sets the amount associated with a given split index.

Parameters:
index  index of the split to modify the amount for
amount  new amount

void SplitsForm::setCount UInt8    count
 

sets the value of splits_count; also updates the total_debits and credits variables.


Member Data Documentation

SplitsForm* SplitsForm::_instance [static, private]
 

singleton reference to this form.

Definition at line 91 of file SplitsForm.h.

EditSplitForm SplitsForm::edit_split_form [private]
 

object handling particular split editing.

Definition at line 89 of file SplitsForm.h.

UInt8 SplitsForm::splits_count [private]
 

total number of splits for current transaction.

Definition at line 81 of file SplitsForm.h.

MemHandle SplitsForm::splits_data [private]
 

handle to memory area containing the array of splits.

Definition at line 83 of file SplitsForm.h.

SplitsTable SplitsForm::splits_tbl [private]
 

table used to display and select splits.

Definition at line 79 of file SplitsForm.h.

UInt32 SplitsForm::total_credits [private]
 

total for credit splits.

Definition at line 87 of file SplitsForm.h.

UInt32 SplitsForm::total_debits [private]
 

total for debit splits.

Definition at line 85 of file SplitsForm.h.


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