kexi

KexiDB::Field Class Reference

#include <field.h>

Inheritance diagram for KexiDB::Field:

KexiDB::QueryAsterisk List of all members.

Detailed Description

Meta-data for a field.

KexiDB::Field provides information about single database field.

Field class has defined following members:

  • name
  • type
  • database constraints
  • additional options
  • length (make sense mostly for string types)
  • precision (for floating-point type)
  • defaultValue
  • caption (user readable name that can be e.g. translated)
  • description (user readable name additional text, can be useful for developers)
  • width (a hint for displaying in tabular mode or as text box)

Field can also have assigned expression (see KexiDB::BaseExpr class, and expression() method). If an expression is defined, then field's name is

Note that aliases for fields are defined within query, not in Field object, because the same field can be used in different queries with different alias.

Notes for advanced use: Field obeject is designed to be owned by a parent object. Such a parent object can be KexiDB::TableSchema, if the field defines single table column, or KexiDB::QuerySchema, if the field defines an expression (KexiDB::BaseExpr class).

Using expression class for fields allos to define expressions within queries like "SELECT AVG(price) FROM products"

You can choose whether your field is owned by query or table, using appropriate constructor, or using parameterless constructor and calling setTable() or setQuery() later.

Definition at line 72 of file field.h.


Public Types

enum  Type {
  InvalidType = 0, Byte = 1, ShortInteger = 2, Integer = 3,
  BigInteger = 4, Boolean = 5, Date = 6, DateTime = 7,
  Time = 8, Float = 9, Double = 10, Text = 11,
  LongText = 12, BLOB = 13, LastType = 13, Null = 64,
  Asterisk = 128, Enum = 129, Map = 130
}
enum  TypeGroup {
  InvalidGroup = 0, TextGroup = 1, IntegerGroup = 2, FloatGroup = 3,
  BooleanGroup = 4, DateTimeGroup = 5, BLOBGroup = 6, LastTypeGroup = 6
}
enum  Constraints {
  NoConstraints = 0, AutoInc = 1, Unique = 2, PrimaryKey = 4,
  ForeignKey = 8, NotNull = 16, NotEmpty = 32, Indexed = 64
}
enum  Options { NoOptions = 0, Unsigned = 1 }
typedef QPtrList< FieldList
typedef QPtrVector< FieldVector
typedef QPtrListIterator<
Field
ListIterator
typedef QPair< Field *, Field * > Pair
typedef QPtrList< PairPairList
typedef QMap< QCString, QVariant > CustomPropertiesMap

Public Member Functions

 Field (TableSchema *tableSchema)
 Field ()
 Field (const QString &name, Type ctype, uint cconst=NoConstraints, uint options=NoOptions, uint length=0, uint precision=0, QVariant defaultValue=QVariant(), const QString &caption=QString::null, const QString &description=QString::null, uint width=0)
 Field (const Field &f)
virtual ~Field ()
QString name () const
virtual TableSchematable () const
virtual void setTable (TableSchema *table)
QuerySchemaquery () const
void setQuery (QuerySchema *query)
bool isAutoIncrement () const
bool isPrimaryKey () const
bool isUniqueKey () const
bool isForeignKey () const
bool isNotNull () const
bool isNotEmpty () const
bool isIndexed () const
bool isNumericType () const
bool isIntegerType () const
bool isFPNumericType () const
bool isDateTimeType () const
bool isTextType () const
uint options () const
void setOptions (uint options)
QVariant::Type variantType () const
Type type () const
QString typeName () const
TypeGroup typeGroup () const
QString typeGroupName () const
QString typeString () const
QString typeGroupString () const
QString subType () const
void setSubType (const QString &subType)
QVariant defaultValue () const
uint length () const
uint precision () const
uint scale () const
int visibleDecimalPlaces () const
uint constraints () const
int order () const
QString caption () const
QString captionOrName () const
QString description () const
uint width () const
bool isUnsigned () const
bool hasEmptyProperty () const
bool isAutoIncrementAllowed () const
void setType (Type t)
void setName (const QString &name)
void setConstraints (uint c)
void setLength (uint l)
void setScale (uint s)
void setVisibleDecimalPlaces (int p)
void setPrecision (uint p)
void setUnsigned (bool u)
void setDefaultValue (const QVariant &def)
bool setDefaultValue (const QCString &def)
void setAutoIncrement (bool a)
void setPrimaryKey (bool p)
void setUniqueKey (bool u)
void setForeignKey (bool f)
void setNotNull (bool n)
void setNotEmpty (bool n)
void setIndexed (bool s)
void setCaption (const QString &caption)
void setDescription (const QString &description)
void setWidth (uint w)
bool isQueryAsterisk () const
virtual QString debugString () const
void debug ()
KexiDB::BaseExprexpression ()
void setExpression (KexiDB::BaseExpr *expr)
bool isExpression () const
QValueVector< QString > enumHints () const
QString enumHint (uint num)
void setEnumHints (const QValueVector< QString > &l)
QVariant customProperty (const QCString &propertyName, const QVariant &defaultValue=QVariant()) const
void setCustomProperty (const QCString &propertyName, const QVariant &value)
const CustomPropertiesMap customProperties () const

Static Public Member Functions

static uint defaultTextLength ()
static QVariant::Type variantType (uint type)
static QString typeName (uint type)
static QString typeString (uint type)
static Type typeForString (const QString &typeString)
static TypeGroup typeGroupForString (const QString &typeGroupString)
static TypeGroup typeGroup (uint type)
static QString typeGroupName (uint typeGroup)
static QString typeGroupString (uint typeGroup)
static bool isNumericType (uint type)
static bool isIntegerType (uint type)
static bool isFPNumericType (uint type)
static bool isDateTimeType (uint type)
static bool isTextType (uint type)
static bool hasEmptyProperty (uint type)
static bool isAutoIncrementAllowed (uint type)

Protected Member Functions

 Field (QuerySchema *querySchema, BaseExpr *expr=0)
void init ()
virtual Fieldcopy () const

Protected Attributes

FieldListm_parent
QString m_name
QString m_subType
uint m_constraints
uint m_length
uint m_precision
int m_visibleDecimalPlaces
uint m_options
QVariant m_defaultValue
int m_order
QString m_caption
QString m_desc
uint m_width
QValueVector< QString > m_hints
KexiDB::BaseExprm_expr
CustomPropertiesMapm_customProperties

Static Protected Attributes

static FieldTypeNames m_typeNames
static FieldTypeGroupNames m_typeGroupNames

Friends

class Connection
class FieldList
class TableSchema
class QuerySchema

Classes

class  FieldTypeGroupNames
class  FieldTypeNames

Member Typedef Documentation

typedef QPtrList<Field> KexiDB::Field::List

list of fields

Definition at line 75 of file field.h.

typedef QPtrVector<Field> KexiDB::Field::Vector

vector of fields

Definition at line 76 of file field.h.

typedef QPtrListIterator<Field> KexiDB::Field::ListIterator

iterator for list of fields

Definition at line 77 of file field.h.

typedef QPair<Field*,Field*> KexiDB::Field::Pair

fields pair

Definition at line 78 of file field.h.

typedef QPtrList<Pair> KexiDB::Field::PairList

list of fields pair

Definition at line 79 of file field.h.

typedef QMap<QCString,QVariant> KexiDB::Field::CustomPropertiesMap

A data type used for handling custom properties of a field.

Definition at line 556 of file field.h.


Member Enumeration Documentation

Unified (most common used) types of fields.

Enumerator:
InvalidType  Unsupported/Unimplemented type
Byte  1 byte, signed or unsigned
ShortInteger  2 bytes, signed or unsigned
Integer  4 bytes, signed or unsigned
BigInteger  8 bytes, signed or unsigned
Boolean  0 or 1
Float  4 bytes
Double  8 bytes
Text  Other name: Varchar; no more than 200 bytes, for efficiency
LongText  Other name: Memo. More than 200 bytes
BLOB  Large binary object
LastType  This line should be at the end of the list of types!
Null  Used for fields that are "NULL" expressions.
Asterisk  Special, internal types:.

Used in QueryAsterisk subclass objects only, not used in table definitions, but only in query definitions

Enum  An integer internal with a string list of hints
Map  Mapping from string to string list (more generic than Enum

Definition at line 82 of file field.h.

Type groups for fields.

Definition at line 115 of file field.h.

Possible constraints defined for a field.

Enumerator:
NotEmpty  only legal for string-like and blob fields

Definition at line 129 of file field.h.

Possible options defined for a field.

Definition at line 142 of file field.h.


Constructor & Destructor Documentation

Field::Field ( TableSchema tableSchema  ) 

Creates a database field as a child of tableSchema table No other properties are set (even the name), so these should be set later.

Definition at line 48 of file field.cpp.

Field::Field (  ) 

Creates a database field without any properties set. These should be set later.

Definition at line 41 of file field.cpp.

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

Creates a database field with specified properties.

Definition at line 66 of file field.cpp.

Field::Field ( const Field f  ) 

Copy constructor.

Definition at line 93 of file field.cpp.

Field::Field ( QuerySchema querySchema,
BaseExpr expr = 0 
) [protected]

Creates a database field as a child of querySchema table Assigns expr expression to this field, if present. Used internally by query schemas, e.g. to declare asterisks or to add expression columns. No other properties are set, so these should be set later.

Definition at line 56 of file field.cpp.


Member Function Documentation

QVariant::Type Field::variantType ( uint  type  )  [static]

Converts type type to QVariant equivalent as accurate as possible.

Definition at line 141 of file field.cpp.

QString Field::typeName ( uint  type  )  [static]

Returns:
a i18n'd type name for type (type has to be an element from Field::Type, not greater than Field::LastType)

Definition at line 173 of file field.cpp.

QString Field::typeString ( uint  type  )  [static]

Returns:
type string for type, e.g. "Integer" for Integer type (not-i18n'd, type has to be an element from Field::Type, not greater than Field::LastType)

Definition at line 179 of file field.cpp.

Field::Type Field::typeForString ( const QString &  typeString  )  [static]

Returns:
type for a given typeString

Definition at line 197 of file field.cpp.

Field::TypeGroup Field::typeGroupForString ( const QString &  typeGroupString  )  [static]

Returns:
type group for a given typeGroupString

Definition at line 206 of file field.cpp.

Field::TypeGroup Field::typeGroup ( uint  type  )  [static]

Returns:
group for type

Definition at line 286 of file field.cpp.

QString Field::typeGroupName ( uint  typeGroup  )  [static]

Returns:
a i18n'd group name for typeGroup (typeGroup has to be an element from Field::TypeGroup)

Definition at line 185 of file field.cpp.

QString Field::typeGroupString ( uint  typeGroup  )  [static]

Returns:
type group string for typeGroup, e.g. "IntegerGroup" for IntegerGroup type (not-i18n'd, type has to be an element from Field::Type, not greater than Field::LastType)

Definition at line 191 of file field.cpp.

TableSchema * Field::table (  )  const [virtual]

Returns:
table schema of table that owns this field or null if it has no table assigned.
See also:
query()

Reimplemented in KexiDB::QueryAsterisk.

Definition at line 305 of file field.cpp.

void Field::setTable ( TableSchema table  )  [virtual]

Sets table schema of table that owns this field. This does not adds the field to table object. You do not need to call this method by hand. Call TableSchema::addField(Field *field) instead.

See also:
setQuery()

Reimplemented in KexiDB::QueryAsterisk.

Definition at line 311 of file field.cpp.

QuerySchema * Field::query (  )  const

For special use when the field defines expression.

Returns:
query schema of query that owns this field or null if it has no query assigned.
See also:
table()

Reimplemented in KexiDB::QueryAsterisk.

Definition at line 317 of file field.cpp.

void Field::setQuery ( QuerySchema query  ) 

For special use when field defines expression. Sets query schema of query that owns this field. This does not adds the field to query object. You do not need to call this method by hand. Call QuerySchema::addField() instead.

See also:
setQuery()

Definition at line 323 of file field.cpp.

bool KexiDB::Field::isAutoIncrement (  )  const [inline]

Returns:
true if the field is autoincrement (e.g. integer/numeric)

Definition at line 231 of file field.h.

bool KexiDB::Field::isPrimaryKey (  )  const [inline]

Returns:
true if the field is member of single-field primary key

Definition at line 234 of file field.h.

bool KexiDB::Field::isUniqueKey (  )  const [inline]

Returns:
true if the field is member of single-field unique key

Definition at line 237 of file field.h.

bool KexiDB::Field::isForeignKey (  )  const [inline]

Returns:
true if the field is member of single-field foreign key

Definition at line 240 of file field.h.

bool KexiDB::Field::isNotNull (  )  const [inline]

Returns:
true if the field is not allowed to be null

Definition at line 243 of file field.h.

bool KexiDB::Field::isNotEmpty (  )  const [inline]

Returns:
true if the field is not allowed to be null

Definition at line 246 of file field.h.

bool KexiDB::Field::isIndexed (  )  const [inline]

Returns:
true if the field is indexed using single-field database index.

Definition at line 249 of file field.h.

bool KexiDB::Field::isNumericType (  )  const [inline]

Returns:
true if the field is of any numeric type (integer or floating point)

Definition at line 252 of file field.h.

bool Field::isNumericType ( uint  type  )  [static]

static version of isNumericType() method !

Returns:
true if the field is of any numeric type (integer or floating point)

Definition at line 228 of file field.cpp.

bool KexiDB::Field::isIntegerType (  )  const [inline]

Returns:
true if the field is of any integer type

Definition at line 259 of file field.h.

bool Field::isIntegerType ( uint  type  )  [static]

static version of isIntegerType() method !

Returns:
true if the field is of any integer type

Definition at line 215 of file field.cpp.

bool KexiDB::Field::isFPNumericType (  )  const [inline]

Returns:
true if the field is of any floating point numeric type

Definition at line 266 of file field.h.

bool Field::isFPNumericType ( uint  type  )  [static]

static version of isFPNumericType() method !

Returns:
true if the field is of any floating point numeric type

Definition at line 243 of file field.cpp.

bool KexiDB::Field::isDateTimeType (  )  const [inline]

Returns:
true if the field is of any date or time related type

Definition at line 273 of file field.h.

bool Field::isDateTimeType ( uint  type  )  [static]

static version of isDateTimeType() method !

Returns:
true if the field is of any date or time related type

Definition at line 248 of file field.cpp.

bool KexiDB::Field::isTextType (  )  const [inline]

Returns:
true if the field is of any text type

Definition at line 280 of file field.h.

bool Field::isTextType ( uint  type  )  [static]

static version of isTextType() method !

Returns:
true if the field is of any text type

Definition at line 260 of file field.cpp.

QVariant::Type KexiDB::Field::variantType (  )  const [inline]

Converts field's type to QVariant equivalent as accurate as possible.

Definition at line 291 of file field.h.

Field::Type Field::type (  )  const

Returns:
a type for this field. If there's expression assigned, type of the expression is returned instead.

Definition at line 134 of file field.cpp.

QString KexiDB::Field::typeName (  )  const [inline]

Returns:
a i18n'd type name for this field

Definition at line 298 of file field.h.

TypeGroup KexiDB::Field::typeGroup (  )  const [inline]

Returns:
type group for this field

Definition at line 301 of file field.h.

QString KexiDB::Field::typeGroupName (  )  const [inline]

Returns:
a i18n'd type group name for this field

Definition at line 304 of file field.h.

QString KexiDB::Field::typeString (  )  const [inline]

Returns:
a type string for this field, for example "Integer" string for Field::Integer type.

Definition at line 308 of file field.h.

QString KexiDB::Field::typeGroupString (  )  const [inline]

Returns:
a type group string for this field, for example "Integer" string for Field::IntegerGroup.

Definition at line 312 of file field.h.

QString KexiDB::Field::subType (  )  const [inline]

Returns:
(optional) subtype for this field. Subtype is a string providing additional hint for field's type. E.g. for BLOB type, it can be a MIME type or certain QVariant type name, for example: "QPixmap", "QColor" or "QFont"

Definition at line 318 of file field.h.

void KexiDB::Field::setSubType ( const QString &  subType  )  [inline]

Sets (optional) subtype for this field.

See also:
subType()

Definition at line 322 of file field.h.

QVariant KexiDB::Field::defaultValue (  )  const [inline]

Returns:
default value for this field.

Null value means there is no default value declared. The variant value is compatible with field's type.

Definition at line 326 of file field.h.

uint KexiDB::Field::length (  )  const [inline]

Returns:
length of text, only meaningful if the field type is text. 0 means "default length".

Definition at line 330 of file field.h.

uint KexiDB::Field::precision (  )  const [inline]

Returns:
precision for numeric and other fields that have both length (scale) and precision (floating point types).

Definition at line 334 of file field.h.

uint KexiDB::Field::scale (  )  const [inline]

Returns:
scale for numeric and other fields that have both length (scale) and precision (floating point types). The scale of a numeric is the count of decimal digits in the fractional part, to the right of the decimal point. The precision of a numeric is the total count of significant digits in the whole number, that is, the number of digits to both sides of the decimal point. So the number 23.5141 has a precision of 6 and a scale of 4. Integers can be considered to have a scale of zero.

Definition at line 343 of file field.h.

int KexiDB::Field::visibleDecimalPlaces (  )  const [inline]

Returns:
number of decimal places that should be visible to the user, e.g. within table view widget, form or printout. Only meaningful if the field type is floating point or (in the future: decimal or currency).
  • Any value less than 0 (-1 is the default) means that there should be displayed all digits of the fractional part, except the ending zeros. This is known as "auto" mode. For example, 12.345000 becomes 12.345.

  • Value of 0 means that all the fractional part should be hidden (as well as the dot or comma). For example, 12.345000 becomes 12.

  • Value N > 0 means that the fractional part should take exactly N digits. If the fractional part is shorter than N, additional zeros are appended. For example, "12.345" becomes "12.345000" if N=6.

Definition at line 361 of file field.h.

uint KexiDB::Field::constraints (  )  const [inline]

Returns:
the constraints defined for this field.

Definition at line 364 of file field.h.

int KexiDB::Field::order (  )  const [inline]

Returns:
order of this field in containing table (counting starts from 0) (-1 if unspecified).

Definition at line 368 of file field.h.

QString KexiDB::Field::caption (  )  const [inline]

Returns:
caption of this field.

Definition at line 371 of file field.h.

QString KexiDB::Field::captionOrName (  )  const [inline]

Returns:
caption of this field or - if empty - return its name.

Definition at line 374 of file field.h.

QString KexiDB::Field::description (  )  const [inline]

Returns:
description text for this field.

Definition at line 377 of file field.h.

uint KexiDB::Field::width (  )  const [inline]

Returns:
width of this field (usually in pixels or points) 0 (the default) means there is no hint for the width.

Definition at line 381 of file field.h.

bool KexiDB::Field::isUnsigned (  )  const [inline]

if the type has the unsigned attribute

Definition at line 384 of file field.h.

bool KexiDB::Field::hasEmptyProperty (  )  const [inline]

Returns:
true if this field has EMPTY property (i.e. it is of type string or is a BLOB).

Definition at line 388 of file field.h.

bool Field::hasEmptyProperty ( uint  type  )  [static]

static version of hasEmptyProperty() method

Returns:
true if this field type has EMPTY property (i.e. it is string or BLOB type)

Definition at line 276 of file field.cpp.

bool KexiDB::Field::isAutoIncrementAllowed (  )  const [inline]

Returns:
true if this field can be auto-incremented. Actually, returns true for integer field type.
See also:
IntegerType, isAutoIncrement()

Definition at line 396 of file field.h.

bool Field::isAutoIncrementAllowed ( uint  type  )  [static]

static version of isAutoIncrementAllowed() method

Returns:
true if this field type can be auto-incremented.

Definition at line 281 of file field.cpp.

void Field::setType ( Type  t  ) 

Sets type t for this field. This does nothing if there's already expression assigned, see expression().

Definition at line 335 of file field.cpp.

void Field::setName ( const QString &  name  ) 

Sets name name for this field.

Definition at line 329 of file field.cpp.

void Field::setConstraints ( uint  c  ) 

Sets constraints to c. If PrimaryKey is set in c, also constraits implied by being primary key are enforced (see setPrimaryKey()). If Indexed is not set in c, constraits implied by not being are enforced as well (see setIndexed()).

Definition at line 346 of file field.cpp.

void Field::setLength ( uint  l  ) 

Sets length for this field. Only works for Text Type (even not LongText!). 0 means "default length".

See also:
length()

Definition at line 362 of file field.cpp.

void Field::setScale ( uint  s  ) 

Sets scale for this field. Only works for floating-point types.

See also:
scale()

Definition at line 378 of file field.cpp.

void Field::setVisibleDecimalPlaces ( int  p  ) 

Sets number of decimal places that should be visible to the user.

See also:
visibleDecimalPlaces()

Definition at line 386 of file field.cpp.

void Field::setPrecision ( uint  p  ) 

Sets scale for this field. Only works for floating-point types.

Definition at line 370 of file field.cpp.

void Field::setUnsigned ( bool  u  ) 

Sets unsigned flag for this field. Only works for integer types.

Definition at line 394 of file field.cpp.

void Field::setDefaultValue ( const QVariant &  def  ) 

Sets default value for this field. Setting null value removes the default value.

See also:
defaultValue()

Definition at line 401 of file field.cpp.

bool Field::setDefaultValue ( const QCString &  def  ) 

Sets default value decoded from QCString. Decoding errors are detected (value is strictly checked against field type)

  • if one is encountered, default value is cleared (defaultValue()==QVariant()).
    Returns:
    true if given value was valid for field type.

Todo:
BigInteger support

Definition at line 407 of file field.cpp.

void Field::setAutoIncrement ( bool  a  ) 

Sets auto increment flag. Only available to set true, if isAutoIncrementAllowed() is true.

Definition at line 520 of file field.cpp.

void Field::setPrimaryKey ( bool  p  ) 

Specifies whether the field is single-field primary key or not (KexiDB::PrimeryKey item). Use this with caution. Setting this to true implies setting:

  • setUniqueKey(true)
  • setNotNull(true)
  • setNotEmpty(true)
  • setIndexed(true)

Setting this to false implies setting setAutoIncrement(false).

Todo:
is this ok for all engines?

Definition at line 529 of file field.cpp.

void Field::setUniqueKey ( bool  u  ) 

Specifies whether the field has single-field unique constraint or not (KexiDB::Unique item). Setting this to true implies setting Indexed flag to true (setIndexed(true)), because index is required it control unique constraint.

Definition at line 546 of file field.cpp.

void Field::setForeignKey ( bool  f  ) 

Sets whether the field has to be declared with single-field foreign key. Used in IndexSchema::setForeigKey().

Definition at line 556 of file field.cpp.

void Field::setNotNull ( bool  n  ) 

Specifies whether the field has single-field unique constraint or not (KexiDB::NotNull item). Setting this to true implies setting Indexed flag to true (setIndexed(true)), because index is required it control not null constraint.

Definition at line 563 of file field.cpp.

void Field::setNotEmpty ( bool  n  ) 

Specifies whether the field has single-field unique constraint or not (KexiDB::NotEmpty item). Setting this to true implies setting Indexed flag to true (setIndexed(true)), because index is required it control not empty constraint.

Definition at line 569 of file field.cpp.

void Field::setIndexed ( bool  s  ) 

Specifies whether the field is indexed (KexiDB::Indexed item) (by single-field implicit index) or not. Use this with caution. Since index is used to control unique, not null/empty constratins, setting this to false implies setting:

  • setPrimaryKey(false)
  • setUniqueKey(false)
  • setNotNull(false)
  • setNotEmpty(false) because above flags need index to be present. Similarly, setting one of the above flags to true, will automatically do setIndexed(true) for the same reason.

Definition at line 575 of file field.cpp.

void KexiDB::Field::setCaption ( const QString &  caption  )  [inline]

Sets caption for this field to caption.

Definition at line 493 of file field.h.

void KexiDB::Field::setDescription ( const QString &  description  )  [inline]

Sets description for this field to description.

Definition at line 496 of file field.h.

void KexiDB::Field::setWidth ( uint  w  )  [inline]

Sets visible width for this field to w (usually in pixels or points). 0 means there is no hint for the width.

Definition at line 500 of file field.h.

bool Field::isQueryAsterisk (  )  const

There can be added asterisks (QueryAsterisk objects) to query schemas' field list. QueryAsterisk subclasses Field class, and to check if the given object (pointed by Field*) is asterisk or just ordinary field definition, you can call this method. This is just effective version of QObject::isA(). Every QueryAsterisk object returns true here, and every Field object returns false.

Definition at line 271 of file field.cpp.

QString Field::debugString (  )  const [virtual]

Returns:
string for debugging purposes.

Definition at line 588 of file field.cpp.

void Field::debug (  ) 

Shows debug information about this field.

Definition at line 633 of file field.cpp.

KexiDB::BaseExpr* KexiDB::Field::expression (  )  [inline]

Returns:
KexiDB::BaseExpr object if the field value is an expression. Unless the expression is set with setExpression(), it is null.

Definition at line 521 of file field.h.

void Field::setExpression ( KexiDB::BaseExpr expr  ) 

Sets expression data expr. If there was already expression set, it is destroyed before new assignment. This Field object becames owner of expr object, so you do not have to worry about deleting it later. If the expr is null, current field's expression is deleted, if exists.

Because the field defines an expression, it should be assigned to a query, not to a table.

Definition at line 638 of file field.cpp.

bool KexiDB::Field::isExpression (  )  const [inline]

Returns:
true if there is expression defined for this field. This method is provided for better readibility

Definition at line 537 of file field.h.

QValueVector<QString> KexiDB::Field::enumHints (  )  const [inline]

Returns:
the hints for enum fields.

Definition at line 541 of file field.h.

void KexiDB::Field::setEnumHints ( const QValueVector< QString > &  l  )  [inline]

sets the hint for enum fields

Definition at line 544 of file field.h.

QVariant Field::customProperty ( const QCString &  propertyName,
const QVariant &  defaultValue = QVariant() 
) const

Returns:
custom property propertyName. If there is no such a property, defaultValue is returned.

Definition at line 649 of file field.cpp.

void Field::setCustomProperty ( const QCString &  propertyName,
const QVariant &  value 
)

Sets value value for custom property propertyName.

Definition at line 660 of file field.cpp.

const CustomPropertiesMap KexiDB::Field::customProperties (  )  const [inline]

Returns:
all custom properties

Definition at line 559 of file field.h.

Field * Field::copy (  )  const [protected, virtual]

Returns:
a deep copy of this object. Used in FieldList(const FieldList& fl).

Reimplemented in KexiDB::QueryAsterisk.

Definition at line 113 of file field.cpp.


Member Data Documentation

In most cases this points to a TableSchema object that field is assigned.

Definition at line 576 of file field.h.

uint KexiDB::Field::m_length [protected]

also used for storing scale for floating point types

Definition at line 581 of file field.h.

used in visibleDecimalPlaces()

Definition at line 583 of file field.h.

real i18n'd type names (and not-i18n'd type name strings)

Definition at line 616 of file field.h.

real i18n'd type group names (and not-i18n'd group name strings)

Definition at line 619 of file field.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys