#include <register.h>
Signals | |
void | selectionChanged (void) |
void | selectionChanged (const KMyMoneyRegister::SelectedTransactions &list) |
void | focusChanged (KMyMoneyRegister::Transaction *item) |
void | focusChanged (void) |
void | aboutToSelectItem (KMyMoneyRegister::RegisterItem *item, bool &okToSelect) |
void | editTransaction (void) |
void | headerClicked (void) |
void | reconcileStateColumnClicked (KMyMoneyRegister::Transaction *item) |
void | emptyItemSelected (void) |
void | openContextMenu (void) |
void | itemAdded (RegisterItem *item) |
Public Member Functions | |
Register (QWidget *parent=0, const char *name=0) | |
virtual | ~Register () |
void | addItem (RegisterItem *p) |
void | insertItemAfter (RegisterItem *p, RegisterItem *q) |
void | removeItem (RegisterItem *p) |
QValueList< RegisterItem * > | selectedItems (void) const |
void | selectedTransactions (SelectedTransactions &list) const |
QString | text (int row, int col) const |
QWidget * | createEditor (int row, int col, bool initFromCell) const |
void | setCellContentFromEditor (int row, int col) |
QWidget * | cellWidget (int row, int col) const |
void | endEdit (int row, int col, bool accept, bool replace) |
void | paintCell (QPainter *painter, int row, int col, const QRect &r, bool selected, const QColorGroup &cg) |
void | resizeData (int) |
QTableItem * | item (int, int) |
void | setItem (int, int, QTableItem *) |
void | clearCell (int, int) |
void | clearCellWidget (int, int) |
void | paintFocus (QPainter *, const QRect &) |
void | updateCell (int, int) |
RegisterItem * | focusItem (void) const |
RegisterItem * | anchorItem (void) const |
bool | setFocusItem (RegisterItem *focusItem) |
void | setAnchorItem (RegisterItem *anchorItem) |
bool | setFocusToTop (void) |
void | selectItem (RegisterItem *item, bool dontChangeSelections=false) |
void | clear (void) |
void | updateRegister (bool forceUpdateRowHeight=false) |
void | updateAlternate (void) const |
void | suppressAdjacentMarkers (void) |
void | adjustColumn (int col) |
void | setupRegister (const MyMoneyAccount &account, bool showAccountColumn=false) |
void | setupRegister (const MyMoneyAccount &account, const QValueList< Column > &cols) |
void | setSortOrder (const QString &order) |
const QValueList < TransactionSortField > & | sortOrder (void) const |
TransactionSortField | primarySortKey (void) const |
void | sortItems (void) |
Column | lastCol (void) const |
RegisterItem * | firstItem (void) const |
RegisterItem * | firstVisibleItem (void) const |
RegisterItem * | nextItem (RegisterItem *) const |
RegisterItem * | lastItem (void) const |
RegisterItem * | lastVisibleItem (void) const |
RegisterItem * | prevItem (RegisterItem *) const |
RegisterItem * | itemAtRow (int row) const |
void | resize (int col) |
void | forceUpdateLists (void) |
void | ensureItemVisible (RegisterItem *item) |
void | arrangeEditWidgets (QMap< QString, QWidget * > &editWidgets, Transaction *t) |
void | removeEditWidgets (QMap< QString, QWidget * > &editWidgets) |
void | tabOrder (QWidgetList &tabOrderWidgets, KMyMoneyRegister::Transaction *t) const |
int | rowHeightHint (void) const |
void | clearSelection (void) |
bool | markErronousTransactions (void) const |
const MyMoneyAccount & | account (void) const |
void | repaintItems (RegisterItem *first=0, RegisterItem *last=0) |
unsigned int | drawCounter (void) const |
void | addGroupMarkers (void) |
void | removeUnwantedGroupMarkers (void) |
void | setLedgerLensForced (bool forced=true) |
void | setSelectionMode (SelectionMode mode) |
Static Public Member Functions | |
static Transaction * | transactionFactory (Register *parent, const MyMoneyTransaction &transaction, const MyMoneySplit &split, int uniqueId) |
Protected Slots | |
void | resize (void) |
void | selectItem (int row, int col, int button, const QPoint &mousePos) |
void | slotEnsureItemVisible (void) |
void | slotDoubleClicked (int, int, int, const QPoint &) |
void | slotToggleErronousTransactions (void) |
void | slotAutoColumnSizing (int section) |
Protected Member Functions | |
void | drawContents (QPainter *p, int cx, int cy, int cw, int ch) |
void | contentsMouseReleaseEvent (QMouseEvent *e) |
void | unselectItems (int from=-1, int to=-1) |
void | selectItems (int from, int to) |
void | doSelectItems (int from, int to, bool selected) |
int | selectedItemsCount (void) const |
void | focusOutEvent (QFocusEvent *) |
void | focusInEvent (QFocusEvent *) |
void | keyPressEvent (QKeyEvent *) |
int | rowToIndex (int row) const |
void | setupItemIndex (int rowCount) |
void | scrollPage (int key, ButtonState state) |
RegisterItem * | itemById (const QString &id) const |
void | insertWidget (int row, int col, QWidget *w) |
bool | focusNextPrevChild (bool next) |
bool | eventFilter (QObject *o, QEvent *e) |
void | handleItemChange (RegisterItem *old, bool shift, bool control) |
void | selectRange (RegisterItem *from, RegisterItem *to, bool invert, bool includeFirst, bool clearSel) |
void | dragMoveEvent (QDragMoveEvent *event) |
void | dropEvent (QDropEvent *event) |
Transaction * | dropTransaction (QPoint cPos) const |
Protected Attributes | |
ItemPtrVector | m_items |
QValueVector< RegisterItem * > | m_itemIndex |
RegisterItem * | m_selectAnchor |
RegisterItem * | m_focusItem |
RegisterItem * | m_ensureVisibleItem |
RegisterItem * | m_firstItem |
RegisterItem * | m_lastItem |
RegisterItem * | m_firstErronous |
RegisterItem * | m_lastErronous |
int | m_markErronousTransactions |
int | m_rowHeightHint |
MyMoneyAccount | m_account |
bool | m_ledgerLensForced |
SelectionMode | m_selectionMode |
Private Attributes | |
bool | m_listsDirty |
bool | m_ignoreNextButtonRelease |
bool | m_needInitialColumnResize |
Qt::ButtonState | m_buttonState |
Column | m_lastCol |
QValueList< TransactionSortField > | m_sortOrder |
QMap< QPair< int, int > , QWidget * > | m_cellWidgets |
RegisterToolTip * | m_tooltip |
QRect | m_lastRepaintRect |
unsigned int | m_drawCounter |
Friends | |
class | Transaction |
class | StdTransaction |
class | InvestTransaction |
KMyMoneyRegister::Register::Register | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 | |||
) |
virtual KMyMoneyRegister::Register::~Register | ( | ) | [virtual] |
void KMyMoneyRegister::Register::addItem | ( | RegisterItem * | p | ) |
add the item p to the register
void KMyMoneyRegister::Register::insertItemAfter | ( | RegisterItem * | p, | |
RegisterItem * | q | |||
) |
insert the item p into the register after item q
void KMyMoneyRegister::Register::removeItem | ( | RegisterItem * | p | ) |
remove the item from
the register
QValueList<RegisterItem*> KMyMoneyRegister::Register::selectedItems | ( | void | ) | const |
This method returns a list of pointers to all selected items in the register
QValueList<RegisterItem*> |
void KMyMoneyRegister::Register::selectedTransactions | ( | SelectedTransactions & | list | ) | const |
Construct a list of all currently selected transactions in the register. If the current item carrying the focus (see focusItem() ) is selected it will be the first one contained in the list.
list | reference to QValueList receiving the SelectedTransaction()'s |
QString KMyMoneyRegister::Register::text | ( | int | row, | |
int | col | |||
) | const |
QWidget* KMyMoneyRegister::Register::createEditor | ( | int | row, | |
int | col, | |||
bool | initFromCell | |||
) | const |
void KMyMoneyRegister::Register::setCellContentFromEditor | ( | int | row, | |
int | col | |||
) |
QWidget* KMyMoneyRegister::Register::cellWidget | ( | int | row, | |
int | col | |||
) | const |
void KMyMoneyRegister::Register::endEdit | ( | int | row, | |
int | col, | |||
bool | accept, | |||
bool | replace | |||
) |
void KMyMoneyRegister::Register::paintCell | ( | QPainter * | painter, | |
int | row, | |||
int | col, | |||
const QRect & | r, | |||
bool | selected, | |||
const QColorGroup & | cg | |||
) |
void KMyMoneyRegister::Register::resizeData | ( | int | ) | [inline] |
QTableItem* KMyMoneyRegister::Register::item | ( | int | , | |
int | ||||
) | [inline] |
void KMyMoneyRegister::Register::setItem | ( | int | , | |
int | , | |||
QTableItem * | ||||
) | [inline] |
void KMyMoneyRegister::Register::clearCell | ( | int | , | |
int | ||||
) | [inline] |
void KMyMoneyRegister::Register::clearCellWidget | ( | int | , | |
int | ||||
) |
void KMyMoneyRegister::Register::paintFocus | ( | QPainter * | , | |
const QRect & | ||||
) | [inline] |
Override the QTable member function to avoid display of focus
void KMyMoneyRegister::Register::updateCell | ( | int | , | |
int | ||||
) | [inline] |
Override the QTable member function to avoid functionality
RegisterItem* KMyMoneyRegister::Register::focusItem | ( | void | ) | const [inline] |
RegisterItem* KMyMoneyRegister::Register::anchorItem | ( | void | ) | const [inline] |
bool KMyMoneyRegister::Register::setFocusItem | ( | RegisterItem * | focusItem | ) |
set focus to specific item.
void KMyMoneyRegister::Register::setAnchorItem | ( | RegisterItem * | anchorItem | ) |
bool KMyMoneyRegister::Register::setFocusToTop | ( | void | ) |
Set focus to the first focussable item
void KMyMoneyRegister::Register::selectItem | ( | RegisterItem * | item, | |
bool | dontChangeSelections = false | |||
) |
Select item and unselect all others if dontChangeSelections is false. If m_buttonState differs from Qt::NoButton (method is called as a result of a mouse button press), then the setting of dontChangeSelections has no effect.
void KMyMoneyRegister::Register::clear | ( | void | ) |
Clears all items in the register. All objects added to the register will be deleted.
void KMyMoneyRegister::Register::updateRegister | ( | bool | forceUpdateRowHeight = false |
) |
void KMyMoneyRegister::Register::updateAlternate | ( | void | ) | const |
Assign all visible items an alternate background color
void KMyMoneyRegister::Register::suppressAdjacentMarkers | ( | void | ) |
make sure, we only show a single marker in a row through hiding unused ones
void KMyMoneyRegister::Register::adjustColumn | ( | int | col | ) |
Adjusts column col so that all data fits in width.
void KMyMoneyRegister::Register::setupRegister | ( | const MyMoneyAccount & | account, | |
bool | showAccountColumn = false | |||
) |
Convenience method to setup the register to show the columns based on the account type of account. If showAccountColumn is true then the account column is shown independant of the account type. If account does not have an id, all columns will be hidden.
void KMyMoneyRegister::Register::setupRegister | ( | const MyMoneyAccount & | account, | |
const QValueList< Column > & | cols | |||
) |
Show the columns contained in cols for account. account can be left empty ( MyMoneyAccount() ) e.g. for the search dialog.
void KMyMoneyRegister::Register::setSortOrder | ( | const QString & | order | ) |
const QValueList<TransactionSortField>& KMyMoneyRegister::Register::sortOrder | ( | void | ) | const [inline] |
TransactionSortField KMyMoneyRegister::Register::primarySortKey | ( | void | ) | const |
void KMyMoneyRegister::Register::sortItems | ( | void | ) |
Column KMyMoneyRegister::Register::lastCol | ( | void | ) | const [inline] |
This member returns the last visible column that is used by the register after it has been setup using setupRegister().
RegisterItem* KMyMoneyRegister::Register::firstItem | ( | void | ) | const |
RegisterItem* KMyMoneyRegister::Register::firstVisibleItem | ( | void | ) | const |
RegisterItem* KMyMoneyRegister::Register::nextItem | ( | RegisterItem * | ) | const |
RegisterItem* KMyMoneyRegister::Register::lastItem | ( | void | ) | const |
RegisterItem* KMyMoneyRegister::Register::lastVisibleItem | ( | void | ) | const |
RegisterItem* KMyMoneyRegister::Register::prevItem | ( | RegisterItem * | ) | const |
RegisterItem* KMyMoneyRegister::Register::itemAtRow | ( | int | row | ) | const |
void KMyMoneyRegister::Register::resize | ( | int | col | ) |
void KMyMoneyRegister::Register::forceUpdateLists | ( | void | ) | [inline] |
void KMyMoneyRegister::Register::ensureItemVisible | ( | RegisterItem * | item | ) |
void KMyMoneyRegister::Register::arrangeEditWidgets | ( | QMap< QString, QWidget * > & | editWidgets, | |
Transaction * | t | |||
) | [virtual] |
Implements TransactionEditorContainer.
void KMyMoneyRegister::Register::removeEditWidgets | ( | QMap< QString, QWidget * > & | editWidgets | ) | [virtual] |
Implements TransactionEditorContainer.
void KMyMoneyRegister::Register::tabOrder | ( | QWidgetList & | tabOrderWidgets, | |
KMyMoneyRegister::Transaction * | t | |||
) | const [virtual] |
Implements TransactionEditorContainer.
int KMyMoneyRegister::Register::rowHeightHint | ( | void | ) | const |
void KMyMoneyRegister::Register::clearSelection | ( | void | ) |
bool KMyMoneyRegister::Register::markErronousTransactions | ( | void | ) | const [inline] |
static Transaction* KMyMoneyRegister::Register::transactionFactory | ( | Register * | parent, | |
const MyMoneyTransaction & | transaction, | |||
const MyMoneySplit & | split, | |||
int | uniqueId | |||
) | [static] |
This method creates a specifc transaction according to the transaction passed in transaction.
parent | pointer to register where the created object should be added | |
transaction | the transaction which should be used to create the object | |
split | the split of the transaction which should be used to create the object | |
uniqueId | an int that will be used to construct the id of the item |
const MyMoneyAccount& KMyMoneyRegister::Register::account | ( | void | ) | const [inline] |
void KMyMoneyRegister::Register::repaintItems | ( | RegisterItem * | first = 0 , |
|
RegisterItem * | last = 0 | |||
) |
unsigned int KMyMoneyRegister::Register::drawCounter | ( | void | ) | const [inline] |
void KMyMoneyRegister::Register::addGroupMarkers | ( | void | ) |
This method creates group marker items and adds them to the register
void KMyMoneyRegister::Register::removeUnwantedGroupMarkers | ( | void | ) |
This method removes all trailing group markers and in a second run reduces all adjacent group markers to show only one. In that case the last one will remain.
void KMyMoneyRegister::Register::setLedgerLensForced | ( | bool | forced = true |
) | [inline] |
void KMyMoneyRegister::Register::setSelectionMode | ( | SelectionMode | mode | ) | [inline] |
Sets the selection mode to mode. Supported modes are QTable::Single and QTable::Multi. QTable::Multi is the default when the object is created.
void KMyMoneyRegister::Register::drawContents | ( | QPainter * | p, | |
int | cx, | |||
int | cy, | |||
int | cw, | |||
int | ch | |||
) | [protected] |
void KMyMoneyRegister::Register::contentsMouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected] |
void KMyMoneyRegister::Register::unselectItems | ( | int | from = -1 , |
|
int | to = -1 | |||
) | [inline, protected] |
void KMyMoneyRegister::Register::selectItems | ( | int | from, | |
int | to | |||
) | [inline, protected] |
void KMyMoneyRegister::Register::doSelectItems | ( | int | from, | |
int | to, | |||
bool | selected | |||
) | [protected] |
int KMyMoneyRegister::Register::selectedItemsCount | ( | void | ) | const [protected] |
void KMyMoneyRegister::Register::focusOutEvent | ( | QFocusEvent * | ) | [protected] |
void KMyMoneyRegister::Register::focusInEvent | ( | QFocusEvent * | ) | [protected] |
void KMyMoneyRegister::Register::keyPressEvent | ( | QKeyEvent * | ) | [protected] |
int KMyMoneyRegister::Register::rowToIndex | ( | int | row | ) | const [protected] |
void KMyMoneyRegister::Register::setupItemIndex | ( | int | rowCount | ) | [protected] |
void KMyMoneyRegister::Register::scrollPage | ( | int | key, | |
ButtonState | state | |||
) | [protected] |
This method determines the register item that is one page further down or up in the ledger from the previous focus item. The height to scroll is determined by visibleHeight()
key | Qt::Page_Up or Qt::Page_Down depending on the direction to scroll | |
state | state of Qt::ShiftButton, Qt::ControlButton, Qt::AltButton and Qt::MetaButton. |
RegisterItem* KMyMoneyRegister::Register::itemById | ( | const QString & | id | ) | const [protected] |
This method determines the pointer to a RegisterItem based on the item's id. If id is empty, this method returns m_lastItem.
id | id of the item to be searched |
void KMyMoneyRegister::Register::insertWidget | ( | int | row, | |
int | col, | |||
QWidget * | w | |||
) | [protected] |
bool KMyMoneyRegister::Register::focusNextPrevChild | ( | bool | next | ) | [protected] |
Override logic and use standard QFrame behaviour
bool KMyMoneyRegister::Register::eventFilter | ( | QObject * | o, | |
QEvent * | e | |||
) | [protected] |
void KMyMoneyRegister::Register::handleItemChange | ( | RegisterItem * | old, | |
bool | shift, | |||
bool | control | |||
) | [protected] |
void KMyMoneyRegister::Register::selectRange | ( | RegisterItem * | from, | |
RegisterItem * | to, | |||
bool | invert, | |||
bool | includeFirst, | |||
bool | clearSel | |||
) | [protected] |
void KMyMoneyRegister::Register::dragMoveEvent | ( | QDragMoveEvent * | event | ) | [protected] |
void KMyMoneyRegister::Register::dropEvent | ( | QDropEvent * | event | ) | [protected] |
Transaction* KMyMoneyRegister::Register::dropTransaction | ( | QPoint | cPos | ) | const [protected] |
void KMyMoneyRegister::Register::resize | ( | void | ) | [protected, slot] |
void KMyMoneyRegister::Register::selectItem | ( | int | row, | |
int | col, | |||
int | button, | |||
const QPoint & | mousePos | |||
) | [protected, slot] |
void KMyMoneyRegister::Register::slotEnsureItemVisible | ( | void | ) | [protected, slot] |
void KMyMoneyRegister::Register::slotDoubleClicked | ( | int | , | |
int | , | |||
int | , | |||
const QPoint & | ||||
) | [protected, slot] |
void KMyMoneyRegister::Register::slotToggleErronousTransactions | ( | void | ) | [protected, slot] |
void KMyMoneyRegister::Register::slotAutoColumnSizing | ( | int | section | ) | [protected, slot] |
void KMyMoneyRegister::Register::selectionChanged | ( | void | ) | [signal] |
void KMyMoneyRegister::Register::selectionChanged | ( | const KMyMoneyRegister::SelectedTransactions & | list | ) | [signal] |
void KMyMoneyRegister::Register::focusChanged | ( | KMyMoneyRegister::Transaction * | item | ) | [signal] |
This signal is emitted when the focus and selection changes to item
.
item | pointer to transaction that received the focus and was selected |
void KMyMoneyRegister::Register::focusChanged | ( | void | ) | [signal] |
This signal is emitted when the focus changes but the selection remains the same. This usually happens when the focus is changed using the keyboard.
void KMyMoneyRegister::Register::aboutToSelectItem | ( | KMyMoneyRegister::RegisterItem * | item, | |
bool & | okToSelect | |||
) | [signal] |
This signal is emitted when an item
is about to be selected. The boolean okToSelect
is preset to true
. If the item
should not be selected for whatever reason, the boolean okToSelect
should be reset to false
by the connected slot.
void KMyMoneyRegister::Register::editTransaction | ( | void | ) | [signal] |
void KMyMoneyRegister::Register::headerClicked | ( | void | ) | [signal] |
void KMyMoneyRegister::Register::reconcileStateColumnClicked | ( | KMyMoneyRegister::Transaction * | item | ) | [signal] |
This signal is sent out when the user clicks on the ReconcileStateColumn and only a single transaction is selected.
void KMyMoneyRegister::Register::emptyItemSelected | ( | void | ) | [signal] |
This signal is sent out, if an item without a transaction id has been selected.
void KMyMoneyRegister::Register::openContextMenu | ( | void | ) | [signal] |
This signal is sent out, if the user selects an item with the right mouse button
void KMyMoneyRegister::Register::itemAdded | ( | RegisterItem * | item | ) | [signal] |
This signal is sent out when a new item has been added to the register
friend class Transaction [friend] |
friend class StdTransaction [friend] |
friend class InvestTransaction [friend] |
ItemPtrVector KMyMoneyRegister::Register::m_items [protected] |
QValueVector<RegisterItem*> KMyMoneyRegister::Register::m_itemIndex [protected] |
RegisterItem* KMyMoneyRegister::Register::m_selectAnchor [protected] |
RegisterItem* KMyMoneyRegister::Register::m_focusItem [protected] |
RegisterItem* KMyMoneyRegister::Register::m_firstItem [protected] |
RegisterItem* KMyMoneyRegister::Register::m_lastItem [protected] |
RegisterItem* KMyMoneyRegister::Register::m_firstErronous [protected] |
RegisterItem* KMyMoneyRegister::Register::m_lastErronous [protected] |
int KMyMoneyRegister::Register::m_markErronousTransactions [protected] |
int KMyMoneyRegister::Register::m_rowHeightHint [protected] |
MyMoneyAccount KMyMoneyRegister::Register::m_account [protected] |
bool KMyMoneyRegister::Register::m_ledgerLensForced [protected] |
SelectionMode KMyMoneyRegister::Register::m_selectionMode [protected] |
bool KMyMoneyRegister::Register::m_listsDirty [private] |
bool KMyMoneyRegister::Register::m_ignoreNextButtonRelease [private] |
bool KMyMoneyRegister::Register::m_needInitialColumnResize [private] |
Qt::ButtonState KMyMoneyRegister::Register::m_buttonState [private] |
Column KMyMoneyRegister::Register::m_lastCol [private] |
QMap<QPair<int, int>, QWidget*> KMyMoneyRegister::Register::m_cellWidgets [private] |
RegisterToolTip* KMyMoneyRegister::Register::m_tooltip [private] |
QRect KMyMoneyRegister::Register::m_lastRepaintRect [private] |
unsigned int KMyMoneyRegister::Register::m_drawCounter [private] |