kMyMoneyAccountSelector Class Reference

#include <kmymoneyaccountselector.h>

Inheritance diagram for kMyMoneyAccountSelector:

KMyMoneySelector QWidget
Collaboration diagram for kMyMoneyAccountSelector:

Collaboration graph

List of all members.

Public Slots

void slotSelectAllAccounts (void)
void slotDeselectAllAccounts (void)

Public Member Functions

 kMyMoneyAccountSelector (QWidget *parent=0, const char *name=0, QWidget::WFlags flags=0, const bool createButtons=true)
virtual ~kMyMoneyAccountSelector ()
QStringList accountList (const QValueList< MyMoneyAccount::accountTypeE > &list=QValueList< MyMoneyAccount::accountTypeE >()) const
void setSelectionMode (QListView::SelectionMode mode)
virtual bool match (const QRegExp &exp, QListViewItem *item) const
virtual bool contains (const QString &txt) const
void removeButtons (void)

Protected Slots

void slotSelectIncomeCategories (void)
void slotSelectExpenseCategories (void)

Protected Member Functions

int loadSubAccounts (QListViewItem *parent, const QStringList &list)
void selectCategories (const bool income, const bool expense)

Protected Attributes

KPushButton * m_allAccountsButton
KPushButton * m_noAccountButton
KPushButton * m_incomeCategoriesButton
KPushButton * m_expenseCategoriesButton
QValueList< int > m_typeList
QStringList m_accountList


class AccountSet

Detailed Description

This class implements an account/category selector. It is based on a tree view. Using this widget, one can select one or multiple accounts depending on the mode of operation and the set of accounts selected to be displayed. (see setSelectionMode() and loadList() about the specifics of configuration).

Constructor & Destructor Documentation

kMyMoneyAccountSelector::kMyMoneyAccountSelector ( QWidget parent = 0,
const char *  name = 0,
QWidget::WFlags  flags = 0,
const bool  createButtons = true 

virtual kMyMoneyAccountSelector::~kMyMoneyAccountSelector (  )  [virtual]

Member Function Documentation

QStringList kMyMoneyAccountSelector::accountList ( const QValueList< MyMoneyAccount::accountTypeE > &  list = QValueListMyMoneyAccount::accountTypeE >()  )  const

This method returns a list of account ids of those accounts currently loaded into the widget. It is possible to select a list of specific account types only. In this case, pass a list of account types as parameter list.

list QValueList of account types to be returned. If this list is empty (the default), then the ids of all accounts will be returned.
QStringList of account ids

void kMyMoneyAccountSelector::setSelectionMode ( QListView::SelectionMode  mode  ) 

This method sets the mode of operation of this widget. Supported values are QListView::Single and QListView::Multi.

mode QListView::Single selects single selection mode and QListView::Multi selects multi selection mode
When the widget is created, it defaults to QListView::Single. Any items loaded into the widget will be cleared if the mode changes. Changing the selection mode also changes the type of the items created through newItem(). You should therefor set the selection mode before you create items.

Reimplemented from KMyMoneySelector.

virtual bool kMyMoneyAccountSelector::match ( const QRegExp &  exp,
QListViewItem item 
) const [virtual]

This method checks if a given item matches the given regular expression exp.

exp const reference to a regular expression object
item pointer to QListViewItem
Return values:
true item matches
false item does not match

Reimplemented from KMyMoneySelector.

virtual bool kMyMoneyAccountSelector::contains ( const QString &  txt  )  const [virtual]

This method returns, if any of the items in the selector contains the text txt.

txt const reference to string to be looked for
Return values:
true exact match found
false no match found

Reimplemented from KMyMoneySelector.

void kMyMoneyAccountSelector::removeButtons ( void   ) 

This method removes all the buttons of the widget

void kMyMoneyAccountSelector::slotSelectAllAccounts ( void   )  [inline, slot]

This slot selects all items that are currently in the account list of the widget.

void kMyMoneyAccountSelector::slotDeselectAllAccounts ( void   )  [inline, slot]

This slot deselects all items that are currently in the account list of the widget.

int kMyMoneyAccountSelector::loadSubAccounts ( QListViewItem parent,
const QStringList &  list 
) [protected]

This method loads the list of subaccounts as found in the list and attaches them to the parent widget passed as parent.

parent pointer to parent widget
list QStringList containing the ids of all subaccounts to load
This method returns the number of accounts loaded into the list

void kMyMoneyAccountSelector::selectCategories ( const bool  income,
const bool  expense 
) [protected]

This is a helper method for selectAllIncomeCategories() and selectAllExpenseCategories().

void kMyMoneyAccountSelector::slotSelectIncomeCategories ( void   )  [inline, protected, slot]

This slot selects all income categories

void kMyMoneyAccountSelector::slotSelectExpenseCategories ( void   )  [inline, protected, slot]

This slot selects all expense categories

Friends And Related Function Documentation

friend class AccountSet [friend]

Member Data Documentation

QStringList kMyMoneyAccountSelector::m_accountList [protected]

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

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