lib

KoVariableFormat Class Reference

#include <KoVariable.h>

Inheritance diagram for KoVariableFormat:

KoVariableDateFormat KoVariableStringFormat KoVariableTimeFormat

List of all members.


Detailed Description

Class: KoVariableFormat Base class for a variable format - held by KWDocument.

Example of formats are time, date, string, number, floating-point number... The reason for formats to be separated is that it allows to customize the formats, to implement subformats (various date formats, etc.).

Definition at line 121 of file KoVariable.h.


Public Member Functions

virtual QCString key () const =0
virtual QCString getKey (const QString &props) const =0
virtual void load (const QCString &key)=0
virtual QString convert (const QVariant &data) const =0
virtual void setFormatProperties (const QString &)
virtual QString formatProperties () const
virtual QStringList formatPropsList () const
virtual QStringList translatedFormatPropsList () const

Member Function Documentation

virtual QCString KoVariableFormat::key (  )  const [pure virtual]

Return a key describing this format.

Used for the flyweight pattern in KoVariableFormatCollection

Implemented in KoVariableDateFormat, KoVariableTimeFormat, and KoVariableStringFormat.

virtual QCString KoVariableFormat::getKey ( const QString &  props  )  const [pure virtual]

Returns:
the key for a given set of properties. Use this key to lookup the format in the "variable format" collection.
Parameters:
props properties of this format, e.g. DD/MM/YYYY for a date format.

Implemented in KoVariableDateFormat, KoVariableTimeFormat, and KoVariableStringFormat.

virtual void KoVariableFormat::load ( const QCString &  key  )  [pure virtual]

Create a format from this key.

Implemented in KoVariableDateFormat, KoVariableTimeFormat, and KoVariableStringFormat.

virtual QString KoVariableFormat::convert ( const QVariant &  data  )  const [pure virtual]

Use this format to convert a piece of data into a string.

Implemented in KoVariableDateFormat, KoVariableTimeFormat, and KoVariableStringFormat.

virtual void KoVariableFormat::setFormatProperties ( const QString &   )  [inline, virtual]

Set the properties of this format, e.g.

DD/MM/YYYY for a date format. WARNING: if you call this, you might be modifying a format that other variables use as well. Don't do it, use getKey.

Reimplemented in KoVariableDateFormat, and KoVariableTimeFormat.

Definition at line 150 of file KoVariable.h.

virtual QString KoVariableFormat::formatProperties (  )  const [inline, virtual]

Returns:
the properties of this format, e.g. DD/MM/YYYY for a date format.

Reimplemented in KoVariableDateFormat, and KoVariableTimeFormat.

Definition at line 154 of file KoVariable.h.

virtual QStringList KoVariableFormat::formatPropsList (  )  const [inline, virtual]

Returns:
the list of available properties strings (e.g. hh:mm:ss)

Reimplemented in KoVariableDateFormat, and KoVariableTimeFormat.

Definition at line 158 of file KoVariable.h.

virtual QStringList KoVariableFormat::translatedFormatPropsList (  )  const [inline, virtual]

Returns:
the translated version of the list of format properties

Reimplemented in KoVariableDateFormat, and KoVariableTimeFormat.

Definition at line 162 of file KoVariable.h.


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