|
|
@ -1,4 +1,4 @@
|
|
|
|
/* Sidewinder - Portable library for spreadsheet
|
|
|
|
/* Sidewinder - Portable library for spreadsheet
|
|
|
|
Copyright (C) 2003-2006 Ariya Hidayat <ariya@kde.org>
|
|
|
|
Copyright (C) 2003-2006 Ariya Hidayat <ariya@kde.org>
|
|
|
|
Copyright (C) 2006 Marijn Kruisselbrink <m.kruisselbrink@student.tue.nl>
|
|
|
|
Copyright (C) 2006 Marijn Kruisselbrink <m.kruisselbrink@student.tue.nl>
|
|
|
|
|
|
|
|
|
|
|
@ -6,7 +6,7 @@
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
@ -30,33 +30,33 @@ namespace Swinder
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @short Provides color based on RGB values.
|
|
|
|
* @short Provides color based on RGB values.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Class Color provides color based on terms of RGB (red, green and blue)
|
|
|
|
* Class Color provides color based on terms of RGB (red, green and blue)
|
|
|
|
* components.
|
|
|
|
* components.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
class Color
|
|
|
|
class Color
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
unsigned red, green, blue;
|
|
|
|
unsigned red, green, blue;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Constructs a default color with the RGB value (0, 0, 0), i.e black.
|
|
|
|
* Constructs a default color with the RGB value (0, 0, 0), i.e black.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Color(){ red = green = blue = 0; };
|
|
|
|
Color(){ red = green = blue = 0; };
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Creates a copy of another color.
|
|
|
|
* Creates a copy of another color.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Color( const Color& c )
|
|
|
|
Color( const Color& c )
|
|
|
|
{ red = c.red; green = c.green; blue = c.blue; }
|
|
|
|
{ red = c.red; green = c.green; blue = c.blue; }
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Creates a color based on given red, green and blue values.
|
|
|
|
* Creates a color based on given red, green and blue values.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Color( unsigned r, unsigned g, unsigned b )
|
|
|
|
Color( unsigned r, unsigned g, unsigned b )
|
|
|
|
{ red = r; green = g; blue = b; }
|
|
|
|
{ red = r; green = g; blue = b; }
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Creates a color based on given red, green and blue values, encoded as #RRGGBB in a string.
|
|
|
|
* Creates a color based on given red, green and blue values, encoded as #RRGGBB in a string.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -84,11 +84,11 @@ class Pen
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
unsigned style;
|
|
|
|
unsigned style;
|
|
|
|
|
|
|
|
|
|
|
|
unsigned width;
|
|
|
|
unsigned width;
|
|
|
|
|
|
|
|
|
|
|
|
Color color;
|
|
|
|
Color color;
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
enum {
|
|
|
|
NoLine, // no line at all
|
|
|
|
NoLine, // no line at all
|
|
|
|
SolidLine, // a simple solid line
|
|
|
|
SolidLine, // a simple solid line
|
|
|
@ -97,7 +97,7 @@ public:
|
|
|
|
DashDotLine, // alternate dots and dashes
|
|
|
|
DashDotLine, // alternate dots and dashes
|
|
|
|
DashDotDotLine // one dash, two dots, one dash, two dots
|
|
|
|
DashDotDotLine // one dash, two dots, one dash, two dots
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Pen(): style( SolidLine ), width( 0 ){}
|
|
|
|
Pen(): style( SolidLine ), width( 0 ){}
|
|
|
|
|
|
|
|
|
|
|
|
friend inline bool operator==(const Pen&, const Pen&);
|
|
|
|
friend inline bool operator==(const Pen&, const Pen&);
|
|
|
@ -122,7 +122,7 @@ inline bool operator!=(const Pen& p1, const Pen& p2)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Class FormatFont defines the font family, size and other attributes
|
|
|
|
* Class FormatFont defines the font family, size and other attributes
|
|
|
|
* for use in cell format.
|
|
|
|
* for use in cell format.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
class FormatFont
|
|
|
|
class FormatFont
|
|
|
@ -133,67 +133,67 @@ public:
|
|
|
|
* Creates a default font information.
|
|
|
|
* Creates a default font information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatFont();
|
|
|
|
FormatFont();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Destroys the font information
|
|
|
|
* Destroys the font information
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
~FormatFont();
|
|
|
|
~FormatFont();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Creates a copy of font information.
|
|
|
|
* Creates a copy of font information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatFont( const FormatFont& );
|
|
|
|
FormatFont( const FormatFont& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Assigns from another font information.
|
|
|
|
* Assigns from another font information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatFont& operator=( const FormatFont& );
|
|
|
|
FormatFont& operator=( const FormatFont& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Assigns from another font information.
|
|
|
|
* Assigns from another font information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatFont& assign( const FormatFont& );
|
|
|
|
FormatFont& assign( const FormatFont& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if it is a default font information.
|
|
|
|
* Returns true if it is a default font information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool isNull() const;
|
|
|
|
bool isNull() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the name of font family, e.g "Helvetica".
|
|
|
|
* Returns the name of font family, e.g "Helvetica".
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const UString& fontFamily() const;
|
|
|
|
const UString& fontFamily() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets a new family for the font information.
|
|
|
|
* Sets a new family for the font information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setFontFamily( const UString& fontFamily );
|
|
|
|
void setFontFamily( const UString& fontFamily );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the size of font (in points).
|
|
|
|
* Returns the size of font (in points).
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
double fontSize() const;
|
|
|
|
double fontSize() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets the size of font (in points).
|
|
|
|
* Sets the size of font (in points).
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setFontSize( double fs );
|
|
|
|
void setFontSize( double fs );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the color of the font.
|
|
|
|
* Returns the color of the font.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Color color() const;
|
|
|
|
Color color() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets the color of the font.
|
|
|
|
* Sets the color of the font.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setColor( const Color& color );
|
|
|
|
void setColor( const Color& color );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if bold has been set.
|
|
|
|
* Returns true if bold has been set.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool bold() const;
|
|
|
|
bool bold() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* If b is true, bold is set on; otherwise bold is set off.
|
|
|
|
* If b is true, bold is set on; otherwise bold is set off.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -203,52 +203,52 @@ public:
|
|
|
|
* Returns true if italic has been set.
|
|
|
|
* Returns true if italic has been set.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool italic() const;
|
|
|
|
bool italic() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* If i is true, italic is set on; otherwise italic is set off.
|
|
|
|
* If i is true, italic is set on; otherwise italic is set off.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setItalic( bool i );
|
|
|
|
void setItalic( bool i );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if underline has been set.
|
|
|
|
* Returns true if underline has been set.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool underline() const;
|
|
|
|
bool underline() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* If u is true, underline is set on; otherwise underline is set off.
|
|
|
|
* If u is true, underline is set on; otherwise underline is set off.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setUnderline( bool u );
|
|
|
|
void setUnderline( bool u );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if strikeout has been set.
|
|
|
|
* Returns true if strikeout has been set.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool strikeout() const;
|
|
|
|
bool strikeout() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* If s is true, strikeout is set on; otherwise strikeout is set off.
|
|
|
|
* If s is true, strikeout is set on; otherwise strikeout is set off.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setStrikeout( bool s );
|
|
|
|
void setStrikeout( bool s );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if subscript has been set.
|
|
|
|
* Returns true if subscript has been set.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool subscript() const;
|
|
|
|
bool subscript() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* If s is true, subscript is set on; otherwise subscript is set off.
|
|
|
|
* If s is true, subscript is set on; otherwise subscript is set off.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setSubscript( bool s );
|
|
|
|
void setSubscript( bool s );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if superscript has been set.
|
|
|
|
* Returns true if superscript has been set.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool superscript() const;
|
|
|
|
bool superscript() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* If s is true, superscript is set on; otherwise superscript is set off.
|
|
|
|
* If s is true, superscript is set on; otherwise superscript is set off.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setSuperscript( bool s );
|
|
|
|
void setSuperscript( bool s );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if this font is equal to f; otherwise returns false.
|
|
|
|
* Returns true if this font is equal to f; otherwise returns false.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -259,7 +259,7 @@ public:
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool operator!=(const FormatFont& f) const;
|
|
|
|
bool operator!=(const FormatFont& f) const;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
class Private;
|
|
|
|
class Private;
|
|
|
|
Private *d;
|
|
|
|
Private *d;
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -270,7 +270,7 @@ private:
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Class FormatAlignment defines the horizontal and vertical alignment
|
|
|
|
* Class FormatAlignment defines the horizontal and vertical alignment
|
|
|
|
* for the text inside a cell.
|
|
|
|
* for the text inside a cell.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
class FormatAlignment
|
|
|
|
class FormatAlignment
|
|
|
@ -281,32 +281,32 @@ public:
|
|
|
|
* Creates a default alignment information.
|
|
|
|
* Creates a default alignment information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatAlignment();
|
|
|
|
FormatAlignment();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Destroys the alignment information
|
|
|
|
* Destroys the alignment information
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
~FormatAlignment();
|
|
|
|
~FormatAlignment();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Creates a copy of alignment information.
|
|
|
|
* Creates a copy of alignment information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatAlignment( const FormatAlignment& );
|
|
|
|
FormatAlignment( const FormatAlignment& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Assigns from another alignment information.
|
|
|
|
* Assigns from another alignment information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatAlignment& operator=( const FormatAlignment& );
|
|
|
|
FormatAlignment& operator=( const FormatAlignment& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Assigns from another alignment information.
|
|
|
|
* Assigns from another alignment information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatAlignment& assign( const FormatAlignment& );
|
|
|
|
FormatAlignment& assign( const FormatAlignment& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if it is a default alignment information.
|
|
|
|
* Returns true if it is a default alignment information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool isNull() const;
|
|
|
|
bool isNull() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns horizontal alignment. Possible values are
|
|
|
|
* Returns horizontal alignment. Possible values are
|
|
|
|
* Format::Left, Format::Right and Format::Center.
|
|
|
|
* Format::Left, Format::Right and Format::Center.
|
|
|
@ -314,71 +314,71 @@ public:
|
|
|
|
* \sa setAlignX
|
|
|
|
* \sa setAlignX
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
unsigned alignX() const;
|
|
|
|
unsigned alignX() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets the horizontal alignment.
|
|
|
|
* Sets the horizontal alignment.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa alignX
|
|
|
|
* \sa alignX
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setAlignX( unsigned xa );
|
|
|
|
void setAlignX( unsigned xa );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns horizontal alignment. Possible values are
|
|
|
|
* Returns horizontal alignment. Possible values are
|
|
|
|
* Format::Top, Format::Middle and Format::Bottom.
|
|
|
|
* Format::Top, Format::Middle and Format::Bottom.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setAlignY
|
|
|
|
* \sa setAlignY
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
unsigned alignY() const;
|
|
|
|
unsigned alignY() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets the horizontal alignment.
|
|
|
|
* Sets the horizontal alignment.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa alignY
|
|
|
|
* \sa alignY
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setAlignY( unsigned xa );
|
|
|
|
void setAlignY( unsigned xa );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if the text should be wrapped at right border.
|
|
|
|
* Returns true if the text should be wrapped at right border.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setWrap
|
|
|
|
* \sa setWrap
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool wrap() const;
|
|
|
|
bool wrap() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets whether the text should be wrapped at right border.
|
|
|
|
* Sets whether the text should be wrapped at right border.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setWrap
|
|
|
|
* \sa setWrap
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setWrap( bool w );
|
|
|
|
void setWrap( bool w );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the indentation level.
|
|
|
|
* Returns the indentation level.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setIndentLevel
|
|
|
|
* \sa setIndentLevel
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
unsigned indentLevel() const;
|
|
|
|
unsigned indentLevel() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets the indentation level.
|
|
|
|
* Sets the indentation level.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa indentLevel
|
|
|
|
* \sa indentLevel
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setIndentLevel( unsigned i );
|
|
|
|
void setIndentLevel( unsigned i );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the text rotation angle.
|
|
|
|
* Returns the text rotation angle.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setRotationAngle
|
|
|
|
* \sa setRotationAngle
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
unsigned rotationAngle() const;
|
|
|
|
unsigned rotationAngle() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets the text rotation angle.
|
|
|
|
* Sets the text rotation angle.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa rotationAngle
|
|
|
|
* \sa rotationAngle
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setRotationAngle( unsigned r );
|
|
|
|
void setRotationAngle( unsigned r );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if this alignment is equal to f; otherwise returns false.
|
|
|
|
* Returns true if this alignment is equal to f; otherwise returns false.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -389,14 +389,14 @@ public:
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool operator!=(const FormatAlignment& f) const;
|
|
|
|
bool operator!=(const FormatAlignment& f) const;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
class Private;
|
|
|
|
class Private;
|
|
|
|
Private *d;
|
|
|
|
Private *d;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Defines background information for cell.
|
|
|
|
* Defines background information for cell.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
class FormatBackground
|
|
|
|
class FormatBackground
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -405,32 +405,32 @@ public:
|
|
|
|
* Creates a default background information.
|
|
|
|
* Creates a default background information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatBackground();
|
|
|
|
FormatBackground();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Destroys the background information.
|
|
|
|
* Destroys the background information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
~FormatBackground();
|
|
|
|
~FormatBackground();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Creates a copy of background information.
|
|
|
|
* Creates a copy of background information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatBackground( const FormatBackground& );
|
|
|
|
FormatBackground( const FormatBackground& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Assigns from another background information.
|
|
|
|
* Assigns from another background information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatBackground& operator=( const FormatBackground& );
|
|
|
|
FormatBackground& operator=( const FormatBackground& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Assigns from another background information.
|
|
|
|
* Assigns from another background information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatBackground& assign( const FormatBackground& );
|
|
|
|
FormatBackground& assign( const FormatBackground& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if it is a default background information.
|
|
|
|
* Returns true if it is a default background information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool isNull() const;
|
|
|
|
bool isNull() const;
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
enum {
|
|
|
|
SolidPattern,
|
|
|
|
SolidPattern,
|
|
|
|
Dense1Pattern,
|
|
|
|
Dense1Pattern,
|
|
|
@ -441,49 +441,49 @@ public:
|
|
|
|
Dense6Pattern,
|
|
|
|
Dense6Pattern,
|
|
|
|
Dense7Pattern,
|
|
|
|
Dense7Pattern,
|
|
|
|
HorPattern, // Horizonatal lines
|
|
|
|
HorPattern, // Horizonatal lines
|
|
|
|
VerPattern, //Qt::Vertical lines
|
|
|
|
VerPattern, // Vertical lines
|
|
|
|
CrossPattern, //Qt::Horizontal andQt::Vertical lines
|
|
|
|
CrossPattern, // Horizontal and vertical lines
|
|
|
|
BDiagPattern, // Left-bottom to right-top diagonal lines
|
|
|
|
BDiagPattern, // Left-bottom to right-top diagonal lines
|
|
|
|
FDiagPattern, // Left-top to right-bottom diagonal lines
|
|
|
|
FDiagPattern, // Left-top to right-bottom diagonal lines
|
|
|
|
DiagCrossPattern, // Crossing diagonal lines
|
|
|
|
DiagCrossPattern, // Crossing diagonal lines
|
|
|
|
EmptyPattern
|
|
|
|
EmptyPattern
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns pattern for this background.
|
|
|
|
* Returns pattern for this background.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setPattern
|
|
|
|
* \sa setPattern
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
unsigned pattern() const;
|
|
|
|
unsigned pattern() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Set the pattern for this background.
|
|
|
|
* Set the pattern for this background.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa pattern
|
|
|
|
* \sa pattern
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setPattern( unsigned );
|
|
|
|
void setPattern( unsigned );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the background color of the background area.
|
|
|
|
* Returns the background color of the background area.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setBackgroundColor
|
|
|
|
* \sa setBackgroundColor
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Color backgroundColor() const;
|
|
|
|
Color backgroundColor() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Set the background color.
|
|
|
|
* Set the background color.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa backgroundColor
|
|
|
|
* \sa backgroundColor
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setBackgroundColor( const Color& );
|
|
|
|
void setBackgroundColor( const Color& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the foreground color of the background area.
|
|
|
|
* Returns the foreground color of the background area.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setForegroundColor
|
|
|
|
* \sa setForegroundColor
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Color foregroundColor() const;
|
|
|
|
Color foregroundColor() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets the foreground color.
|
|
|
|
* Sets the foreground color.
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -500,7 +500,7 @@ public:
|
|
|
|
* Returns true if this background is not equal to f; otherwise returns false.
|
|
|
|
* Returns true if this background is not equal to f; otherwise returns false.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool operator!=(const FormatBackground& f) const;
|
|
|
|
bool operator!=(const FormatBackground& f) const;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
class Private;
|
|
|
|
class Private;
|
|
|
|
Private *d;
|
|
|
|
Private *d;
|
|
|
@ -508,7 +508,7 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Defines borders information for cell.
|
|
|
|
* Defines borders information for cell.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
class FormatBorders
|
|
|
|
class FormatBorders
|
|
|
@ -519,81 +519,81 @@ public:
|
|
|
|
* Creates a default border information.
|
|
|
|
* Creates a default border information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatBorders();
|
|
|
|
FormatBorders();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Destroys the border information
|
|
|
|
* Destroys the border information
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
~FormatBorders();
|
|
|
|
~FormatBorders();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Creates a copy of border information.
|
|
|
|
* Creates a copy of border information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatBorders( const FormatBorders& );
|
|
|
|
FormatBorders( const FormatBorders& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Assigns from another border information.
|
|
|
|
* Assigns from another border information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatBorders& operator=( const FormatBorders& );
|
|
|
|
FormatBorders& operator=( const FormatBorders& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Assigns from another border information.
|
|
|
|
* Assigns from another border information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatBorders& assign( const FormatBorders& );
|
|
|
|
FormatBorders& assign( const FormatBorders& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if it is a default border information.
|
|
|
|
* Returns true if it is a default border information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool isNull() const;
|
|
|
|
bool isNull() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns pen style, width and color for left border.
|
|
|
|
* Returns pen style, width and color for left border.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setLeftBorder
|
|
|
|
* \sa setLeftBorder
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const Pen& leftBorder() const;
|
|
|
|
const Pen& leftBorder() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets pen style, width and color for left border.
|
|
|
|
* Sets pen style, width and color for left border.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa leftBorder
|
|
|
|
* \sa leftBorder
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setLeftBorder( const Pen& pen );
|
|
|
|
void setLeftBorder( const Pen& pen );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns pen style, width and color for right border.
|
|
|
|
* Returns pen style, width and color for right border.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setRightBorder
|
|
|
|
* \sa setRightBorder
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const Pen& rightBorder() const;
|
|
|
|
const Pen& rightBorder() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets pen style, width and color for right border.
|
|
|
|
* Sets pen style, width and color for right border.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa rightBorder
|
|
|
|
* \sa rightBorder
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setRightBorder( const Pen& pen );
|
|
|
|
void setRightBorder( const Pen& pen );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns pen style, width and color for top border.
|
|
|
|
* Returns pen style, width and color for top border.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setTopBorder
|
|
|
|
* \sa setTopBorder
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const Pen& topBorder() const;
|
|
|
|
const Pen& topBorder() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets pen style, width and color for top border.
|
|
|
|
* Sets pen style, width and color for top border.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa topBorder
|
|
|
|
* \sa topBorder
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setTopBorder( const Pen& pen );
|
|
|
|
void setTopBorder( const Pen& pen );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns pen style, width and color for bottom border.
|
|
|
|
* Returns pen style, width and color for bottom border.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* \sa setBottomBorder
|
|
|
|
* \sa setBottomBorder
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const Pen& bottomBorder() const;
|
|
|
|
const Pen& bottomBorder() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets pen style, width and color for bottom border.
|
|
|
|
* Sets pen style, width and color for bottom border.
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -610,11 +610,11 @@ public:
|
|
|
|
* Returns true if this background is not equal to f; otherwise returns false.
|
|
|
|
* Returns true if this background is not equal to f; otherwise returns false.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool operator!=(const FormatBorders& f) const;
|
|
|
|
bool operator!=(const FormatBorders& f) const;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
class Private;
|
|
|
|
class Private;
|
|
|
|
Private *d;
|
|
|
|
Private *d;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Defines format of cell.
|
|
|
|
* Defines format of cell.
|
|
|
@ -622,21 +622,21 @@ private:
|
|
|
|
* Class Format defines possible formatting for use in cells or ranges.
|
|
|
|
* Class Format defines possible formatting for use in cells or ranges.
|
|
|
|
* Basically, Format might consist of one or more "pieces". Each piece
|
|
|
|
* Basically, Format might consist of one or more "pieces". Each piece
|
|
|
|
* specifies only one type of formatting, e.g whether the text should
|
|
|
|
* specifies only one type of formatting, e.g whether the text should
|
|
|
|
* be shown in bold or not, which borders should the cells/ranges have,
|
|
|
|
* be shown in bold or not, which borders should the cells/ranges have,
|
|
|
|
* and so on.
|
|
|
|
* and so on.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* A complex formatting can be decomposed into different pieces. For example,
|
|
|
|
* A complex formatting can be decomposed into different pieces. For example,
|
|
|
|
* formatting like "Font is Arial 10 pt, background color is blue,
|
|
|
|
* formatting like "Font is Arial 10 pt, background color is blue,
|
|
|
|
" formula is hidden" could be a combination of three simple formatting pieces
|
|
|
|
" formula is hidden" could be a combination of three simple formatting pieces
|
|
|
|
* as: (1) font is "Arial 10pt", (2) background pattern is 100%, blue
|
|
|
|
* as: (1) font is "Arial 10pt", (2) background pattern is 100%, blue
|
|
|
|
* and (3) cell is protected, formula is hidden. This also means
|
|
|
|
* and (3) cell is protected, formula is hidden. This also means
|
|
|
|
* that one format might be applied to another format. An example of this is
|
|
|
|
* that one format might be applied to another format. An example of this is
|
|
|
|
* "Font is Helvetica" format and "Left border, 1pt, blue" format will yields
|
|
|
|
* "Font is Helvetica" format and "Left border, 1pt, blue" format will yields
|
|
|
|
* something like "Font is Helvetica, with left border of blue 1pt".
|
|
|
|
* something like "Font is Helvetica, with left border of blue 1pt".
|
|
|
|
* Use Format::apply to do such format merging.
|
|
|
|
* Use Format::apply to do such format merging.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Format
|
|
|
|
class Format
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -646,86 +646,86 @@ public:
|
|
|
|
* Creates a default format.
|
|
|
|
* Creates a default format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Format();
|
|
|
|
Format();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Destroys the format.
|
|
|
|
* Destroys the format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
~Format();
|
|
|
|
~Format();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Creates a copy from another format.
|
|
|
|
* Creates a copy from another format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Format( const Format& f );
|
|
|
|
Format( const Format& f );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Assigns from another format.
|
|
|
|
* Assigns from another format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Format& operator= ( const Format& f );
|
|
|
|
Format& operator= ( const Format& f );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Assigns from another value.
|
|
|
|
* Assigns from another value.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Format& assign( const Format& f );
|
|
|
|
Format& assign( const Format& f );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns true if it is a default format information.
|
|
|
|
* Returns true if it is a default format information.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool isNull() const;
|
|
|
|
bool isNull() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns a constant reference to the formatting information of this format.
|
|
|
|
* Returns a constant reference to the formatting information of this format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatFont& font() const;
|
|
|
|
FormatFont& font() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets new font information for this format.
|
|
|
|
* Sets new font information for this format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setFont( const FormatFont& font );
|
|
|
|
void setFont( const FormatFont& font );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns a constant reference to the alignment information of this format.
|
|
|
|
* Returns a constant reference to the alignment information of this format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatAlignment& alignment() const;
|
|
|
|
FormatAlignment& alignment() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets new alignment information for this format.
|
|
|
|
* Sets new alignment information for this format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setAlignment( const FormatAlignment& alignment );
|
|
|
|
void setAlignment( const FormatAlignment& alignment );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns a reference to the borders information of this format.
|
|
|
|
* Returns a reference to the borders information of this format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatBorders& borders() const;
|
|
|
|
FormatBorders& borders() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets new borders information for this format.
|
|
|
|
* Sets new borders information for this format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setBorders( const FormatBorders& border );
|
|
|
|
void setBorders( const FormatBorders& border );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns a reference to the background information of this format.
|
|
|
|
* Returns a reference to the background information of this format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
FormatBackground& background() const;
|
|
|
|
FormatBackground& background() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets new background information for this format.
|
|
|
|
* Sets new background information for this format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setBackground( const FormatBackground& );
|
|
|
|
void setBackground( const FormatBackground& );
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Returns the formatting string to display the value of this format.
|
|
|
|
* Returns the formatting string to display the value of this format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const UString& valueFormat() const;
|
|
|
|
const UString& valueFormat() const;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Sets the new formatting string to display the value of this format.
|
|
|
|
* Sets the new formatting string to display the value of this format.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void setValueFormat( const UString& valueFormat );
|
|
|
|
void setValueFormat( const UString& valueFormat );
|
|
|
|
|
|
|
|
|
|
|
|
enum { Left, Center, Right };
|
|
|
|
enum { Left, Center, Right };
|
|
|
|
|
|
|
|
|
|
|
|
enum { Top, Middle, Bottom };
|
|
|
|
enum { Top, Middle, Bottom };
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Applies another format to this format. Basically this will merge
|
|
|
|
* Applies another format to this format. Basically this will merge
|
|
|
|
* the formatting information of f into the current format.
|
|
|
|
* the formatting information of f into the current format.
|
|
|
|