kexi

KexiTableDesignerInterface Class Reference

#include <kexitabledesignerinterface.h>

Inheritance diagram for KexiTableDesignerInterface:

KexiTableDesignerView

List of all members.


Detailed Description

Interface for main Table Designer's commands.

This interface has been specified to enable invoking Table Designer's commands at application's level. This is used in the "altertable" test suite, available in kexi/tests/altertable Kexi source code directory. KexiTableDesignerInterface is implemented by KexiTableDesignerView, so it's enough to use dynamic_cast:

 KexiDialogBase *dlg = KexiMainWindowImpl::self()->currentDialog();
 if (dlg) {
   KexiTableDesignerInterface* designerIface 
     = dynamic_cast<KexiTableDesignerInterface*>( dlg->selectedView() );
   if (designerIface) {
     //for example, delete row #3
     designerIface->deleteRow( 3, true );
   }
 }
Methods of KexiTableDesignerInterface are also used by classes of KexiTableDesignerCommands namespace (KCommand derivatives) for implementing commands execution and unexecution.

All the methods contain addCommand argument. Set if to true to get the command added to the undo/redo buffer, what will look like real user's action. This is also needed to poperly generate arguments for commiting the "alter table" operation.

Definition at line 54 of file kexitabledesignerinterface.h.


Public Member Functions

virtual void clearRow (int row, bool addCommand=false)=0
virtual void insertField (int row, const QString &caption, bool addCommand=false)=0
virtual void insertField (int row, KoProperty::Set &set, bool addCommand=false)=0
virtual void insertEmptyRow (int row, bool addCommand=false)=0
virtual void deleteRow (int row, bool addCommand=false)=0
virtual void changeFieldPropertyForRow (int fieldUID, const QCString &propertyName, const QVariant &newValue, KoProperty::Property::ListData *const listData=0, bool addCommand=false)=0
virtual QString debugStringForCurrentTableSchema (tristate &result)=0
virtual tristate simulateAlterTableExecution (QString *debugTarget)=0
virtual tristate executeRealAlterTable ()=0

Member Function Documentation

virtual void KexiTableDesignerInterface::clearRow ( int  row,
bool  addCommand = false 
) [pure virtual]

Clears field information entered for row. This is performed by removing values from caption and data type columns.

Implemented in KexiTableDesignerView.

virtual void KexiTableDesignerInterface::insertField ( int  row,
const QString &  caption,
bool  addCommand = false 
) [pure virtual]

Inserts a new field with caption for row. Property set is also created. Existing field will be overwritten, so use insertEmptyRow() is you want to move subsequent fields down.

Implemented in KexiTableDesignerView.

virtual void KexiTableDesignerInterface::insertField ( int  row,
KoProperty::Set &  set,
bool  addCommand = false 
) [pure virtual]

Inserts a new field for row. Property set is also created. set will be deeply-copied into the new set. Existing field will be overwritten, so use insertEmptyRow() is you want to move subsequent fields down.

Implemented in KexiTableDesignerView.

virtual void KexiTableDesignerInterface::insertEmptyRow ( int  row,
bool  addCommand = false 
) [pure virtual]

Inserts a new empty row at position row.

Implemented in KexiTableDesignerView.

virtual void KexiTableDesignerInterface::deleteRow ( int  row,
bool  addCommand = false 
) [pure virtual]

Deletes row from the table view. Property set is also deleted. All the subsequent fields are moved up.

Implemented in KexiTableDesignerView.

virtual void KexiTableDesignerInterface::changeFieldPropertyForRow ( int  fieldUID,
const QCString &  propertyName,
const QVariant &  newValue,
KoProperty::Property::ListData *const   listData = 0,
bool  addCommand = false 
) [pure virtual]

Changes property propertyName to newValue for a field pointed by fieldUID. If listData is not NULL and not empty, a deep copy of it is passed to Property::setListData(). If listData nlist if not NULL but empty, Property::setListData(0) is called.

Implemented in KexiTableDesignerView.

virtual QString KexiTableDesignerInterface::debugStringForCurrentTableSchema ( tristate result  )  [pure virtual]

Creates temporary table for the current design and returns debug string for it.

Implemented in KexiTableDesignerView.

virtual tristate KexiTableDesignerInterface::simulateAlterTableExecution ( QString *  debugTarget  )  [pure virtual]

Simulates execution of alter table, and puts debug into debugTarget. A case when debugTarget is not 0 is true for the alter table test suite.

Implemented in KexiTableDesignerView.

virtual tristate KexiTableDesignerInterface::executeRealAlterTable (  )  [pure virtual]

Real execution of the Alter Table. For debugging of the real alter table.

Returns:
true on success, false on failure and cancelled if user has cancelled execution.

Implemented in KexiTableDesignerView.


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