Kexi API Documentation (2.0 alpha)

KexiDB::AlterTableHandler::ChangeFieldPropertyAction Class Reference

#include <alter.h>

Inheritance diagram for KexiDB::AlterTableHandler::ChangeFieldPropertyAction:

KexiDB::AlterTableHandler::FieldActionBase KexiDB::AlterTableHandler::ActionBase List of all members.

Detailed Description

Defines an action for changing a single property value of a table field. Supported properties are currently: "name", "type", "caption", "description", "unsigned", "length", "precision", "width", "defaultValue", "primaryKey", "unique", "notNull", "allowEmpty", "autoIncrement", "indexed", "visibleDecimalPlaces"

More to come.

Definition at line 271 of file alter.h.

Public Member Functions

 ChangeFieldPropertyAction (const QString &fieldName, const QString &propertyName, const QVariant &newValue, int uid)
 ChangeFieldPropertyAction (bool null)
virtual ~ChangeFieldPropertyAction ()
QString propertyName () const
QVariant newValue () const
virtual QString debugString (const DebugOptions &debugOptions=DebugOptions())
virtual void simplifyActions (ActionDictDict &fieldActions)
virtual bool shouldBeRemoved (ActionDictDict &fieldActions)
virtual tristate updateTableSchema (TableSchema &table, Field *field, QMap< QString, QString > &fieldMap)

Protected Member Functions

virtual void updateAlteringRequirements ()
virtual tristate execute (Connection &conn, TableSchema &table)
 Performs physical execution of this action.

Protected Attributes

QString m_propertyName
QVariant m_newValue


Constructor & Destructor Documentation

AlterTableHandler::ChangeFieldPropertyAction::ChangeFieldPropertyAction const QString fieldName,
const QString propertyName,
const QVariant &  newValue,
int  uid
 

Definition at line 170 of file alter.cpp.

AlterTableHandler::ChangeFieldPropertyAction::ChangeFieldPropertyAction bool  null  ) 
 

Definition at line 178 of file alter.cpp.

AlterTableHandler::ChangeFieldPropertyAction::~ChangeFieldPropertyAction  )  [virtual]
 

Definition at line 183 of file alter.cpp.


Member Function Documentation

QString AlterTableHandler::ChangeFieldPropertyAction::debugString const DebugOptions &  debugOptions = DebugOptions()  )  [virtual]
 

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 193 of file alter.cpp.

References KexiDB::AlterTableHandler::FieldActionBase::fieldName(), KexiDB::AlterTableHandler::FieldActionBase::m_fieldUID, m_newValue, and m_propertyName.

Referenced by simplifyActions().

tristate AlterTableHandler::ChangeFieldPropertyAction::execute Connection conn,
TableSchema table
[protected, virtual]
 

Performs physical execution of this action.

Many of the properties must be applied using a separate algorithm.

Todo:
errmsg
Todo:

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 392 of file alter.cpp.

References KexiDB::AlterTableHandler::alteringTypeForProperty(), KexiDB::FieldList::field(), field, KexiDB::AlterTableHandler::FieldActionBase::fieldName(), m_propertyName, newValue(), KexiDB::AlterTableHandler::SchemaAlteringRequired, and KexiDB::setFieldProperty().

QVariant KexiDB::AlterTableHandler::ChangeFieldPropertyAction::newValue  )  const [inline]
 

Definition at line 280 of file alter.h.

Referenced by KexiTableDesignerCommands::ChangePropertyVisibilityCommand::execute(), KexiTableDesignerCommands::ChangeFieldPropertyCommand::execute(), execute(), KexiTableDesignerCommands::ChangePropertyVisibilityCommand::name(), KexiTableDesignerCommands::ChangeFieldPropertyCommand::name(), simplifyActions(), and updateTableSchema().

QString KexiDB::AlterTableHandler::ChangeFieldPropertyAction::propertyName  )  const [inline]
 

Definition at line 279 of file alter.h.

Referenced by KexiTableDesignerCommands::ChangeFieldPropertyCommand::createAction(), KexiTableDesignerCommands::ChangePropertyVisibilityCommand::execute(), KexiTableDesignerCommands::ChangeFieldPropertyCommand::execute(), KexiTableDesignerCommands::ChangePropertyVisibilityCommand::name(), KexiTableDesignerCommands::ChangeFieldPropertyCommand::name(), KexiTableDesignerCommands::ChangePropertyVisibilityCommand::unexecute(), and KexiTableDesignerCommands::ChangeFieldPropertyCommand::unexecute().

bool AlterTableHandler::ChangeFieldPropertyAction::shouldBeRemoved ActionDictDict fieldActions  )  [virtual]
 

After calling simplifyActions() for each action, shouldBeRemoved() is called for them as an additional step. This is used for ChangeFieldPropertyAction items so actions that do not change property values are removed.

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 364 of file alter.cpp.

References KexiDB::AlterTableHandler::FieldActionBase::fieldName(), and m_newValue.

void AlterTableHandler::ChangeFieldPropertyAction::simplifyActions ActionDictDict fieldActions  )  [virtual]
 

Legend: A,B==fields, P==property, [....]==action, (..,..,..) group of actions, <...> internal operation. Case 1. (special) when new action=[rename A to B] and exists=[rename B to C] => remove [rename B to C] and set result to new [rename A to C] and go to 1b. Case 1b. when new action=[rename A to B] and actions exist like [set property P to C in field B] or like [delete field B] or like [move field B] => change B to A for all these actions Case 2. when new action=[change property in field A] (property != name) and exists=[remove A] or exists=[change property in field A] => do not add [change property in field A] because it will be removed anyway or the property will change

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 291 of file alter.cpp.

References createActionDict(), debugString(), KexiDB::AlterTableHandler::FieldActionBase::fieldName(), foreach_dict, KexiDBDbg, m_propertyName, newValue(), and KexiDB::AlterTableHandler::FieldActionBase::uid().

void AlterTableHandler::ChangeFieldPropertyAction::updateAlteringRequirements  )  [protected, virtual]
 

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 187 of file alter.cpp.

References KexiDB::AlterTableHandler::alteringTypeForProperty(), m_propertyName, and KexiDB::AlterTableHandler::ActionBase::setAlteringRequirements().

tristate AlterTableHandler::ChangeFieldPropertyAction::updateTableSchema TableSchema table,
Field field,
QMap< QString, QString > &  fieldMap
[virtual]
 

Reimplemented from KexiDB::AlterTableHandler::ActionBase.

Definition at line 370 of file alter.cpp.

References KexiDB::AlterTableHandler::alteringTypeForProperty(), cancelled, m_propertyName, KexiDB::Field::name(), newValue(), KexiDB::FieldList::renameField(), KexiDB::AlterTableHandler::SchemaAlteringRequired, and KexiDB::setFieldProperty().


Member Data Documentation

QVariant KexiDB::AlterTableHandler::ChangeFieldPropertyAction::m_newValue [protected]
 

Definition at line 297 of file alter.h.

Referenced by debugString(), and shouldBeRemoved().

QString KexiDB::AlterTableHandler::ChangeFieldPropertyAction::m_propertyName [protected]
 

Definition at line 296 of file alter.h.

Referenced by debugString(), execute(), simplifyActions(), updateAlteringRequirements(), and updateTableSchema().


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