lib Library API Documentation

KoVariableFormat Class Reference

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

#include <kovariable.h>

Inheritance diagram for KoVariableFormat:

KoVariableDateFormat KoVariableStringFormat KoVariableTimeFormat List of all members.

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

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 104 of file kovariable.h.


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.

Referenced by KoVariable::save().

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.

Referenced by KoVariable::text().

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 133 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 137 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 141 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 145 of file kovariable.h.


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Sep 24 18:22:32 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003