KexiDataItemInterface Class Reference
#include <kexidataiteminterface.h>
Inheritance diagram for KexiDataItemInterface:

Detailed Description
An interface for declaring widgets to be data-aware.
Definition at line 51 of file kexidataiteminterface.h.
Public Member Functions | |
| KexiDataItemInterface () | |
| virtual | ~KexiDataItemInterface () |
| void | setValue (const QVariant &value, const QVariant &add=QVariant(), bool removeOld=false, const QVariant *visibleValue=0) |
| virtual KexiDB::Field * | field () const =0 |
| virtual KexiDB::QueryColumnInfo * | columnInfo () const =0 |
| virtual void | setColumnInfo (KexiDB::QueryColumnInfo *cinfo)=0 |
| Used internally to set column information. | |
| virtual void | installListener (KexiDataItemChangesListener *listener) |
| Sets listener. No need to reimplement this. | |
| virtual QVariant | value ()=0 |
| virtual bool | valueIsValid () |
| virtual bool | valueIsNull ()=0 |
| virtual bool | valueIsEmpty ()=0 |
| virtual QVariant | visibleValue () |
| virtual bool | isReadOnly () const |
| virtual QWidget * | widget ()=0 |
| virtual void | hideWidget () |
| virtual void | showWidget () |
| virtual bool | valueChanged () |
| virtual bool | cursorAtStart ()=0 |
| virtual bool | cursorAtEnd ()=0 |
| virtual void | moveCursorToEnd () |
| virtual void | moveCursorToStart () |
| virtual void | selectAll () |
| virtual void | clear ()=0 |
| clears item's data, so the data will contain NULL data | |
| bool | hasFocusableWidget () const |
| virtual void | showFocus (const QRect &r, bool readOnly) |
| virtual void | hideFocus () |
| virtual void | clickedOnContents () |
| bool | acceptEditorAfterDeleteContents () const |
| virtual void | setFocus () |
| bool | cursorAtNewRow () |
| void | setParentDataItemInterface (KexiDataItemInterface *parentDataItemInterface) |
| KexiDataItemInterface * | parentInterface () const |
| virtual void | handleAction (const QString &actionName) |
Protected Member Functions | |
| virtual void | setValueInternal (const QVariant &add, bool removeOld)=0 |
| virtual void | setVisibleValueInternal (const QVariant &value) |
| virtual void | signalValueChanged () |
| virtual void | beforeSignalValueChanged () |
| KexiDataItemChangesListener * | listener () |
Protected Attributes | |
| QGuardedPtr< QObject > | m_listenerObject |
| KexiDataItemChangesListener * | m_listener |
| bool | m_listenerIsQObject |
| QVariant | m_origValue |
| KexiDataItemInterface * | m_parentDataItemInterface |
| bool | m_hasFocusableWidget: 1 |
| bool | m_disable_signalValueChanged: 1 |
| bool | m_acceptEditorAfterDeleteContents: 1 |
Constructor & Destructor Documentation
|
|
Definition at line 34 of file kexidataiteminterface.cpp. |
|
|
Definition at line 44 of file kexidataiteminterface.cpp. |
Member Function Documentation
|
|
Definition at line 184 of file kexidataiteminterface.h. |
|
|
Used to perform some actions before signalValueChanged() call. We need this because the intrface is not QObject and thus has got no real signals. Used in KexiDBComboBox. Reimplemented in KexiDBComboBox. Definition at line 232 of file kexidataiteminterface.h. Referenced by signalValueChanged(). |
|
|
clears item's data, so the data will contain NULL data
Implemented in KexiDBAutoField, KexiDBCheckBox, KexiDBDateEdit, KexiDBDateTimeEdit, KexiDBDoubleSpinBox, KexiDBForm, KexiDBImageBox, KexiDBIntSpinBox, KexiDBLabel, KexiDBLineEdit, KexiDBTextEdit, KexiDBTimeEdit, KexiBlobTableEdit, KexiKIconTableEdit, KexiBoolTableEdit, KexiComboBoxTableEdit, and KexiInputTableEdit. Referenced by KexiDBAutoField::clear(), and KexiDBFactory::clearWidgetContent(). |
|
|
Allows to define reaction for clicking on cell's contents. Currently it's used for editor of type boolean, where we want to toggle true/false on single mouse click.
Reimplemented in KexiBoolTableEdit. Definition at line 129 of file kexidataiteminterface.cpp. Referenced by KexiDataAwareObjectInterface::boolToggled(). |
|
|
Implemented in KexiFormDataItemInterface, and KexiTableEdit. Referenced by KexiDataAwareObjectInterface::acceptEditor(), and KexiFormDataItemInterface::visibleColumnInfo(). |
|
|
Implemented in KexiDBAutoField, KexiDBCheckBox, KexiDBDateEdit, KexiDBDateTimeEdit, KexiDBDoubleSpinBox, KexiDBForm, KexiDBImageBox, KexiDBIntSpinBox, KexiDBLabel, KexiDBLineEdit, KexiDBTextEdit, KexiDBTimeEdit, KexiBlobTableEdit, KexiKIconTableEdit, KexiBoolTableEdit, and KexiInputTableEdit. Referenced by KexiDBAutoField::cursorAtEnd(). |
|
|
Definition at line 143 of file kexidataiteminterface.cpp. References listener(). Referenced by KexiDBTextWidgetInterface::paint(). |
|
|
Implemented in KexiDBAutoField, KexiDBCheckBox, KexiDBDateEdit, KexiDBDateTimeEdit, KexiDBDoubleSpinBox, KexiDBForm, KexiDBImageBox, KexiDBIntSpinBox, KexiDBLabel, KexiDBLineEdit, KexiDBTextEdit, KexiDBTimeEdit, KexiBlobTableEdit, KexiKIconTableEdit, KexiBoolTableEdit, and KexiInputTableEdit. Referenced by KexiDBAutoField::cursorAtStart(). |
|
|
Implemented in KexiFormDataItemInterface, KexiDBComboBox, KexiComboBoxTableEdit, and KexiTableEdit. Referenced by KexiDataAwareObjectInterface::acceptEditor(). |
|
|
Handles action having standard name actionName. Action could be: "edit_cut", "edit_paste", etc. For reimplementation. Reimplemented in KexiDBLineEdit, KexiBlobTableEdit, KexiBoolTableEdit, KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, KexiInputTableEdit, and KexiTimeTableEdit. Definition at line 204 of file kexidataiteminterface.h. Referenced by KexiTableView::cutSelection(), and KexiTableView::paste(). |
|
|
Definition at line 160 of file kexidataiteminterface.h. Referenced by KexiDataAwareObjectInterface::acceptEditor(), KexiTableView::createEditor(), and KexiTableView::paintCell(). |
|
|
Hides additional elements that are needed for indicating that the current cell is selected. For reimplementation. By default does nothing. Reimplemented in KexiBlobTableEdit, and KexiComboBoxTableEdit. Definition at line 125 of file kexidataiteminterface.cpp. Referenced by KexiDataAwareObjectInterface::reloadData(), and KexiDataAwareObjectInterface::setCursorPosition(). |
|
|
Hides item's widget, if available. Reimplemented in KexiFormDataItemInterface, and KexiTableEdit. Definition at line 123 of file kexidataiteminterface.h. Referenced by KexiDataAwareObjectInterface::removeEditor(). |
|
|
Sets listener. No need to reimplement this.
Reimplemented in KexiDBAutoField. Definition at line 111 of file kexidataiteminterface.cpp. References m_listener, m_listenerIsQObject, and m_listenerObject. Referenced by KexiDBAutoField::installListener(), and KexiFormDataProvider::setMainDataSourceWidget(). |
|
|
|
Definition at line 102 of file kexidataiteminterface.cpp. References m_listener, m_listenerIsQObject, and m_listenerObject. Referenced by cursorAtNewRow(). |
|
|
Moves cursor after the last character (or element). For implementation in items supporting text cursor's movement; by default does nothing. Reimplemented in KexiDBAutoField, KexiDBLineEdit, KexiDBTextEdit, KexiComboBoxTableEdit, and KexiInputTableEdit. Definition at line 143 of file kexidataiteminterface.h. Referenced by KexiDBAutoField::moveCursorToEnd(). |
|
|
Moves cursor before the first character (or element). For implementation in items supporting text cursor's movement; by default does nothing. Reimplemented in KexiDBAutoField, KexiDBLineEdit, KexiDBTextEdit, KexiComboBoxTableEdit, and KexiInputTableEdit. Definition at line 147 of file kexidataiteminterface.h. Referenced by KexiDBAutoField::moveCursorToStart(). |
|
|
Definition at line 199 of file kexidataiteminterface.h. Referenced by KexiDBForm::eventFilter(), and KexiFormDataProvider::setMainDataSourceWidget(). |
|
|
Selects all characters (or elements) of the item. For implementation in items supporting text or elements; by default does nothing. Reimplemented in KexiDBAutoField, KexiDBLineEdit, KexiDBTextEdit, KexiComboBoxTableEdit, and KexiInputTableEdit. Definition at line 151 of file kexidataiteminterface.h. Referenced by KexiDBAutoField::selectAll(). |
|
|
Used internally to set column information.
Implemented in KexiFormDataItemInterface, KexiDBAutoField, KexiDBComboBox, KexiDBImageBox, KexiDBLabel, KexiDBLineEdit, KexiDBTextEdit, and KexiTableEdit. |
|
|
Definition at line 186 of file kexidataiteminterface.h. Referenced by KexiDataAwareObjectInterface::acceptEditor(), KexiDataAwareObjectInterface::addNewRecordRequested(), and KexiTableView::createEditor(). |
|
|
Sets a pointer to a Parent Data Item Interface. This pointer is 0 by default, but can be set by parent widget if this interface is a building block of a larger data widget. It is the case for KexiDBFieldEdit widget (see KexiDBFieldEdit::createEditor()). Use with care. signalValueChanged() method will check this pointer, and if it's not 0, m_parentDataItemInterface->signalValueChanged() is called, so a changes can be signalled at higher level. Definition at line 138 of file kexidataiteminterface.cpp. References m_parentDataItemInterface. |
|
||||||||||||||||||||
|
Just initializes value, and calls setValueInternal(const QString& add, bool removeOld). If removeOld is true, current value is set up as add. If removeOld if false, current value is set up as value + add. value is stored as 'old value' -it'd be usable in the future (e.g. Combo Box editor can use old value if current value does not match any item on the list). visibleValue (if not NULL) is passed to provide visible value to display instead of value. This is currently used only in case of the combo box form widget, where displayed content (usually a text of image) differs from the value of the widget (a numeric index). This method is called by table view's and form's editors. Definition at line 48 of file kexidataiteminterface.cpp. References m_disable_signalValueChanged, m_origValue, setValueInternal(), and setVisibleValueInternal(). Referenced by KexiTableView::createEditor(), KexiFormDataProvider::fillDataItems(), KexiDBComboBox::setValueInInternalEditor(), KexiDBAutoField::setValueInternal(), and KexiDBComboBox::setVisibleValueInternal(). |
|
||||||||||||
|
Initializes this editor with add value, which should be somewhat added to the current value (already storted in m_origValue). If removeOld is true, a value should be set to add, otherwise -it should be set to current m_origValue + add, if possible. Implement this. Implemented in KexiDBAutoField, KexiDBCheckBox, KexiDBComboBox, KexiDBDateEdit, KexiDBDateTimeEdit, KexiDBDoubleSpinBox, KexiDBForm, KexiDBImageBox, KexiDBIntSpinBox, KexiDBLabel, KexiDBLineEdit, KexiDBTextEdit, KexiDBTimeEdit, KexiBlobTableEdit, KexiKIconTableEdit, KexiBoolTableEdit, KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, KexiInputTableEdit, and KexiTimeTableEdit. Referenced by setValue(), KexiDBImageBox::setValueInternal(), and KexiFormDataItemInterface::undoChanges(). |
|
|
Initializes this editor with value visible value. This is currently used only in case of the combo box form widget, where displayed content (usually a text of image) differs from the value of the widget (a numeric index). For implementation in the combo box widget, by default does nothing. Reimplemented in KexiDBComboBox. Definition at line 66 of file kexidataiteminterface.cpp. Referenced by setValue(). |
|
||||||||||||
|
Displays additional elements that are needed for indicating that the current cell is selected. For example, combobox editor (KexiComboBoxTableEdit) moves and shows dropdown button. r is the rectangle for the cell. If readOnly is true, additional elements should be visually disabled, e.g. dropdown button of the combobox editor should be disabled. For reimplementation. By default does nothing. Reimplemented in KexiBlobTableEdit, and KexiComboBoxTableEdit. Definition at line 119 of file kexidataiteminterface.cpp. Referenced by KexiTableView::editorShowFocus(). |
|
|
Shows item's widget, if available. Reimplemented in KexiFormDataItemInterface, and KexiTableEdit. Definition at line 126 of file kexidataiteminterface.h. Referenced by KexiDataAwareObjectInterface::acceptEditor(). |
|
|
Call this in your implementation when value changes, so installed listener can react on this change. If there is a parent data item defined (see setParentDataItemInterface()), parent's signalValueChanged() method will be called instead. Definition at line 71 of file kexidataiteminterface.cpp. References beforeSignalValueChanged(), isReadOnly(), m_disable_signalValueChanged, m_listener, m_parentDataItemInterface, and signalValueChanged(). Referenced by KexiDBComboBox::acceptRequested(), KexiDBImageBox::clear(), KexiDBImageBox::handleInsertFromFileAction(), KexiDBImageBox::handlePasteAction(), signalValueChanged(), KexiDBCheckBox::slotStateChanged(), KexiDBTextEdit::slotTextChanged(), KexiDBLineEdit::slotTextChanged(), KexiDBIntSpinBox::slotValueChanged(), and KexiDBDoubleSpinBox::slotValueChanged(). |
|
|
Implemented in KexiDBAutoField, KexiDBCheckBox, KexiDBComboBox, KexiDBDateEdit, KexiDBDateTimeEdit, KexiDBDoubleSpinBox, KexiDBForm, KexiDBImageBox, KexiDBIntSpinBox, KexiDBLabel, KexiDBLineEdit, KexiDBTextEdit, KexiDBTimeEdit, KexiBlobTableEdit, KexiKIconTableEdit, KexiBoolTableEdit, KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, KexiInputTableEdit, and KexiTimeTableEdit. Referenced by KexiDataAwareObjectInterface::acceptEditor(), KexiDBComboBox::beforeSignalValueChanged(), KexiTableView::paintCell(), KexiDBAutoField::value(), KexiFormScrollView::valueChanged(), and valueChanged(). |
|
|
Reimplemented in KexiDBAutoField, KexiDBComboBox, KexiComboBoxTableEdit, and KexiInputTableEdit. Definition at line 85 of file kexidataiteminterface.cpp. References m_origValue, and value(). Referenced by KexiDataAwareObjectInterface::acceptEditor(), KexiDBDateEdit::KexiDBDateEdit(), KexiDBDateTimeEdit::KexiDBDateTimeEdit(), KexiDBDoubleSpinBox::KexiDBDoubleSpinBox(), KexiDBIntSpinBox::KexiDBIntSpinBox(), KexiDBTimeEdit::KexiDBTimeEdit(), KexiDBLabel::setText(), KexiInputTableEdit::valueChanged(), and KexiDBAutoField::valueChanged(). |
|
|
Implemented in KexiDBAutoField, KexiDBCheckBox, KexiDBDateEdit, KexiDBDateTimeEdit, KexiDBDoubleSpinBox, KexiDBForm, KexiDBImageBox, KexiDBIntSpinBox, KexiDBLabel, KexiDBLineEdit, KexiDBTextEdit, KexiDBTimeEdit, KexiBlobTableEdit, KexiKIconTableEdit, KexiBoolTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, KexiInputTableEdit, and KexiTimeTableEdit. Referenced by KexiDataAwareObjectInterface::acceptEditor(), and KexiDBAutoField::valueIsEmpty(). |
|
|
Implemented in KexiDBAutoField, KexiDBCheckBox, KexiDBDateEdit, KexiDBDateTimeEdit, KexiDBDoubleSpinBox, KexiDBForm, KexiDBImageBox, KexiDBIntSpinBox, KexiDBLabel, KexiDBLineEdit, KexiDBTextEdit, KexiDBTimeEdit, KexiBlobTableEdit, KexiKIconTableEdit, KexiBoolTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, KexiInputTableEdit, and KexiTimeTableEdit. Referenced by KexiDataAwareObjectInterface::acceptEditor(), and KexiDBAutoField::valueIsNull(). |
|
|
Reimplemented in KexiDBAutoField, KexiDBLineEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit. Definition at line 133 of file kexidataiteminterface.cpp. Referenced by KexiDataAwareObjectInterface::acceptEditor(), and KexiDBAutoField::valueIsValid(). |
|
|
Reimplemented in KexiDBComboBox, and KexiComboBoxTableEdit. Definition at line 112 of file kexidataiteminterface.h. Referenced by KexiDataAwareObjectInterface::acceptEditor(). |
|
|
Implemented in KexiFormDataItemInterface, KexiDBCheckBox, KexiDBDateEdit, KexiDBDateTimeEdit, KexiDBDoubleSpinBox, KexiDBForm, KexiDBImageBox, KexiDBIntSpinBox, KexiDBLabel, KexiDBLineEdit, KexiDBTextEdit, KexiDBTimeEdit, and KexiTableEdit. |
Member Data Documentation
|
|
Definition at line 246 of file kexidataiteminterface.h. Referenced by KexiBoolTableEdit::KexiBoolTableEdit(). |
|
|
Definition at line 245 of file kexidataiteminterface.h. Referenced by setValue(), and signalValueChanged(). |
|
|
Definition at line 244 of file kexidataiteminterface.h. Referenced by KexiDBLabel::init(), KexiKIconTableEdit::init(), KexiBlobTableEdit::KexiBlobTableEdit(), KexiBoolTableEdit::KexiBoolTableEdit(), and KexiDBForm::KexiDBForm(). |
|
|
Definition at line 238 of file kexidataiteminterface.h. Referenced by installListener(), listener(), and signalValueChanged(). |
|
|
Definition at line 239 of file kexidataiteminterface.h. Referenced by installListener(), and listener(). |
|
|
Definition at line 237 of file kexidataiteminterface.h. Referenced by installListener(), and listener(). |
|
|
|
Definition at line 243 of file kexidataiteminterface.h. Referenced by setParentDataItemInterface(), and signalValueChanged(). |
The documentation for this class was generated from the following files:
