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 |
bool | operator!= (const Style &other) 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 |
void | clearFeature (FlagsSet f) |
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 | dateType (const QString &_format) |
static FormatType | timeType (const QString &_format) |
static FormatType | fractionType (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, const QString &_prefix, const QString &_suffix) |
static QString | saveOasisStyleNumericFraction (KoGenStyles &mainStyles, FormatType _style, const QString &_prefix, const QString _suffix) |
static QString | saveOasisStyleNumericTime (KoGenStyles &mainStyles, FormatType _style, const QString &_prefix, const QString &_suffix) |
static QString | saveOasisStyleNumericCustom (KoGenStyles &mainStyles, FormatType _style, const QString &_prefix, const QString &_suffix) |
static QString | saveOasisStyleNumericScientific (KoGenStyles &mainStyles, FormatType _style, const QString &_prefix, const QString _suffix, int _precision) |
static QString | saveOasisStyleNumericPercentage (KoGenStyles &mainStyles, FormatType _style, int _precision, const QString &_prefix, const QString &_suffix) |
static QString | saveOasisStyleNumericMoney (KoGenStyles &mainStyles, FormatType _style, const QString &symbol, int _precision, const QString &_prefix, const QString &_suffix) |
static QString | saveOasisStyleNumericText (KoGenStyles &mainStyles, FormatType _style, int _precision, const QString &_prefix, const QString &_suffix) |
static QString | saveOasisStyleNumericNumber (KoGenStyles &mainStyles, FormatType _style, int _precision, const QString &_prefix, const QString &_suffix) |
static QString | saveOasisBackgroundStyle (KoGenStyles &mainStyles, const QBrush &brush) |
static QString | colorName (const QColor &color) |
Protected Member Functions | |
void | saveOasisStyle (KoGenStyle &style, KoGenStyles &mainStyles) |
void | loadOasisDataStyle (KoOasisStyles &oasisStyles, const QDomElement &styleStack) |
void | loadOasisParagraphProperties (KoOasisStyles &oasisStyles, const KoStyleStack &styleStack) |
void | loadOasisTableCellProperties (KoOasisStyles &oasisStyles, const KoStyleStack &styleStack) |
void | loadOasisTextProperties (KoOasisStyles &oasisStyles, const KoStyleStack &styleStack) |
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
The style type.
- Enumerator:
-
BUILTIN built-in style (the default style) CUSTOM custom style (defined in the StyleManager dialog) AUTO automatically generated on cell format changes TENTATIVE
Definition at line 49 of file kspread_style.h.
Constructor & Destructor Documentation
Style::Style | ( | ) |
Style::Style | ( | Style * | style | ) |
Constructor.
Creates an automatic style. If style
is a custom or built-in style (e.g. the default style), style
becomes the parent style. In this case, features are NOT SET.
- Parameters:
-
style The style which features are copied.
Definition at line 90 of file kspread_style.cc.
Style::~Style | ( | ) | [virtual] |
Member Function Documentation
bool Style::operator== | ( | const Style & | style | ) | const |
Returns true if both styles have the same properties.
Definition at line 127 of file kspread_style.cc.
QString Style::saveOasisStyleNumeric | ( | KoGenStyle & | style, | |
KoGenStyles & | mainStyles, | |||
FormatType | _style, | |||
const QString & | _prefix, | |||
const QString & | _postfix, | |||
int | _precision, | |||
const QString & | symbol | |||
) | [static] |
- Returns:
- the name of the data style (number, currency, percentage, date, boolean, text)
Definition at line 696 of file kspread_style.cc.
QString Style::saveOasis | ( | KoGenStyle & | style, | |
KoGenStyles & | mainStyles | |||
) | [virtual] |
Saves an OASIS automatic style.
Reimplemented by CustomStyle for OASIS user styles.
- Returns:
- always QString::null
Reimplemented in KSpread::CustomStyle.
Definition at line 1112 of file kspread_style.cc.
bool Style::release | ( | ) |
Releases this style.
The internal reference counter is decremented.
- Returns:
- true, if this style is not used anymore and should be deleted.
Definition at line 1818 of file kspread_style.cc.
void Style::addRef | ( | ) |
Marks this style as used.
The internal reference counter is incremented.
Definition at line 1831 of file kspread_style.cc.
int KSpread::Style::usage | ( | ) | const [inline] |
QString Style::colorName | ( | const QColor & | color | ) | [static] |
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 2671 of file kspread_style.cc.
void Style::saveOasisStyle | ( | KoGenStyle & | style, | |
KoGenStyles & | mainStyles | |||
) | [protected] |
Helper function for saveOasis Does the real work by determining the used attributes.
Definition at line 1123 of file kspread_style.cc.
Member Data Documentation
Format::Align KSpread::Style::m_alignX [protected] |
Format::AlignY KSpread::Style::m_alignY [protected] |
Format::FloatColor KSpread::Style::m_floatColor [protected] |
QString KSpread::Style::m_fontFamily [protected] |
QPen KSpread::Style::m_textPen [protected] |
QColor KSpread::Style::m_bgColor [protected] |
QPen KSpread::Style::m_rightBorderPen [protected] |
QPen KSpread::Style::m_bottomBorderPen [protected] |
QPen KSpread::Style::m_leftBorderPen [protected] |
QPen KSpread::Style::m_topBorderPen [protected] |
QPen KSpread::Style::m_fallDiagonalPen [protected] |
QPen KSpread::Style::m_goUpDiagonalPen [protected] |
QBrush KSpread::Style::m_backGroundBrush [protected] |
double KSpread::Style::m_indent [protected] |
QString KSpread::Style::m_strFormat [protected] |
Format of the content, e.g.
#.##0.00, dd/mmm/yyyy,...
Definition at line 367 of file kspread_style.h.
int KSpread::Style::m_precision [protected] |
The precision of the floating point representation If precision is -1, this means that no precision is specified.
Definition at line 372 of file kspread_style.h.
QString KSpread::Style::m_prefix [protected] |
The prefix of a numeric value ( for example "$" ) May be empty.
Definition at line 377 of file kspread_style.h.
QString KSpread::Style::m_postfix [protected] |
The postfix of a numeric value ( for example "DM" ) May be empty.
Definition at line 382 of file kspread_style.h.
Format::Currency KSpread::Style::m_currency [protected] |
Currency information: about which currency from which country.
Definition at line 387 of file kspread_style.h.
uint KSpread::Style::m_properties [protected] |
Stores information like: DonPrint, DontShowFormula, Protected.
..
Definition at line 392 of file kspread_style.h.
The documentation for this class was generated from the following files: