lib

KoVariableFormat Class Referenceabstract

#include <KoVariable.h>

Inheritance diagram for KoVariableFormat:
KoVariableDateFormat KoVariableStringFormat KoVariableTimeFormat

Public Member Functions

virtual TQCString key () const =0
 
virtual TQCString getKey (const TQString &props) const =0
 
virtual void load (const TQCString &key)=0
 
virtual TQString convert (const TQVariant &data) const =0
 
virtual void setFormatProperties (const TQString &)
 
virtual TQString formatProperties () const
 
virtual TQStringList formatPropsList () const
 
virtual TQStringList 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 121 of file KoVariable.h.

Constructor & Destructor Documentation

◆ KoVariableFormat()

KoVariableFormat::KoVariableFormat ( )
inline

Definition at line 124 of file KoVariable.h.

◆ ~KoVariableFormat()

virtual KoVariableFormat::~KoVariableFormat ( )
inlinevirtual

Definition at line 125 of file KoVariable.h.

Member Function Documentation

◆ convert()

virtual TQString KoVariableFormat::convert ( const TQVariant &  data) const
pure virtual

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

Implemented in KoVariableDateFormat, KoVariableTimeFormat, and KoVariableStringFormat.

◆ formatProperties()

virtual TQString KoVariableFormat::formatProperties ( ) const
inlinevirtual
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.

◆ formatPropsList()

virtual TQStringList KoVariableFormat::formatPropsList ( ) const
inlinevirtual
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.

◆ getKey()

virtual TQCString KoVariableFormat::getKey ( const TQString &  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
propsproperties of this format, e.g. DD/MM/YYYY for a date format.

Implemented in KoVariableDateFormat, KoVariableTimeFormat, and KoVariableStringFormat.

◆ key()

virtual TQCString KoVariableFormat::key ( ) const
pure virtual

Return a key describing this format.

Used for the flyweight pattern in KoVariableFormatCollection

Implemented in KoVariableDateFormat, KoVariableTimeFormat, and KoVariableStringFormat.

◆ load()

virtual void KoVariableFormat::load ( const TQCString &  key)
pure virtual

Create a format from this key.

Implemented in KoVariableTimeFormat, KoVariableStringFormat, and KoVariableDateFormat.

◆ setFormatProperties()

virtual void KoVariableFormat::setFormatProperties ( const TQString &  )
inlinevirtual

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.

◆ translatedFormatPropsList()

virtual TQStringList KoVariableFormat::translatedFormatPropsList ( ) const
inlinevirtual
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: