KGlobalLedgerView Class Reference

#include <kgloballedgerview.h>

Inheritance diagram for KGlobalLedgerView:

KMyMoneyViewBase QWidget
Collaboration diagram for KGlobalLedgerView:

Collaboration graph
[legend]

List of all members.

Public Slots

void show (void)
void slotLoadView (void)
bool slotSelectAccount (const QString &accountId, const QString &transactionId=QString())
bool slotSelectAccount (const MyMoneyObject &acc)
void slotSetReconcileAccount (const MyMoneyAccount &account=MyMoneyAccount(), const QDate &reconciliationDate=QDate(), const MyMoneyMoney &endingBalance=MyMoneyMoney())
void slotSelectAllTransactions (void)

Signals

void accountSelected (const MyMoneyObject &)
void transactionsSelected (const KMyMoneyRegister::SelectedTransactions &)
void newTransaction (void)
void startEdit (void)
void endEdit (void)
void cancelOrEndEdit (bool &)
void reportGenerated (const MyMoneyReport &report)
void openContextMenu (void)
void toggleReconciliationFlag (void)

Public Member Functions

 KGlobalLedgerView (QWidget *parent=0, const char *name=0)
 ~KGlobalLedgerView ()
const QString accountId (void) const
bool canCreateTransactions (QString &tooltip) const
bool canModifyTransactions (const KMyMoneyRegister::SelectedTransactions &list, QString &tooltip) const
bool canDuplicateTransactions (const KMyMoneyRegister::SelectedTransactions &list, QString &tooltip) const
bool canEditTransactions (const KMyMoneyRegister::SelectedTransactions &list, QString &tooltip) const
TransactionEditorstartEdit (const KMyMoneyRegister::SelectedTransactions &list)
bool selectEmptyTransaction (void)

Protected Slots

void slotLeaveEditMode (const KMyMoneyRegister::SelectedTransactions &list)
void slotNewTransaction (void)
void slotNewTransaction (KMyMoneyRegister::Action)
void slotUpdateViewPos (void)
void slotSortOptions (void)
void slotToggleTransactionMark (KMyMoneyRegister::Transaction *t)
void slotKeepPostDate (const QDate &)
void slotAboutToSelectItem (KMyMoneyRegister::RegisterItem *, bool &)

Protected Member Functions

void loadAccounts (void)
void clear (void)
void loadView (void)
void resizeEvent (QResizeEvent *)
void selectTransaction (const QString &id)
bool focusNextPrevChild (bool next)
bool eventFilter (QObject *o, QEvent *e)
bool isReconciliationAccount (void) const
void updateSummaryLine (const QMap< QString, MyMoneyMoney > &actBalance, const QMap< QString, MyMoneyMoney > &clearedBalance)
void setupDefaultAction (void)

Static Protected Attributes

static QDate m_lastPostDate

Private Member Functions

bool canProcessTransactions (const KMyMoneyRegister::SelectedTransactions &list, QString &tooltip) const

Private Attributes

Private *const d
QFramem_toolbarFrame
QFramem_registerFrame
QFramem_buttonFrame
QFramem_formFrame
QFramem_summaryFrame
KMyMoneyAccountCombom_accountComboBox
KMyMoneyRegister::Registerm_register
KToolBar * m_toolbar
KToolBar * m_buttonbar
MyMoneyAccount m_account
QValueList< QPair
< MyMoneyTransaction,
MyMoneySplit > > 
m_transactionList
QLabelm_leftSummaryLabel
QLabelm_centerSummaryLabel
QLabelm_rightSummaryLabel
KMyMoneyTransactionForm::TransactionFormm_form
bool m_needReload
bool m_newAccountLoaded
bool m_inEditMode
QWidgetList m_tabOrderWidgets


Detailed Description

Author:
Thomas Baumgart

Constructor & Destructor Documentation

KGlobalLedgerView::KGlobalLedgerView ( QWidget parent = 0,
const char *  name = 0 
)

KGlobalLedgerView::~KGlobalLedgerView (  ) 


Member Function Documentation

const QString KGlobalLedgerView::accountId ( void   )  const [inline]

This method returns the id of the currently selected account or QString() if none is selected.

bool KGlobalLedgerView::canCreateTransactions ( QString &  tooltip  )  const

Checks if new transactions can be created in the current context

Parameters:
tooltip reference to string receiving the tooltip text which explains why the modify function is not available (in case of returning false)
Return values:
true Yes, view allows to create transactions (tooltip is not changed)
false No, view does not support creation of transactions (tooltip is updated with message)

bool KGlobalLedgerView::canModifyTransactions ( const KMyMoneyRegister::SelectedTransactions list,
QString &  tooltip 
) const

Checks if a list of transactions can be modified (edit/delete) in the current context

Parameters:
list list of selected transactions
tooltip reference to string receiving the tooltip text which explains why the modify function is not available (in case of returning false)
Return values:
true Yes, view allows to edit/delete transactions (tooltip is not changed)
false No, view cannot edit/delete transactions (tooltip is updated with message)

bool KGlobalLedgerView::canDuplicateTransactions ( const KMyMoneyRegister::SelectedTransactions list,
QString &  tooltip 
) const

bool KGlobalLedgerView::canEditTransactions ( const KMyMoneyRegister::SelectedTransactions list,
QString &  tooltip 
) const

Checks if the list of transactions can be edited in the current context

Parameters:
list list of selected transactions
tooltip reference to string receiving the tooltip text which explains why the edit function is not available (in case of returning false)
Returns:
true if edit operation is possible, false if not

TransactionEditor* KGlobalLedgerView::startEdit ( const KMyMoneyRegister::SelectedTransactions list  ) 

bool KGlobalLedgerView::selectEmptyTransaction ( void   ) 

Method to prepare the ledger view to create a new transaction. Returns if successful or not.

retval true Emtpy transaction selected. retval false Not successful (e.g. already editing a transaction)

void KGlobalLedgerView::show ( void   )  [slot]

void KGlobalLedgerView::slotLoadView ( void   )  [slot]

This method loads the view with data from the MyMoney engine.

bool KGlobalLedgerView::slotSelectAccount ( const QString &  accountId,
const QString &  transactionId = QString() 
) [slot]

This slot is used to select the correct ledger view type for the account specified by id in a specific mode.

Parameters:
accountId Internal id used for the account to show
transactionId Internal id used for the transaction to select. Default is QString() which will select the last transaction in the ledger if not the same account
Return values:
true selection of account referenced by id succeeded
false selection of account failed

bool KGlobalLedgerView::slotSelectAccount ( const MyMoneyObject acc  )  [slot]

This method is provided for convenience and acts as the method above.

void KGlobalLedgerView::slotSetReconcileAccount ( const MyMoneyAccount account = MyMoneyAccount(),
const QDate &  reconciliationDate = QDate(),
const MyMoneyMoney endingBalance = MyMoneyMoney() 
) [slot]

Switch to reconciliation mode for account account. If account is MyMoneyAccount() (the default), reconciliation mode is turned off.

Parameters:
account account for which reconciliation mode is activated. Default is MyMoneyAccount().
reconciliationDate date of statment
endingBalance The calculated ending balance for the statement Default ist 0.

void KGlobalLedgerView::slotSelectAllTransactions ( void   )  [slot]

Select all transactions in the ledger that are not hidden.

void KGlobalLedgerView::loadAccounts ( void   )  [protected]

This method reloads the account selection combo box of the view with all asset and liability accounts from the engine. If the account id of the current account held in m_accountId is empty or if the referenced account does not exist in the engine, the first account found in the list will be made the current account.

void KGlobalLedgerView::clear ( void   )  [protected]

This method clears the register, form, transaction list. See

See also:
m_register,

m_transactionList

void KGlobalLedgerView::loadView ( void   )  [protected]

void KGlobalLedgerView::resizeEvent ( QResizeEvent *   )  [protected]

void KGlobalLedgerView::selectTransaction ( const QString &  id  )  [protected]

bool KGlobalLedgerView::focusNextPrevChild ( bool  next  )  [protected]

This method handles the focus of the keyboard. When in edit mode (m_inEditMode is true) the keyboard focus is handled according to the widgets that are referenced in m_tabOrderWidgets. If not in edit mode, the base class functionality is provided.

Parameters:
next true if forward-tab, false if backward-tab was pressed by the user

bool KGlobalLedgerView::eventFilter ( QObject o,
QEvent *  e 
) [protected]

bool KGlobalLedgerView::isReconciliationAccount ( void   )  const [protected]

Returns true if setReconciliationAccount() has been called for the current loaded account.

Return values:
true current account is in reconciliation mode
false current account is not in reconciliation mode

void KGlobalLedgerView::updateSummaryLine ( const QMap< QString, MyMoneyMoney > &  actBalance,
const QMap< QString, MyMoneyMoney > &  clearedBalance 
) [protected]

Updates the values on the summary line beneath the register with the given values. The contents shown differs between reconciliation mode and normal mode.

Parameters:
actBalance map of account indexed values to be used as actual balance
clearedBalance map of account indexed values to be used as cleared balance

void KGlobalLedgerView::setupDefaultAction ( void   )  [protected]

setup the default action according to the current account type

void KGlobalLedgerView::slotLeaveEditMode ( const KMyMoneyRegister::SelectedTransactions list  )  [protected, slot]

void KGlobalLedgerView::slotNewTransaction ( void   )  [protected, slot]

void KGlobalLedgerView::slotNewTransaction ( KMyMoneyRegister::Action   )  [protected, slot]

void KGlobalLedgerView::slotUpdateViewPos ( void   )  [protected, slot]

Sets the contentsPos of the register to d->m_startPoint or makes the focus item visible if d->m_startPoint equals QPoint(-1, -1).

void KGlobalLedgerView::slotSortOptions ( void   )  [protected, slot]

void KGlobalLedgerView::slotToggleTransactionMark ( KMyMoneyRegister::Transaction t  )  [protected, slot]

void KGlobalLedgerView::slotKeepPostDate ( const QDate &   )  [protected, slot]

void KGlobalLedgerView::slotAboutToSelectItem ( KMyMoneyRegister::RegisterItem ,
bool &   
) [protected, slot]

void KGlobalLedgerView::accountSelected ( const MyMoneyObject  )  [signal]

void KGlobalLedgerView::transactionsSelected ( const KMyMoneyRegister::SelectedTransactions  )  [signal]

void KGlobalLedgerView::newTransaction ( void   )  [signal]

void KGlobalLedgerView::startEdit ( void   )  [signal]

void KGlobalLedgerView::endEdit ( void   )  [signal]

void KGlobalLedgerView::cancelOrEndEdit ( bool &   )  [signal]

void KGlobalLedgerView::reportGenerated ( const MyMoneyReport report  )  [signal]

This signal is emitted, when a new report has been generated. A 'generated' report is halfway between a default report and a custom report. It's created by the system in response to the user's request, and it's usually filtered to be a little more specific than the usual default reports.

The proper behaviour when getting this signal is to switch to the reports view and display the report. But it should NOT be added to the data file, unless the user customizes it further. That's because the user can always come back to the ledger UI to generate the report again.

Parameters:
report reference to MyMoneyReport object that contains the report details

void KGlobalLedgerView::openContextMenu ( void   )  [signal]

void KGlobalLedgerView::toggleReconciliationFlag ( void   )  [signal]

This signal is sent out, when the current selected transaction should be marked different

bool KGlobalLedgerView::canProcessTransactions ( const KMyMoneyRegister::SelectedTransactions list,
QString &  tooltip 
) const [private]


Member Data Documentation

QDate KGlobalLedgerView::m_lastPostDate [static, protected]

This member keeps the date that was used as the last posting date. It will be updated whenever the user modifies the post date and is used to preset the posting date when new transactions are created. This member is initialised to the current date when the program is started.

Private* const KGlobalLedgerView::d [private]

Reimplemented from KMyMoneyViewBase.

KToolBar* KGlobalLedgerView::m_toolbar [private]

KToolBar* KGlobalLedgerView::m_buttonbar [private]

This member holds the currently selected account

This member holds the transaction list

QWidgetList KGlobalLedgerView::m_tabOrderWidgets [private]


The documentation for this class was generated from the following file:

Generated on Wed Jan 26 13:07:32 2011 for KMyMoney by  doxygen 1.5.6