filters

Swinder::Format Class Reference

#include <format.h>

Public Types

enum  { Left , Center , Right }
enum  { Top , Middle , Bottom }

Public Member Functions

 Format ()
 ~Format ()
 Format (const Format &f)
Format & operator= (const Format &f)
Format & assign (const Format &f)
bool isNull () const
FormatFont & font () const
void setFont (const FormatFont &font)
FormatAlignment & alignment () const
void setAlignment (const FormatAlignment &alignment)
FormatBorders & borders () const
void setBorders (const FormatBorders &border)
FormatBackground & background () const
void setBackground (const FormatBackground &)
const UString & valueFormat () const
void setValueFormat (const UString &valueFormat)
Format & apply (const Format &f)
bool operator== (const Format &f) const
bool operator!= (const Format &f) const

Detailed Description

Defines format of cell.

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, 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 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". Use Format::apply to do such format merging.

Definition at line 641 of file kspread/excel/sidewinder/format.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 725 of file kspread/excel/sidewinder/format.h.

◆ anonymous enum

anonymous enum

Definition at line 727 of file kspread/excel/sidewinder/format.h.

Constructor & Destructor Documentation

◆ Format() [1/2]

Format::Format ( )

Creates a default format.

Definition at line 591 of file kspread/excel/sidewinder/format.cpp.

◆ ~Format()

Format::~Format ( )

Destroys the format.

Definition at line 598 of file kspread/excel/sidewinder/format.cpp.

◆ Format() [2/2]

Format::Format ( const Format & f)

Creates a copy from another format.

Definition at line 604 of file kspread/excel/sidewinder/format.cpp.

Member Function Documentation

◆ alignment()

FormatAlignment & Format::alignment ( ) const

Returns a constant reference to the alignment information of this format.

Definition at line 642 of file kspread/excel/sidewinder/format.cpp.

◆ apply()

Format & Format::apply ( const Format & f)

Applies another format to this format.

Basically this will merge the formatting information of f into the current format. For example, if current format is "Bold, Italic" and f is "Left border", the current format would become "Bold, Italic, left border".

If parts of the formatting information in f are already specified in the current format, then it will override the current format. For example, if current format is "Bold, right-aligned" and f is "Italic", the result is "Italic, right-aligned".

Definition at line 683 of file kspread/excel/sidewinder/format.cpp.

◆ assign()

Format & Format::assign ( const Format & f)

Assigns from another value.

Definition at line 617 of file kspread/excel/sidewinder/format.cpp.

◆ background()

FormatBackground & Format::background ( ) const

Returns a reference to the background information of this format.

Definition at line 662 of file kspread/excel/sidewinder/format.cpp.

◆ borders()

FormatBorders & Format::borders ( ) const

Returns a reference to the borders information of this format.

Definition at line 652 of file kspread/excel/sidewinder/format.cpp.

◆ font()

FormatFont & Format::font ( ) const

Returns a constant reference to the formatting information of this format.

Definition at line 632 of file kspread/excel/sidewinder/format.cpp.

◆ isNull()

bool Format::isNull ( ) const

Returns true if it is a default format information.

Definition at line 627 of file kspread/excel/sidewinder/format.cpp.

◆ operator!=()

bool Format::operator!= ( const Format & f) const

Returns true if this format is not equal to f; otherwise returns false.

Definition at line 709 of file kspread/excel/sidewinder/format.cpp.

◆ operator=()

Format & Format::operator= ( const Format & f)

Assigns from another format.

Definition at line 611 of file kspread/excel/sidewinder/format.cpp.

◆ operator==()

bool Format::operator== ( const Format & f) const

Returns true if this format is equal to f; otherwise returns false.

Definition at line 699 of file kspread/excel/sidewinder/format.cpp.

◆ setAlignment()

void Format::setAlignment ( const FormatAlignment & alignment)

Sets new alignment information for this format.

Definition at line 647 of file kspread/excel/sidewinder/format.cpp.

◆ setBackground()

void Format::setBackground ( const FormatBackground & background)

Sets new background information for this format.

Definition at line 667 of file kspread/excel/sidewinder/format.cpp.

◆ setBorders()

void Format::setBorders ( const FormatBorders & border)

Sets new borders information for this format.

Definition at line 657 of file kspread/excel/sidewinder/format.cpp.

◆ setFont()

void Format::setFont ( const FormatFont & font)

Sets new font information for this format.

Definition at line 637 of file kspread/excel/sidewinder/format.cpp.

◆ setValueFormat()

void Format::setValueFormat ( const UString & valueFormat)

Sets the new formatting string to display the value of this format.

Definition at line 677 of file kspread/excel/sidewinder/format.cpp.

◆ valueFormat()

const UString & Format::valueFormat ( ) const

Returns the formatting string to display the value of this format.

Definition at line 672 of file kspread/excel/sidewinder/format.cpp.


The documentation for this class was generated from the following files: