Kexi API Documentation (2.0 alpha)

KexiTableViewColumn Class Reference

#include <kexitableviewdata.h>

List of all members.


Detailed Description

Single column definition.

Definition at line 52 of file kexitableviewdata.h.

Public Types

typedef QPtrList< KexiTableViewColumnList
typedef QPtrListIterator<
KexiTableViewColumn
ListIterator

Public Member Functions

 KexiTableViewColumn (KexiDB::Field &f, bool owner=false)
 KexiTableViewColumn (const QString &name, KexiDB::Field::Type ctype, uint cconst=KexiDB::Field::NoConstraints, uint options=KexiDB::Field::NoOptions, uint length=0, uint precision=0, QVariant defaultValue=QVariant(), const QString &caption=QString::null, const QString &description=QString::null, uint width=0)
 KexiTableViewColumn (const QString &name, KexiDB::Field::Type ctype, const QString &caption, const QString &description=QString::null)
 KexiTableViewColumn (const KexiDB::QuerySchema &query, KexiDB::QueryColumnInfo &aColumnInfo, KexiDB::QueryColumnInfo *aVisibleLookupColumnInfo=0)
 Db-aware version.
virtual ~KexiTableViewColumn ()
virtual bool acceptsFirstChar (const QChar &ch) const
bool isReadOnly () const
void setReadOnly (bool ro)
 forces readOnly flag to be set to ro
bool visible () const
 Column visibility. By default column is visible.
void setVisible (bool v)
 Changes column visibility.
void setIcon (const QIconSet &icon)
QIconSet icon () const
void setHeaderTextVisible (bool visible)
bool isHeaderTextVisible () const
QString captionAliasOrName () const
void setValidator (KexiUtils::Validator *v)
KexiUtils::Validatorvalidator () const
void setRelatedData (KexiTableViewData *data)
KexiTableViewDatarelatedData () const
KexiDB::Fieldfield () const
void setRelatedDataEditable (bool set)
bool relatedDataEditable () const

Public Attributes

KexiDB::QueryColumnInfocolumnInfo
KexiDB::QueryColumnInfovisibleLookupColumnInfo
bool isDBAware: 1
 true if data is stored in DB, not only in memeory

Protected Member Functions

 KexiTableViewColumn (bool)
 special ctor that do not allocate d member;
void init ()

Protected Attributes

QString m_captionAliasOrName
QIconSet m_icon
KexiUtils::Validatorm_validator
KexiTableViewDatam_data
 Data that this column is assigned to.
KexiTableViewDatam_relatedData
uint m_relatedDataPKeyID
KexiDB::Fieldm_field
bool m_readOnly: 1
bool m_fieldOwned: 1
bool m_visible: 1
bool m_relatedDataEditable: 1
bool m_headerTextVisible: 1

Friends

class KexiTableViewData


Member Typedef Documentation

typedef QPtrList<KexiTableViewColumn> KexiTableViewColumn::List
 

Definition at line 54 of file kexitableviewdata.h.

typedef QPtrListIterator<KexiTableViewColumn> KexiTableViewColumn::ListIterator
 

Definition at line 55 of file kexitableviewdata.h.


Constructor & Destructor Documentation

KexiTableViewColumn::KexiTableViewColumn KexiDB::Field f,
bool  owner = false
 

Not db-aware ctor. if owner is true, the field will be owned by this column, so you shouldn't care about destroying this field.

Definition at line 46 of file kexitableviewdata.cpp.

References KexiDB::Field::captionOrName(), init(), isDBAware, m_captionAliasOrName, m_field, and m_fieldOwned.

KexiTableViewColumn::KexiTableViewColumn const QString name,
KexiDB::Field::Type  ctype,
uint  cconst = KexiDB::Field::NoConstraints,
uint  options = KexiDB::Field::NoOptions,
uint  length = 0,
uint  precision = 0,
QVariant  defaultValue = QVariant(),
const QString caption = QString::null,
const QString description = QString::null,
uint  width = 0
 

Not db-aware, convenience ctor, like above. The field is created using specified parameters that are equal to these accepted by KexiDB::Field ctor. The column will be the owner of this automatically generated field.

Definition at line 57 of file kexitableviewdata.cpp.

References KexiDB::Field::captionOrName(), init(), isDBAware, m_captionAliasOrName, m_field, and m_fieldOwned.

KexiTableViewColumn::KexiTableViewColumn const QString name,
KexiDB::Field::Type  ctype,
const QString caption,
const QString description = QString::null
 

Not db-aware, convenience ctor, simplified version of the above.

Definition at line 81 of file kexitableviewdata.cpp.

References KexiDB::Field::captionOrName(), init(), isDBAware, m_captionAliasOrName, m_field, m_fieldOwned, KexiDB::Field::NoConstraints, and KexiDB::Field::NoOptions.

KexiTableViewColumn::KexiTableViewColumn const KexiDB::QuerySchema query,
KexiDB::QueryColumnInfo aColumnInfo,
KexiDB::QueryColumnInfo aVisibleLookupColumnInfo = 0
 

Db-aware version.

Definition at line 101 of file kexitableviewdata.cpp.

References KexiDB::QueryColumnInfo::alias, columnInfo, KexiDB::QuerySchema::connection(), KexiDB::QueryColumnInfo::field, init(), isDBAware, m_captionAliasOrName, m_fieldOwned, m_readOnly, and KexiDB::QuerySchema::masterTable().

KexiTableViewColumn::~KexiTableViewColumn  )  [virtual]
 

Definition at line 144 of file kexitableviewdata.cpp.

References m_field, m_fieldOwned, m_relatedData, and setValidator().

KexiTableViewColumn::KexiTableViewColumn bool   )  [protected]
 

special ctor that do not allocate d member;

Definition at line 135 of file kexitableviewdata.cpp.

References init(), and isDBAware.


Member Function Documentation

bool KexiTableViewColumn::acceptsFirstChar const QChar &  ch  )  const [virtual]
 

Definition at line 198 of file kexitableviewdata.cpp.

References KexiDB::Field::Boolean, KexiDB::Field::Date, KexiDB::Field::DateTime, KexiDB::QueryColumnInfo::field, KexiDB::Field::isFPNumericType(), KexiDB::Field::isNumericType(), KexiDB::Field::isUnsigned(), m_field, KexiDB::Field::Time, KexiDB::Field::type(), and visibleLookupColumnInfo.

Referenced by KexiTableView::keyPressEvent().

QString KexiTableViewColumn::captionAliasOrName  )  const [inline]
 

Returns:
whatever is available:
  • field's caption
  • or field's alias (from query)
  • or finally - field's name

Definition at line 123 of file kexitableviewdata.h.

KexiDB::Field* KexiTableViewColumn::field  )  const [inline]
 

Returns:
field for this column. For db-aware information is taken from columnInfo member.

Definition at line 149 of file kexitableviewdata.h.

Referenced by KexiDataAwareObjectInterface::acceptEditor(), KexiDataAwareObjectInterface::bufferedValueAt(), KexiDataAwareObjectInterface::columnType(), KexiTableEdit::displayedField(), KexiComboBoxTableEdit::field(), KFormDesigner::ConnectionDialog::initTable(), KexiQueryDesignerGuiEditor::initTableColumns(), KexiMacroDesignView::KexiMacroDesignView(), KexiTableDesignerView::KexiTableDesignerView(), KexiTableView::paintCell(), KexiComboBoxPopup::setData(), KexiTableViewData::setSorting(), and KexiTableViewData::updateRowEditBufferRef().

QIconSet KexiTableViewColumn::icon  )  const [inline]
 

Returns:
bame of icon displayed in the caption area (header).

Definition at line 109 of file kexitableviewdata.h.

void KexiTableViewColumn::init  )  [protected]
 

Definition at line 152 of file kexitableviewdata.cpp.

References m_data, m_headerTextVisible, m_readOnly, m_relatedData, m_relatedDataEditable, m_validator, and m_visible.

Referenced by KexiTableViewColumn().

bool KexiTableViewColumn::isHeaderTextVisible  )  const [inline]
 

Returns:
true if caption has to be displayed in the column's header, (or field's name if caption is empty.

Definition at line 117 of file kexitableviewdata.h.

bool KexiTableViewColumn::isReadOnly  )  const [inline]
 

Returns:
true if the column is read-only For db-aware column this can depend on whether the column is in parent table of this query.
See also:
setReadOnly()

Definition at line 89 of file kexitableviewdata.h.

Referenced by KexiDataAwareObjectInterface::columnEditable(), and KexiTableView::paintCell().

KexiTableViewData* KexiTableViewColumn::relatedData  )  const [inline]
 

For not-db-aware data only: Related data data for this column, what defines simple one-field. NULL by default.

See also:
setRelatedData()

Definition at line 145 of file kexitableviewdata.h.

Referenced by KexiComboBoxPopup::setData().

bool KexiTableViewColumn::relatedDataEditable  )  const [inline]
 

Only usable if related data is set (ie. this is for combo boxes).

Returns:
'editable' flag for this column. False by default.
See also:
setRelatedDataEditable(bool).

Definition at line 159 of file kexitableviewdata.h.

void KexiTableViewColumn::setHeaderTextVisible bool  visible  )  [inline]
 

If visible is true, caption has to be displayed in the column's header, (or field's name if caption is empty. True by default.

Definition at line 113 of file kexitableviewdata.h.

Referenced by KexiTableDesignerView::KexiTableDesignerView().

void KexiTableViewColumn::setIcon const QIconSet &  icon  )  [inline]
 

Sets icon for displaying in the caption area (header).

Definition at line 106 of file kexitableviewdata.h.

Referenced by KexiTableDesignerView::KexiTableDesignerView().

void KexiTableViewColumn::setReadOnly bool  ro  )  [inline]
 

forces readOnly flag to be set to ro

Definition at line 93 of file kexitableviewdata.h.

Referenced by KFormDesigner::ConnectionDialog::initTable(), and KexiTableDesignerView::KexiTableDesignerView().

void KexiTableViewColumn::setRelatedData KexiTableViewData data  ) 
 

For not-db-aware data only: Sets related data data for this column, what defines simple one-field, one-to-many relationship between this column and the primary key in data. The relationship will be used to generate a popup editor instead of just regular editor. This assignment has no result if data has no primary key defined. data is owned, so is will be destroyed when needed. It is also destroyed when another data (or NULL) is set for the same column.

Definition at line 172 of file kexitableviewdata.cpp.

References KexiTableViewData::columns, isDBAware, m_relatedData, and m_relatedDataPKeyID.

Referenced by KFormDesigner::ConnectionDialog::initTable(), and KexiQueryDesignerGuiEditor::initTableColumns().

void KexiTableViewColumn::setRelatedDataEditable bool  set  ) 
 

Only usable if related data is set (ie. this is for combo boxes). Sets 'editable' flag for this column, what means a new value can be entered by hand. This is similar to QComboBox::setEditable().

Definition at line 193 of file kexitableviewdata.cpp.

References m_relatedDataEditable.

Referenced by KexiQueryDesignerGuiEditor::initTableColumns().

void KexiTableViewColumn::setValidator KexiUtils::Validator v  ) 
 

Assigns validator v for this column. If the validator has no parent object, it will be owned by the column, so you shouldn't care about destroying it.

Definition at line 163 of file kexitableviewdata.cpp.

References m_validator.

Referenced by ~KexiTableViewColumn().

void KexiTableViewColumn::setVisible bool  v  )  [inline]
 

Changes column visibility.

Definition at line 99 of file kexitableviewdata.h.

Referenced by KexiTableViewData::init().

KexiUtils::Validator* KexiTableViewColumn::validator  )  const [inline]
 

Returns:
validator assigned for this column of 0 if there is no validator assigned.

Definition at line 131 of file kexitableviewdata.h.

Referenced by KexiDataAwareObjectInterface::acceptEditor().

bool KexiTableViewColumn::visible  )  const [inline]
 

Column visibility. By default column is visible.

Definition at line 96 of file kexitableviewdata.h.

Referenced by KexiTableViewData::addColumn().


Friends And Related Function Documentation

friend class KexiTableViewData [friend]
 

Definition at line 209 of file kexitableviewdata.h.


Member Data Documentation

KexiDB::QueryColumnInfo* KexiTableViewColumn::columnInfo
 

A rich field information for db-aware data. For not-db-aware data it is always 0 (use field() instead).

Definition at line 163 of file kexitableviewdata.h.

Referenced by KexiDataAwareObjectInterface::bufferedValueAt(), KexiBlobTableEdit::KexiBlobTableEdit(), KexiTableViewColumn(), KexiTableViewData::setSorting(), and KexiTableViewData::updateRowEditBufferRef().

bool KexiTableViewColumn::isDBAware
 

true if data is stored in DB, not only in memeory

Definition at line 172 of file kexitableviewdata.h.

Referenced by KexiDataAwareObjectInterface::bufferedValueAt(), KexiTableViewColumn(), and setRelatedData().

QString KexiTableViewColumn::m_captionAliasOrName [protected]
 

Definition at line 189 of file kexitableviewdata.h.

Referenced by KexiTableViewColumn().

KexiTableViewData* KexiTableViewColumn::m_data [protected]
 

Data that this column is assigned to.

Definition at line 196 of file kexitableviewdata.h.

Referenced by KexiTableViewData::addColumn(), and init().

KexiDB::Field* KexiTableViewColumn::m_field [protected]
 

Definition at line 201 of file kexitableviewdata.h.

Referenced by acceptsFirstChar(), KexiTableViewColumn(), and ~KexiTableViewColumn().

bool KexiTableViewColumn::m_fieldOwned [protected]
 

Definition at line 204 of file kexitableviewdata.h.

Referenced by KexiTableViewColumn(), and ~KexiTableViewColumn().

bool KexiTableViewColumn::m_headerTextVisible [protected]
 

Definition at line 207 of file kexitableviewdata.h.

Referenced by init().

QIconSet KexiTableViewColumn::m_icon [protected]
 

Definition at line 191 of file kexitableviewdata.h.

bool KexiTableViewColumn::m_readOnly [protected]
 

Definition at line 203 of file kexitableviewdata.h.

Referenced by init(), and KexiTableViewColumn().

KexiTableViewData* KexiTableViewColumn::m_relatedData [protected]
 

Definition at line 198 of file kexitableviewdata.h.

Referenced by init(), setRelatedData(), and ~KexiTableViewColumn().

bool KexiTableViewColumn::m_relatedDataEditable [protected]
 

Definition at line 206 of file kexitableviewdata.h.

Referenced by init(), and setRelatedDataEditable().

uint KexiTableViewColumn::m_relatedDataPKeyID [protected]
 

Definition at line 199 of file kexitableviewdata.h.

Referenced by setRelatedData().

KexiUtils::Validator* KexiTableViewColumn::m_validator [protected]
 

Definition at line 193 of file kexitableviewdata.h.

Referenced by init(), and setValidator().

bool KexiTableViewColumn::m_visible [protected]
 

Definition at line 205 of file kexitableviewdata.h.

Referenced by init().

KexiDB::QueryColumnInfo* KexiTableViewColumn::visibleLookupColumnInfo
 

A rich field information for db-aware data. Specifies information for a column that should be visible instead of columnInfo. For example case see KexiDB::QueryColumnInfo::Vector KexiDB::QuerySchema::fieldsExpanded(KexiDB::QuerySchema::FieldsExpandedOptions options = Default)

For not-db-aware data it is always 0.

Definition at line 170 of file kexitableviewdata.h.

Referenced by KexiDataAwareObjectInterface::acceptEditor(), acceptsFirstChar(), KexiComboBoxTableEdit::createInternalEditor(), KexiTableEdit::displayedField(), KexiTableView::getVisibleLookupValue(), KexiTableViewData::setSorting(), and KexiTableViewData::updateRowEditBufferRef().


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