Kexi API Documentation (2.0 alpha)

KexiTableDesignerView Class Reference

#include <kexitabledesignerview.h>

Inheritance diagram for KexiTableDesignerView:

KexiDataTable KexiTableDesignerInterface KexiDataAwareView KexiViewBase QWidget KexiActionProxy List of all members.

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::TempDatatempData () 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::FieldbuildField (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::SchemaDatastoreNewData (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

KexiTableDesignerView::KexiTableDesignerView KexiMainWindow win,
QWidget parent
 

Creates a new alter table dialog.

Definition at line 107 of file kexitabledesignerview.cpp.

References KexiTableDesignerViewPrivate::action_toggle_pkey, KexiTableViewData::addColumn(), KexiUtils::colorizeIconToTextColor(), KexiDataAwareObjectInterface::contextMenu(), KexiTableDesignerViewPrivate::contextMenuTitle, KexiTableDesignerViewPrivate::data, KexiDB::Field::Enum, executeRealAlterTable(), KexiTableViewColumn::field(), KexiTableDesignerViewPrivate::history, KexiCustomPropertyFactory::init(), KexiDB::Connection::isReadOnly(), KexiDB::Field::LastTypeGroup, KexiDataAwareView::mainWidget(), KexiViewBase::mainWin(), KexiTableDesignerViewPrivate::maxTypeNameTextWidth, KexiTableView::minimumSizeHint(), KexiActionProxy::plugSharedAction(), KexiViewBase::setAvailable(), KexiTableViewColumn::setHeaderTextVisible(), KexiTableViewColumn::setIcon(), KexiTableViewData::setInsertingEnabled(), KexiTableViewColumn::setReadOnly(), KexiTableViewData::setReadOnly(), KexiTableDesignerViewPrivate::sets, KexiTableView::setSpreadSheetMode(), KexiViewBase::sharedAction(), slotAboutToDeleteRow(), slotAboutToShowContextMenu(), slotBeforeCellChanged(), slotCommandExecuted(), slotRedo(), slotRowInserted(), slotRowUpdated(), slotSimulateAlterTableExecution(), slotTogglePrimaryKey(), slotUndo(), KexiDB::Field::Text, KexiDB::Field::typeGroupName(), updateActions(), and KexiTableDesignerViewPrivate::view.

KexiTableDesignerView::~KexiTableDesignerView  )  [virtual]
 

Definition at line 204 of file kexitabledesignerview.cpp.


Member Function Documentation

void KexiTableDesignerView::addHistoryCommand KCommand command,
bool  execute
[protected]
 

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().

tristate KexiTableDesignerView::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 621 of file kexitabledesignerview.cpp.

References Kexi::DataViewMode, initData(), and Kexi::NoViewMode.

tristate KexiTableDesignerView::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 574 of file kexitabledesignerview.cpp.

References KexiTableView::acceptRowEdit(), cancelled, Kexi::DataViewMode, KexiViewBase::dirty(), KexiTableDesignerViewPrivate::dontAskOnStoreData, KexiTableDesignerViewPrivate::messageForSavingChanges(), KexiViewBase::parentDialog(), Kexi::TextViewMode, and KexiTableDesignerViewPrivate::view.

tristate KexiTableDesignerView::buildAlterTableActions KexiDB::AlterTableHandler::ActionList actions  )  [protected]
 

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().

KexiDB::Field * KexiTableDesignerView::buildField const KoProperty::Set &  set  )  const
 

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().

tristate KexiTableDesignerView::buildSchema KexiDB::TableSchema schema,
bool  beSilent = false
[protected]
 

Builds table schema by looking at the current design. Used in storeNewData() and storeData(). If beSilent is true, no message boxes are used to show questions or warnings. This is used in the altertable test suite (kexi/tests/altertable).

Returns:
true on successful schema creating, false on failure and cancelled when there was a problem with user's design (and user has been informed about it).

Definition at line 1191 of file kexitabledesignerview.cpp.

References KexiTableView::acceptRowEdit(), KexiDataAwarePropertySet::at(), buildField(), cancelled, COLUMN_ID_CAPTION, COLUMN_ID_TYPE, KexiDataAwareObjectInterface::data(), KexiTableView::insertEmptyRow(), KexiDB::Field::IntegerGroup, kexipluginsdbg, kexipluginswarn, KexiTableDesignerViewPrivate::primaryKeyExists, KexiDB::LookupFieldSchema::rowSource(), KexiDataAwareObjectInterface::selectedItem(), KexiDB::LookupFieldSchema::setBoundColumn(), KexiDataAwareObjectInterface::setCursorPosition(), KexiTableDesignerViewPrivate::sets, KexiDB::LookupFieldSchema::setVisibleColumn(), slotTogglePrimaryKey(), KexiTableView::startEditCurrentCell(), and KexiTableDesignerViewPrivate::view.

Referenced by debugStringForCurrentTableSchema(), storeData(), and storeNewData().

void KexiTableDesignerView::changeFieldProperty int  fieldUID,
const QCString &  propertyName,
const QVariant &  newValue,
KoProperty::Property::ListData *const   listData = 0,
bool  addCommand = false
 

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.

void KexiTableDesignerView::changeFieldPropertyForRow int  row,
const QCString &  propertyName,
const QVariant &  newValue,
KoProperty::Property::ListData *const   listData,
bool  addCommand
[virtual]
 

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().

void KexiTableDesignerView::changePropertyVisibility int  fieldUID,
const QCString &  propertyName,
bool  visible
 

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.

void KexiTableDesignerView::clearRow int  row,
bool  addCommand = false
[virtual]
 

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.

KoProperty::Set * KexiTableDesignerView::createPropertySet int  row,
const KexiDB::Field field,
bool  newOne = false
[protected]
 

Creates a new property set for field. The property set will be asigned to row, and owned by this dialog. If newOne is true, the property set will be marked as newly created.

Returns:
newly created property set.

Definition at line 304 of file kexitabledesignerview.cpp.

References KexiDB::LookupFieldSchema::boundColumn(), KexiDB::Field::caption(), KexiDB::Field::customProperty(), DEFAULT_OBJECT_TYPE_VALUE, KexiDB::Field::defaultValue(), KexiDB::Field::description(), KexiTableDesignerViewPrivate::generateUniqueId(), getSubTypeListData(), KexiCustomPropertyFactory::Identifier, KexiDataAwarePropertySet::insert(), KexiDB::Field::isAutoIncrement(), KexiDB::Field::isIndexed(), KexiDB::Field::isNotEmpty(), KexiDB::Field::isNotNull(), KexiDB::Field::isPrimaryKey(), KexiDB::Field::isUniqueKey(), KexiDB::Field::isUnsigned(), KexiDB::Field::length(), KexiViewBase::mainWin(), KexiDB::Field::name(), KexiDB::Field::precision(), KexiDB::LookupFieldSchema::rowSource(), KexiTableDesignerViewPrivate::sets, slotPropertyChanged(), KexiDB::Field::table(), KexiDB::Field::type(), KexiDB::Field::typeGroup(), KexiDB::Field::typeGroupString(), KexiDB::Field::typeString(), KexiTableDesignerViewPrivate::updatePropertiesVisibility(), KexiDB::Field::variantType(), KexiDB::LookupFieldSchema::visibleColumn(), KexiDB::Field::visibleDecimalPlaces(), and KexiDB::Field::width().

Referenced by initData(), and slotRowUpdated().

QString KexiTableDesignerView::debugStringForCurrentTableSchema tristate result  )  [virtual]
 

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().

void KexiTableDesignerView::deleteRow int  row,
bool  addCommand = false
[virtual]
 

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.

tristate KexiTableDesignerView::executeRealAlterTable  )  [virtual, slot]
 

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.

Implements KexiTableDesignerInterface.

Definition at line 1541 of file kexitabledesignerview.cpp.

References KexiViewBase::mainWin(), KexiTableDesignerViewPrivate::recentResultOfStoreData, and KexiTableDesignerViewPrivate::tempStoreDataUsingRealAlterTable.

Referenced by KexiTableDesignerView().

void KexiTableDesignerView::getSubTypeListData KexiDB::Field::TypeGroup  fieldTypeGroup,
QStringList &  stringsList,
QStringList &  namesList
[protected]
 

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().

void KexiTableDesignerView::initData  )  [protected]
 

called whenever data should be reloaded (on switching to this view mode)

Definition at line 210 of file kexitabledesignerview.cpp.

References KexiTableView::adjustColumnWidthToContents(), KexiTableViewData::append(), KexiDB::Field::captionOrName(), COLUMN_ID_CAPTION, COLUMN_ID_DESC, COLUMN_ID_ICON, COLUMN_ID_TYPE, KexiTableView::columnWidth(), KexiTableViewData::createItem(), createPropertySet(), KexiTableDesignerViewPrivate::data, KexiTableViewData::deleteAllRows(), KexiDB::Field::description(), field, KexiDB::Field::isPrimaryKey(), KexiTableDesignerViewPrivate::maxTypeNameTextWidth, KexiDB::LookupFieldSchema::RowSource::NoType, KexiTableDesignerViewPrivate::primaryKeyExists, propertySetSwitched(), KexiTableView::rowHeight(), KexiDB::LookupFieldSchema::rowSource(), KexiTableView::setColumnStretchEnabled(), KexiTableView::setColumnWidth(), KexiDataAwareObjectInterface::setCursorPosition(), KexiTableView::setData(), KexiViewBase::setDirty(), KexiDB::Field::table(), tempData(), KexiDB::Field::typeGroup(), and KexiTableDesignerViewPrivate::view.

Referenced by afterSwitchFrom().

void KexiTableDesignerView::insertEmptyRow int  row,
bool  addCommand = false
[virtual]
 

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.

void KexiTableDesignerView::insertField int  row,
KoProperty::Set &  set,
bool  addCommand = false
[virtual]
 

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().

void KexiTableDesignerView::insertField int  row,
const QString caption,
bool  addCommand = false
[virtual]
 

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().

void KexiTableDesignerView::insertFieldInternal int  row,
KoProperty::Set *  set,
const QString caption,
bool  addCommand
[protected]
 

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().

KoProperty::Set * KexiTableDesignerView::propertySet  )  [protected, virtual]
 

Returns:
property set associated with currently selected row (i.e. field) or 0 if current row is empty.

Reimplemented from KexiViewBase.

Definition at line 629 of file kexitabledesignerview.cpp.

References KexiDataAwarePropertySet::currentPropertySet(), and KexiTableDesignerViewPrivate::sets.

Referenced by propertySetSwitched(), slotAboutToShowContextMenu(), slotTogglePrimaryKey(), and updateActions().

void KexiTableDesignerView::propertySetSwitched  )  [protected, virtual]
 

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().

tristate KexiTableDesignerView::simulateAlterTableExecution QString debugTarget  )  [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.

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().

void KexiTableDesignerView::slotAboutToDeleteRow KexiTableItem item,
KexiDB::ResultInfo result,
bool  repaint
[protected, slot]
 

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().

void KexiTableDesignerView::slotAboutToShowContextMenu  )  [protected, slot]
 

Todo:
show "field" icon

Definition at line 1638 of file kexitabledesignerview.cpp.

References KexiTableDesignerViewPrivate::contextMenuTitle, and propertySet().

Referenced by KexiTableDesignerView().

void KexiTableDesignerView::slotBeforeCellChanged KexiTableItem item,
int  colnum,
QVariant &  newValue,
KexiDB::ResultInfo result
[protected, slot]
 

Called before cell change in tableview.

forceAddCommand

Todo:
maybe this is good for other data types as well?
forceAddCommand

rememberOldValue

forceAddCommand

rememberOldValue

Todo:
should we display (passive?) dialog informing about cleared pkey?
rememberOldValue

Definition at line 650 of file kexitabledesignerview.cpp.

References addHistoryCommand(), KexiTableDesignerViewPrivate::addHistoryCommand_in_slotPropertyChanged_enabled, KexiDB::Field::Boolean, COLUMN_ID_CAPTION, COLUMN_ID_DESC, COLUMN_ID_ICON, COLUMN_ID_TYPE, KexiDataAwareObjectInterface::data(), KexiDB::defaultTypeForGroup(), KexiDataAwarePropertySet::findPropertySetForItem(), getSubTypeListData(), KexiDB::Field::IntegerGroup, KexiDB::Field::InvalidType, kexipluginsdbg, KexiDB::Field::LastTypeGroup, KexiViewBase::propertySetReloaded(), KexiTableDesignerViewPrivate::setPropertyValueIfNeeded(), KexiTableDesignerViewPrivate::sets, KexiTableDesignerViewPrivate::slotBeforeCellChanged_enabled, KexiDB::Field::Text, KexiDB::Field::typeForString(), KexiDB::Field::typeGroup(), KexiDB::Field::typeName(), KexiDB::Field::typeString(), KexiTableDesignerViewPrivate::updatePropertiesVisibility(), and KexiTableDesignerViewPrivate::view.

Referenced by KexiTableDesignerView().

void KexiTableDesignerView::slotCommandExecuted KCommand command  )  [protected, slot]
 

Reaction on command execution from the command history

Definition at line 1631 of file kexitabledesignerview.cpp.

Referenced by KexiTableDesignerView().

void KexiTableDesignerView::slotPropertyChanged KoProperty::Set &  set,
KoProperty::Property &  property
[protected, slot]
 

Called after any property has been changed in the current property set, to perform some actions (like updating other dependent properties)

Definition at line 914 of file kexitabledesignerview.cpp.

References addHistoryCommand(), KexiTableDesignerViewPrivate::addHistoryCommand_in_slotPropertyChanged_enabled, KexiDB::Field::BigInteger, KexiDataAwarePropertySet::findRowForPropertyValue(), KexiDB::intToFieldType(), KexiDataAwareObjectInterface::itemAt(), kexipluginsdbg, KexiTableDesignerViewPrivate::primaryKeyExists, KexiViewBase::propertySetReloaded(), KexiTableDesignerViewPrivate::setPropertyValueIfNeeded(), KexiTableDesignerViewPrivate::sets, KexiTableDesignerViewPrivate::slotPropertyChanged_primaryKey_enabled, KexiTableDesignerViewPrivate::slotPropertyChanged_subType_enabled, switchPrimaryKey(), tryCastQVariant(), KexiDB::Field::typeForString(), KexiDB::Field::typeName(), KexiDB::Field::typeString(), KexiTableDesignerViewPrivate::updateIconForItem(), KexiTableDesignerViewPrivate::updatePropertiesVisibility(), KexiDB::Field::variantType(), and KexiTableDesignerViewPrivate::view.

Referenced by createPropertySet().

void KexiTableDesignerView::slotRedo  )  [protected, slot]
 

Redoes the recently undoed action.

Definition at line 1620 of file kexitabledesignerview.cpp.

References KexiTableDesignerViewPrivate::history, CommandHistory::redo(), and updateUndoRedoActions().

Referenced by KexiTableDesignerView().

void KexiTableDesignerView::slotRowInserted  )  [protected, slot]
 

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().

void KexiTableDesignerView::slotRowUpdated KexiTableItem item  )  [protected, slot]
 

Called on row change in a tableview.

Definition at line 827 of file kexitabledesignerview.cpp.

References addHistoryCommand(), KexiTableDesignerViewPrivate::addHistoryCommand_in_slotRowUpdated_enabled, KexiDataAwarePropertySet::at(), KexiDB::Field::Boolean, COLUMN_ID_CAPTION, COLUMN_ID_DESC, COLUMN_ID_TYPE, createPropertySet(), KexiDataAwareObjectInterface::data(), KexiDB::Field::debugString(), KexiDB::defaultTypeForGroup(), description, field, KexiDB::intToFieldType(), kexipluginsdbg, kexipluginswarn, KexiDB::Field::NoConstraints, KexiDB::Field::NoOptions, propertySetSwitched(), KexiDataAwarePropertySet::remove(), KexiDB::Field::setDefaultValue(), KexiViewBase::setDirty(), KexiDB::Field::setNotNull(), KexiTableDesignerViewPrivate::sets, KexiUtils::string2Identifier(), and KexiTableDesignerViewPrivate::view.

Referenced by KexiTableDesignerView().

void KexiTableDesignerView::slotSimulateAlterTableExecution  )  [protected, slot]
 

Simulates real execution of the Alter Table. For debugging.

Definition at line 1536 of file kexitabledesignerview.cpp.

References simulateAlterTableExecution().

Referenced by KexiTableDesignerView().

void KexiTableDesignerView::slotTogglePrimaryKey  )  [protected, slot]
 

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().

void KexiTableDesignerView::slotUndo  )  [protected, slot]
 

Undoes the recently performed action.

Definition at line 1609 of file kexitabledesignerview.cpp.

References KexiTableDesignerViewPrivate::history, CommandHistory::undo(), and updateUndoRedoActions().

Referenced by KexiTableDesignerView().

void KexiTableDesignerView::slotUpdateRowActions int  row  )  [protected, virtual, slot]
 

Reimplemented from KexiDataAwareView.

Definition at line 473 of file kexitabledesignerview.cpp.

References KexiDataAwareView::slotUpdateRowActions(), and updateActions().

tristate KexiTableDesignerView::storeData bool  dontAsk = false  )  [protected, virtual]
 

Reimplemented from KexiViewBase, because table storage is more complex. Table schema altering may be required, so just buildSchema() is used to create a new schema.

Reimplemented from KexiViewBase.

Definition at line 1411 of file kexitabledesignerview.cpp.

References KexiDB::Connection::alterTable(), KexiTablePart::askForClosingObjectsUsingTableSchema(), buildAlterTableActions(), buildSchema(), cancelled, KexiDB::Object::debugError(), KexiTableDesignerViewPrivate::dontAskOnStoreData, KexiDB::AlterTableHandler::execute(), kexipluginsdbg, KexiViewBase::m_dialog, KexiViewBase::mainWin(), KexiTableDesignerViewPrivate::messageForSavingChanges(), KexiDB::AlterTableHandler::ExecutionArguments::onlyComputeRequirements, KexiViewBase::parentDialog(), KexiTableDesignerViewPrivate::recentResultOfStoreData, KexiDB::AlterTableHandler::ExecutionArguments::requirements, KexiDB::AlterTableHandler::ExecutionArguments::result, KexiDB::AlterTableHandler::SchemaAlteringRequired, KexiDialogBase::schemaData(), KexiDB::AlterTableHandler::setActions(), tempData(), KexiTableDesignerViewPrivate::tempStoreDataUsingRealAlterTable, and tristate::toString().

KexiDB::SchemaData * KexiTableDesignerView::storeNewData const KexiDB::SchemaData sdata,
bool &  cancel
[protected, virtual]
 

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().

void KexiTableDesignerView::switchPrimaryKey KoProperty::Set &  propertySet,
bool  set,
bool  aWasPKey = false,
CommandGroup commandGroup = 0
[protected]
 

Helper, used for slotTogglePrimaryKey() and slotPropertyChanged(). Assigns primary key icon and value for property set propertySet, and deselects it from previous pkey's row. aWasPKey is internal. If commandGroup is not 0, it is used as parent group for storing actions' history.

Definition at line 503 of file kexitabledesignerview.cpp.

References KexiTableDesignerViewPrivate::action_toggle_pkey, KexiDataAwarePropertySet::at(), KexiDB::Field::BigInteger, COLUMN_ID_ICON, COLUMN_ID_TYPE, KexiDataAwareObjectInterface::currentRow(), KexiDataAwareObjectInterface::data(), KexiDB::Field::IntegerGroup, KexiDataAwareObjectInterface::itemAt(), KexiTableDesignerViewPrivate::primaryKeyExists, KexiDataAwareObjectInterface::selectedItem(), KexiTableDesignerViewPrivate::setPropertyValueIfNeeded(), KexiTableDesignerViewPrivate::sets, KexiDataAwarePropertySet::size(), KexiTableDesignerViewPrivate::slotBeforeCellChanged_enabled, KexiDB::Field::typeString(), updateActions(), and KexiTableDesignerViewPrivate::view.

Referenced by slotPropertyChanged().

KexiTablePart::TempData * KexiTableDesignerView::tempData  )  const
 

Definition at line 1552 of file kexitabledesignerview.cpp.

References KexiViewBase::parentDialog().

Referenced by debugStringForCurrentTableSchema(), initData(), KexiTableDesignerViewPrivate::messageForSavingChanges(), simulateAlterTableExecution(), storeData(), and storeNewData().

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

Todo:
check if we can set pkey for this column type (eg. BLOB?)

Reimplemented from KexiDataAwareView.

Definition at line 460 of file kexitabledesignerview.cpp.

References KexiTableDesignerViewPrivate::action_toggle_pkey, KexiViewBase::mainWin(), propertySet(), KexiViewBase::setAvailable(), and KexiTableDesignerViewPrivate::slotTogglePrimaryKeyCalled.

void KexiTableDesignerView::updateActions  )  [protected, slot]
 

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().

void KexiTableDesignerView::updateUndoRedoActions  )  [protected]
 

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:
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:28 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003