kspread
KSpread::Format Class Reference
Inheritance diagram for KSpread::Format:

Detailed Description
Definition at line 54 of file kspread_format.h.
Public Types | |
Left = 1 | |
Center = 2 | |
Right = 3 | |
Undefined = 4 | |
Top = 1 | |
Middle = 2 | |
Bottom = 3 | |
UndefinedY = 4 | |
AlwaysSigned = 1 | |
AlwaysUnsigned = 2 | |
OnlyNegSigned = 3 | |
NegRed = 1 | |
AllBlack = 2 | |
NegBrackets = 3 | |
NegRedBrackets = 4 | |
PAlign = 0x01 | |
PAlignY = 0x02 | |
PPrefix = 0x08 | |
PPostfix = 0x10 | |
PLeftBorder = 0x20 | |
PRightBorder = 0x40 | |
PTopBorder = 0x80 | |
PBottomBorder = 0x100 | |
PFallDiagonal = 0x200 | |
PGoUpDiagonal = 0x400 | |
PBackgroundBrush = 0x800 | |
PFont = 0x1000 | |
PTextPen = 0x2000 | |
PBackgroundColor = 0x4000 | |
PFloatFormat = 0x8000 | |
PFloatColor = 0x10000 | |
PMultiRow = 0x20000 | |
PVerticalText = 0x40000 | |
PPrecision = 0x80000 | |
PFormatType = 0x100000 | |
PAngle = 0x200000 | |
PComment = 0x400000 | |
PIndent = 0x800000 | |
PDontPrintText = 0x1000000 | |
PCustomFormat = 0x2000000 | |
PNotProtected = 0x4000000 | |
PHideAll = 0x8000000 | |
PHideFormula = 0x10000000 | |
Flag_MultiRow = 0x00000001 | |
Flag_VerticalText = 0x00000002 | |
Flag_DontPrintText = 0x00000004 | |
Flag_HideAll = 0x00000008 | |
Flag_HideFormula = 0x00000010 | |
Flag_NotProtected = 0x00000020 | |
enum | Align { Left = 1, Center = 2, Right = 3, Undefined = 4 } |
enum | AlignY { Top = 1, Middle = 2, Bottom = 3, UndefinedY = 4 } |
enum | FloatFormat { AlwaysSigned = 1, AlwaysUnsigned = 2, OnlyNegSigned = 3 } |
enum | FloatColor { NegRed = 1, AllBlack = 2, NegBrackets = 3, NegRedBrackets = 4 } |
enum | Properties { PAlign = 0x01, PAlignY = 0x02, PPrefix = 0x08, PPostfix = 0x10, PLeftBorder = 0x20, PRightBorder = 0x40, PTopBorder = 0x80, PBottomBorder = 0x100, PFallDiagonal = 0x200, PGoUpDiagonal = 0x400, PBackgroundBrush = 0x800, PFont = 0x1000, PTextPen = 0x2000, PBackgroundColor = 0x4000, PFloatFormat = 0x8000, PFloatColor = 0x10000, PMultiRow = 0x20000, PVerticalText = 0x40000, PPrecision = 0x80000, PFormatType = 0x100000, PAngle = 0x200000, PComment = 0x400000, PIndent = 0x800000, PDontPrintText = 0x1000000, PCustomFormat = 0x2000000, PNotProtected = 0x4000000, PHideAll = 0x8000000, PHideFormula = 0x10000000 } |
enum | FormatFlags { Flag_MultiRow = 0x00000001, Flag_VerticalText = 0x00000002, Flag_DontPrintText = 0x00000004, Flag_HideAll = 0x00000008, Flag_HideFormula = 0x00000010, Flag_NotProtected = 0x00000020 } |
Public Member Functions | |
Format (Sheet *sheet, Style *style) | |
virtual | ~Format () |
void | copy (const Format &other) |
void | defaultStyleFormat () |
bool | load (const QDomElement &f, Paste::Mode pm, bool paste=false) |
bool | loadFormat (const QDomElement &f, Paste::Mode pm=Paste::Normal, bool paste=false) |
QDomElement | save (QDomDocument &doc, int _col, int _row, bool force=false, bool copy=false) const |
QDomElement | saveFormat (QDomDocument &doc, bool force=false, bool copy=false) const |
QDomElement | saveFormat (QDomDocument &doc, int _col, int _row, bool force=false, bool copy=false) const |
void | loadOasisStyle (KoOasisLoadingContext &context) |
bool | loadOasisStyleProperties (KoStyleStack &styleStack, const KoOasisStyles &oasisStyles) |
bool | loadFontOasisStyle (KoStyleStack &font) |
QString | saveOasisCellStyle (KoGenStyle ¤tCellStyle, KoGenStyles &mainStyle) |
uint | propertiesMask () |
void | clearProperties () |
void | clearProperty (Properties p) |
void | clearNoFallBackProperties () |
void | clearNoFallBackProperties (Properties p) |
void | setNoFallBackProperties (Properties p) |
bool | hasNoFallBackProperties (Properties p) const |
void | clearFlag (FormatFlags flag) |
void | setFlag (FormatFlags flag) |
bool | testFlag (FormatFlags flag) const |
void | setStyle (Style *style) |
void | setCell (Cell *cell) |
void | setFormatString (QString const &format) |
void | setAlign (Align _align) |
void | setAlignY (AlignY _alignY) |
void | setPrefix (const QString &_prefix) |
void | setPostfix (const QString &_postfix) |
void | setPrecision (int _p) |
virtual void | setLeftBorderPen (const QPen &_p) |
void | setLeftBorderStyle (Qt::PenStyle s) |
void | setLeftBorderColor (const QColor &_c) |
void | setLeftBorderWidth (int _w) |
virtual void | setTopBorderPen (const QPen &_p) |
void | setTopBorderStyle (Qt::PenStyle s) |
void | setTopBorderColor (const QColor &_c) |
void | setTopBorderWidth (int _w) |
virtual void | setRightBorderPen (const QPen &p) |
void | setRightBorderStyle (Qt::PenStyle _s) |
void | setRightBorderColor (const QColor &_c) |
void | setRightBorderWidth (int _w) |
virtual void | setBottomBorderPen (const QPen &p) |
void | setBottomBorderStyle (Qt::PenStyle _s) |
void | setBottomBorderColor (const QColor &_c) |
void | setBottomBorderWidth (int _w) |
void | setFallDiagonalPen (const QPen &_p) |
void | setFallDiagonalStyle (Qt::PenStyle s) |
void | setFallDiagonalColor (const QColor &_c) |
void | setFallDiagonalWidth (int _w) |
void | setGoUpDiagonalPen (const QPen &_p) |
void | setGoUpDiagonalStyle (Qt::PenStyle s) |
void | setGoUpDiagonalColor (const QColor &_c) |
void | setGoUpDiagonalWidth (int _w) |
void | setBackGroundBrush (const QBrush &_p) |
void | setBackGroundBrushStyle (Qt::BrushStyle s) |
void | setBackGroundBrushColor (const QColor &_c) |
void | setTextFont (const QFont &_f) |
void | setTextFontSize (int _s) |
void | setTextFontFamily (const QString &_f) |
void | setTextFontBold (bool _b) |
void | setTextFontItalic (bool _i) |
void | setTextFontUnderline (bool _i) |
void | setTextFontStrike (bool _i) |
void | setTextPen (const QPen &_p) |
void | setTextColor (const QColor &_c) |
void | setBgColor (const QColor &_c) |
void | setFloatFormat (FloatFormat _f) |
void | setFloatColor (FloatColor _c) |
void | setMultiRow (bool _b) |
void | setVerticalText (bool _b) |
void | setFormatType (FormatType _format) |
void | setAngle (int _angle) |
void | setComment (const QString &c) |
void | setIndent (double _indent) |
void | setDontPrintText (bool _b) |
void | setNotProtected (bool _b) |
void | setHideAll (bool _b) |
void | setHideFormula (bool _b) |
void | setCurrency (Currency const &c) |
void | setCurrency (int type, QString const &symbol) |
QString const & | getFormatString (int col, int row) const |
virtual const QPen & | leftBorderPen (int col, int row) const |
int | leftBorderWidth (int col, int row) const |
Qt::PenStyle | leftBorderStyle (int col, int row) const |
const QColor & | leftBorderColor (int col, int row) const |
virtual const QPen & | topBorderPen (int col, int row) const |
int | topBorderWidth (int col, int row) const |
Qt::PenStyle | topBorderStyle (int col, int row) const |
const QColor & | topBorderColor (int col, int row) const |
virtual const QPen & | rightBorderPen (int col, int row) const |
int | rightBorderWidth (int col, int row) const |
Qt::PenStyle | rightBorderStyle (int col, int row) const |
const QColor & | rightBorderColor (int col, int row) const |
virtual const QPen & | bottomBorderPen (int col, int row) const |
int | bottomBorderWidth (int col, int row) const |
Qt::PenStyle | bottomBorderStyle (int col, int row) const |
const QColor & | bottomBorderColor (int col, int row) const |
const QPen & | fallDiagonalPen (int col, int row) const |
int | fallDiagonalWidth (int col, int row) const |
Qt::PenStyle | fallDiagonalStyle (int col, int row) const |
const QColor & | fallDiagonalColor (int col, int row) const |
const QPen & | goUpDiagonalPen (int col, int row) const |
int | goUpDiagonalWidth (int col, int row) const |
Qt::PenStyle | goUpDiagonalStyle (int col, int row) const |
const QColor & | goUpDiagonalColor (int col, int row) const |
const QBrush & | backGroundBrush (int col, int row) const |
Qt::BrushStyle | backGroundBrushStyle (int col, int row) const |
const QColor & | backGroundBrushColor (int col, int row) const |
uint | bottomBorderValue (int col, int row) const |
uint | rightBorderValue (int col, int row) const |
uint | leftBorderValue (int col, int row) const |
uint | topBorderValue (int col, int row) const |
int | precision (int col, int row) const |
QString | prefix (int col, int row) const |
QString | postfix (int col, int row) const |
FloatFormat | floatFormat (int col, int row) const |
FloatColor | floatColor (int col, int row) const |
const QPen & | textPen (int col, int row) const |
const QColor & | textColor (int col, int row) const |
const QColor & | bgColor (int col, int row) const |
const QFont | textFont (int col, int row) const |
int | textFontSize (int col, int row) const |
QString const & | textFontFamily (int col, int row) const |
bool | textFontBold (int col, int row) const |
bool | textFontItalic (int col, int row) const |
bool | textFontUnderline (int col, int row) const |
bool | textFontStrike (int col, int row) const |
Align | align (int col, int row) const |
AlignY | alignY (int col, int row) const |
bool | multiRow (int col, int row) const |
bool | verticalText (int col, int row) const |
FormatType | getFormatType (int col, int row) const |
int | getAngle (int col, int row) const |
const QString * | comment () const |
QString | comment (int col, int row) const |
QString * | commentP (int col, int row) const |
double | getIndent (int col, int row) const |
bool | getDontprintText (int col, int row) const |
bool | notProtected (int col, int row) const |
bool | isHideAll (int col, int row) const |
bool | isHideFormula (int col, int row) const |
bool | isProtected (int col, int row) const |
Style * | style () const |
Sheet * | sheet () |
const Sheet * | sheet () const |
bool | hasProperty (Properties p, bool withoutParent=false) const |
bool | currencyInfo (Currency ¤cy) const |
QString | getCurrencySymbol () const |
QFont | font () const |
Static Public Member Functions | |
static void | setGlobalColWidth (double width) |
static void | setGlobalRowHeight (double height) |
static double | globalRowHeight () |
static double | globalColWidth () |
Protected Member Functions | |
const QPen & | rightBorderPen () const |
const QPen & | bottomBorderPen () const |
void | formatChanged () |
virtual Format * | fallbackFormat (int col, int row) |
virtual const Format * | fallbackFormat (int col, int row) const |
virtual bool | isDefault () const |
Protected Attributes | |
Sheet * | m_pSheet |
Style * | m_pStyle |
uint | m_mask |
uint | m_bNoFallBack |
Q_UINT32 | m_flagsMask |
QString * | m_strComment |
Classes | |
struct | Currency |
Constructor & Destructor Documentation
Constructor.
- Parameters:
-
sheet The sheet this format belongs to.
- Todo:
- The format should not belong to a sheet. The cell belongs to a sheet. Move the sheet pointer to Cell.
- Parameters:
-
style The style this format should use. You should pass 0
in here, only if you copy another Format on this directly after.
Definition at line 67 of file kspread_format.cc.
Format::~Format | ( | ) | [virtual] |
Destructor.
The associated style's reference counter is decremented and if it has no further references, it is deleted.
Definition at line 78 of file kspread_format.cc.
Member Function Documentation
- Parameters:
-
_col the column this cell is assumed to be in _row the row this cell is assumed to be in
- Returns:
- the background color.
Definition at line 2103 of file kspread_format.cc.
bool Format::currencyInfo | ( | Currency & | currency | ) | const |
returns false if no currency information is set or doesn't apply
Definition at line 2381 of file kspread_format.cc.
If a cell is set, it returns the row format of the sheet.
Otherwise, it returns 0.
Reimplemented in KSpread::RowFormat, and KSpread::ColumnFormat.
Definition at line 2476 of file kspread_format.cc.
If a cell is set, it returns the row format of the sheet.
Otherwise, it returns 0.
Reimplemented in KSpread::RowFormat, and KSpread::ColumnFormat.
Definition at line 2471 of file kspread_format.cc.
Format::FloatColor Format::floatColor | ( | int | col, | |
int | row | |||
) | const |
- Returns:
- the color format of a floating point value
Definition at line 2092 of file kspread_format.cc.
Format::FloatFormat Format::floatFormat | ( | int | col, | |
int | row | |||
) | const |
- Returns:
- the way of formatting a floating point value
Definition at line 2081 of file kspread_format.cc.
void Format::formatChanged | ( | ) | [protected] |
If a cell is set, marks its Layout and TextFormat as dirty.
Definition at line 2462 of file kspread_format.cc.
bool Format::isDefault | ( | ) | const [protected, virtual] |
Default implementation returns true.
Reimplemented in KSpread::RowFormat, and KSpread::ColumnFormat.
Definition at line 2481 of file kspread_format.cc.
- Returns:
- the postfix of a numeric value ( for example "DM" )
Definition at line 1818 of file kspread_format.cc.
- Returns:
- the precision of the floating point representation.
Definition at line 2070 of file kspread_format.cc.
- Returns:
- the prefix of a numeric value ( for example "$" )
Definition at line 1807 of file kspread_format.cc.
QString Format::saveOasisCellStyle | ( | KoGenStyle & | currentCellStyle, | |
KoGenStyles & | mainStyle | |||
) |
- Returns:
- the OASIS style's name, if it was created. QString::null otherwise.
Definition at line 227 of file kspread_format.cc.
void Format::setFormatString | ( | QString const & | format | ) |
sets the format of the content, e.g.
#.##0.00, dd/mmm/yyyy,...
Definition at line 1092 of file kspread_format.cc.
Member Data Documentation
uint KSpread::Format::m_bNoFallBack [protected] |
used m_bNoFallBack when you put default value in a cell and not used column/row parameters
Definition at line 428 of file kspread_format.h.
QString* KSpread::Format::m_strComment [protected] |
The documentation for this class was generated from the following files: