kexi

KexiQueryView Class Reference

Inheritance diagram for KexiQueryView:

KexiDataTable KexiDataAwareView KexiViewBase KexiSearchAndReplaceViewInterface KexiActionProxy List of all members.

Detailed Description

Definition at line 32 of file kexiqueryview.h.


Public Member Functions

 KexiQueryView (KexiMainWindow *win, QWidget *parent, const char *name=0)
 ~KexiQueryView ()

Protected Member Functions

virtual tristate afterSwitchFrom (int mode)
virtual KexiDB::SchemaDatastoreNewData (const KexiDB::SchemaData &sdata, bool &cancel)
virtual tristate storeData (bool dontAsk=false)
tristate executeQuery (KexiDB::QuerySchema *query)

Protected Attributes

Private * d

Member Function Documentation

tristate KexiQueryView::afterSwitchFrom ( int  mode  )  [protected, virtual]

called by KexiDialogBase::switchToViewMode() right after dialog is switched to new mode By default does nothing. Reimplement this if you need to do something after switching to this view.

Returns:
true if you accept or false if a error occupied and view shouldn't change If there is no error but switching should be just cancelled (probably after showing some info messages), you need to return cancelled.

Reimplemented from KexiViewBase.

Definition at line 108 of file kexiqueryview.cpp.

KexiDB::SchemaData * KexiQueryView::storeNewData ( const KexiDB::SchemaData sdata,
bool &  cancel 
) [protected, virtual]

Tells this dialog to create and store data of the new object pointed by sdata on the backend. Called by KexiDialogBase::storeNewData(). Default implementation:

  • makes a deep copy of sdata
  • stores object schema data sdata in 'kexi__objects' internal table using Connection::storeObjectSchemaData(). Reimpelment this for your needs. Requirements:
  • deep copy of sdata should be made
  • schema data should be created at the backend (by calling KexiViewBase::storeNewData(const KexiDB::SchemaData& sdata)), or using Connection::storeObjectSchemaData() or more specialized method. For example, KexiAlterTableDialog uses Connection::createTable(TableSchema) for this (tableschema is SchemaData subclass) to store more information than just a schem adata. You should use such subclasses if needed. Should return newly created schema data object on success. In this case, do not store schema object yourself (make deep copy if needed).

Reimplemented from KexiViewBase.

Definition at line 132 of file kexiqueryview.cpp.

tristate KexiQueryView::storeData ( bool  dontAsk = false  )  [protected, virtual]

Tells this view to store data changes on the backend. Called by KexiDialogBase::storeData(). Default implementation:

  • makes a deep copy of sdata
  • stores object schema data sdata in 'kexi__objects' internal table using Connection::storeObjectSchemaData(). If dontAsk is true, no question dialog will be shown to the user. The default is false.

Reimpelment this for your needs. Should return true on success or cancelled when the task should be cancelled.

See also:
storeNewData()

Reimplemented from KexiViewBase.

Definition at line 142 of file kexiqueryview.cpp.

tristate KexiQueryView::executeQuery ( KexiDB::QuerySchema query  )  [protected]

Executes query query, filling the table view with query results.

Returns:
true on success, false on failure and cancelled when user has cancelled execution (for example when she pressed the Cancel button of the "Enter Query Parameter" input dialog.

Todo:
remove close() when dynamic cursors arrive

Todo:
maybe allow writing and inserting for single-table relations?

Todo:
maybe allow writing and inserting for single-table relations?

Definition at line 67 of file kexiqueryview.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys