kspread
KSpread::Style Class Reference
#include <kspread_style.h>
Inheritance diagram for KSpread::Style:

Detailed Description
The Style class represents a cell style.Built-in and custom styles, the ones shown in the StyleManager dialog, are CustomStyles. Pure Styles have no name, for instance, and are only used as AUTO styles.
Definition at line 45 of file kspread_style.h.
Public Types | |
enum | StyleType { BUILTIN, CUSTOM, AUTO, TENTATIVE } |
enum | FontFlags { FBold = 0x01, FUnderline = 0x02, FItalic = 0x04, FStrike = 0x08 } |
enum | Properties { PDontPrintText = 0x01, PCustomFormat = 0x02, PNotProtected = 0x04, PHideAll = 0x08, PHideFormula = 0x10, PMultiRow = 0x20, PVerticalText = 0x40 } |
enum | FlagsSet { SAlignX = 0x01, SAlignY = 0x02, SPrefix = 0x08, SPostfix = 0x10, SLeftBorder = 0x20, SRightBorder = 0x40, STopBorder = 0x80, SBottomBorder = 0x100, SFallDiagonal = 0x200, SGoUpDiagonal = 0x400, SBackgroundBrush = 0x800, SFont = 0x1000, STextPen = 0x2000, SBackgroundColor = 0x4000, SFloatFormat = 0x8000, SFloatColor = 0x10000, SMultiRow = 0x20000, SVerticalText = 0x40000, SPrecision = 0x80000, SFormatType = 0x100000, SAngle = 0x200000, SIndent = 0x800000, SDontPrintText = 0x1000000, SCustomFormat = 0x2000000, SNotProtected = 0x4000000, SHideAll = 0x8000000, SHideFormula = 0x10000000, SFontSize = 0x20000000, SFontFlag = 0x40000000, SFontFamily = 0x80000000 } |
Public Member Functions | |
Style () | |
Style (Style *style) | |
virtual | ~Style () |
bool | operator== (const Style &style) const |
StyleType | type () const |
void | saveXML (QDomDocument &doc, QDomElement &format) const |
bool | loadXML (QDomElement &format) |
virtual QString | saveOasis (KoGenStyle &style, KoGenStyles &mainStyles) |
void | loadOasisStyle (KoOasisStyles &oasisStyles, const QDomElement &element) |
bool | release () |
void | addRef () |
int | usage () const |
bool | hasProperty (Properties p) const |
bool | hasFeature (FlagsSet f, bool withoutParent) const |
uint | features () const |
uint | bottomPenValue () const |
uint | rightPenValue () const |
uint | leftPenValue () const |
uint | topPenValue () const |
QPen const & | pen () const |
QColor const & | bgColor () const |
QPen const & | rightBorderPen () const |
QPen const & | bottomBorderPen () const |
QPen const & | leftBorderPen () const |
QPen const & | topBorderPen () const |
QPen const & | fallDiagonalPen () const |
QPen const & | goUpDiagonalPen () const |
QBrush const & | backGroundBrush () const |
QString const & | strFormat () const |
QString const & | prefix () const |
QString const & | postfix () const |
QString const & | fontFamily () const |
Format::Align | alignX () const |
Format::AlignY | alignY () const |
Format::FloatFormat | floatFormat () const |
Format::FloatColor | floatColor () const |
FormatType | formatType () const |
Format::Currency const & | currency () const |
QFont | font () const |
uint | fontFlags () const |
int | fontSize () const |
int | precision () const |
int | rotateAngle () const |
double | indent () const |
Style * | setAlignX (Format::Align alignX) |
Style * | setAlignY (Format::AlignY alignY) |
Style * | setFont (QFont const &f) |
Style * | setFontFamily (QString const &fam) |
Style * | setFontFlags (uint flags) |
Style * | setFontSize (int size) |
Style * | setPen (QPen const &pen) |
Style * | setBgColor (QColor const &color) |
Style * | setRightBorderPen (QPen const &pen) |
Style * | setBottomBorderPen (QPen const &pen) |
Style * | setLeftBorderPen (QPen const &pen) |
Style * | setTopBorderPen (QPen const &pen) |
Style * | setFallDiagonalPen (QPen const &pen) |
Style * | setGoUpDiagonalPen (QPen const &pen) |
Style * | setRotateAngle (int angle) |
Style * | setIndent (double indent) |
Style * | setBackGroundBrush (QBrush const &brush) |
Style * | setFloatFormat (Format::FloatFormat format) |
Style * | setFloatColor (Format::FloatColor color) |
Style * | setFormatType (FormatType format) |
Style * | setStrFormat (QString const &strFormat) |
Style * | setPrecision (int precision) |
Style * | setPrefix (QString const &prefix) |
Style * | setPostfix (QString const &postfix) |
Style * | setCurrency (Format::Currency const ¤cy) |
Style * | setProperty (Properties p) |
Style * | clearProperty (Properties p) |
CustomStyle * | parent () const |
QString const & | parentName () const |
void | setParent (CustomStyle *parent) |
Static Public Member Functions | |
static FormatType | formatType (const QString &_format) |
static QString | saveOasisStyleNumeric (KoGenStyle &style, KoGenStyles &mainStyles, FormatType _style, const QString &_prefix, const QString &_postfix, int _precision, const QString &symbol) |
static QString | saveOasisStyleNumericDate (KoGenStyles &mainStyles, FormatType _style) |
static QString | saveOasisStyleNumericFraction (KoGenStyles &mainStyles, FormatType _style, const QString &_prefix, const QString _suffix) |
static QString | saveOasisStyleNumericTime (KoGenStyles &mainStyles, FormatType _style) |
static QString | saveOasisStyleNumericCustom (KoGenStyles &mainStyles, FormatType _style) |
static QString | saveOasisStyleNumericScientific (KoGenStyles &mainStyles, FormatType _style, const QString &_prefix, const QString _suffix, int _precision) |
static QString | saveOasisStyleNumericPercentage (KoGenStyles &mainStyles, FormatType _style, int _precision) |
static QString | saveOasisStyleNumericMoney (KoGenStyles &mainStyles, FormatType _style, int _precision) |
static QString | saveOasisStyleNumericText (KoGenStyles &mainStyles, FormatType _style, int _precision) |
static QString | saveOasisStyleNumericNumber (KoGenStyles &mainStyles, FormatType _style, int _precision) |
static QString | saveOasisBackgroundStyle (KoGenStyles &mainStyles, const QBrush &brush) |
static QString | colorName (const QColor &color) |
Protected Member Functions | |
void | saveOasisStyle (KoGenStyle &style, KoGenStyles &mainStyles) |
bool | featureSet (FlagsSet f) const |
Protected Attributes | |
CustomStyle * | m_parent |
QString | m_parentName |
StyleType | m_type |
uint | m_usageCount |
uint | m_featuresSet |
Format::Align | m_alignX |
Format::AlignY | m_alignY |
Format::FloatFormat | m_floatFormat |
Format::FloatColor | m_floatColor |
FormatType | m_formatType |
QString | m_fontFamily |
uint | m_fontFlags |
int | m_fontSize |
QPen | m_textPen |
QColor | m_bgColor |
QPen | m_rightBorderPen |
QPen | m_bottomBorderPen |
QPen | m_leftBorderPen |
QPen | m_topBorderPen |
QPen | m_fallDiagonalPen |
QPen | m_goUpDiagonalPen |
QBrush | m_backGroundBrush |
int | m_rotateAngle |
double | m_indent |
QString | m_strFormat |
int | m_precision |
QString | m_prefix |
QString | m_postfix |
Format::Currency | m_currency |
uint | m_properties |
uint | m_bottomPenValue |
uint | m_rightPenValue |
uint | m_leftPenValue |
uint | m_topPenValue |
Member Enumeration Documentation
|
Definition at line 79 of file kspread_style.h. |
|
Definition at line 66 of file kspread_style.h. |
|
The style type.
Definition at line 49 of file kspread_style.h. |
Constructor & Destructor Documentation
|
Constructor. Creates an empty automatic style. Definition at line 50 of file kspread_style.cc. |
|
Constructor.
Creates an automatic style. If
Definition at line 89 of file kspread_style.cc. |
|
Destructor.
Definition at line 122 of file kspread_style.cc. |
Member Function Documentation
|
Marks this style as used. The internal reference counter is incremented. Definition at line 1805 of file kspread_style.cc. |
|
Returns the name of a colour. This is the same as returned by QColor::name, but an internal cache is used to reduce the overhead when asking for the name of the same colour. Definition at line 2644 of file kspread_style.cc. |
|
Returns true if both styles have the same properties.
Definition at line 126 of file kspread_style.cc. |
|
Releases this style. The internal reference counter is decremented.
Definition at line 1792 of file kspread_style.cc. |
|
Saves an OASIS automatic style. Reimplemented by CustomStyle for OASIS user styles.
Reimplemented in KSpread::CustomStyle. Definition at line 1094 of file kspread_style.cc. |
|
Helper function for saveOasis Does the real work by determining the used attributes.
Definition at line 1105 of file kspread_style.cc. |
|
Definition at line 711 of file kspread_style.cc. |
|
Definition at line 181 of file kspread_style.h. |
Member Data Documentation
|
Alignment of the text.
Definition at line 276 of file kspread_style.h. |
|
Aligment of the text at top middle or bottom.
Definition at line 280 of file kspread_style.h. |
|
The brush used to draw the background.
Definition at line 338 of file kspread_style.h. |
|
The background color.
Definition at line 304 of file kspread_style.h. |
|
The pen used to draw the bottom border.
Definition at line 314 of file kspread_style.h. |
|
Currency information: about which currency from which country.
Definition at line 368 of file kspread_style.h. |
|
The pen used to draw the diagonal.
Definition at line 329 of file kspread_style.h. |
|
The color format of a floating point value.
Definition at line 286 of file kspread_style.h. |
|
The font used to draw the text.
Definition at line 293 of file kspread_style.h. |
|
The pen used to draw the the diagonal which go up.
Definition at line 333 of file kspread_style.h. |
|
Give indent.
Definition at line 344 of file kspread_style.h. |
|
The pen used to draw the left border.
Definition at line 319 of file kspread_style.h. |
|
The postfix of a numeric value ( for example "DM" ) May be empty.
Definition at line 363 of file kspread_style.h. |
|
The precision of the floating point representation If precision is -1, this means that no precision is specified.
Definition at line 353 of file kspread_style.h. |
|
The prefix of a numeric value ( for example "$" ) May be empty.
Definition at line 358 of file kspread_style.h. |
|
Stores information like: DonPrint, DontShowFormula, Protected. .. Definition at line 373 of file kspread_style.h. |
|
The pen used to draw the right border.
Definition at line 309 of file kspread_style.h. |
|
Format of the content, e.g. #.##0.00, dd/mmm/yyyy,... Definition at line 348 of file kspread_style.h. |
|
The pen used to draw the text.
Definition at line 300 of file kspread_style.h. |
|
The pen used to draw the top border.
Definition at line 324 of file kspread_style.h. |
The documentation for this class was generated from the following files: