kexi

KexiTableDesignerInterface Class Referenceabstract

#include <kexitabledesignerinterface.h>

Inheritance diagram for KexiTableDesignerInterface:
KexiTableDesignerView

Public Member Functions

virtual void clearRow (int row, bool addCommand=false)=0
 
virtual void insertField (int row, const TQString &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 TQCString &propertyName, const TQVariant &newValue, KoProperty::Property::ListData *const listData=0, bool addCommand=false)=0
 
virtual TQString debugStringForCurrentTableSchema (tristate &result)=0
 
virtual tristate simulateAlterTableExecution (TQString *debugTarget)=0
 
virtual tristate executeRealAlterTable ()=0
 

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:

if (dlg) {
= dynamic_cast<KexiTableDesignerInterface*>( dlg->selectedView() );
if (designerIface) {
//for example, delete row #3
designerIface->deleteRow( 3, true );
}
}
Base class for child window of Kexi's main application window.
KexiViewBase * selectedView() const
static KexiMainWindowImpl * self()
virtual KexiDialogBase * currentDialog() const
Interface for main Table Designer's commands.
virtual void deleteRow(int row, bool addCommand=false)=0

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.

Constructor & Destructor Documentation

◆ KexiTableDesignerInterface()

KexiTableDesignerInterface::KexiTableDesignerInterface ( )

Definition at line 22 of file kexitabledesignerinterface.cpp.

◆ ~KexiTableDesignerInterface()

KexiTableDesignerInterface::~KexiTableDesignerInterface ( )
virtual

Definition at line 26 of file kexitabledesignerinterface.cpp.

Member Function Documentation

◆ changeFieldPropertyForRow()

virtual void KexiTableDesignerInterface::changeFieldPropertyForRow ( int  fieldUID,
const TQCString &  propertyName,
const TQVariant &  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.

◆ clearRow()

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.

◆ debugStringForCurrentTableSchema()

virtual TQString KexiTableDesignerInterface::debugStringForCurrentTableSchema ( tristate &  result)
pure virtual

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

Implemented in KexiTableDesignerView.

◆ deleteRow()

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.

◆ executeRealAlterTable()

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.

◆ insertEmptyRow()

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

Inserts a new empty row at position row.

Implemented in KexiTableDesignerView.

◆ insertField() [1/2]

virtual void KexiTableDesignerInterface::insertField ( int  row,
const TQString &  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.

◆ insertField() [2/2]

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.

◆ simulateAlterTableExecution()

virtual tristate KexiTableDesignerInterface::simulateAlterTableExecution ( TQString *  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.


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