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