Kexi API Documentation (2.0 alpha)

KexiDB::FieldList Class Reference

#include <fieldlist.h>

Inheritance diagram for KexiDB::FieldList:

KexiDB::IndexSchema KexiDB::QuerySchema KexiDB::TableSchema KexiDB::InternalTableSchema List of all members.

Detailed Description

Helper class that stores list of fields.

Definition at line 37 of file fieldlist.h.

Public Member Functions

 FieldList (bool owner=false)
 FieldList (const FieldList &fl)
virtual ~FieldList ()
uint fieldCount () const
FieldListaddField (Field *field)
virtual FieldListinsertField (uint index, Field *field)
virtual void removeField (KexiDB::Field *field)
Fieldfield (uint id)
virtual Fieldfield (const QString &name)
bool hasField (const Field *field)
int indexOf (const Field *field)
QStringList names () const
Field::ListIterator fieldsIterator () const
Field::Listfields ()
Field::ListautoIncrementFields ()
bool isOwner () const
virtual void clear ()
virtual QString debugString ()
void debug ()
FieldListsubList (const QString &n1, const QString &n2=QString::null, const QString &n3=QString::null, const QString &n4=QString::null, const QString &n5=QString::null, const QString &n6=QString::null, const QString &n7=QString::null, const QString &n8=QString::null, const QString &n9=QString::null, const QString &n10=QString::null, const QString &n11=QString::null, const QString &n12=QString::null, const QString &n13=QString::null, const QString &n14=QString::null, const QString &n15=QString::null, const QString &n16=QString::null, const QString &n17=QString::null, const QString &n18=QString::null)
FieldListsubList (const QStringList &list)
QString sqlFieldsList (Driver *driver)
void renameField (const QString &oldName, const QString &newName)
void renameField (KexiDB::Field *field, const QString &newName)

Static Public Member Functions

static QString sqlFieldsList (Field::List *list, Driver *driver)

Protected Attributes

Field::List m_fields
QDict< Fieldm_fields_by_name
 Fields collected by name. Not used by QuerySchema.
Field::Listm_autoinc_fields


Constructor & Destructor Documentation

FieldList::FieldList bool  owner = false  ) 
 

Creates empty list of fields. If owner is true, the list will be owner of any added field, what means that these field will be removed on the list destruction. Otherwise, the list just points any field that was added.

See also:
isOwner()

Definition at line 29 of file fieldlist.cpp.

References m_autoinc_fields, m_fields, and m_fields_by_name.

Referenced by subList().

FieldList::FieldList const FieldList fl  ) 
 

Copy constructor.

Definition at line 38 of file fieldlist.cpp.

References addField(), m_autoinc_fields, m_fields, m_fields_by_name, and KexiDB::Field::m_parent.

FieldList::~FieldList  )  [virtual]
 

Destroys the list. If the list owns fields (see constructor), these are also deleted.

Definition at line 53 of file fieldlist.cpp.

References m_autoinc_fields.


Member Function Documentation

FieldList & FieldList::addField Field field  ) 
 

Adds field at the and of field list.

Definition at line 103 of file fieldlist.cpp.

References insertField(), and m_fields.

Referenced by KexiCSVImportDialog::accept(), KexiDB::IndexSchema::addField(), KexiProject::createInternalStructures(), KexiMigration::PqxxMigrate::drv_readTableSchema(), KexiMigration::MySQLMigrate::drv_readTableSchema(), FieldList(), KexiMigration::KexiMigrate::performImport(), KexiDB::Connection::setupKexiDBSystemSchema(), and KexiDB::Connection::setupTableSchema().

Field::List * FieldList::autoIncrementFields  ) 
 

Returns:
list of autoincremented fields. The list is owned by this FieldList object.

Reimplemented in KexiDB::QuerySchema.

Definition at line 240 of file fieldlist.cpp.

References KexiDB::Field::isAutoIncrement(), m_autoinc_fields, and m_fields.

void FieldList::clear  )  [virtual]
 

Removes all fields from the list.

Reimplemented in KexiDB::QuerySchema, and KexiDB::TableSchema.

Definition at line 58 of file fieldlist.cpp.

References m_autoinc_fields, m_fields, and m_fields_by_name.

Referenced by KexiDB::TableSchema::clear(), KexiDB::QuerySchema::clear(), and KexiDB::IndexSchema::IndexSchema().

void FieldList::debug  ) 
 

Shows debug information about all fields in the list.

Definition at line 143 of file fieldlist.cpp.

References debugString(), and KexiDBDbg.

Referenced by KexiDB::TableOrQuerySchema::debug(), KexiDB::AlterTableHandler::execute(), KexiFormDataProvider::invalidateDataSources(), KexiQueryPart::loadSchemaData(), and KexiDB::Connection::setupKexiDBSystemSchema().

QString FieldList::debugString  )  [virtual]
 

Returns:
String for debugging purposes.

Reimplemented in KexiDB::IndexSchema, KexiDB::QuerySchema, and KexiDB::TableSchema.

Definition at line 123 of file fieldlist.cpp.

References KexiDB::Field::debugString(), field(), and m_fields.

Referenced by debug(), KexiDB::TableSchema::debugString(), KexiDB::QuerySchema::debugString(), KexiDB::IndexSchema::debugString(), and KexiDialogBase::storeNewData().

Field * FieldList::field const QString name  )  [virtual]
 

Returns:
field with name name or NULL if there is no such a field.

Definition at line 118 of file fieldlist.cpp.

References m_fields_by_name.

Field* KexiDB::FieldList::field uint  id  )  [inline]
 

Returns:
field id or NULL if there is no such a field.

Reimplemented in KexiDB::QuerySchema.

Definition at line 74 of file fieldlist.h.

Referenced by KexiCSVImportDialog::accept(), addColumn(), KexiRelationView::addConnection(), KexiQueryDesignerGuiEditor::buildSchema(), KexiDB::QuerySchema::computeFieldsExpanded(), debugString(), KexiDB::AlterTableHandler::execute(), KexiDB::AlterTableHandler::ChangeFieldPropertyAction::execute(), KexiDB::TableOrQuerySchema::field(), KexiDB::QuerySchema::findTableField(), KexiFormPart::generateForm(), KexiDB::PreparedStatement::generateStatementString(), KexiDB::IndexSchema::IndexSchema(), KexiFormView::initDataSource(), KexiDB::Connection::loadExtendedTableSchemaData(), KexiBLOBBuffer::objectForId(), KexiDB::Connection::selectStatement(), KexiDB::TableSchema::setLookupFieldSchema(), KexiQueryDesignerGuiEditor::slotTableFieldDoubleClicked(), and KexiDB::VariableExpr::validate().

uint KexiDB::FieldList::fieldCount  )  const [inline]
 

Returns:
number of fields in the list.

Definition at line 56 of file fieldlist.h.

Referenced by KexiDB::QuerySchema::computeFieldsExpanded(), KexiDB::Connection::createTable(), KexiDB::QuerySchema::debugString(), KexiDB::Connection::deleteRow(), KexiDB::AlterTableHandler::execute(), KexiDB::Field::Field(), KexiFormPart::generateForm(), KexiDB::PreparedStatement::generateStatementString(), KexiDB::QuerySchema::insertField(), KexiDB::Connection::insertRow(), KexiDB::QuerySchema::pkeyFieldsOrder(), KexiDB::Connection::selectStatement(), KexiDB::QuerySchema::setColumnVisible(), KexiDB::IndexSchema::setForeignKey(), KexiDB::Relationship::setIndices(), KexiDB::TableSchema::setPrimaryKey(), and KexiDB::Connection::updateRow().

Field::List* KexiDB::FieldList::fields  )  [inline]
 

Definition at line 91 of file fieldlist.h.

Referenced by KexiDB::QuerySchema::computeFieldsExpanded(), KexiCellEditorFactory::createEditor(), KexiDB::Connection::createTable(), KexiDB::Connection::deleteAllRows(), KexiDB::Connection::findSystemFieldName(), KexiFormView::initForm(), KexiDB::Connection::insertRecord(), KexiDB::Connection::insertRow(), KexiDB::Relationship::setIndices(), KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(), and KexiDB::Connection::updateRow().

Field::ListIterator KexiDB::FieldList::fieldsIterator  )  const [inline]
 

Definition at line 89 of file fieldlist.h.

Referenced by KexiDB::QuerySchema::computeFieldsExpanded(), KexiDB::Connection::deleteRow(), KexiDB::SQLitePreparedStatement::execute(), KexiDB::MySqlPreparedStatement::execute(), KexiDB::AlterTableHandler::execute(), KexiDB::PreparedStatement::generateStatementString(), KexiDB::Connection::selectStatement(), KexiDB::Connection::storeMainFieldSchema(), KexiQueryDesignerGuiEditor::updateColumnsData(), and KexiDB::Connection::updateRow().

bool KexiDB::FieldList::hasField const Field field  )  [inline]
 

Returns:
true if this list contains given field.

Definition at line 80 of file fieldlist.h.

Referenced by KexiDB::TableSchema::anyNonPKField(), and KexiFormView::initDataSource().

int KexiDB::FieldList::indexOf const Field field  )  [inline]
 

Returns:
first occurrence of field in the list or -1 if this list does not contain this field.

Definition at line 84 of file fieldlist.h.

Referenced by KexiDB::QuerySchema::pkeyFieldsOrder().

FieldList & FieldList::insertField uint  index,
Field field
[virtual]
 

Inserts field into a specified position (index).

Note: You can reimplement this method but you should still call this implementation in your subclass.

Definition at line 68 of file fieldlist.cpp.

References KexiDBFatal, m_fields, m_fields_by_name, and KexiDB::Field::name().

Referenced by addField(), KexiDB::TableSchema::insertField(), and KexiDB::QuerySchema::insertField().

bool KexiDB::FieldList::isOwner  )  const [inline]
 

Returns:
true if fields in the list are owned by this list.

Definition at line 97 of file fieldlist.h.

QStringList FieldList::names  )  const
 

Returns:
list of field names for this list.

Definition at line 201 of file fieldlist.cpp.

References m_fields.

Referenced by KexiFormView::storeData().

void FieldList::removeField KexiDB::Field field  )  [virtual]
 

Removes field from the field list. Use with care.

Note: You can reimplement this method but you should still call this implementation in your subclass.

Reimplemented in KexiDB::QuerySchema, and KexiDB::TableSchema.

Definition at line 108 of file fieldlist.cpp.

References m_fields, m_fields_by_name, and KexiDB::Field::name().

Referenced by KexiDB::TableSchema::removeField(), and KexiDB::QuerySchema::removeField().

void FieldList::renameField KexiDB::Field field,
const QString newName
 

Definition at line 90 of file fieldlist.cpp.

References KexiDBFatal, m_fields_by_name, KexiDB::Field::name(), and KexiDB::Field::setName().

void FieldList::renameField const QString oldName,
const QString newName
 

Definition at line 85 of file fieldlist.cpp.

References m_fields_by_name.

Referenced by KexiDB::AlterTableHandler::ChangeFieldPropertyAction::updateTableSchema().

QString FieldList::sqlFieldsList Field::List list,
Driver driver
[static]
 

Like above, but thsi is convenient static function, so you can pass any list here.

Definition at line 213 of file fieldlist.cpp.

References KexiDB::Driver::escapeIdentifier().

QString FieldList::sqlFieldsList Driver driver  ) 
 

Returns:
a string that is a result of all field names concatenated and with "," between. This is usable e.g. as argument like "field1,field2" for "INSERT INTO (xxx) ..". The result of this method is effectively cached, and it is invalidated when set of fields changes (e.g. using clear() or addField()).

Definition at line 231 of file fieldlist.cpp.

References m_fields.

Referenced by KexiDB::Connection::insertRecord().

FieldList * FieldList::subList const QStringList &  list  ) 
 

Like above, but with a QStringList

Definition at line 191 of file fieldlist.cpp.

References _ADD_FIELD, and FieldList().

FieldList * FieldList::subList const QString n1,
const QString n2 = QString::null,
const QString n3 = QString::null,
const QString n4 = QString::null,
const QString n5 = QString::null,
const QString n6 = QString::null,
const QString n7 = QString::null,
const QString n8 = QString::null,
const QString n9 = QString::null,
const QString n10 = QString::null,
const QString n11 = QString::null,
const QString n12 = QString::null,
const QString n13 = QString::null,
const QString n14 = QString::null,
const QString n15 = QString::null,
const QString n16 = QString::null,
const QString n17 = QString::null,
const QString n18 = QString::null
 

Creates and returns list that contain fields selected by name. At least field (exising on this list) should be selected, otherwise NULL is returned. Returned FieldList object is not owned by any parent (so you need to destroy yourself) and Field objects included in it are not owned by it (but still as before, by 'this' object). Returned list can be usable e.g. as argument for Connection::insertRecord().

Definition at line 156 of file fieldlist.cpp.

References _ADD_FIELD, and FieldList().

Referenced by KexiPart::Manager::checkProject(), createFieldListForKexi__Fields(), KexiProject::createInternalStructures(), KexiFormView::storeData(), KexiDialogBase::storeNewData(), and KexiDB::Connection::storeObjectSchemaData().


Member Data Documentation

Field::List* KexiDB::FieldList::m_autoinc_fields [protected]
 

Definition at line 151 of file fieldlist.h.

Referenced by autoIncrementFields(), clear(), FieldList(), and ~FieldList().

Field::List KexiDB::FieldList::m_fields [protected]
 

Definition at line 149 of file fieldlist.h.

Referenced by KexiDB::QuerySchema::addField(), addField(), KexiDB::TableSchema::anyNonPKField(), autoIncrementFields(), clear(), KexiDB::Connection::createTableStatement(), KexiDB::TableSchema::debugString(), KexiDB::QuerySchema::debugString(), debugString(), FieldList(), KexiDB::TableSchema::insertField(), KexiDB::QuerySchema::insertField(), insertField(), KexiDB::TableSchema::lookupFieldsList(), names(), removeField(), KexiDB::QuerySchema::setColumnAlias(), KexiDB::IndexSchema::setForeignKey(), and sqlFieldsList().

QDict<Field> KexiDB::FieldList::m_fields_by_name [protected]
 

Fields collected by name. Not used by QuerySchema.

Definition at line 150 of file fieldlist.h.

Referenced by clear(), field(), FieldList(), insertField(), removeField(), and renameField().


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