KexiTableDesignerView Class Reference
#include <kexitabledesignerview.h>
Inheritance diagram for KexiTableDesignerView:

Detailed Description
Design view of the Table Designer.Contains a spreadsheet-like space for entering field definitions. Property editor is provided for altering field definitions.
The view also supports Undo and Redo operations. These are connected to a factility creating a list of actions used by AlterTableHandler to perform required operation of altering the table.
Altering itself is performed upon design saving (storeData()). Saving unstored designs just creates a new table. Saving changes made to empty (not filled with data) table is performed by physically deleting the previous table schema and recreating it TODO: this will be not quite when we have db relationships supported.
Saving changes made to table containing data requires use of the AlterTableHandler functionality.
Definition at line 56 of file kexitabledesignerview.h.
Public Slots | |
| virtual tristate | executeRealAlterTable () |
Public Member Functions | |
| KexiTableDesignerView (KexiMainWindow *win, QWidget *parent) | |
| virtual | ~KexiTableDesignerView () |
| KexiTablePart::TempData * | tempData () const |
| virtual void | clearRow (int row, bool addCommand=false) |
| virtual void | insertField (int row, const QString &caption, bool addCommand=false) |
| virtual void | insertField (int row, KoProperty::Set &set, bool addCommand=false) |
| virtual void | insertEmptyRow (int row, bool addCommand=false) |
| virtual void | deleteRow (int row, bool addCommand=false) |
| virtual void | changeFieldPropertyForRow (int row, const QCString &propertyName, const QVariant &newValue, KoProperty::Property::ListData *const listData, bool addCommand) |
| void | changeFieldProperty (int fieldUID, const QCString &propertyName, const QVariant &newValue, KoProperty::Property::ListData *const listData=0, bool addCommand=false) |
| void | changePropertyVisibility (int fieldUID, const QCString &propertyName, bool visible) |
| KexiDB::Field * | buildField (const KoProperty::Set &set) const |
| virtual QString | debugStringForCurrentTableSchema (tristate &result) |
| virtual tristate | simulateAlterTableExecution (QString *debugTarget) |
Protected Slots | |
| void | updateActions () |
| virtual void | slotUpdateRowActions (int row) |
| void | slotAboutToShowContextMenu () |
| void | slotBeforeCellChanged (KexiTableItem *item, int colnum, QVariant &newValue, KexiDB::ResultInfo *result) |
| Called before cell change in tableview. | |
| void | slotRowUpdated (KexiTableItem *item) |
| Called on row change in a tableview. | |
| void | slotRowInserted () |
| Called before row inserting in tableview. | |
| void | slotAboutToDeleteRow (KexiTableItem &item, KexiDB::ResultInfo *result, bool repaint) |
| Called before row deleting in tableview. | |
| void | slotPropertyChanged (KoProperty::Set &set, KoProperty::Property &property) |
| void | slotTogglePrimaryKey () |
| void | slotUndo () |
| void | slotRedo () |
| void | slotCommandExecuted (KCommand *command) |
| void | slotSimulateAlterTableExecution () |
Protected Member Functions | |
| virtual void | updateActions (bool activated) |
| void | initData () |
| called whenever data should be reloaded (on switching to this view mode) | |
| KoProperty::Set * | createPropertySet (int row, const KexiDB::Field &field, bool newOne=false) |
| virtual tristate | beforeSwitchTo (int mode, bool &dontStore) |
| virtual tristate | afterSwitchFrom (int mode) |
| virtual KoProperty::Set * | propertySet () |
| virtual KexiDB::SchemaData * | storeNewData (const KexiDB::SchemaData &sdata, bool &cancel) |
| virtual tristate | storeData (bool dontAsk=false) |
| tristate | buildSchema (KexiDB::TableSchema &schema, bool beSilent=false) |
| tristate | buildAlterTableActions (KexiDB::AlterTableHandler::ActionList &actions) |
| void | switchPrimaryKey (KoProperty::Set &propertySet, bool set, bool aWasPKey=false, CommandGroup *commandGroup=0) |
| void | getSubTypeListData (KexiDB::Field::TypeGroup fieldTypeGroup, QStringList &stringsList, QStringList &namesList) |
| Gets subtype strings and names for type fieldType. | |
| void | addHistoryCommand (KCommand *command, bool execute) |
| void | updateUndoRedoActions () |
| Updates undo/redo shared actions availability by looking at command history's action. | |
| void | insertFieldInternal (int row, KoProperty::Set *set, const QString &caption, bool addCommand) |
| virtual void | propertySetSwitched () |
| Reimplemented to pass the information also to the "Lookup" tab. | |
Constructor & Destructor Documentation
|
||||||||||||
|
|
Definition at line 204 of file kexitabledesignerview.cpp. |
Member Function Documentation
|
||||||||||||
|
Adds history command command to the undo/redo buffer. If execute is true, the command is executed afterwards. Definition at line 1590 of file kexitabledesignerview.cpp. References CommandHistory::addCommand(), KexiTableDesignerViewPrivate::history, and updateUndoRedoActions(). Referenced by slotAboutToDeleteRow(), slotBeforeCellChanged(), slotPropertyChanged(), slotRowInserted(), and slotRowUpdated(). |
|
|
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.
Reimplemented from KexiViewBase. Definition at line 621 of file kexitabledesignerview.cpp. References Kexi::DataViewMode, initData(), and Kexi::NoViewMode. |
|
||||||||||||
|
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.
Reimplemented from KexiViewBase. Definition at line 574 of file kexitabledesignerview.cpp. References KexiTableView::acceptRowEdit(), cancelled, Kexi::DataViewMode, KexiViewBase::dirty(), KexiTableDesignerViewPrivate::dontAskOnStoreData, KexiTableDesignerViewPrivate::messageForSavingChanges(), KexiViewBase::parentDialog(), Kexi::TextViewMode, and KexiTableDesignerViewPrivate::view. |
|
|
Builds action list usable for KexiDB::AlterTableHandler by looking at undo buffer of commands' history. Used in storeData() Definition at line 1364 of file kexitabledesignerview.cpp. References CommandHistory::commands(), copyAlterTableActions(), KexiTableDesignerViewPrivate::history, and kexipluginsdbg. Referenced by simulateAlterTableExecution(), and storeData(). |
|
|
Builds table field's schema by looking at the set. Definition at line 1161 of file kexitabledesignerview.cpp. References KexiDB::Field::BLOB, field, KexiTableDesignerViewPrivate::internalPropertyNames, KexiDB::intToFieldType(), kexipluginsdbg, and KexiDB::setFieldProperties(). Referenced by buildSchema(), and KexiTableDesignerCommands::InsertFieldCommand::InsertFieldCommand(). |
|
||||||||||||
|
||||||||||||||||||||||||
|
Changes property propertyName to newValue. Works exactly like changeFieldPropertyForRow() except the field is pointed by fieldUID. Used by ChangeFieldPropertyCommand to change field's property. Definition at line 1856 of file kexitabledesignerview.cpp. References changeFieldPropertyForRow(), KexiDataAwarePropertySet::findRowForPropertyValue(), kexipluginswarn, and KexiTableDesignerViewPrivate::sets. |
|
||||||||||||||||||||||||
|
Changes property propertyName to newValue for a field at row row. 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. Implements KexiTableDesignerInterface. Definition at line 1783 of file kexitabledesignerview.cpp. References KexiTableView::acceptRowEdit(), KexiTableDesignerViewPrivate::addHistoryCommand_in_slotPropertyChanged_enabled, KexiTableDesignerViewPrivate::addHistoryCommand_in_slotRowUpdated_enabled, KexiDataAwarePropertySet::at(), COLUMN_ID_CAPTION, COLUMN_ID_DESC, COLUMN_ID_TYPE, KexiDataAwareObjectInterface::data(), KexiDataAwareObjectInterface::itemAt(), KexiTableDesignerViewPrivate::sets, KexiTableDesignerViewPrivate::slotBeforeCellChanged_enabled, KexiTableDesignerViewPrivate::slotPropertyChanged_subType_enabled, KexiDB::Field::typeGroup(), KexiTableView::updateRow(), and KexiTableDesignerViewPrivate::view. Referenced by changeFieldProperty(). |
|
||||||||||||||||
|
Changes visibility of property propertyName to visible for a field pointed by fieldUID. Used by ChangePropertyVisibilityCommand. Definition at line 1869 of file kexitabledesignerview.cpp. References KexiTableView::acceptRowEdit(), KexiDataAwarePropertySet::at(), KexiDataAwarePropertySet::findRowForPropertyValue(), KexiViewBase::propertySetReloaded(), KexiTableDesignerViewPrivate::sets, and KexiTableDesignerViewPrivate::view. |
|
||||||||||||
|
Clears field information entered for row. This is performed by removing values from caption and data type columns. Used by InsertFieldCommand to undo inserting a new field. Implements KexiTableDesignerInterface. Definition at line 1667 of file kexitabledesignerview.cpp. References KexiTableView::acceptRowEdit(), KexiTableDesignerViewPrivate::addHistoryCommand_in_slotPropertyChanged_enabled, KexiTableDesignerViewPrivate::addHistoryCommand_in_slotRowUpdated_enabled, COLUMN_ID_TYPE, KexiDataAwareObjectInterface::data(), KexiDataAwareObjectInterface::itemAt(), KexiDataAwarePropertySet::remove(), KexiTableDesignerViewPrivate::sets, KexiTableDesignerViewPrivate::slotBeforeCellChanged_enabled, and KexiTableDesignerViewPrivate::view. |
|
||||||||||||||||
|
|
Creates temporary table for the current design and returns debug string for it. Implements KexiTableDesignerInterface. Definition at line 1654 of file kexitabledesignerview.cpp. References buildSchema(), KexiDB::TableSchema::debugString(), and tempData(). |
|
||||||||||||
|
Deletes row from the table view. Property set is also deleted. All the subsequent fields are moved up. Used for undoing InsertEmptyRowCommand and by RemoveFieldCommand to remove a field. Implements KexiTableDesignerInterface. Definition at line 1767 of file kexitabledesignerview.cpp. References KexiTableDesignerViewPrivate::addHistoryCommand_in_slotAboutToDeleteRow_enabled, KexiDataAwareObjectInterface::deleteItem(), KexiDataAwareObjectInterface::itemAt(), and KexiTableDesignerViewPrivate::view. |
|
|
Real execution of the Alter Table. For debugging of the real alter table.
Implements KexiTableDesignerInterface. Definition at line 1541 of file kexitabledesignerview.cpp. References KexiViewBase::mainWin(), KexiTableDesignerViewPrivate::recentResultOfStoreData, and KexiTableDesignerViewPrivate::tempStoreDataUsingRealAlterTable. Referenced by KexiTableDesignerView(). |
|
||||||||||||||||
|
Gets subtype strings and names for type fieldType.
Definition at line 285 of file kexitabledesignerview.cpp. References kexipluginsdbg, KexiDB::typeNamesForGroup(), and KexiDB::typeStringsForGroup(). Referenced by createPropertySet(), and slotBeforeCellChanged(). |
|
|
||||||||||||
|
Inserts a new empty row at position row. Used by RemoveFieldCommand as a part of undo inserting a new field; also used by InsertEmptyRowCommand. Implements KexiTableDesignerInterface. Definition at line 1749 of file kexitabledesignerview.cpp. References KexiTableDesignerViewPrivate::addHistoryCommand_in_slotRowInserted_enabled, KexiTableView::insertEmptyRow(), and KexiTableDesignerViewPrivate::view. |
|
||||||||||||||||
|
Inserts a new field for row. Property set is also created. set will be deeply-copied into the new set. Used by InsertFieldCommand to insert a new field. Implements KexiTableDesignerInterface. Definition at line 1697 of file kexitabledesignerview.cpp. References insertFieldInternal(). |
|
||||||||||||||||
|
Inserts a new field with caption for row. Property set is also created. Implements KexiTableDesignerInterface. Definition at line 1692 of file kexitabledesignerview.cpp. References insertFieldInternal(). |
|
||||||||||||||||||||
|
Inserts a new field for row. Property set is also created. If set is not 0 (the default), it will be copied into the new set. Used by insertField(). Definition at line 1702 of file kexitabledesignerview.cpp. References KexiTableView::acceptRowEdit(), KexiTableDesignerViewPrivate::addHistoryCommand_in_slotPropertyChanged_enabled, KexiTableDesignerViewPrivate::addHistoryCommand_in_slotRowUpdated_enabled, KexiDataAwarePropertySet::at(), COLUMN_ID_CAPTION, COLUMN_ID_DESC, COLUMN_ID_TYPE, KexiDataAwareObjectInterface::data(), KexiDataAwareObjectInterface::itemAt(), kexipluginswarn, KexiViewBase::propertySetReloaded(), KexiTableDesignerViewPrivate::sets, KexiTableDesignerViewPrivate::slotBeforeCellChanged_enabled, KexiDB::Field::TextGroup, KexiDB::Field::typeGroup(), KexiTableView::updateRow(), and KexiTableDesignerViewPrivate::view. Referenced by insertField(). |
|
|
Reimplemented from KexiViewBase. Definition at line 629 of file kexitabledesignerview.cpp. References KexiDataAwarePropertySet::currentPropertySet(), and KexiTableDesignerViewPrivate::sets. Referenced by propertySetSwitched(), slotAboutToShowContextMenu(), slotTogglePrimaryKey(), and updateActions(). |
|
|
Reimplemented to pass the information also to the "Lookup" tab.
Reimplemented from KexiViewBase. Definition at line 1894 of file kexitabledesignerview.cpp. References KexiViewBase::parentDialog(), propertySet(), and KexiViewBase::propertySetSwitched(). Referenced by initData(), and slotRowUpdated(). |
|
|
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. Implements KexiTableDesignerInterface. Definition at line 1505 of file kexitabledesignerview.cpp. References buildAlterTableActions(), KexiDB::AlterTableHandler::ExecutionArguments::debugString, KexiDB::AlterTableHandler::execute(), KexiViewBase::m_dialog, KexiViewBase::mainWin(), KexiViewBase::parentDialog(), KexiDB::AlterTableHandler::ExecutionArguments::result, KexiDialogBase::schemaData(), KexiDB::AlterTableHandler::setActions(), KexiDB::AlterTableHandler::ExecutionArguments::simulate, and tempData(). Referenced by slotSimulateAlterTableExecution(). |
|
||||||||||||||||
|
Called before row deleting in tableview.
Definition at line 1142 of file kexitabledesignerview.cpp. References addHistoryCommand(), KexiTableDesignerViewPrivate::addHistoryCommand_in_slotAboutToDeleteRow_enabled, KexiDataAwarePropertySet::at(), COLUMN_ID_ICON, KexiDataAwareObjectInterface::data(), KexiTableDesignerViewPrivate::primaryKeyExists, KexiTableDesignerViewPrivate::sets, and KexiTableDesignerViewPrivate::view. Referenced by KexiTableDesignerView(). |
|
|
Definition at line 1638 of file kexitabledesignerview.cpp. References KexiTableDesignerViewPrivate::contextMenuTitle, and propertySet(). Referenced by KexiTableDesignerView(). |
|
||||||||||||||||||||
|
|
Reaction on command execution from the command history Definition at line 1631 of file kexitabledesignerview.cpp. Referenced by KexiTableDesignerView(). |
|
||||||||||||
|
|
Redoes the recently undoed action. Definition at line 1620 of file kexitabledesignerview.cpp. References KexiTableDesignerViewPrivate::history, CommandHistory::redo(), and updateUndoRedoActions(). Referenced by KexiTableDesignerView(). |
|
|
Called before row inserting in tableview.
Definition at line 1129 of file kexitabledesignerview.cpp. References addHistoryCommand(), KexiTableDesignerViewPrivate::addHistoryCommand_in_slotRowInserted_enabled, KexiDataAwareObjectInterface::currentRow(), updateActions(), and KexiTableDesignerViewPrivate::view. Referenced by KexiTableDesignerView(). |
|
|
|
Simulates real execution of the Alter Table. For debugging. Definition at line 1536 of file kexitabledesignerview.cpp. References simulateAlterTableExecution(). Referenced by KexiTableDesignerView(). |
|
|
Toggles primary key for currently selected field. Does nothing for empty row. Definition at line 479 of file kexitabledesignerview.cpp. References propertySet(), and KexiTableDesignerViewPrivate::slotTogglePrimaryKeyCalled. Referenced by buildSchema(), and KexiTableDesignerView(). |
|
|
Undoes the recently performed action. Definition at line 1609 of file kexitabledesignerview.cpp. References KexiTableDesignerViewPrivate::history, CommandHistory::undo(), and updateUndoRedoActions(). Referenced by KexiTableDesignerView(). |
|
|
Reimplemented from KexiDataAwareView. Definition at line 473 of file kexitabledesignerview.cpp. References KexiDataAwareView::slotUpdateRowActions(), and updateActions(). |
|
|
||||||||||||
|
Reimplemented from KexiViewBase, because tables creation is more complex. No table schema altering is required, so just buildSchema() is used to create a new schema. Reimplemented from KexiViewBase. Definition at line 1375 of file kexitabledesignerview.cpp. References buildSchema(), KexiDB::Connection::createTable(), KexiViewBase::m_dialog, KexiViewBase::mainWin(), KexiViewBase::parentDialog(), KexiDialogBase::schemaData(), and tempData(). |
|
||||||||||||||||||||
|
|
Definition at line 1552 of file kexitabledesignerview.cpp. References KexiViewBase::parentDialog(). Referenced by debugStringForCurrentTableSchema(), initData(), KexiTableDesignerViewPrivate::messageForSavingChanges(), simulateAlterTableExecution(), storeData(), and storeNewData(). |
|
|
Reimplemented from KexiDataAwareView. Definition at line 460 of file kexitabledesignerview.cpp. References KexiTableDesignerViewPrivate::action_toggle_pkey, KexiViewBase::mainWin(), propertySet(), KexiViewBase::setAvailable(), and KexiTableDesignerViewPrivate::slotTogglePrimaryKeyCalled. |
|
|
Equivalent to updateActions(false). Called on row insert/delete in a KexiDataAwarePropertySet. Definition at line 909 of file kexitabledesignerview.cpp. Referenced by KexiTableDesignerView(), slotRowInserted(), slotUpdateRowActions(), and switchPrimaryKey(). |
|
|
Updates undo/redo shared actions availability by looking at command history's action.
Definition at line 1601 of file kexitabledesignerview.cpp. References KexiTableDesignerViewPrivate::historyActionCollection, and KexiViewBase::setAvailable(). Referenced by addHistoryCommand(), slotRedo(), and slotUndo(). |
The documentation for this class was generated from the following files:
