Kexi API Documentation (2.0 alpha)

KexiDB::LookupFieldSchema Class Reference

#include <lookupfieldschema.h>

List of all members.


Detailed Description

Provides information about lookup field's setup.

LookupFieldSchema object is owned by TableSchema and created upon creating or retrieving the table schema from the database metadata.

See also:
LookupFieldSchema *TableSchema::lookupFieldSchema( Field& field ) const

Definition at line 54 of file lookupfieldschema.h.

Public Types

enum  DisplayWidget { ComboBox, ListBox }
 used in displayWidget() More...

Public Member Functions

 LookupFieldSchema ()
 ~LookupFieldSchema ()
RowSourcerowSource ()
void setRowSource (const RowSource &rowSource)
int boundColumn () const
void setBoundColumn (int column)
int visibleColumn () const
void setVisibleColumn (int column)
const QValueList< int > columnWidths () const
void setColumnWidths (const QValueList< int > &widths)
bool columnHeadersVisible () const
void setColumnHeadersVisible (bool set)
uint maximumListRows () const
void setMaximumListRows (uint rows)
bool limitToList () const
void setLimitToList (bool set)
DisplayWidget displayWidget () const
void setDisplayWidget (DisplayWidget widget)
QString debugString () const
void debug () const

Static Public Member Functions

static LookupFieldSchemaloadFromDom (const QDomElement &lookupEl)
static void saveToDom (LookupFieldSchema &lookupSchema, QDomDocument &doc, QDomElement &parentEl)

Protected Attributes

RowSource m_rowSource
int m_boundColumn
int m_visibleColumn
QValueList< int > m_columnWidths
uint m_maximumListRows
DisplayWidget m_displayWidget
bool m_columnHeadersVisible: 1
bool m_limitToList: 1

Classes

class  RowSource
 Row source information that can be specified for the lookup field schema. More...


Member Enumeration Documentation

enum KexiDB::LookupFieldSchema::DisplayWidget
 

used in displayWidget()

Enumeration values:
ComboBox  (the default) combobox widget should be displayed in forms for this lookup field
ListBox  listbox widget should be displayed in forms for this lookup field

Definition at line 177 of file lookupfieldschema.h.


Constructor & Destructor Documentation

LookupFieldSchema::LookupFieldSchema  ) 
 

Definition at line 104 of file lookupfieldschema.cpp.

Referenced by loadFromDom().

LookupFieldSchema::~LookupFieldSchema  ) 
 

Definition at line 114 of file lookupfieldschema.cpp.


Member Function Documentation

int KexiDB::LookupFieldSchema::boundColumn  )  const [inline]
 

Returns:
bound column: an integer specifying a column that is bound (counted from 0). -1 means unspecified value.
Todo:
in later implementation there can be more columns

Definition at line 130 of file lookupfieldschema.h.

Referenced by KexiTableDesignerView::createPropertySet(), KexiComboBoxBase::rowToHighlightForLookupTable(), KexiComboBoxBase::setValueInternal(), and KexiComboBoxBase::value().

bool KexiDB::LookupFieldSchema::columnHeadersVisible  )  const [inline]
 

Returns:
true if column headers are visible in the associated combo box popup or the list view. The default is false.

Definition at line 153 of file lookupfieldschema.h.

const QValueList<int> KexiDB::LookupFieldSchema::columnWidths  )  const [inline]
 

Returns:
a number of ordered integers specifying column widths; -1 means 'default width' for a given column.

Definition at line 146 of file lookupfieldschema.h.

Referenced by loadFromDom(), and saveToDom().

void LookupFieldSchema::debug  )  const
 

Shows debug information.

Definition at line 151 of file lookupfieldschema.cpp.

References debugString(), and KexiDBDbg.

QString LookupFieldSchema::debugString  )  const
 

Returns:
String for debugging purposes.

Definition at line 128 of file lookupfieldschema.cpp.

References ComboBox, KexiDB::LookupFieldSchema::RowSource::debugString(), foreach, m_boundColumn, m_columnHeadersVisible, m_columnWidths, m_displayWidget, m_limitToList, m_maximumListRows, m_rowSource, and m_visibleColumn.

Referenced by debug(), and KexiDB::TableSchema::debugString().

DisplayWidget KexiDB::LookupFieldSchema::displayWidget  )  const [inline]
 

Returns:
the widget type that should be displayed within the forms for this lookup field. The default is ComboBox. For the Table View, combo box is always displayed.

Definition at line 185 of file lookupfieldschema.h.

bool KexiDB::LookupFieldSchema::limitToList  )  const [inline]
 

Returns:
true if , only values present on the list can be selected using the combo box. The default is true.

Definition at line 171 of file lookupfieldschema.h.

LookupFieldSchema * LookupFieldSchema::loadFromDom const QDomElement &  lookupEl  )  [static]
 

Loads data of lookup column schema from DOM tree. The data can be outdated or invalid, so the app should handle such cases.

Returns:
a new LookupFieldSchema object even if lookupEl contains no valid contents.

Definition at line 157 of file lookupfieldschema.cpp.

References columnWidths(), ComboBox, ListBox, KexiDB::loadPropertyValueFromDom(), LookupFieldSchema(), rowSource(), setBoundColumn(), setColumnHeadersVisible(), setColumnWidths(), setDisplayWidget(), setLimitToList(), setMaximumListRows(), and setVisibleColumn().

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

uint KexiDB::LookupFieldSchema::maximumListRows  )  const [inline]
 

Returns:
integer property specifying a maximum number of rows that can be displayed in a combo box popup or a list box. The default is equal to KEXIDB_LOOKUP_FIELD_DEFAULT_LIST_ROWS constant.

Definition at line 161 of file lookupfieldschema.h.

RowSource& KexiDB::LookupFieldSchema::rowSource  )  [inline]
 

Returns:
row source information for the lookup field schema

Definition at line 122 of file lookupfieldschema.h.

Referenced by KexiTableDesignerView::buildSchema(), KexiTableDesignerView::createPropertySet(), KexiTableDesignerView::initData(), KexiDB::Connection::loadExtendedTableSchemaData(), and loadFromDom().

void LookupFieldSchema::saveToDom LookupFieldSchema lookupSchema,
QDomDocument &  doc,
QDomElement &  parentEl
[static]
 

Saves data of lookup column schema to parentEl DOM element of doc document.

Definition at line 248 of file lookupfieldschema.cpp.

References columnWidths(), KEXIDB_LOOKUP_FIELD_DEFAULT_DISPLAY_WIDGET, KEXIDB_LOOKUP_FIELD_DEFAULT_HEADERS_VISIBLE, KEXIDB_LOOKUP_FIELD_DEFAULT_LIMIT_TO_LIST, KEXIDB_LOOKUP_FIELD_DEFAULT_LIST_ROWS, ListBox, KexiDB::saveBooleanElementToDom(), and KexiDB::saveNumberElementToDom().

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

void KexiDB::LookupFieldSchema::setBoundColumn int  column  )  [inline]
 

Sets bound column number to column.

See also:
boundColumn()

Definition at line 133 of file lookupfieldschema.h.

Referenced by KexiTableDesignerView::buildSchema(), KexiDB::Connection::loadExtendedTableSchemaData(), and loadFromDom().

void KexiDB::LookupFieldSchema::setColumnHeadersVisible bool  set  )  [inline]
 

Sets "column headers visibility" flag.

See also:
columnHeadersVisible()

Definition at line 156 of file lookupfieldschema.h.

Referenced by loadFromDom().

void KexiDB::LookupFieldSchema::setColumnWidths const QValueList< int > &  widths  )  [inline]
 

Sets column widths.

See also:
columnWidths

Definition at line 149 of file lookupfieldschema.h.

Referenced by loadFromDom().

void KexiDB::LookupFieldSchema::setDisplayWidget DisplayWidget  widget  )  [inline]
 

Sets type of widget to display within the forms for this lookup field.

See also:
displayWidget()

Definition at line 188 of file lookupfieldschema.h.

Referenced by loadFromDom().

void KexiDB::LookupFieldSchema::setLimitToList bool  set  )  [inline]
 

Sets "limit to list" flag.

See also:
limitToList()

Definition at line 174 of file lookupfieldschema.h.

Referenced by loadFromDom().

void LookupFieldSchema::setMaximumListRows uint  rows  ) 
 

Sets maximum number of rows that can be displayed in a combo box popup or a list box. If rows is 0, KEXIDB_LOOKUP_FIELD_DEFAULT_LIST_ROWS is set. If rows is greater than KEXIDB_LOOKUP_FIELD_MAX_LIST_ROWS, KEXIDB_LOOKUP_FIELD_MAX_LIST_ROWS is set.

Definition at line 118 of file lookupfieldschema.cpp.

References KEXIDB_LOOKUP_FIELD_DEFAULT_LIST_ROWS, KEXIDB_LOOKUP_FIELD_MAX_LIST_ROWS, and m_maximumListRows.

Referenced by loadFromDom().

void KexiDB::LookupFieldSchema::setRowSource const RowSource rowSource  )  [inline]
 

Sets row source for the lookup field schema

Definition at line 125 of file lookupfieldschema.h.

void KexiDB::LookupFieldSchema::setVisibleColumn int  column  )  [inline]
 

Sets visible column number to column.

See also:
visibleColumn()

Definition at line 142 of file lookupfieldschema.h.

Referenced by KexiTableDesignerView::buildSchema(), KexiDB::Connection::loadExtendedTableSchemaData(), and loadFromDom().

int KexiDB::LookupFieldSchema::visibleColumn  )  const [inline]
 

Returns:
visible column: an integer specifying a column that has to be visible in the combo box (counted from 0). -1 means unspecified value.
Todo:
in later implementation there can be more columns

Definition at line 139 of file lookupfieldschema.h.

Referenced by KexiTableDesignerView::createPropertySet(), KexiComboBoxBase::selectItemForEnteredValueInLookupTable(), KexiComboBoxBase::setValueInternal(), and KexiComboBoxBase::visibleValueForLookupField().


Member Data Documentation

int KexiDB::LookupFieldSchema::m_boundColumn [protected]
 

Definition at line 206 of file lookupfieldschema.h.

Referenced by debugString().

bool KexiDB::LookupFieldSchema::m_columnHeadersVisible [protected]
 

Definition at line 210 of file lookupfieldschema.h.

Referenced by debugString().

QValueList<int> KexiDB::LookupFieldSchema::m_columnWidths [protected]
 

Definition at line 207 of file lookupfieldschema.h.

Referenced by debugString().

DisplayWidget KexiDB::LookupFieldSchema::m_displayWidget [protected]
 

Definition at line 209 of file lookupfieldschema.h.

Referenced by debugString().

bool KexiDB::LookupFieldSchema::m_limitToList [protected]
 

Definition at line 211 of file lookupfieldschema.h.

Referenced by debugString().

uint KexiDB::LookupFieldSchema::m_maximumListRows [protected]
 

Definition at line 208 of file lookupfieldschema.h.

Referenced by debugString(), and setMaximumListRows().

RowSource KexiDB::LookupFieldSchema::m_rowSource [protected]
 

Definition at line 205 of file lookupfieldschema.h.

Referenced by debugString().

int KexiDB::LookupFieldSchema::m_visibleColumn [protected]
 

Definition at line 206 of file lookupfieldschema.h.

Referenced by debugString().


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