Kexi API Documentation (2.0 alpha)

KexiQueryDesignerSQLView Class Reference

#include <kexiquerydesignersql.h>

Inheritance diagram for KexiQueryDesignerSQLView:

KexiViewBase QWidget KexiActionProxy List of all members.

Detailed Description

The KexiQueryDesignerSQLView class for editing Queries in text mode.

It is a view containing SQL text editor and SQL history/status widget splitted vertically. Depending on user's will, the widget can be in "sql history" mode or in "sql status" mode.

Definition at line 35 of file kexiquerydesignersql.h.

Signals

void queryShortcut ()

Public Member Functions

 KexiQueryDesignerSQLView (KexiMainWindow *mainWin, QWidget *parent, const char *name=0)
virtual ~KexiQueryDesignerSQLView ()
QString sqlText () const
KexiQueryDesignerSQLEditoreditor () const
virtual bool eventFilter (QObject *o, QEvent *e)

Protected Slots

bool slotCheckQuery ()
void slotUpdateMode ()
void slotTextChanged ()
void slotSelectQuery ()

Protected Member Functions

KexiQueryPart::TempDatatempData () const
virtual tristate beforeSwitchTo (int mode, bool &dontStore)
virtual tristate afterSwitchFrom (int mode)
virtual KexiDB::SchemaDatastoreNewData (const KexiDB::SchemaData &sdata, bool &cancel)
virtual tristate storeData (bool dontAsk=false)
void setStatusOk ()
void setStatusError (const QString &msg)
void setStatusEmpty ()
void setStatusText (const QString &text)
virtual void updateActions (bool activated)

Friends

class KexiQueryView


Constructor & Destructor Documentation

KexiQueryDesignerSQLView::KexiQueryDesignerSQLView KexiMainWindow mainWin,
QWidget parent,
const char *  name = 0
 

Definition at line 102 of file kexiquerydesignersql.cpp.

References KexiViewBase::addChildView(), KexiActionProxy::plugSharedAction(), KexiViewBase::setViewWidget(), KexiViewBase::sharedAction(), slotCheckQuery(), slotSelectQuery(), slotTextChanged(), and slotUpdateMode().

KexiQueryDesignerSQLView::~KexiQueryDesignerSQLView  )  [virtual]
 

Definition at line 162 of file kexiquerydesignersql.cpp.


Member Function Documentation

tristate KexiQueryDesignerSQLView::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 283 of file kexiquerydesignersql.cpp.

References KexiDB::Driver::EscapeKexi, KexiDB::Connection::SelectStatementOptions::identifierEscaping, KexiViewBase::loadDataBlock(), KexiViewBase::mainWin(), Kexi::NoViewMode, options, KexiViewBase::parentDialog(), KexiQueryPart::TempData::query(), KexiDB::Connection::selectStatement(), KexiViewBase::setFocus(), KexiQueryPart::TempData::setQuery(), and tempData().

tristate KexiQueryDesignerSQLView::beforeSwitchTo int  mode,
bool &  dontStore
[protected, virtual]
 

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.

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. Set dontStore to true (it's false by default) if you want to avoid data storing by storeData() or storeNewData().

Reimplemented from KexiViewBase.

Definition at line 208 of file kexiquerydesignersql.cpp.

References cancelled, compareSQL(), Kexi::DataViewMode, Kexi::DesignViewMode, KexiViewBase::parentDialog(), KexiQueryPart::TempData::query(), KexiQueryPart::TempData::queryChangedInPreviousView, KexiQueryPart::TempData::setQuery(), slotCheckQuery(), sqlText(), and tempData().

KexiQueryDesignerSQLEditor * KexiQueryDesignerSQLView::editor  )  const
 

Definition at line 167 of file kexiquerydesignersql.cpp.

bool KexiQueryDesignerSQLView::eventFilter QObject *  o,
QEvent *  e
[virtual]
 

Reimplemented from KexiViewBase.

Definition at line 409 of file kexiquerydesignersql.cpp.

References KexiViewBase::eventFilter().

void KexiQueryDesignerSQLView::queryShortcut  )  [signal]
 

void KexiQueryDesignerSQLView::setStatusEmpty  )  [protected]
 

Definition at line 186 of file kexiquerydesignersql.cpp.

References setStatusText().

Referenced by slotCheckQuery(), and slotTextChanged().

void KexiQueryDesignerSQLView::setStatusError const QString msg  )  [protected]
 

Definition at line 179 of file kexiquerydesignersql.cpp.

References setStatusText().

Referenced by slotCheckQuery().

void KexiQueryDesignerSQLView::setStatusOk  )  [protected]
 

Definition at line 172 of file kexiquerydesignersql.cpp.

References setStatusText().

Referenced by slotCheckQuery().

void KexiQueryDesignerSQLView::setStatusText const QString text  )  [protected]
 

Definition at line 192 of file kexiquerydesignersql.cpp.

Referenced by setStatusEmpty(), setStatusError(), and setStatusOk().

bool KexiQueryDesignerSQLView::slotCheckQuery  )  [protected, slot]
 

Performs query checking (by text parsing).

Returns:
true and sets d->parsedQuery to the new query schema object on success.

Definition at line 332 of file kexiquerydesignersql.cpp.

References KexiDB::ParserError::at(), KexiDB::ParserError::error(), KexiDB::Parser::error(), KexiViewBase::mainWin(), KexiDB::Parser::parse(), parser, KexiDB::Parser::query(), setStatusEmpty(), setStatusError(), setStatusOk(), and sqlText().

Referenced by beforeSwitchTo(), KexiQueryDesignerSQLView(), slotUpdateMode(), storeData(), and storeNewData().

void KexiQueryDesignerSQLView::slotSelectQuery  )  [protected, slot]
 

Definition at line 432 of file kexiquerydesignersql.cpp.

Referenced by KexiQueryDesignerSQLView().

void KexiQueryDesignerSQLView::slotTextChanged  )  [protected, slot]
 

Definition at line 401 of file kexiquerydesignersql.cpp.

References KexiViewBase::setDirty(), and setStatusEmpty().

Referenced by KexiQueryDesignerSQLView().

void KexiQueryDesignerSQLView::slotUpdateMode  )  [protected, slot]
 

Definition at line 361 of file kexiquerydesignersql.cpp.

References KexiViewBase::m_dialog, and slotCheckQuery().

Referenced by KexiQueryDesignerSQLView(), and updateActions().

QString KexiQueryDesignerSQLView::sqlText  )  const
 

Definition at line 327 of file kexiquerydesignersql.cpp.

Referenced by beforeSwitchTo(), and slotCheckQuery().

tristate KexiQueryDesignerSQLView::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 500 of file kexiquerydesignersql.cpp.

References KexiViewBase::setDirty(), slotCheckQuery(), KexiViewBase::storeData(), and KexiViewBase::storeDataBlock().

KexiDB::SchemaData * KexiQueryDesignerSQLView::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 447 of file kexiquerydesignersql.cpp.

References KexiDB::SchemaData::id(), KexiViewBase::m_dialog, KexiViewBase::m_mainWin, KexiMainWindow::project(), KexiDialogBase::setId(), slotCheckQuery(), and KexiViewBase::storeDataBlock().

KexiQueryPart::TempData * KexiQueryDesignerSQLView::tempData  )  const [protected]
 

Definition at line 441 of file kexiquerydesignersql.cpp.

References KexiViewBase::parentDialog().

Referenced by afterSwitchFrom(), and beforeSwitchTo().

void KexiQueryDesignerSQLView::updateActions bool  activated  )  [protected, virtual]
 

Updates actions (e.g. availability). Reimplement it, if needed (you must call superclass impelmentation at the end!). This implementation does nothing for this view but calls updateActions() for every child-view of this view. called by KexiDialogBase on dialog's activation (activated is true) or deactivation.

Reimplemented from KexiViewBase.

Definition at line 422 of file kexiquerydesignersql.cpp.

References KexiViewBase::setAvailable(), slotUpdateMode(), and KexiViewBase::updateActions().


Friends And Related Function Documentation

friend class KexiQueryView [friend]
 

Definition at line 79 of file kexiquerydesignersql.h.


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