KexiFormView Class Reference
#include <kexiformview.h>
Inheritance diagram for KexiFormView:

Detailed Description
The KexiFormView lass provides a data-driven (record-based) form view .The KexiFormView can display data provided "by hand" or from KexiDB-compatible database source.
This class provides a single view used inside KexiDialogBase. It takes care of saving/loading form, of enabling actions when needed. One KexiFormView object is instantiated for data view mode and a second KexiFormView object is instantiated for design view mode.
- See also:
- KexiDataTable
Definition at line 51 of file kexiformview.h.
Public Types | |
| enum | ResizeMode { ResizeAuto = 0, ResizeDefault = ResizeAuto, ResizeFixed = 1, NoResize = 2 } |
Public Slots | |
| virtual void | show () |
| void | insertAutoFields (const QString &sourceMimeType, const QString &sourceName, const QStringList &fields, const QPoint &pos=QPoint(-1,-1)) |
Public Member Functions | |
| KexiFormView (KexiMainWindow *mainWin, QWidget *parent, const char *name=0, bool dbAware=true) | |
| virtual | ~KexiFormView () |
| virtual QSize | preferredSizeHint (const QSize &otherSize) |
| int | resizeMode () const |
| KFormDesigner::Form * | form () const |
| void | setUnsavedLocalBLOB (QWidget *widget, KexiBLOBBuffer::Id_t id) |
Protected Slots | |
| void | slotPropertySetSwitched (KoProperty::Set *b, bool forceReload=false, const QCString &propertyToSelect=QCString()) |
| void | slotDirty (KFormDesigner::Form *f, bool isDirty) |
| void | slotFocus (bool in) |
| void | slotHandleDragMoveEvent (QDragMoveEvent *e) |
| void | slotHandleDropEvent (QDropEvent *e) |
| Handles field(s) dropping from the data source pane onto the form. | |
Protected Member Functions | |
| virtual tristate | beforeSwitchTo (int mode, bool &dontStore) |
| virtual tristate | afterSwitchFrom (int mode) |
| virtual KoProperty::Set * | propertySet () |
| virtual KexiDB::SchemaData * | storeNewData (const KexiDB::SchemaData &sdata, bool &cancel) |
| virtual tristate | storeData (bool dontAsk=false) |
| KexiFormPart::TempData * | tempData () const |
| KexiFormPart * | formPart () const |
| void | setForm (KFormDesigner::Form *f) |
| void | initForm () |
| void | loadForm () |
| void | updateAutoFieldsDataSource () |
| Used in loadForm(). | |
| void | updateValuesForSubproperties () |
| Used in loadForm(). | |
| virtual void | resizeEvent (QResizeEvent *) |
| void | initDataSource () |
| virtual void | setFocusInternal () |
| void | updateTabStopsOrder () |
| void | deleteQuery () |
| void | updateDataSourcePage () |
Protected Attributes | |
| KexiDBForm * | m_dbform |
| KexiFormScrollView * | m_scrollView |
| KoProperty::Set * | m_propertySet |
| QString | m_previousDataSourceString |
| int | m_resizeMode |
| KexiDB::QuerySchema * | m_query |
| bool | m_queryIsOwned |
| KexiDB::Cursor * | m_cursor |
| int | m_delayedFormContentsResizeOnShow |
| QGuardedPtr< QWidget > | m_setFocusInternalOnce |
| Used in setFocusInternal(). | |
| QRect | m_widgetGeometryForRecentInsertAutoFields |
| QMap< QWidget *, KexiBLOBBuffer::Id_t > | m_unsavedLocalBLOBs |
| Used in setUnsavedLocalBLOBs(). | |
Member Enumeration Documentation
|
|
Definition at line 56 of file kexiformview.h. |
Constructor & Destructor Documentation
|
||||||||||||||||||||
|
Definition at line 61 of file kexiformview.cpp. References Kexi::DataViewMode, Kexi::DesignViewMode, KexiViewBase::dirty(), KexiViewBase::focus(), KexiDataAwareView::init(), initForm(), m_dbform, m_delayedFormContentsResizeOnShow, m_scrollView, KexiActionProxy::plugSharedAction(), KexiViewBase::propertySetSwitched(), KexiScrollView::recordNavigator(), KFormDesigner::FormManager::self(), KexiViewBase::setAvailable(), KexiScrollView::setResizingEnabled(), KexiScrollView::setWidget(), slotDirty(), slotFocus(), slotHandleDragMoveEvent(), slotHandleDropEvent(), slotPropertySetSwitched(), and KexiViewBase::viewMode(). |
|
|
Definition at line 165 of file kexiformview.cpp. References KexiDB::Connection::deleteCursor(), deleteQuery(), m_cursor, m_propertySet, KexiViewBase::parentDialog(), and KexiViewBase::propertySetSwitched(). |
Member Function Documentation
|
|
Reimplemented from KexiViewBase. Definition at line 422 of file kexiformview.cpp. References KexiFormDataItemInterface::columnInfo(), KexiFormDataItemInterface::dataSource(), Kexi::DataViewMode, Kexi::DesignViewMode, form(), initDataSource(), initForm(), KexiDataItemInterface::isReadOnly(), kexipluginsdbg, m_dbform, m_query, m_scrollView, m_setFocusInternalOnce, KexiViewBase::mainWin(), KexiDBForm::orderedFocusWidgets(), KexiViewBase::parentDialog(), KexiScrollView::refreshContentsSizeLater(), KexiDataAwareObjectInterface::selectFirstRow(), SET_FOCUS_USING_REASON, KexiDBForm::setAutoTabStops(), KexiViewBase::setDirty(), KexiFormEventHandler::setMainWidgetForEventHandling(), KexiScrollView::setWidget(), tempData(), and KexiViewBase::viewMode(). |
|
||||||||||||
|
called by KexiDialogBase::switchToViewMode() right before dialog is switched to new mode By default does nothing. Reimplement this if you need to do something before switching to this view.
Reimplemented from KexiViewBase. Definition at line 394 of file kexiformview.cpp. References KexiDataAwareObjectInterface::acceptRowEdit(), KexiFormScrollView::beforeSwitchView(), cancelled, Kexi::DataViewMode, KexiViewBase::dirty(), form(), m_scrollView, KFormDesigner::FormIO::saveFormToString(), tempData(), KexiFormPart::TempData::tempForm, and KexiViewBase::viewMode(). |
|
|
Definition at line 182 of file kexiformview.cpp. References KexiDB::Connection::deleteCursor(), m_cursor, m_query, m_queryIsOwned, and KexiViewBase::parentDialog(). Referenced by initDataSource(), and ~KexiFormView(). |
|
|
Definition at line 199 of file kexiformview.cpp. References Kexi::DataViewMode, tempData(), and KexiViewBase::viewMode(). Referenced by afterSwitchFrom(), beforeSwitchTo(), initForm(), insertAutoFields(), loadForm(), slotDirty(), slotFocus(), slotPropertySetSwitched(), storeData(), updateAutoFieldsDataSource(), and updateValuesForSubproperties(). |
|
|
Definition at line 139 of file kexiformview.h. References KexiViewBase::part(). Referenced by initForm(), slotPropertySetSwitched(), and updateDataSourcePage(). |
|
|
|
||||||||||||||||||||
|
|
Definition at line 352 of file kexiformview.cpp. References KexiDBForm::autoTabStops, Kexi::DataViewMode, form(), kexipluginsdbg, KexiViewBase::loadDataBlock(), KFormDesigner::FormIO::loadFormFromString(), m_dbform, KexiViewBase::parentDialog(), tempData(), updateAutoFieldsDataSource(), updateValuesForSubproperties(), and KexiViewBase::viewMode(). Referenced by initForm(). |
|
|
Reimplemented from KexiViewBase. Definition at line 925 of file kexiformview.cpp. References m_dbform, m_scrollView, KexiViewBase::parentDialog(), KexiViewBase::preferredSizeHint(), and KexiFormScrollView::verticalScrollBar(). |
|
|
Reimplemented from KexiViewBase. Definition at line 132 of file kexiformview.h. Referenced by insertAutoFields(). |
|
|
Definition at line 939 of file kexiformview.cpp. References Kexi::DataViewMode, m_dbform, m_delayedFormContentsResizeOnShow, m_scrollView, KexiScrollView::refreshContentsSizeLater(), KexiScrollView::updateNavPanelGeometry(), and KexiViewBase::viewMode(). |
|
|
Definition at line 72 of file kexiformview.h. Referenced by show(), and KexiFormScrollView::show(). |
|
|
Reimplemented from KexiViewBase. Definition at line 956 of file kexiformview.cpp. References Kexi::DataViewMode, m_dbform, m_setFocusInternalOnce, SET_FOCUS_USING_REASON, and KexiViewBase::viewMode(). |
|
|
Definition at line 208 of file kexiformview.cpp. References Kexi::DataViewMode, tempData(), and KexiViewBase::viewMode(). Referenced by initForm(). |
|
||||||||||||
|
Assigns id local (static) BLOB's identifier for widget widget. Previously assigned BLOB will be usassigned. If id is 0, BLOB is unassigned and no new is assigned. This method is called when a widget supporting BLOB data (currently, images from KexiDBImageBox, within KexiDBFactory) has BLOB assigned by identifier id. BLOB identifiers are defined by KexiBLOBBuffer (KexiBLOBBuffer::self() instance). The data collected by this method is used on form's design saving (in design mode). Local BLOBs are retrieved KexiBLOBBuffer::self() and stored in "kexi__blobs" 'system' table. Note that db-aware BLOBs (non local) are not handled this way. Definition at line 1179 of file kexiformview.cpp. References m_unsavedLocalBLOBs. |
|
|
Reimplemented to update resize policy. Definition at line 975 of file kexiformview.cpp. References Kexi::DataViewMode, m_scrollView, ResizeAuto, resizeMode(), and KexiViewBase::viewMode(). |
|
||||||||||||
|
Definition at line 662 of file kexiformview.cpp. References form(), and KexiViewBase::setDirty(). Referenced by KexiFormView(). |
|
|
Definition at line 990 of file kexiformview.cpp. References form(), m_dbform, KFormDesigner::FormManager::self(), and updateDataSourcePage(). Referenced by KexiFormView(). |
|
|
Definition at line 1014 of file kexiformview.cpp. References KexiFieldDrag::canDecodeMultiple(). Referenced by KexiFormView(). |
|
|
Handles field(s) dropping from the data source pane onto the form.
Definition at line 1023 of file kexiformview.cpp. References KexiFieldDrag::canDecodeMultiple(), KexiFieldDrag::decodeMultiple(), and insertAutoFields(). Referenced by KexiFormView(). |
|
||||||||||||||||
|
Definition at line 379 of file kexiformview.cpp. References form(), formPart(), m_propertySet, KexiViewBase::propertySetReloaded(), KexiViewBase::propertySetSwitched(), and KFormDesigner::FormManager::self(). Referenced by KexiFormView(). |
|
|
||||||||||||
|
Tells this dialog to create and store data of the new object pointed by sdata on the backend. Called by KexiDialogBase::storeNewData(). Default implementation:
Reimplemented from KexiViewBase. Definition at line 669 of file kexiformview.cpp. References KexiDB::SchemaData::id(), kexipluginsdbg, KexiViewBase::parentDialog(), KexiDB::Connection::removeObject(), storeData(), and KexiViewBase::storeNewData(). |
|
|
Definition at line 137 of file kexiformview.h. References KexiViewBase::parentDialog(). Referenced by afterSwitchFrom(), beforeSwitchTo(), form(), loadForm(), setForm(), and storeData(). |
|
|
Used in loadForm().
Definition at line 288 of file kexiformview.cpp. References KexiDB::TableOrQuerySchema::columnInfo(), KexiDBAutoField::dataSource, KexiDBForm::dataSource, KexiDBForm::dataSourceMimeType, form(), m_dbform, KexiViewBase::parentDialog(), KexiDB::TableOrQuerySchema::query(), KexiDBAutoField::setColumnInfo(), and KexiDB::TableOrQuerySchema::table(). Referenced by loadForm(). |
|
|
Definition at line 999 of file kexiformview.cpp. References KFormDesigner::WidgetPropertySet::contains(), Kexi::DesignViewMode, formPart(), KFormDesigner::FormManager::self(), and KexiViewBase::viewMode(). Referenced by initForm(), and slotFocus(). |
|
|
Called after loading the form contents (before showing it). Also called when the form window (KexiDialogBase) is detached (in KMDI's Child Frame mode), because otherwise tabstop ordering can get broken. |
|
|
Used in loadForm().
Definition at line 317 of file kexiformview.cpp. References KexiDBForm::dataSource, KexiDBForm::dataSourceMimeType, form(), kexipluginsdbg, m_dbform, KexiViewBase::parentDialog(), KexiDB::TableOrQuerySchema::query(), KFormDesigner::WidgetWithSubpropertiesInterface::subwidget(), and KexiDB::TableOrQuerySchema::table(). Referenced by loadForm(). |
Member Data Documentation
|
|
Definition at line 204 of file kexiformview.h. Referenced by deleteQuery(), initDataSource(), and ~KexiFormView(). |
|
|
Reimplemented after KexiViewBase. Updates actions (e.g. availability). Definition at line 185 of file kexiformview.h. Referenced by afterSwitchFrom(), initDataSource(), initForm(), insertAutoFields(), KexiFormView(), loadForm(), preferredSizeHint(), resizeEvent(), setFocusInternal(), slotFocus(), updateAutoFieldsDataSource(), and updateValuesForSubproperties(). |
|
|
For new (empty) forms only: Our form's area will be resized more than once. We will resize form widget itself later (in resizeEvent()). Definition at line 209 of file kexiformview.h. Referenced by initForm(), KexiFormView(), and resizeEvent(). |
|
|
Database cursor used for data retrieving. It is shared between subsequent Data view sessions (just reopened on switch), but deleted and recreated from scratch when form's "dataSource" property changed since last form viewing (m_previousDataSourceString is used for that). Definition at line 193 of file kexiformview.h. |
|
|
Definition at line 187 of file kexiformview.h. Referenced by slotPropertySetSwitched(), and ~KexiFormView(). |
|
|
Definition at line 197 of file kexiformview.h. Referenced by afterSwitchFrom(), deleteQuery(), and initDataSource(). |
|
|
True, if m_query is created as temporary object within this form. If user selected an existing, predefined (stored) query, m_queryIsOwned will be false, so the query object will not be destroyed. Definition at line 202 of file kexiformview.h. Referenced by deleteQuery(), and initDataSource(). |
|
|
Definition at line 195 of file kexiformview.h. |
|
|
Definition at line 186 of file kexiformview.h. Referenced by afterSwitchFrom(), beforeSwitchTo(), initDataSource(), initForm(), insertAutoFields(), KexiFormView(), preferredSizeHint(), resizeEvent(), and show(). |
|
|
Used in setFocusInternal().
Definition at line 212 of file kexiformview.h. Referenced by afterSwitchFrom(), and setFocusInternal(). |
|
|
Used in setUnsavedLocalBLOBs().
Definition at line 223 of file kexiformview.h. Referenced by setUnsavedLocalBLOB(), and storeData(). |
|
|
Stores geometry of widget recently inserted using insertAutoFields() method. having this information, we'r eable to compute position for a newly inserted widget in insertAutoFields() is such position has not been specified. (the position is specified when a widget is inserted with mouse drag & dropping but not with clicking of 'Insert fields' button from Data Source pane) Definition at line 220 of file kexiformview.h. Referenced by insertAutoFields(). |
The documentation for this class was generated from the following files:
