Kexi API Documentation (2.0 alpha)

KexiTextFormatter Class Reference

#include <kexitextformatter.h>

List of all members.


Detailed Description

Text formatter used to format QVariant values to text for displaying and back to QVariant.

Used by KexiInputTableEdit, KexiDateTableEdit, KexiTimeTableEdit, KexiDateTimeTableEdit, KexiDBLineEdit (forms), etc.

Definition at line 28 of file kexitextformatter.h.

Public Member Functions

 KexiTextFormatter ()
 ~KexiTextFormatter ()
void setField (KexiDB::Field *field)
 Assigns field to the formatter. This affects its behaviour.
QString valueToText (const QVariant &value, const QString &add) const
QVariant textToValue (const QString &text) const
bool valueIsEmpty (const QString &text) const
bool valueIsValid (const QString &text) const
QString inputMask () const

Public Attributes

Private * d


Constructor & Destructor Documentation

KexiTextFormatter::KexiTextFormatter  ) 
 

Definition at line 45 of file kexitextformatter.cpp.

KexiTextFormatter::~KexiTextFormatter  ) 
 

Definition at line 50 of file kexitextformatter.cpp.

References d.


Member Function Documentation

QString KexiTextFormatter::inputMask  )  const
 

Returns:
input mask for intering values related to a field schema which has been set using setField().

Definition at line 221 of file kexitextformatter.cpp.

References d, KexiDB::Field::Date, KexiDB::Field::DateTime, dateTimeInputMask(), and KexiDB::Field::Time.

Referenced by KexiDBLineEdit::setColumnInfo().

void KexiTextFormatter::setField KexiDB::Field field  ) 
 

Assigns field to the formatter. This affects its behaviour.

Definition at line 55 of file kexitextformatter.cpp.

References d, KexiDB::Field::Date, KexiDB::Field::DateTime, and KexiDB::Field::Time.

Referenced by KexiInputTableEdit::init(), and KexiDBLineEdit::setColumnInfo().

QVariant KexiTextFormatter::textToValue const QString text  )  const
 

Returns:
value cnverted from text A field schema set using setField() is used to perform the formatting. Used in KexiInputTableEdit::setValueInternal(), by form widgets and for reporting/printing.

Definition at line 141 of file kexitextformatter.cpp.

References KexiDB::Field::BigInteger, KexiDB::Field::Boolean, KexiDB::Field::Byte, d, KexiDB::Field::Date, KexiDB::Field::DateTime, KexiDB::Field::Double, KexiDB::Field::Float, KexiDB::Field::Integer, KexiDB::Field::LongText, KexiDB::Field::ShortInteger, stringToDateTime(), KexiDB::Field::Text, and KexiDB::Field::Time.

Referenced by KexiDBLineEdit::value().

bool KexiTextFormatter::valueIsEmpty const QString text  )  const
 

Returns:
true if value formatted as text is empty. A field schema set using setField() is used to perform the calculation.

Definition at line 182 of file kexitextformatter.cpp.

References d, KexiDB::Field::Date, dateTimeIsEmpty(), and KexiDB::Field::Time.

Referenced by KexiDBLineEdit::valueIsEmpty(), and valueIsValid().

bool KexiTextFormatter::valueIsValid const QString text  )  const
 

Returns:
true if value formatted as text is valid. A field schema set using setField() is used to perform the calculation.

Definition at line 201 of file kexitextformatter.cpp.

References d, KexiDB::Field::Date, KexiDB::Field::DateTime, dateTimeIsValid(), KexiDB::Field::Time, and valueIsEmpty().

Referenced by KexiDBLineEdit::valueIsValid().

QString KexiTextFormatter::valueToText const QVariant &  value,
const QString add
const
 

Returns:
text for value. A field schema set using setField() is used to perform the formatting. add is a text that should be added to the value if possible. Used in KexiInputTableEdit::setValueInternal(), by form widgets and for reporting/printing.

Definition at line 74 of file kexitextformatter.cpp.

References d, and KexiDB::formatNumberForVisibleDecimalPlaces().

Referenced by KexiInputTableEdit::handleCopyAction(), KexiInputTableEdit::setValueInternal(), KexiDBLineEdit::setValueInternal(), and KexiInputTableEdit::showToolTipIfNeeded().


Member Data Documentation

Private* KexiTextFormatter::d
 

Definition at line 60 of file kexitextformatter.h.

Referenced by inputMask(), setField(), textToValue(), valueIsEmpty(), valueIsValid(), valueToText(), and ~KexiTextFormatter().


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