Kexi API Documentation (2.0 alpha)

KexiQueryView Class Reference

#include <kexiqueryview.h>

Inheritance diagram for KexiQueryView:

KexiDataTable KexiDataAwareView KexiViewBase QWidget KexiActionProxy List of all members.

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

Constructor & Destructor Documentation

KexiQueryView::KexiQueryView KexiMainWindow win,
QWidget parent,
const char *  name = 0
 

Definition at line 53 of file kexiqueryview.cpp.

References KexiDataTable::tableView().

KexiQueryView::~KexiQueryView  ) 
 

Definition at line 60 of file kexiqueryview.cpp.

References 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 105 of file kexiqueryview.cpp.

References Kexi::DesignViewMode, executeQuery(), Kexi::NoViewMode, KexiViewBase::parentDialog(), KexiQueryPart::TempData::query(), and Kexi::TextViewMode.

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.

Definition at line 67 of file kexiqueryview.cpp.

References cancelled, KexiDB::Cursor::connection(), d, KexiDB::debug(), KexiQueryParameters::getParameters(), KexiViewBase::mainWin(), KexiDB::QuerySchema::parameters(), KexiViewBase::parentDialog(), KexiDataTable::setData(), and KexiDataTable::tableView().

Referenced by afterSwitchFrom().

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 139 of file kexiqueryview.cpp.

References KexiViewBase::parentDialog().

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 129 of file kexiqueryview.cpp.

References KexiViewBase::parentDialog().


Member Data Documentation

Private* KexiQueryView::d [protected]
 

Definition at line 53 of file kexiqueryview.h.

Referenced by executeQuery(), and ~KexiQueryView().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:19 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003