kexi
KexiDataAwareObjectInterface Class Reference
#include <kexidataawareobjectiface.h>
Inheritance diagram for KexiDataAwareObjectInterface:

Detailed Description
This interface is implemented by KexiTableView and KexiFormView and used by KexiDataAwareView.If yu're implementing this interface, add KEXI_DATAAWAREOBJECTINTERFACE convenience macro just after Q_OBJECT.
You should add following code to your destructor so data is deleted:
This is not performed in KexiDataAwareObjectInterface because you may need to access m_data in your desctructor.
Definition at line 65 of file kexidataawareobjectiface.h.
Public Types | |
NoDelete = 0 | |
AskDelete = 1 | |
ImmediateDelete = 2 | |
SignalDelete = 3 | |
enum | DeletionPolicy { NoDelete = 0, AskDelete = 1, ImmediateDelete = 2, SignalDelete = 3 } |
Public Member Functions | |
KexiDataAwareObjectInterface () | |
virtual | ~KexiDataAwareObjectInterface () |
void | setData (KexiTableViewData *data, bool owner=true) |
KexiTableViewData * | data () const |
int | currentColumn () const |
int | currentRow () const |
KexiTableItem * | selectedItem () const |
int | rows () const |
virtual int | columns () const |
int | dataColumns () const |
virtual bool | isReadOnly () const |
void | setReadOnly (bool set) |
bool | isSortingEnabled () const |
virtual void | setSorting (int col, bool ascending=true) |
virtual void | setSortingEnabled (bool set) |
int | dataSortedColumn () const |
int | dataSortingOrder () const |
virtual bool | sort () |
void | sortAscending () |
void | sortDescending () |
virtual bool | isInsertingEnabled () const |
void | setInsertingEnabled (bool set) |
bool | isDeleteEnabled () const |
bool | isEmptyRowInsertingEnabled () const |
void | setEmptyRowInsertingEnabled (bool set) |
virtual void | setFilteringEnabled (bool set) |
bool | isFilteringEnabled () const |
virtual void | setSpreadSheetMode () |
bool | spreadSheetMode () const |
bool | rowEditing () const |
DeletionPolicy | deletionPolicy () const |
virtual void | setDeletionPolicy (DeletionPolicy policy) |
void | deleteCurrentRow () |
KexiTableItem * | insertEmptyRow (int row=-1) |
virtual bool | beforeDeleteItem (KexiTableItem *item) |
bool | deleteItem (KexiTableItem *item) |
void | insertItem (KexiTableItem *newItem, int row=-1) |
tristate | deleteAllRows (bool ask=false, bool repaint=true) |
virtual int | rowsPerPage () const =0 |
virtual void | selectRow (int row) |
virtual void | selectNextRow () |
virtual void | selectPrevRow () |
virtual void | selectNextPage () |
virtual void | selectPrevPage () |
virtual void | selectFirstRow () |
virtual void | selectLastRow () |
virtual void | clearSelection () |
virtual void | setCursorPosition (int row, int col=-1, bool forceSet=false) |
virtual void | ensureCellVisible (int row, int col)=0 |
void | setAcceptsRowEditAfterCellAccepting (bool set) |
bool | acceptsRowEditAfterCellAccepting () const |
bool | dropsAtRowEnabled () const |
void | setDropsAtRowEnabled (bool set) |
KexiDataItemInterface * | editor () const |
virtual void | cancelRowEdit () |
virtual bool | acceptRowEdit () |
virtual void | removeEditor () |
virtual void | cancelEditor () |
virtual bool | acceptEditor () |
virtual void | createEditor (int row, int col, const QString &addText=QString::null, bool removeOld=false)=0 |
virtual void | startEditCurrentCell (const QString &setText=QString::null) |
virtual void | deleteAndStartEditCurrentCell () |
KexiTableItem * | itemAt (int row) const |
virtual KexiTableViewColumn * | column (int col) |
virtual int | fieldNumberForColumn (int col) |
const QVariant * | bufferedValueAt (int col) |
int | columnType (int col) |
QVariant | columnDefaultValue (int col) const |
virtual bool | columnEditable (int col) |
KexiRecordMarker * | verticalHeader () const |
virtual void | itemChanged (KexiTableItem *, int row, int col)=0 |
virtual void | itemChanged (KexiTableItem *, int row, int col, QVariant oldValue)=0 |
virtual void | itemDeleteRequest (KexiTableItem *, int row, int col)=0 |
virtual void | currentItemDeleteRequest ()=0 |
virtual void | dataRefreshed ()=0 |
virtual void | dataSet (KexiTableViewData *data)=0 |
KPopupMenu * | contextMenu () const |
bool | contextMenuEnabled () const |
void | setContextMenuEnabled (bool set) |
void | startEditOrToggleValue () |
virtual void | boolToggled () |
virtual void | connectCellSelectedSignal (const QObject *receiver, const char *intIntMember)=0 |
virtual void | connectRowEditStartedSignal (const QObject *receiver, const char *intMember)=0 |
virtual void | connectRowEditTerminatedSignal (const QObject *receiver, const char *voidMember)=0 |
virtual void | connectReloadActionsSignal (const QObject *receiver, const char *voidMember)=0 |
virtual void | connectDataSetSignal (const QObject *receiver, const char *kexiTableViewDataMember)=0 |
virtual void | connectToReloadDataSlot (const QObject *sender, const char *voidSignal)=0 |
virtual void | slotDataDestroying () |
Protected Member Functions | |
virtual void | initDataContents () |
virtual void | clearColumns (bool repaint=true) |
virtual void | clearColumnsInternal (bool repaint)=0 |
virtual void | addHeaderColumn (const QString &caption, const QString &description, int width)=0 |
virtual int | currentLocalSortingOrder () const =0 |
virtual int | currentLocalSortColumn () const =0 |
virtual void | setLocalSortingOrder (int col, int order)=0 |
virtual void | sortColumnInternal (int col, int order=0) |
virtual void | updateGUIAfterSorting ()=0 |
virtual void | reloadActions ()=0 |
virtual void | reloadData () |
virtual void | itemSelected (KexiTableItem *)=0 |
virtual void | cellSelected (int col, int row)=0 |
virtual void | sortedColumnChanged (int col)=0 |
virtual void | rowEditTerminated (int row)=0 |
virtual void | clearVariables () |
virtual KexiDataItemInterface * | editor (int col, bool ignoreMissingEditor=false)=0 |
virtual void | editorShowFocus (int row, int col)=0 |
virtual void | updateCell (int row, int col)=0 |
virtual void | updateRow (int row)=0 |
virtual void | updateWidgetContents ()=0 |
virtual void | updateWidgetContentsSize ()=0 |
virtual void | updateWidgetScrollBars ()=0 |
virtual void | updateAfterCancelRowEdit () |
virtual void | updateAfterAcceptRowEdit () |
virtual void | slotRowRepaintRequested (KexiTableItem &item) |
virtual void | slotAboutToDeleteRow (KexiTableItem &item, KexiDB::ResultInfo *result, bool repaint) |
virtual void | slotRowDeleted () |
virtual void | slotRowInserted (KexiTableItem *item, bool repaint) |
virtual void | slotRowInserted (KexiTableItem *item, uint row, bool repaint) |
virtual void | slotRowsDeleted (const QValueList< int > &) |
bool | hasData () const |
virtual void | selectCellInternal () |
virtual void | updateAllVisibleRowsBelow (int row) |
virtual void | addNewRecordRequested () |
Protected Attributes | |
KexiTableViewData * | m_data |
bool | m_owner: 1 |
int | m_curRow |
int | m_curCol |
KexiTableItem * | m_currentItem |
KexiTableViewData::Iterator * | m_itemIterator |
KexiTableItem * | m_insertItem |
KexiDB::RowEditBuffer * | m_rowEditBuffer |
bool | m_rowEditing: 1 |
bool | m_newRowEditing: 1 |
bool | m_isSortingEnabled: 1 |
bool | m_isFilteringEnabled: 1 |
bool | m_acceptsRowEditAfterCellAccepting: 1 |
bool | m_inside_acceptEditor: 1 |
bool | m_internal_acceptsRowEditAfterCellAccepting: 1 |
bool | m_emptyRowInsertingEnabled: 1 |
int | m_readOnly |
bool | m_contentsMousePressEvent_dblClick: 1 |
int | m_insertingEnabled |
bool | m_initDataContentsOnShow: 1 |
bool | m_cursorPositionSetExplicityBeforeShow: 1 |
bool | m_spreadSheetMode: 1 |
bool | m_dropsAtRowEnabled: 1 |
bool | m_updateEntireRowWhenMovingToOtherRow: 1 |
DeletionPolicy | m_deletionPolicy |
KexiRecordMarker * | m_verticalHeader |
KexiDataItemInterface * | m_editor |
KexiRecordNavigator * | m_navPanel |
bool | m_navPanelEnabled: 1 |
bool | m_verticalHeaderAlreadyAdded: 1 |
int | m_dragIndicatorLine |
KPopupMenu * | m_popup |
bool | m_contextMenuEnabled: 1 |
bool | m_alsoUpdateNextRow: 1 |
int | m_rowWillBeDeleted |
QGuardedPtr< QLabel > | m_errorMessagePopup |
Member Function Documentation
bool KexiDataAwareObjectInterface::acceptEditor | ( | ) | [virtual] |
bool KexiDataAwareObjectInterface::acceptRowEdit | ( | ) | [virtual] |
Accepts row editing. All changes made to the editing row during this current session will be accepted (saved).
- Returns:
- true if accepting was successfull, false otherwise (e.g. when current row contain data that does not meet given constraints).
Reimplemented in KexiTableView.
Definition at line 644 of file kexidataawareobjectiface.cpp.
bool KexiDataAwareObjectInterface::acceptsRowEditAfterCellAccepting | ( | ) | const [inline] |
- Returns:
- true, if this object automatically accepts row editing (using acceptRowEdit()) on accepting any cell's edit (i.e. after acceptEditor()). By default this flag is set to false. Not that if the query for this table has given constraints defined, like NOT NULL / NOT EMPTY for more than one field - editing a record would be impossible for the flag set to true, because of constraints violation. However, setting this flag to true can be usefull especially for not-db-aware data set (it's used e.g. in Kexi Alter Table's field editor).
Definition at line 311 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::beforeDeleteItem | ( | KexiTableItem * | item | ) | [virtual] |
For reimplementation: called by deleteItem(). If returns false, deleting is aborted. Default implementation just returns true.
Definition at line 1461 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::boolToggled | ( | ) | [virtual] |
Reaction on toggling a boolean value of a cell: we're starting to edit the cell and inverting it's state.
Definition at line 1550 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::cancelRowEdit | ( | ) | [virtual] |
Cancels row editing All changes made to the editing row during this current session will be undone.
- Todo:
- (js): cancel changes for this row!
Reimplemented in KexiTableView.
Definition at line 753 of file kexidataawareobjectiface.cpp.
virtual void KexiDataAwareObjectInterface::cellSelected | ( | int | col, | |
int | row | |||
) | [protected, pure virtual] |
for implementation as a signal
Implemented in KexiFormScrollView, and KexiTableView.
void KexiDataAwareObjectInterface::clearColumns | ( | bool | repaint = true |
) | [protected, virtual] |
Clears columns information and thus all internal table data and its visible representation. Repaints widget if repaint is true.
Definition at line 1308 of file kexidataawareobjectiface.cpp.
virtual void KexiDataAwareObjectInterface::clearColumnsInternal | ( | bool | repaint | ) | [protected, pure virtual] |
Called by clearColumns() to clear internals of the object. For example, KexiTableView removes contents of it's horizontal header.
Implemented in KexiFormScrollView, and KexiTableView.
void KexiDataAwareObjectInterface::clearSelection | ( | ) | [virtual] |
Clears current selection. Current row and column will be now unspecified: currentRow(), currentColumn() will return -1, and selectedItem() will return null.
Definition at line 449 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::clearVariables | ( | ) | [protected, virtual] |
Clear temporary members like the pointer to current editor. If you reimplement this method, don't forget to call this one.
Reimplemented in KexiTableView.
Definition at line 84 of file kexidataawareobjectiface.cpp.
KexiTableViewColumn * KexiDataAwareObjectInterface::column | ( | int | col | ) | [virtual] |
- Returns:
- column information for column number col. Default implementation just returns column # col, but for Kexi Forms column data corresponding to widget number is used here (see KexiFormScrollView::fieldNumberForColumn()).
Reimplemented in KexiFormScrollView.
Definition at line 1501 of file kexidataawareobjectiface.cpp.
QVariant KexiDataAwareObjectInterface::columnDefaultValue | ( | int | col | ) | const |
bool KexiDataAwareObjectInterface::columnEditable | ( | int | col | ) | [virtual] |
- Returns:
- true is column col is editable. Default implementation takes information about 'readOnly' flag from data member. Within forms, this is reimplemented for checking 'readOnly' flag from a widget ('readOnly' flag from data member is still checked though).
Reimplemented in KexiFormScrollView.
Definition at line 1379 of file kexidataawareobjectiface.cpp.
virtual int KexiDataAwareObjectInterface::columns | ( | ) | const [inline, virtual] |
- Returns:
- number of visible columns in this view. By default returns dataColumns(), what is proper table view. In case of form view, there can be a number of duplicated columns defined (data-aware widgets, see KexiFormScrollView::columns()), so columns() can return greater number than dataColumns().
Reimplemented in KexiFormScrollView.
Definition at line 99 of file kexidataawareobjectiface.h.
int KexiDataAwareObjectInterface::columnType | ( | int | col | ) |
- Returns:
- a type of column col - one of KexiDB::Field::Type
Definition at line 1373 of file kexidataawareobjectiface.cpp.
bool KexiDataAwareObjectInterface::contextMenuEnabled | ( | ) | const [inline] |
- Returns:
- true if the context menu is enabled (visible) for the view. True by default.
Definition at line 400 of file kexidataawareobjectiface.h.
virtual void KexiDataAwareObjectInterface::createEditor | ( | int | row, | |
int | col, | |||
const QString & | addText = QString::null , |
|||
bool | removeOld = false | |||
) | [pure virtual] |
Creates editors and shows it, what usually means the beginning of a cell editing.
Implemented in KexiFormScrollView, and KexiTableView.
int KexiDataAwareObjectInterface::currentColumn | ( | ) | const [inline] |
- Returns:
- currently selected column number or -1.
Definition at line 83 of file kexidataawareobjectiface.h.
int KexiDataAwareObjectInterface::currentRow | ( | ) | const [inline] |
- Returns:
- currently selected row number or -1.
Definition at line 86 of file kexidataawareobjectiface.h.
KexiTableViewData* KexiDataAwareObjectInterface::data | ( | ) | const [inline] |
- Returns:
- data structure displayed for this object
Definition at line 80 of file kexidataawareobjectiface.h.
int KexiDataAwareObjectInterface::dataColumns | ( | ) | const |
Helper function.
- Returns:
- number of columns of data.
Definition at line 1392 of file kexidataawareobjectiface.cpp.
virtual void KexiDataAwareObjectInterface::dataRefreshed | ( | ) | [pure virtual] |
Data has been refreshed on-screen - emitted from initDataContents().
Implemented in KexiFormScrollView, and KexiTableView.
int KexiDataAwareObjectInterface::dataSortedColumn | ( | ) | const |
- Returns:
- sorted column number or -1 if no column is sorted within data. This does not mean that any sorting has been performed within GUI of this object, because the data could be changed in the meantime outside of this GUI object.
Definition at line 243 of file kexidataawareobjectiface.cpp.
int KexiDataAwareObjectInterface::dataSortingOrder | ( | ) | const |
- Returns:
- 1 if ascending order for data sorting data is set, -1 for descending, 0 for no sorting. This does not mean that any sorting has been performed within GUI of this objetct, because the data could be changed in the meantime outside of this GUI object.
Definition at line 250 of file kexidataawareobjectiface.cpp.
tristate KexiDataAwareObjectInterface::deleteAllRows | ( | bool | ask = false , |
|
bool | repaint = true | |||
) |
Clears entire table data, its visible representation and deletes data at database backend (if this is db-aware object). Does not clear columns information. Does not destroy KexiTableViewData object (if present) but only clears its contents. Displays confirmation dialog if ask is true (the default is false). Repaints widget if repaint is true (the default). For empty tables, true is returned immediately. If isDeleteEnabled() is false, false is returned. For spreadsheet mode all current rows are just replaced by empty rows.
- Returns:
- true on success, false on failure, and cancelled if user cancelled deletion (only possible if ask is true).
Definition at line 1261 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::deleteAndStartEditCurrentCell | ( | ) | [virtual] |
Deletes currently selected cell's contents, if allowed. In most cases delete is not accepted immediately but "row editing" mode is just started.
Reimplemented in KexiTableView.
Definition at line 1112 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::deleteCurrentRow | ( | ) |
Deletes currently selected record; does nothing if no record is currently selected. If record is in edit mode, editing is cancelled before deleting.
Reimplemented in KexiTableView.
Definition at line 1134 of file kexidataawareobjectiface.cpp.
bool KexiDataAwareObjectInterface::deleteItem | ( | KexiTableItem * | item | ) |
Deletes item. Used by deleteCurrentRow(). Calls beforeDeleteItem() before deleting, to double-check if deleting is allowed.
- Returns:
- true on success.
Definition at line 1467 of file kexidataawareobjectiface.cpp.
DeletionPolicy KexiDataAwareObjectInterface::deletionPolicy | ( | ) | const [inline] |
- Returns:
- deletion policy for this object. The default (after allocating) is AskDelete.
Definition at line 226 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::dropsAtRowEnabled | ( | ) | const [inline] |
- Returns:
- true, if this table accepts dropping data on the rows.
Definition at line 314 of file kexidataawareobjectiface.h.
KexiDataItemInterface* KexiDataAwareObjectInterface::editor | ( | ) | const [inline] |
- Returns:
- currently used data (field/cell) editor or 0 if there is no data editing.
Definition at line 325 of file kexidataawareobjectiface.h.
virtual void KexiDataAwareObjectInterface::editorShowFocus | ( | int | row, | |
int | col | |||
) | [protected, pure virtual] |
Updates editor's position, size and shows its focus (not the editor!) for row and col, using editor(). Does nothing if editor not found.
Implemented in KexiFormScrollView, and KexiTableView.
virtual void KexiDataAwareObjectInterface::ensureCellVisible | ( | int | row, | |
int | col | |||
) | [pure virtual] |
Ensures that cell at row and col is visible. If col is -1, current column number is used. row and col (if not -1) must be between 0 and rows() (or cols() accordingly).
Implemented in KexiFormScrollView, and KexiTableView.
virtual int KexiDataAwareObjectInterface::fieldNumberForColumn | ( | int | col | ) | [inline, virtual] |
- Returns:
- field number within data model connected to a data-aware widget at column col. Can return -1 if there's no such column.
Reimplemented in KexiFormScrollView.
Definition at line 367 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::hasData | ( | ) | const [inline, protected] |
for sanity checks (return true if m_data is present; else: outputs warning)
Definition at line 714 of file kexidataawareobjectiface.h.
void KexiDataAwareObjectInterface::initDataContents | ( | ) | [protected, virtual] |
Reimplementation for KexiDataAwareObjectInterface. Initializes data contents (resizes it, sets cursor at 1st row). Sets record count for record navigator. Sets cursor positin (using setCursorPosition()) to first row or sets (-1, -1) position if no rows are available. Called on setData(). Also called once on show event after refreshRequested() signal was received from KexiTableViewData object.
Reimplemented in KexiFormScrollView, and KexiTableView.
Definition at line 184 of file kexidataawareobjectiface.cpp.
KexiTableItem * KexiDataAwareObjectInterface::insertEmptyRow | ( | int | row = -1 |
) |
Inserts one empty row above row row. If row is -1 (the default), new row is inserted above the current row (or above 1st row if there is no current). A new item becomes current if row is -1 or if row is equal currentRow(). This method does nothing if: -inserting flag is disabled (see isInsertingEnabled()) -read-only flag is set (see isReadOnly()) \ return inserted row's data
Reimplemented in KexiTableView.
Definition at line 1171 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::insertItem | ( | KexiTableItem * | newItem, | |
int | row = -1 | |||
) |
Inserts newItem at row. -1 means current row. Used by insertEmptyRow().
Definition at line 1182 of file kexidataawareobjectiface.cpp.
bool KexiDataAwareObjectInterface::isDeleteEnabled | ( | ) | const |
- Returns:
- true if row deleting is enabled. Equal to deletionPolicy() != NoDelete && !isReadOnly()).
Definition at line 347 of file kexidataawareobjectiface.cpp.
bool KexiDataAwareObjectInterface::isEmptyRowInsertingEnabled | ( | ) | const [inline] |
- Returns:
- true if inserting empty rows are enabled (false by default). Mostly usable for not db-aware objects (e.g. used in Kexi Alter Table). Note, that if inserting is disabled, or the data set is read-only, this flag will be ignored.
Definition at line 190 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::isFilteringEnabled | ( | ) | const [inline] |
bool KexiDataAwareObjectInterface::isInsertingEnabled | ( | ) | const [virtual] |
- Returns:
- true if data inserting is enabled (the default).
Definition at line 331 of file kexidataawareobjectiface.cpp.
bool KexiDataAwareObjectInterface::isReadOnly | ( | ) | const [virtual] |
- Returns:
- true if data represented by this object is not editable (it can be editable with other ways although, outside of this object).
Definition at line 369 of file kexidataawareobjectiface.cpp.
bool KexiDataAwareObjectInterface::isSortingEnabled | ( | ) | const [inline] |
virtual void KexiDataAwareObjectInterface::itemChanged | ( | KexiTableItem * | , | |
int | row, | |||
int | col | |||
) | [pure virtual] |
virtual void KexiDataAwareObjectInterface::itemSelected | ( | KexiTableItem * | ) | [protected, pure virtual] |
for implementation as a signal
Implemented in KexiFormScrollView, and KexiTableView.
virtual void KexiDataAwareObjectInterface::reloadActions | ( | ) | [protected, pure virtual] |
Emitted in initActions() to force reload actions You should remove existing actions and add them again. Define and emit reloadActions() signal here.
Implemented in KexiFormScrollView, and KexiTableView.
void KexiDataAwareObjectInterface::reloadData | ( | ) | [protected, virtual] |
Reloads data for this object.
Reimplemented in KexiFormScrollView, and KexiTableView.
Definition at line 1343 of file kexidataawareobjectiface.cpp.
bool KexiDataAwareObjectInterface::rowEditing | ( | ) | const [inline] |
- Returns:
- true if currently selected row is edited.
Definition at line 214 of file kexidataawareobjectiface.h.
virtual void KexiDataAwareObjectInterface::rowEditTerminated | ( | int | row | ) | [protected, pure virtual] |
for implementation as a signal
Implemented in KexiFormScrollView, and KexiTableView.
int KexiDataAwareObjectInterface::rows | ( | ) | const |
virtual int KexiDataAwareObjectInterface::rowsPerPage | ( | ) | const [pure virtual] |
- Returns:
- maximum number of rows that can be displayed per one "page" for current view's size.
Implemented in KexiFormScrollView, and KexiTableView.
virtual void KexiDataAwareObjectInterface::selectCellInternal | ( | ) | [inline, protected, virtual] |
Only needed for forms: called by KexiDataAwareObjectInterface::setCursorPosition() if cursor's position is really changed.
Reimplemented in KexiFormScrollView.
Definition at line 579 of file kexidataawareobjectiface.h.
KexiTableItem* KexiDataAwareObjectInterface::selectedItem | ( | ) | const [inline] |
- Returns:
- currently selected item (row data) or null.
Definition at line 89 of file kexidataawareobjectiface.h.
void KexiDataAwareObjectInterface::selectNextPage | ( | ) | [virtual] |
void KexiDataAwareObjectInterface::selectPrevPage | ( | ) | [virtual] |
void KexiDataAwareObjectInterface::setAcceptsRowEditAfterCellAccepting | ( | bool | set | ) |
Specifies, if this object automatically accepts row editing (using acceptRowEdit()) on accepting any cell's edit (i.e. after acceptEditor()).
- See also:
- acceptsRowEditAfterCellAccepting()
Reimplemented in KexiTableView.
Definition at line 1406 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::setContextMenuEnabled | ( | bool | set | ) | [inline] |
Enables or disables the context menu for the view.
Definition at line 403 of file kexidataawareobjectiface.h.
void KexiDataAwareObjectInterface::setCursorPosition | ( | int | row, | |
int | col = -1 , |
|||
bool | forceSet = false | |||
) | [virtual] |
Moves cursor to row and col. If col is -1, current column number is used. If forceSet is true, cursor position is updated even if row and col doesn't differ from actual position.
Definition at line 462 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::setData | ( | KexiTableViewData * | data, | |
bool | owner = true | |||
) |
Sets data for this object. if owner is true, the object will own data and therefore will be destroyed when needed, else: data is (possibly) shared and not owned by the widget. If widget already has _different_ data object assigned (and owns this data), old data is destroyed before new assignment.
- Todo:
- : store sorting settings?
Reimplemented in KexiTableView.
Definition at line 95 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::setDropsAtRowEnabled | ( | bool | set | ) |
Specifies, if this table accepts dropping data on the rows. If enabled:
- dragging over row is indicated by drawing a line at bottom side of this row
- dragOverRow() signal will be emitted on dragging, -droppedAtRow() will be emitted on dropping By default this flag is set to false.
Reimplemented in KexiTableView.
Definition at line 1411 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::setEmptyRowInsertingEnabled | ( | bool | set | ) |
Sets emptyRowInserting flag. Note, that if inserting is disabled, this flag is ignored.
Definition at line 1426 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::setFilteringEnabled | ( | bool | set | ) | [virtual] |
Enables or disables filtering. Filtering is enabled by default.
Definition at line 342 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::setInsertingEnabled | ( | bool | set | ) |
Sets insertingEnabled flag. If true, empty row is available at the end of this widget for new entering new data. Unless the flag is set, the widget inherits insertingEnabled flag from it's data structure assigned with setData(). The default value if false.
Note: it is not allowed to force insertingEnabled on when internal data has insertingEnabled set off - in that case the method does nothing. You can check internal data flag calling data()->insertingEnabled().
Setting this flag to true will have no effect if read-only flag is true.
- See also:
- setReadOnly()
Definition at line 380 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::setReadOnly | ( | bool | set | ) |
Sets readOnly flag for this object. Unless the flag is set, the widget inherits readOnly flag from it's data structure assigned with setData(). The default value if false.
This method is useful when you need to switch on the flag indepentently from the data structure. Note: it is not allowed to force readOnly off when internal data is readOnly - in that case the method does nothing. You can check internal data flag calling data()->isReadOnly().
If set is true, insertingEnabled flag will be cleared automatically.
- See also:
- isInsertingEnabled()
Definition at line 358 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::setSorting | ( | int | col, | |
bool | ascending = true | |||
) | [virtual] |
Sets sorting on column col, or (when col == -1) sets rows unsorted this will dont work if sorting is disabled with setSortingEnabled()
Definition at line 234 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::setSortingEnabled | ( | bool | set | ) | [virtual] |
Enables or disables sorting for this object This method is different that setSorting() because it prevents both user and programmer from sorting by clicking a column's header or calling setSorting(). By default sorting is enabled.
Definition at line 226 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::setSpreadSheetMode | ( | ) | [virtual] |
Added for convenience: configure this object to behave more like spreadsheet (it's used for things like alter-table view).
- hides navigator
- disables sorting, inserting and filtering
- enables accepting row after cell accepting; see setAcceptsRowEditAfterCellAccepting()
- enables inserting empty row; see setEmptyRowInsertingEnabled()
Reimplemented in KexiTableView.
Definition at line 395 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::slotAboutToDeleteRow | ( | KexiTableItem & | item, | |
KexiDB::ResultInfo * | result, | |||
bool | repaint | |||
) | [protected, virtual] |
Handles KexiTableViewData::aboutToDeleteRow() signal. Prepares info for slotRowDeleted().
Reimplemented in KexiFormScrollView, and KexiTableView.
Definition at line 1432 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::slotRowDeleted | ( | ) | [protected, virtual] |
Handles KexiTableViewData::rowDeleted() signal to repaint when needed.
Reimplemented in KexiFormScrollView, and KexiTableView.
Definition at line 1440 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::slotRowInserted | ( | KexiTableItem * | item, | |
uint | row, | |||
bool | repaint | |||
) | [protected, virtual] |
Like above, not db-aware version.
Reimplemented in KexiFormScrollView, and KexiTableView.
Definition at line 1231 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::slotRowInserted | ( | KexiTableItem * | item, | |
bool | repaint | |||
) | [protected, virtual] |
Handles KexiTableViewData::rowInserted() signal to repaint when needed.
Reimplemented in KexiFormScrollView, and KexiTableView.
Definition at line 1225 of file kexidataawareobjectiface.cpp.
virtual void KexiDataAwareObjectInterface::slotRowRepaintRequested | ( | KexiTableItem & | item | ) | [inline, protected, virtual] |
Handles KexiTableViewData::rowRepaintRequested() signal.
Reimplemented in KexiFormScrollView, and KexiTableView.
Definition at line 557 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::sort | ( | ) | [virtual] |
Sorts all rows by column selected with setSorting(). If there is currently row edited, it is accepted. If acception failed, sort() will return false.
- Returns:
- true on success.
Definition at line 255 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::sortAscending | ( | ) |
Sorts currently selected column in ascending order. This slot is used typically for "data_sort_az" action.
Definition at line 289 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::sortDescending | ( | ) |
Sorts currently selected column in descending order. This slot is used typically for "data_sort_za" action.
Definition at line 296 of file kexidataawareobjectiface.cpp.
virtual void KexiDataAwareObjectInterface::sortedColumnChanged | ( | int | col | ) | [protected, pure virtual] |
for implementation as a signal
Implemented in KexiFormScrollView, and KexiTableView.
bool KexiDataAwareObjectInterface::spreadSheetMode | ( | ) | const [inline] |
- Returns:
- true id "spreadSheetMode" is enabled. It's false by default.
Definition at line 211 of file kexidataawareobjectiface.h.
void KexiDataAwareObjectInterface::startEditCurrentCell | ( | const QString & | setText = QString::null |
) | [virtual] |
Used when Return key is pressed on cell or "+" nav. button is clicked. Also used when we want to continue editing a cell after "invalid value" message was displayed (in this case, setText is usually not empty, what means that text will be set in the cell replacing previous value).
Reimplemented in KexiTableView.
Definition at line 1092 of file kexidataawareobjectiface.cpp.
void KexiDataAwareObjectInterface::startEditOrToggleValue | ( | ) |
Typically handles pressing Enter or F2 key: if current cell has boolean type, toggles it's value, otherwise starts editing (startEditCurrentCell()).
Definition at line 1537 of file kexidataawareobjectiface.cpp.
virtual void KexiDataAwareObjectInterface::updateAllVisibleRowsBelow | ( | int | row | ) | [inline, protected, virtual] |
Used in KexiDataAwareObjectInterface::slotRowDeleted() to repaint tow row and all visible below. Implemented if there is more than one row displayed, i.e. currently for KexiTableView.
Reimplemented in KexiTableView.
Definition at line 584 of file kexidataawareobjectiface.h.
virtual void KexiDataAwareObjectInterface::updateCell | ( | int | row, | |
int | col | |||
) | [protected, pure virtual] |
Redraws specified cell.
Implemented in KexiFormScrollView, and KexiTableView.
virtual void KexiDataAwareObjectInterface::updateRow | ( | int | row | ) | [protected, pure virtual] |
Redraws all cells of specified row.
Implemented in KexiFormScrollView, and KexiTableView.
virtual void KexiDataAwareObjectInterface::updateWidgetContents | ( | ) | [protected, pure virtual] |
Updates contents of the widget. Just call update() here on your widget.
Implemented in KexiFormScrollView, and KexiTableView.
virtual void KexiDataAwareObjectInterface::updateWidgetContentsSize | ( | ) | [protected, pure virtual] |
Updates widget's contents size e.g. using QScrollView::resizeContents().
Implemented in KexiFormScrollView, and KexiTableView.
virtual void KexiDataAwareObjectInterface::updateWidgetScrollBars | ( | ) | [protected, pure virtual] |
Updates scrollbars of the widget. QScrollView::updateScrollbars() will be usually called here.
Implemented in KexiFormScrollView, and KexiTableView.
Member Data Documentation
bool KexiDataAwareObjectInterface::m_acceptsRowEditAfterCellAccepting [protected] |
Public version of 'acceptsRowEditAfterCellAcceptin' flag (available for a user). It's OR'es together with above flag.
Definition at line 625 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_alsoUpdateNextRow [protected] |
bool KexiDataAwareObjectInterface::m_contentsMousePressEvent_dblClick [protected] |
true if currently double click action was is performed (so accept/cancel editor shoudn't be executed)
Definition at line 648 of file kexidataawareobjectiface.h.
KexiTableItem* KexiDataAwareObjectInterface::m_currentItem [protected] |
int KexiDataAwareObjectInterface::m_curRow [protected] |
bool KexiDataAwareObjectInterface::m_cursorPositionSetExplicityBeforeShow [protected] |
Set to true in setCursorPosition() to indicate that cursor position was set before show() and it shouldn't be changed on show(). Only used if initDataContentsOnShow is true.
Definition at line 659 of file kexidataawareobjectiface.h.
KexiTableViewData* KexiDataAwareObjectInterface::m_data [protected] |
int KexiDataAwareObjectInterface::m_dragIndicatorLine [protected] |
Row number that over which user drags a mouse pointer. Used to indicate dropping possibility for that row. Equal -1 if no indication is needed.
Definition at line 693 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_dropsAtRowEnabled [protected] |
true, if this table accepts dropping data on the rows (false by default).
Definition at line 666 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_emptyRowInsertingEnabled [protected] |
true, if inserting empty rows are enabled (false by default)
Definition at line 637 of file kexidataawareobjectiface.h.
QGuardedPtr<QLabel> KexiDataAwareObjectInterface::m_errorMessagePopup [protected] |
Displays passive error popup label used when invalid data has been entered.
Definition at line 711 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_initDataContentsOnShow [protected] |
true, if initDataContents() should be called on show event.
Definition at line 654 of file kexidataawareobjectiface.h.
int KexiDataAwareObjectInterface::m_insertingEnabled [protected] |
like for readOnly: 1 if inserting is enabled
Definition at line 651 of file kexidataawareobjectiface.h.
KexiTableItem* KexiDataAwareObjectInterface::m_insertItem [protected] |
bool KexiDataAwareObjectInterface::m_inside_acceptEditor [protected] |
Used in acceptEditor() to avoid infinite recursion, eg. when we're calling acceptRowEdit() during cell accepting phase.
Definition at line 629 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_isFilteringEnabled [protected] |
true if filtering is enabled for the view.
Definition at line 620 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_isSortingEnabled [protected] |
'sorting by column' availability flag for widget
Definition at line 617 of file kexidataawareobjectiface.h.
main navigation widget
Navigation panel, used if navigationPanelEnabled is true.
Definition at line 681 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_newRowEditing [protected] |
true if currently selected, new row is edited; implies: rowEditing==true.
Definition at line 614 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_owner [protected] |
true if m_data member is owned by this object
Definition at line 592 of file kexidataawareobjectiface.h.
KPopupMenu* KexiDataAwareObjectInterface::m_popup [protected] |
Context menu widget.
Definition at line 696 of file kexidataawareobjectiface.h.
int KexiDataAwareObjectInterface::m_readOnly [protected] |
Contains 1 if the object is readOnly, 0 if not; otherwise (-1 means "dont know") the 'readOnly' flag from object's internal data structure (KexiTableViewData *KexiTableViewm_data) is reused.
Definition at line 643 of file kexidataawareobjectiface.h.
when (current or new) row is edited - changed field values are temporary stored here
Definition at line 607 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_rowEditing [protected] |
true if currently selected row is edited
Definition at line 610 of file kexidataawareobjectiface.h.
int KexiDataAwareObjectInterface::m_rowWillBeDeleted [protected] |
Row number (>=0 or -1 == no row) that will be deleted in deleteRow(). It is set in slotAboutToDeleteRow(KexiTableItem&,KexiDB::ResultInfo*,bool)) slot received from KexiTableViewData member. This value will be used in slotRowDeleted() after rowDeleted() signal is received from KexiTableViewData member and then cleared (set to -1).
Definition at line 708 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_spreadSheetMode [protected] |
true if spreadSheetMode is enabled. False by default.
- See also:
- KexiTableView::setSpreadSheetMode()
Definition at line 663 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_updateEntireRowWhenMovingToOtherRow [protected] |
true, if this entire (visible) row should be updated when boving to other row. False by default. For table view with 'row highlighting' flag enabled, it is true.
Definition at line 670 of file kexidataawareobjectiface.h.
- Todo:
- make generic interface out of KexiRecordMarker
Definition at line 675 of file kexidataawareobjectiface.h.
bool KexiDataAwareObjectInterface::m_verticalHeaderAlreadyAdded [protected] |
true, if certical header shouldn't be increased in KexiTableView::slotRowInserted() because it was already done in KexiTableView::createEditor().
Definition at line 688 of file kexidataawareobjectiface.h.
The documentation for this class was generated from the following files: