kexi

#include <kexiquerydesignerguieditor.h>

Inheritance diagram for KexiQueryDesignerGuiEditor:
KexiViewBase KexiActionProxy

Public Slots

virtual void setFocus ()
 
- Public Slots inherited from KexiViewBase
virtual void setFocus ()
 
virtual void propertySetSwitched ()
 
void setDirty (bool set)
 
void setDirty ()
 

Public Member Functions

 KexiQueryDesignerGuiEditor (KexiMainWindow *mainWin, TQWidget *parent, const char *name=0)
 
KexiRelationWidget * relationView () const
 
virtual TQSize sizeHint () const
 
- Public Member Functions inherited from KexiViewBase
 KexiViewBase (KexiMainWindow *mainWin, TQWidget *parent, const char *name=0)
 
KexiMainWindow * mainWin () const
 
KexiDialogBase * parentDialog () const
 
KexiPart::Part * part () const
 
virtual TQSize preferredSizeHint (const TQSize &otherSize)
 
virtual bool eventFilter (TQObject *o, TQEvent *e)
 
void addChildView (KexiViewBase *childView)
 
virtual bool dirty () const
 
int viewMode () const
 
virtual TDEAction * sharedAction (const char *action_name)
 
virtual void setAvailable (const char *action_name, bool set)
 
- Public Member Functions inherited from KexiActionProxy
 KexiActionProxy (TQObject *receiver, KexiSharedActionHost *host=0)
 
bool activateSharedAction (const char *action_name, bool alsoCheckInChildren=true)
 
void setSharedActionHost (KexiSharedActionHost &host)
 
bool isAvailable (const char *action_name, bool alsoCheckInChildren=true) const
 
bool isSupported (const char *action_name) const
 
void setActionProxyParent_internal (KexiActionProxy *parent)
 

Protected Slots

void slotDragOverTableRow (KexiTableItem *item, int row, TQDragMoveEvent *e)
 
void slotDroppedAtRow (KexiTableItem *item, int row, TQDropEvent *ev, KexiTableItem *&newItem)
 
void slotNewItemAppendedForAfterDeletingInSpreadSheetMode ()
 
void slotTableAdded (KexiDB::TableSchema &t)
 
void slotTableHidden (KexiDB::TableSchema &t)
 
void slotBeforeCellChanged (KexiTableItem *item, int colnum, TQVariant &newValue, KexiDB::ResultInfo *result)
 
void slotRowInserted (KexiTableItem *item, uint row, bool repaint)
 
void slotTablePositionChanged (KexiRelationViewTableContainer *)
 
void slotAboutConnectionRemove (KexiRelationViewConnection *)
 
void slotTableFieldDoubleClicked (KexiDB::TableSchema *table, const TQString &fieldName)
 
bool loadLayout ()
 
bool storeLayout ()
 
void showTablesForQuery (KexiDB::QuerySchema *query)
 
void showFieldsOrRelationsForQueryInternal (KexiDB::QuerySchema *query, bool showFields, bool showRelations, KexiDB::ResultInfo &result)
 
void showFieldsAndRelationsForQuery (KexiDB::QuerySchema *query, KexiDB::ResultInfo &result)
 
void showFieldsForQuery (KexiDB::QuerySchema *query, KexiDB::ResultInfo &result)
 
void showRelationsForQuery (KexiDB::QuerySchema *query, KexiDB::ResultInfo &result)
 
void addConnection (KexiDB::Field *masterField, KexiDB::Field *detailsField)
 
void slotPropertyChanged (KoProperty::Set &list, KoProperty::Property &property)
 
void slotNewItemStored (KexiPart::Item &)
 
void slotItemRemoved (const KexiPart::Item &item)
 
void slotItemRenamed (const KexiPart::Item &item, const TQCString &oldName)
 

Protected Member Functions

void initTableColumns ()
 
void initTableRows ()
 
virtual tristate beforeSwitchTo (int mode, bool &dontStore)
 
virtual tristate afterSwitchFrom (int mode)
 
virtual KexiDB::SchemaData * storeNewData (const KexiDB::SchemaData &sdata, bool &cancel)
 
virtual tristate storeData (bool dontAsk=false)
 
void updateColumnsData ()
 
virtual KoProperty::Set * propertySet ()
 
KoProperty::Set * createPropertySet (int row, const TQString &tableName, const TQString &fieldName, bool newOne=false)
 
bool buildSchema (TQString *errMsg=0)
 
KexiQueryPart::TempData * tempData () const
 
KexiTableItem * createNewRow (const TQString &tableName, const TQString &fieldName, bool visible) const
 
KexiDB::BaseExpr * parseExpressionString (const TQString &fullString, int &token, bool allowRelationalOperator)
 
TQCString generateUniqueAlias () const
 
void updatePropertiesVisibility (KoProperty::Set &buf)
 
- Protected Member Functions inherited from KexiViewBase
virtual void closeEvent (TQCloseEvent *e)
 
void propertySetReloaded (bool preservePrevSelection=false, const TQCString &propertyToSelect=TQCString())
 
bool loadDataBlock (TQString &dataString, const TQString &dataID=TQString(), bool canBeEmpty=false)
 
bool storeDataBlock (const TQString &dataString, const TQString &dataID=TQString())
 
bool removeDataBlock (const TQString &dataID=TQString())
 
void setViewWidget (TQWidget *w, bool focusProxy=false)
 
virtual void updateActions (bool activated)
 
virtual void setFocusInternal ()
 
virtual void parentDialogDetached ()
 
virtual void parentDialogAttached ()
 
- Protected Member Functions inherited from KexiActionProxy
void plugSharedAction (const char *action_name, TQObject *receiver, const char *slot)
 
void unplugSharedAction (const char *action_name)
 
void plugSharedAction (const char *action_name, const char *slot)
 
int plugSharedAction (const char *action_name, TQWidget *w)
 
void plugSharedActionToExternalGUI (const char *action_name, KXMLGUIClient *client)
 
void plugSharedActionsToExternalGUI (const TQValueList< TQCString > &action_names, KXMLGUIClient *client)
 
void unplugSharedAction (const char *action_name, TQWidget *w)
 
TDEAction * plugSharedAction (const char *action_name, const TQString &alternativeText, TQWidget *w)
 
TQObject * receiver () const
 
void addActionProxyChild (KexiActionProxy *child)
 
void takeActionProxyChild (KexiActionProxy *child)
 

Friends

class KexiQueryView
 

Additional Inherited Members

- Signals inherited from KexiViewBase
void closing (bool &cancel)
 
void focus (bool in)
 
- Public Attributes inherited from KexiActionProxy
KexiActionProxy * m_focusedChild
 
- Protected Attributes inherited from KexiViewBase
TQString m_defaultIconName
 
KexiMainWindow * m_mainWin
 
KexiDialogBase * m_dialog
 
TQWidget * m_viewWidget
 
KexiViewBase * m_parentView
 
TQGuardedPtr< TQWidget > m_lastFocusedChildBeforeFocusOut
 
- Protected Attributes inherited from KexiActionProxy
KexiSharedActionHost * m_host
 
TQGuardedPtr< TQObject > m_receiver
 
TQAsciiDict< TQPair< TQSignal *, bool > > m_signals
 
TQPtrList< KexiActionProxy > m_sharedActionChildren
 
TQPtrList< TDEAction > m_alternativeActions
 
KexiActionProxy * m_actionProxyParent
 
TQObject m_signal_parent
 
TDEAction_setEnabled_Helper * m_TDEAction_setEnabled_helper
 

Detailed Description

Design view of the Query Designer.

Definition at line 59 of file kexiquerydesignerguieditor.h.

Constructor & Destructor Documentation

◆ KexiQueryDesignerGuiEditor()

KexiQueryDesignerGuiEditor::KexiQueryDesignerGuiEditor ( KexiMainWindow *  mainWin,
TQWidget *  parent,
const char *  name = 0 
)

Definition at line 141 of file kexiquerydesignerguieditor.cpp.

◆ ~KexiQueryDesignerGuiEditor()

KexiQueryDesignerGuiEditor::~KexiQueryDesignerGuiEditor ( )
virtual

Definition at line 202 of file kexiquerydesignerguieditor.cpp.

Member Function Documentation

◆ addConnection

void KexiQueryDesignerGuiEditor::addConnection ( KexiDB::Field *  masterField,
KexiDB::Field *  detailsField 
)
protectedslot

Definition at line 763 of file kexiquerydesignerguieditor.cpp.

◆ afterSwitchFrom()

tristate KexiQueryDesignerGuiEditor::afterSwitchFrom ( int  mode)
protectedvirtual

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.
Todo:
load global query properties
Todo:
load global query properties

Reimplemented from KexiViewBase.

Definition at line 618 of file kexiquerydesignerguieditor.cpp.

◆ beforeSwitchTo()

tristate KexiQueryDesignerGuiEditor::beforeSwitchTo ( int  mode,
bool &  dontStore 
)
protectedvirtual

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 570 of file kexiquerydesignerguieditor.cpp.

◆ buildSchema()

bool KexiQueryDesignerGuiEditor::buildSchema ( TQString *  errMsg = 0)
protected

Builds query schema out of information provided by gui. The schema is stored in temp->query member. errMsg is optional error message returned.

Returns
true on proper schema creation.
Todo:
what about query?

allowRelationalOperator

set

Todo:
what about query?
Todo:
support expressions here
Todo:
ok, but not for expressions

Definition at line 361 of file kexiquerydesignerguieditor.cpp.

◆ createNewRow()

KexiTableItem * KexiQueryDesignerGuiEditor::createNewRow ( const TQString &  tableName,
const TQString &  fieldName,
bool  visible 
) const
protected

Helper: allocates and initializes new table view's row. Doesn't insert it, just returns. tableName and fieldName shoudl be provided. visible flag sets value for "Visible" column.

Definition at line 1188 of file kexiquerydesignerguieditor.cpp.

◆ createPropertySet()

KoProperty::Set * KexiQueryDesignerGuiEditor::createPropertySet ( int  row,
const TQString &  tableName,
const TQString &  fieldName,
bool  newOne = false 
)
protected
Todo:
add table_field icon (add buff->addProperty(prop = new KexiProperty("this:iconName", "table_field") );

Definition at line 1697 of file kexiquerydesignerguieditor.cpp.

◆ generateUniqueAlias()

TQCString KexiQueryDesignerGuiEditor::generateUniqueAlias ( ) const
protected

Definition at line 1267 of file kexiquerydesignerguieditor.cpp.

◆ initTableColumns()

void KexiQueryDesignerGuiEditor::initTableColumns ( )
protected

Called just once.

Definition at line 207 of file kexiquerydesignerguieditor.cpp.

◆ initTableRows()

void KexiQueryDesignerGuiEditor::initTableRows ( )
protected

Called to have all rows empty.

Definition at line 260 of file kexiquerydesignerguieditor.cpp.

◆ loadLayout

bool KexiQueryDesignerGuiEditor::loadLayout ( )
protectedslot

Loads layout of relation GUI diagram.

Definition at line 1068 of file kexiquerydesignerguieditor.cpp.

◆ parseExpressionString()

KexiDB::BaseExpr * KexiQueryDesignerGuiEditor::parseExpressionString ( const TQString &  fullString,
int &  token,
bool  allowRelationalOperator 
)
protected
Todo:
this is primitive, temporary: reuse SQL parser
Todo:
what about query?

Definition at line 1292 of file kexiquerydesignerguieditor.cpp.

◆ propertySet()

KoProperty::Set * KexiQueryDesignerGuiEditor::propertySet ( )
protectedvirtual
Returns
property buffer associated with currently selected row (i.e. field) or 0 if current row is empty.

Reimplemented from KexiViewBase.

Definition at line 1676 of file kexiquerydesignerguieditor.cpp.

◆ relationView()

KexiRelationWidget * KexiQueryDesignerGuiEditor::relationView ( ) const

Definition at line 344 of file kexiquerydesignerguieditor.cpp.

◆ setFocus

void KexiQueryDesignerGuiEditor::setFocus ( )
virtualslot

Definition at line 1754 of file kexiquerydesignerguieditor.cpp.

◆ showFieldsAndRelationsForQuery

void KexiQueryDesignerGuiEditor::showFieldsAndRelationsForQuery ( KexiDB::QuerySchema *  query,
KexiDB::ResultInfo &  result 
)
protectedslot

convenience method equal to showFieldsOrRelationsForQueryInternal(query, true, true)

Definition at line 784 of file kexiquerydesignerguieditor.cpp.

◆ showFieldsForQuery

void KexiQueryDesignerGuiEditor::showFieldsForQuery ( KexiDB::QuerySchema *  query,
KexiDB::ResultInfo &  result 
)
protectedslot

convenience method equal to showFieldsOrRelationsForQueryInternal(query, true, false)

Definition at line 774 of file kexiquerydesignerguieditor.cpp.

◆ showFieldsOrRelationsForQueryInternal

void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal ( KexiDB::QuerySchema *  query,
bool  showFields,
bool  showRelations,
KexiDB::ResultInfo &  result 
)
protectedslot
Todo:
: now only sigle-field relationships are implemented!
Todo:
move this check to parser on QuerySchema creation or to QuerySchema creation (WHERE expression should be then simplified by removing joins
Todo:
testing primary key here is too simplified; maybe look ar isForeignKey() or indices..
Todo:
Todo:
what about multifield joins?
Todo:
addConnection() should have "bool oneToOne" arg, for 1-to-1 relations
Todo:
fix for !INFIX operators
Todo:
what about ALIAS?
Todo:
fix for !INFIX operators
Todo:
if (!columnAlias.isEmpty())
Todo:
Todo:
set["alias"].setValue(columnAlias, false);

Definition at line 790 of file kexiquerydesignerguieditor.cpp.

◆ showRelationsForQuery

void KexiQueryDesignerGuiEditor::showRelationsForQuery ( KexiDB::QuerySchema *  query,
KexiDB::ResultInfo &  result 
)
protectedslot

convenience method equal to showFieldsOrRelationsForQueryInternal(query, false, true)

Definition at line 779 of file kexiquerydesignerguieditor.cpp.

◆ showTablesForQuery

void KexiQueryDesignerGuiEditor::showTablesForQuery ( KexiDB::QuerySchema *  query)
protectedslot

Definition at line 746 of file kexiquerydesignerguieditor.cpp.

◆ sizeHint()

TQSize KexiQueryDesignerGuiEditor::sizeHint ( ) const
virtual

Definition at line 1180 of file kexiquerydesignerguieditor.cpp.

◆ slotAboutConnectionRemove

void KexiQueryDesignerGuiEditor::slotAboutConnectionRemove ( KexiRelationViewConnection *  )
protectedslot

Definition at line 1651 of file kexiquerydesignerguieditor.cpp.

◆ slotBeforeCellChanged

void KexiQueryDesignerGuiEditor::slotBeforeCellChanged ( KexiTableItem *  item,
int  colnum,
TQVariant &  newValue,
KexiDB::ResultInfo *  result 
)
protectedslot

Called before cell change in tableview.

allowSignals

allowSignals

Todo:
what about expressions?

allowSignals

Todo:
this is primitive, temporary: reuse SQL parser

Definition at line 1417 of file kexiquerydesignerguieditor.cpp.

◆ slotDragOverTableRow

void KexiQueryDesignerGuiEditor::slotDragOverTableRow ( KexiTableItem *  item,
int  row,
TQDragMoveEvent *  e 
)
protectedslot

Definition at line 1209 of file kexiquerydesignerguieditor.cpp.

◆ slotDroppedAtRow

void KexiQueryDesignerGuiEditor::slotDroppedAtRow ( KexiTableItem *  item,
int  row,
TQDropEvent *  ev,
KexiTableItem *&  newItem 
)
protectedslot

Definition at line 1218 of file kexiquerydesignerguieditor.cpp.

◆ slotItemRemoved

void KexiQueryDesignerGuiEditor::slotItemRemoved ( const KexiPart::Item &  item)
protectedslot

Definition at line 1792 of file kexiquerydesignerguieditor.cpp.

◆ slotItemRenamed

void KexiQueryDesignerGuiEditor::slotItemRenamed ( const KexiPart::Item &  item,
const TQCString &  oldName 
)
protectedslot

Definition at line 1797 of file kexiquerydesignerguieditor.cpp.

◆ slotNewItemAppendedForAfterDeletingInSpreadSheetMode

void KexiQueryDesignerGuiEditor::slotNewItemAppendedForAfterDeletingInSpreadSheetMode ( )
protectedslot

Reaction on appending a new item after deleting one.

Definition at line 1235 of file kexiquerydesignerguieditor.cpp.

◆ slotNewItemStored

void KexiQueryDesignerGuiEditor::slotNewItemStored ( KexiPart::Item &  item)
protectedslot

Definition at line 1787 of file kexiquerydesignerguieditor.cpp.

◆ slotPropertyChanged

void KexiQueryDesignerGuiEditor::slotPropertyChanged ( KoProperty::Set &  list,
KoProperty::Property &  property 
)
protectedslot

Definition at line 1759 of file kexiquerydesignerguieditor.cpp.

◆ slotRowInserted

void KexiQueryDesignerGuiEditor::slotRowInserted ( KexiTableItem *  item,
uint  row,
bool  repaint 
)
protectedslot

Definition at line 1242 of file kexiquerydesignerguieditor.cpp.

◆ slotTableAdded

void KexiQueryDesignerGuiEditor::slotTableAdded ( KexiDB::TableSchema &  t)
protectedslot

Definition at line 1251 of file kexiquerydesignerguieditor.cpp.

◆ slotTableFieldDoubleClicked

void KexiQueryDesignerGuiEditor::slotTableFieldDoubleClicked ( KexiDB::TableSchema *  table,
const TQString &  fieldName 
)
protectedslot

Definition at line 1656 of file kexiquerydesignerguieditor.cpp.

◆ slotTableHidden

void KexiQueryDesignerGuiEditor::slotTableHidden ( KexiDB::TableSchema &  t)
protectedslot

Definition at line 1260 of file kexiquerydesignerguieditor.cpp.

◆ slotTablePositionChanged

void KexiQueryDesignerGuiEditor::slotTablePositionChanged ( KexiRelationViewTableContainer *  )
protectedslot

Definition at line 1646 of file kexiquerydesignerguieditor.cpp.

◆ storeData()

tristate KexiQueryDesignerGuiEditor::storeData ( bool  dontAsk = false)
protectedvirtual

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 728 of file kexiquerydesignerguieditor.cpp.

◆ storeLayout

bool KexiQueryDesignerGuiEditor::storeLayout ( )
protectedslot

Stores layout of relation GUI diagram.

Todo:
what about query?

Definition at line 1131 of file kexiquerydesignerguieditor.cpp.

◆ storeNewData()

KexiDB::SchemaData * KexiQueryDesignerGuiEditor::storeNewData ( const KexiDB::SchemaData &  sdata,
bool &  cancel 
)
protectedvirtual

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 695 of file kexiquerydesignerguieditor.cpp.

◆ tempData()

KexiQueryPart::TempData * KexiQueryDesignerGuiEditor::tempData ( ) const
protected

Definition at line 350 of file kexiquerydesignerguieditor.cpp.

◆ updateColumnsData()

void KexiQueryDesignerGuiEditor::updateColumnsData ( )
protected

Updates data in columns depending on tables that are currently inserted. Tabular Data in combo box popups is updated as well.

Todo:
what about query?

Definition at line 274 of file kexiquerydesignerguieditor.cpp.

◆ updatePropertiesVisibility()

void KexiQueryDesignerGuiEditor::updatePropertiesVisibility ( KoProperty::Set &  buf)
protected

Definition at line 1681 of file kexiquerydesignerguieditor.cpp.

Friends And Related Symbol Documentation

◆ KexiQueryView

friend class KexiQueryView
friend

Definition at line 167 of file kexiquerydesignerguieditor.h.


The documentation for this class was generated from the following files: