kexi
KexiDB::LookupFieldSchema Class Reference
#include <lookupfieldschema.h>
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 *TableSchemalookupFieldSchema( Field& field ) const
Definition at line 55 of file lookupfieldschema.h.
Public Types | |
enum | DisplayWidget { ComboBox = 0, ListBox = 1 } |
Public Member Functions | |
RowSource & | rowSource () |
void | setRowSource (const RowSource &rowSource) |
int | boundColumn () const |
void | setBoundColumn (int column) |
QValueList< uint > | visibleColumns () const |
void | setVisibleColumns (const QValueList< uint > &list) |
int | visibleColumn (uint fieldsCount) const |
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 LookupFieldSchema * | loadFromDom (const QDomElement &lookupEl) |
static void | saveToDom (LookupFieldSchema &lookupSchema, QDomDocument &doc, QDomElement &parentEl) |
static bool | setProperty (LookupFieldSchema &lookup, const QCString &propertyName, const QVariant &value) |
Protected Attributes | |
RowSource | m_rowSource |
int | m_boundColumn |
QValueList< uint > | m_visibleColumns |
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
used in displayWidget()
- Enumerator:
-
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 191 of file lookupfieldschema.h.
Member Function Documentation
RowSource& KexiDB::LookupFieldSchema::rowSource | ( | ) | [inline] |
- Returns:
- row source information for the lookup field schema
Definition at line 123 of file lookupfieldschema.h.
void KexiDB::LookupFieldSchema::setRowSource | ( | const RowSource & | rowSource | ) | [inline] |
Sets row source for the lookup field schema
Definition at line 126 of file lookupfieldschema.h.
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 131 of file lookupfieldschema.h.
void KexiDB::LookupFieldSchema::setBoundColumn | ( | int | column | ) | [inline] |
Sets bound column number to column.
- See also:
- boundColumn()
Definition at line 134 of file lookupfieldschema.h.
QValueList<uint> KexiDB::LookupFieldSchema::visibleColumns | ( | ) | const [inline] |
- Returns:
- a list of visible column: a list of integers specifying a column that has to be visible in the combo box (counted from 0). Empty list means unspecified value.
Definition at line 139 of file lookupfieldschema.h.
void KexiDB::LookupFieldSchema::setVisibleColumns | ( | const QValueList< uint > & | list | ) | [inline] |
Sets a list of visible columns to list. Columns will be separated with a single space character when displayed.
Definition at line 143 of file lookupfieldschema.h.
int KexiDB::LookupFieldSchema::visibleColumn | ( | uint | fieldsCount | ) | const [inline] |
A helper method. If visibleColumns() contains one item, this item is returned (a typical case). If visibleColumns() contains no item, -1 is returned. If visibleColumns() multiple items, fieldsCount - 1 is returned.
Definition at line 149 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 160 of file lookupfieldschema.h.
void KexiDB::LookupFieldSchema::setColumnWidths | ( | const QValueList< int > & | widths | ) | [inline] |
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 167 of file lookupfieldschema.h.
void KexiDB::LookupFieldSchema::setColumnHeadersVisible | ( | bool | set | ) | [inline] |
Sets "column headers visibility" flag.
- See also:
- columnHeadersVisible()
Definition at line 170 of file lookupfieldschema.h.
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 175 of file lookupfieldschema.h.
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 117 of file lookupfieldschema.cpp.
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 185 of file lookupfieldschema.h.
void KexiDB::LookupFieldSchema::setLimitToList | ( | bool | set | ) | [inline] |
Sets "limit to list" flag.
- See also:
- limitToList()
Definition at line 188 of file lookupfieldschema.h.
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 199 of file lookupfieldschema.h.
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 202 of file lookupfieldschema.h.
QString LookupFieldSchema::debugString | ( | ) | const |
void LookupFieldSchema::debug | ( | ) | const |
Shows debug information.
Definition at line 154 of file lookupfieldschema.cpp.
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.
- Todo:
- handle fieldlist (retrieve from external table or so?), use lookupFieldSchema.rowSource().setValues()
Definition at line 160 of file lookupfieldschema.cpp.
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 257 of file lookupfieldschema.cpp.
bool LookupFieldSchema::setProperty | ( | LookupFieldSchema & | lookup, | |
const QCString & | propertyName, | |||
const QVariant & | value | |||
) | [static] |
Sets property of name propertyName and value value for the lookup schema lookup
- Returns:
- true on successful set and false on failure because of invalid value or invalid property name.
- Todo:
- Remove this case: it's for backward compatibility with Kexi's 1.1.2 table designer GUI supporting only single lookup column.
Definition at line 328 of file lookupfieldschema.cpp.
The documentation for this class was generated from the following files: