#include <kexitableviewdata.h>
|
| typedef TQPtrListIterator< KexiTableItem > | Iterator |
|
|
void | destroying () |
| void | aboutToChangeCell (KexiTableItem *item, int colnum, TQVariant &newValue, KexiDB::ResultInfo *result) |
| void | aboutToInsertRow (KexiTableItem *item, KexiDB::ResultInfo *result, bool repaint) |
| void | aboutToUpdateRow (KexiTableItem *item, KexiDB::RowEditBuffer *buffer, KexiDB::ResultInfo *result) |
| void | rowUpdated (KexiTableItem *) |
| void | rowInserted (KexiTableItem *, bool repaint) |
| void | rowInserted (KexiTableItem *, uint index, bool repaint) |
| void | aboutToDeleteRow (KexiTableItem &item, KexiDB::ResultInfo *result, bool repaint) |
| void | rowDeleted () |
| void | rowsDeleted (const TQValueList< int > &rowsToDelete) |
| void | reloadRequested () |
|
void | rowRepaintRequested (KexiTableItem &) |
|
| | KexiTableViewData () |
| | KexiTableViewData (KexiDB::Cursor *c) |
| | KexiTableViewData (const TQValueList< TQVariant > &keys, const TQValueList< TQVariant > &values, KexiDB::Field::Type keyType=KexiDB::Field::Text, KexiDB::Field::Type valueType=KexiDB::Field::Text) |
| | KexiTableViewData (KexiDB::Field::Type keyType, KexiDB::Field::Type valueType) |
| void | preloadAllRows () |
| void | setSorting (int column, bool ascending=true) |
| int | sortedColumn () const |
| int | sortingOrder () const |
| void | addColumn (KexiTableViewColumn *col) |
| int | globalColumnID (int visibleID) |
| int | visibleColumnID (int globalID) |
| bool | isDBAware () |
| TQString | dbTableName () const |
| KexiDB::Cursor * | cursor () const |
| uint | columnsCount () const |
| KexiTableViewColumn * | column (uint c) |
| virtual bool | isReadOnly () const |
| virtual void | setReadOnly (bool set) |
| virtual bool | isInsertingEnabled () const |
| virtual void | setInsertingEnabled (bool set) |
| void | clearRowEditBuffer () |
| bool | updateRowEditBufferRef (KexiTableItem *item, int colnum, KexiTableViewColumn *col, TQVariant &newval, bool allowSignals=true, TQVariant *visibleValueForLookupField=0) |
| bool | updateRowEditBuffer (KexiTableItem *item, int colnum, KexiTableViewColumn *col, TQVariant newval, bool allowSignals=true) |
| bool | updateRowEditBuffer (KexiTableItem *item, int colnum, TQVariant newval, bool allowSignals=true) |
| KexiDB::RowEditBuffer * | rowEditBuffer () const |
| KexiDB::ResultInfo * | result () |
| bool | saveRowChanges (KexiTableItem &item, bool repaint=false) |
| bool | saveNewRow (KexiTableItem &item, bool repaint=false) |
| bool | deleteRow (KexiTableItem &item, bool repaint=false) |
| void | deleteRows (const TQValueList< int > &rowsToDelete, bool repaint=false) |
| virtual bool | deleteAllRows (bool repaint=false) |
| virtual void | clearInternal () |
| void | insertRow (KexiTableItem &item, uint index, bool repaint=false) |
| int | autoIncrementedColumn () |
| void | reload () |
| KexiTableItem * | at (uint index) |
| virtual uint | count () const |
| bool | isEmpty () const |
| KexiTableItem * | first () |
| KexiTableItem * | last () |
| int | findRef (const KexiTableItem *item) |
| void | sort () |
| bool | removeFirst () |
| bool | removeLast () |
| void | append (const KexiTableItem *item) |
| void | prepend (const KexiTableItem *item) |
| Iterator | iterator () |
| Iterator * | createIterator () |
| bool | containsROWIDInfo () const |
| KexiTableItem * | createItem () const |
|
| void | init () |
| void | init (const TQValueList< TQVariant > &keys, const TQValueList< TQVariant > &values, KexiDB::Field::Type keyType, KexiDB::Field::Type valueType) |
| virtual int | compareItems (Item item1, Item item2) |
| int | cmpStr (Item item1, Item item2) |
| int | cmpInt (Item item1, Item item2) |
| int | cmpUInt (Item item1, Item item2) |
| int | cmpLongLong (Item item1, Item item2) |
| int | cmpULongLong (Item item1, Item item2) |
| int | cmpDouble (Item item1, Item item2) |
| int | cmpDate (Item item1, Item item2) |
| int | cmpDateTime (Item item1, Item item2) |
| int | cmpTime (Item item1, Item item2) |
| int | cmpBLOB (Item item1, Item item2) |
| bool | saveRow (KexiTableItem &item, bool insert, bool repaint) |
Reimplements TQPtrList to allow configurable sorting and more. Original author: Till Busch. Reimplemented by Jaroslaw Staniek.
Definition at line 222 of file kexitableviewdata.h.
◆ Iterator
| typedef TQPtrListIterator<KexiTableItem> KexiTableViewData::Iterator |
◆ KexiTableViewData() [1/4]
| KexiTableViewData::KexiTableViewData |
( |
| ) |
|
◆ KexiTableViewData() [2/4]
◆ KexiTableViewData() [3/4]
Defines two-column table usually used with comboboxes. First column is invisible and contains key values. Second column and contains user-visible value. - Parameters
-
| keys | a list of keys |
| values | a list of text values (must be of the same length as keys list) |
| keyType | a type for keys |
| valueType | a type for values |
Definition at line 284 of file kexitableviewdata.cpp.
◆ KexiTableViewData() [4/4]
Like above constructor, but keys and values are not provided. You can do this later by calling append(KexiTableItem*) method. (KexiTableItem object must have exactly two columns)
Definition at line 293 of file kexitableviewdata.cpp.
◆ ~KexiTableViewData()
| KexiTableViewData::~KexiTableViewData |
( |
| ) |
|
|
virtual |
◆ aboutToChangeCell
| void KexiTableViewData::aboutToChangeCell |
( |
KexiTableItem * | item, |
|
|
int | colnum, |
|
|
TQVariant & | newValue, |
|
|
KexiDB::ResultInfo * | result ) |
|
signal |
Emitted before change of the single, currently edited cell. Connect this signal to your slot and set result->success to false to disallow this change. You can also change newValue to other value, or change other columns in item row.
◆ aboutToDeleteRow
| void KexiTableViewData::aboutToDeleteRow |
( |
KexiTableItem & | item, |
|
|
KexiDB::ResultInfo * | result, |
|
|
bool | repaint ) |
|
signal |
Emited before deleting of a current row. Connect this signal to your slot and set result->success to false to disallow this deleting.
◆ aboutToInsertRow
| void KexiTableViewData::aboutToInsertRow |
( |
KexiTableItem * | item, |
|
|
KexiDB::ResultInfo * | result, |
|
|
bool | repaint ) |
|
signal |
Emited before inserting of a new, current row. Connect this signal to your slot and set result->success to false to disallow this inserting. You can also change columns in item row.
◆ aboutToUpdateRow
Emited before changing of an edited, current row. Connect this signal to your slot and set result->success to false to disallow this change. You can also change columns in item row.
◆ addColumn()
Adds column col. Warning: col will be owned by this object, and deleted on its destruction.
Definition at line 361 of file kexitableviewdata.cpp.
◆ append()
| void KexiTableViewData::append |
( |
const KexiTableItem * | item | ) |
|
|
inline |
◆ at()
| KexiTableItem * KexiTableViewData::at |
( |
uint | index | ) |
|
|
inline |
◆ autoIncrementedColumn()
| int KexiTableViewData::autoIncrementedColumn |
( |
| ) |
|
- Returns
- index of autoincremented column. The result is cached.
- Todo
what about multiple autoinc columns?
what about changing column order?
Definition at line 845 of file kexitableviewdata.cpp.
◆ clearInternal()
| void KexiTableViewData::clearInternal |
( |
| ) |
|
|
virtual |
◆ clearRowEditBuffer()
| void KexiTableViewData::clearRowEditBuffer |
( |
| ) |
|
◆ cmpBLOB()
| int KexiTableViewData::cmpBLOB |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protected |
Compare function for BLOB data (TQByteArray). Uses size as the weight.
Definition at line 547 of file kexitableviewdata.cpp.
◆ cmpDate()
| int KexiTableViewData::cmpDate |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protected |
◆ cmpDateTime()
| int KexiTableViewData::cmpDateTime |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protected |
◆ cmpDouble()
| int KexiTableViewData::cmpDouble |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protected |
◆ cmpInt()
| int KexiTableViewData::cmpInt |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protected |
◆ cmpLongLong()
| int KexiTableViewData::cmpLongLong |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protected |
◆ cmpStr()
| int KexiTableViewData::cmpStr |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protected |
◆ cmpTime()
| int KexiTableViewData::cmpTime |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protected |
◆ cmpUInt()
| int KexiTableViewData::cmpUInt |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protected |
◆ cmpULongLong()
| int KexiTableViewData::cmpULongLong |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protected |
◆ column()
◆ columnsCount()
| uint KexiTableViewData::columnsCount |
( |
| ) |
const |
|
inline |
◆ compareItems()
| int KexiTableViewData::compareItems |
( |
Item | item1, |
|
|
Item | item2 ) |
|
protectedvirtual |
◆ containsROWIDInfo()
| bool KexiTableViewData::containsROWIDInfo |
( |
| ) |
const |
|
inline |
- Returns
- true if ROWID information is stored within every row. Only reasonable for db-aware version. ROWID information is available if DriverBehaviour::ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE == false for a KexiDB database driver and a table has no primary key defined. Phisically, ROWID information is stored after last KexiTableItem's element, so every KexiTableItem's length is expanded by one.
Definition at line 426 of file kexitableviewdata.h.
◆ count()
| virtual uint KexiTableViewData::count |
( |
| ) |
const |
|
inlinevirtual |
◆ createItem()
| KexiTableItem * KexiTableViewData::createItem |
( |
| ) |
const |
|
inline |
◆ createIterator()
| Iterator * KexiTableViewData::createIterator |
( |
| ) |
|
|
inline |
◆ cursor()
◆ dbTableName()
| TQString KexiTableViewData::dbTableName |
( |
| ) |
const |
For db-aware data set only: table name is returned; equivalent to cursor()->query()->parentTable()->name().
Definition at line 389 of file kexitableviewdata.cpp.
◆ deleteAllRows()
| bool KexiTableViewData::deleteAllRows |
( |
bool | repaint = false | ) |
|
|
virtual |
Deletes all rows. Works either for db-aware and non db-aware tables. Column's definition is not changed. For db-aware version, all rows are removed from a database. Row-edit buffer is cleared.
If repaint is true, reloadRequested() signal is emitted after deleting (if at least one row was deleted), so presenters can repaint their contents.
- Returns
- true on success.
Definition at line 830 of file kexitableviewdata.cpp.
◆ deleteLater
| void KexiTableViewData::deleteLater |
( |
| ) |
|
|
slot |
◆ deleteRow()
| bool KexiTableViewData::deleteRow |
( |
KexiTableItem & | item, |
|
|
bool | repaint = false ) |
◆ deleteRows()
| void KexiTableViewData::deleteRows |
( |
const TQValueList< int > & | rowsToDelete, |
|
|
bool | repaint = false ) |
Deletes rows (by number) passed with rowsToDelete. Currently, this method is only for non data-aware tables.
Definition at line 787 of file kexitableviewdata.cpp.
◆ findRef()
| int KexiTableViewData::findRef |
( |
const KexiTableItem * | item | ) |
|
|
inline |
◆ first()
| KexiTableItem * KexiTableViewData::first |
( |
| ) |
|
|
inline |
◆ globalColumnID()
| int KexiTableViewData::globalColumnID |
( |
int | visibleID | ) |
|
|
inline |
◆ init() [1/2]
| void KexiTableViewData::init |
( |
| ) |
|
|
protected |
◆ init() [2/2]
◆ insertRow()
| void KexiTableViewData::insertRow |
( |
KexiTableItem & | item, |
|
|
uint | index, |
|
|
bool | repaint = false ) |
Inserts new item at index index. item will be owned by this data object. Note: Reasonable only for not not-db-aware version.
Definition at line 807 of file kexitableviewdata.cpp.
◆ isDBAware()
| bool KexiTableViewData::isDBAware |
( |
| ) |
|
|
inline |
◆ isEmpty()
| bool KexiTableViewData::isEmpty |
( |
| ) |
const |
|
inline |
◆ isInsertingEnabled()
| virtual bool KexiTableViewData::isInsertingEnabled |
( |
| ) |
const |
|
inlinevirtual |
◆ isReadOnly()
| bool KexiTableViewData::isReadOnly |
( |
| ) |
const |
|
virtual |
- Returns
- true if data is not editable. Can be set using setReadOnly() but it's still true if database cursor returned by cursor() is not 0 and has read-only connection.
Definition at line 881 of file kexitableviewdata.cpp.
◆ iterator()
| Iterator KexiTableViewData::iterator |
( |
| ) |
|
|
inline |
◆ last()
| KexiTableItem * KexiTableViewData::last |
( |
| ) |
|
|
inline |
◆ preloadAllRows()
| void KexiTableViewData::preloadAllRows |
( |
| ) |
|
Preloads all rows provided by cursor (only for db-aware version). - Todo
- change to bool and return false on error!
Definition at line 861 of file kexitableviewdata.cpp.
◆ prepend()
| void KexiTableViewData::prepend |
( |
const KexiTableItem * | item | ) |
|
|
inline |
◆ reload()
| void KexiTableViewData::reload |
( |
| ) |
|
|
inline |
◆ reloadRequested
| void KexiTableViewData::reloadRequested |
( |
| ) |
|
|
signal |
Displayed data needs to be reloaded in all presenters.
◆ removeFirst()
| bool KexiTableViewData::removeFirst |
( |
| ) |
|
|
inline |
◆ removeLast()
| bool KexiTableViewData::removeLast |
( |
| ) |
|
|
inline |
◆ result()
- Returns
- last operation's result information (always not null).
Definition at line 360 of file kexitableviewdata.h.
◆ rowDeleted
| void KexiTableViewData::rowDeleted |
( |
| ) |
|
|
signal |
Current row has been deleted.
◆ rowEditBuffer()
◆ rowInserted [1/2]
| void KexiTableViewData::rowInserted |
( |
KexiTableItem * | , |
|
|
bool | repaint ) |
|
signal |
◆ rowInserted [2/2]
| void KexiTableViewData::rowInserted |
( |
KexiTableItem * | , |
|
|
uint | index, |
|
|
bool | repaint ) |
|
signal |
A row has been inserted at index position (not db-aware data only).
◆ rowsDeleted
| void KexiTableViewData::rowsDeleted |
( |
const TQValueList< int > & | rowsToDelete | ) |
|
|
signal |
◆ rowUpdated
| void KexiTableViewData::rowUpdated |
( |
KexiTableItem * | | ) |
|
|
signal |
Current row has been updated.
◆ saveNewRow()
| bool KexiTableViewData::saveNewRow |
( |
KexiTableItem & | item, |
|
|
bool | repaint = false ) |
◆ saveRow()
| bool KexiTableViewData::saveRow |
( |
KexiTableItem & | item, |
|
|
bool | insert, |
|
|
bool | repaint ) |
|
protected |
internal: for saveRowChanges() and saveNewRow()
- Todo
- if there're multiple views for this data, we need multiple buffers!
- Todo
- set m_result.column if possible
Definition at line 638 of file kexitableviewdata.cpp.
◆ saveRowChanges()
| bool KexiTableViewData::saveRowChanges |
( |
KexiTableItem & | item, |
|
|
bool | repaint = false ) |
◆ setInsertingEnabled()
| void KexiTableViewData::setInsertingEnabled |
( |
bool | set | ) |
|
|
virtual |
Sets insertingEnabled flag. If true, empty row is available If set is true, read-only flag will be cleared automatically. - See also
- setReadOnly()
Definition at line 562 of file kexitableviewdata.cpp.
◆ setReadOnly()
| void KexiTableViewData::setReadOnly |
( |
bool | set | ) |
|
|
virtual |
◆ setSorting()
| void KexiTableViewData::setSorting |
( |
int | column, |
|
|
bool | ascending = true ) |
Sets sorting for column. If column is -1, sorting is disabled.
TODO allow users to define BLOB sorting function?
Definition at line 396 of file kexitableviewdata.cpp.
◆ sort()
| void KexiTableViewData::sort |
( |
| ) |
|
|
inline |
◆ sortedColumn()
| int KexiTableViewData::sortedColumn |
( |
| ) |
const |
|
inline |
- Returns
- the column number by which the data is sorted, or -1 if sorting is disabled. In this case sortingOrder() will return 0. Initial sorted column number for data after instantiating object is -1.
Definition at line 269 of file kexitableviewdata.h.
◆ sortingOrder()
| int KexiTableViewData::sortingOrder |
( |
| ) |
const |
|
inline |
- Returns
- 1 if ascending sort order is set, -1 id descending sort order is set, or 0 if no sorting is set. This is independent of whether data is sorted now. Initial sorting for data after instantiating object is 0.
Definition at line 274 of file kexitableviewdata.h.
◆ updateRowEditBuffer() [1/2]
| bool KexiTableViewData::updateRowEditBuffer |
( |
KexiTableItem * | item, |
|
|
int | colnum, |
|
|
KexiTableViewColumn * | col, |
|
|
TQVariant | newval, |
|
|
bool | allowSignals = true ) |
|
inline |
Added for convenience. Like above but newval is passed by value.
Definition at line 341 of file kexitableviewdata.h.
◆ updateRowEditBuffer() [2/2]
| bool KexiTableViewData::updateRowEditBuffer |
( |
KexiTableItem * | item, |
|
|
int | colnum, |
|
|
TQVariant | newval, |
|
|
bool | allowSignals = true ) |
|
inline |
Added for convenience. Like above but it's assumed that item item's columns are ordered like in table view, not like in form view. Don't use this with form views.
Definition at line 350 of file kexitableviewdata.h.
◆ updateRowEditBufferRef()
| bool KexiTableViewData::updateRowEditBufferRef |
( |
KexiTableItem * | item, |
|
|
int | colnum, |
|
|
KexiTableViewColumn * | col, |
|
|
TQVariant & | newval, |
|
|
bool | allowSignals = true, |
|
|
TQVariant * | visibleValueForLookupField = 0 ) |
Updates internal row edit buffer: currently edited column col (number colnum) has now assigned new value of newval. Uses column's caption to address the column in buffer if the buffer is of simple type, or db-aware buffer if (isDBAware()==true). (then fields are addressed with KexiDB::Field, instead of caption strings). If allowSignals is true (the default), aboutToChangeCell() signal is emitted. visibleValueForLookupField allows to pass visible value (usually a text) for a lookup field (only reasonable if col->visibleLookupColumnInfo != 0). Note that newval may be changed in aboutToChangeCell() signal handler. - See also
- KexiDB::RowEditBuffer
Definition at line 580 of file kexitableviewdata.cpp.
◆ visibleColumnID()
| int KexiTableViewData::visibleColumnID |
( |
int | globalID | ) |
|
|
inline |
◆ charTable
| unsigned short KexiTableViewData::charTable |
|
staticprotected |
◆ cmpFunc
| int(KexiTableViewData::* KexiTableViewData::cmpFunc) (void *, void *) |
|
protected |
◆ columns
| KexiTableViewColumn::List KexiTableViewData::columns |
◆ m_autoIncrementedColumn
| int KexiTableViewData::m_autoIncrementedColumn |
|
protected |
◆ m_containsROWIDInfo
| bool KexiTableViewData::m_containsROWIDInfo |
|
protected |
◆ m_cursor
◆ m_globalColumnsIDs
| TQValueVector<int> KexiTableViewData::m_globalColumnsIDs |
|
protected |
◆ m_insertingEnabled
| bool KexiTableViewData::m_insertingEnabled |
|
protected |
◆ m_inside_acceptEditor
| bool KexiTableViewData::m_inside_acceptEditor |
|
protected |
Used in acceptEditor() to avoid infinite recursion, eg. when we're calling acceptRowEdit() during cell accepting phase.
Definition at line 527 of file kexitableviewdata.h.
◆ m_itemSize
| int KexiTableViewData::m_itemSize |
|
protected |
◆ m_leftTmp
| TQVariant KexiTableViewData::m_leftTmp |
|
protected |
Temporary, used in compare functions like cmpInt(), cmpString() to avoid memory allocations.
Definition at line 538 of file kexitableviewdata.h.
◆ m_order
| short KexiTableViewData::m_order |
|
protected |
◆ m_pRowEditBuffer
◆ m_readOnly
| bool KexiTableViewData::m_readOnly |
|
protected |
◆ m_realSortedColumn
| int KexiTableViewData::m_realSortedColumn |
|
protected |
◆ m_result
used to faster lookup columns of simple type (not dbaware)
Definition at line 517 of file kexitableviewdata.h.
◆ m_rightTmp
| TQVariant KexiTableViewData::m_rightTmp |
|
protected |
◆ m_sortedColumn
| int KexiTableViewData::m_sortedColumn |
|
protected |
◆ m_type
| short KexiTableViewData::m_type |
|
protected |
◆ m_visibleColumnsCount
| uint KexiTableViewData::m_visibleColumnsCount |
|
protected |
◆ m_visibleColumnsIDs
| TQValueVector<int> KexiTableViewData::m_visibleColumnsIDs |
|
protected |
The documentation for this class was generated from the following files:
|