kspread

KSpread::ValueFormatter Class Reference

#include <valueformatter.h>

List of all members.


Detailed Description

The ValueFormatter class generates a textual representation of data stored in a Value, with a given formatting.

Definition at line 38 of file valueformatter.h.


Public Member Functions

 ValueFormatter (ValueConverter *converter)
QString formatText (Cell *cell, FormatType fmtType)
QString formatText (const Value &value, FormatType fmtType, int precision=-1, Format::FloatFormat floatFormat=Format::OnlyNegSigned, const QString &prefix=QString::null, const QString &postfix=QString::null, const QString &currencySymbol=QString::null)
QString dateFormat (const QDate &_date, FormatType fmtType)
QString timeFormat (const QDateTime &_time, FormatType fmtType)

Protected Member Functions

FormatType determineFormatting (const Value &value, FormatType fmtType)
QString createNumberFormat (double value, int precision, FormatType fmt, bool alwaysSigned, const QString &currencySymbol)
QString fractionFormat (double value, FormatType fmtType)
QString errorFormat (Cell *cell)
void removeTrailingZeros (QString &str, QChar decimal_point)

Protected Attributes

ValueConverterconverter

Constructor & Destructor Documentation

ValueFormatter::ValueFormatter ( ValueConverter converter  ) 

copnstructor

Definition at line 37 of file valueformatter.cc.


Member Function Documentation

QString ValueFormatter::formatText ( Cell cell,
FormatType  fmtType 
)

create a text representation of data in this cell

Definition at line 41 of file valueformatter.cc.

QString ValueFormatter::formatText ( const Value value,
FormatType  fmtType,
int  precision = -1,
Format::FloatFormat  floatFormat = Format::OnlyNegSigned,
const QString &  prefix = QString::null,
const QString &  postfix = QString::null,
const QString &  currencySymbol = QString::null 
)

create a text representation of data in this Value

Definition at line 61 of file valueformatter.cc.

QString ValueFormatter::dateFormat ( const QDate &  _date,
FormatType  fmtType 
)

create a date format

Definition at line 493 of file valueformatter.cc.

QString ValueFormatter::timeFormat ( const QDateTime &  _time,
FormatType  fmtType 
)

create a time format

Definition at line 419 of file valueformatter.cc.

FormatType ValueFormatter::determineFormatting ( const Value value,
FormatType  fmtType 
) [protected]

determine the formatting type that should be used to format this value in a cell with a given format type

Definition at line 133 of file valueformatter.cc.

QString ValueFormatter::createNumberFormat ( double  value,
int  precision,
FormatType  fmt,
bool  alwaysSigned,
const QString &  currencySymbol 
) [protected]

create a number format

Definition at line 236 of file valueformatter.cc.

QString ValueFormatter::fractionFormat ( double  value,
FormatType  fmtType 
) [protected]

create a fraction format

Definition at line 298 of file valueformatter.cc.

void ValueFormatter::removeTrailingZeros ( QString &  str,
QChar  decimal_point 
) [protected]

Remove trailing zeros and the decimal point if necessary unless the number has no decimal point.

Definition at line 202 of file valueformatter.cc.


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