filters

Swinder::Format Class Reference

#include <format.h>

List of all members.


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.


Public Types

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

Public Member Functions

 Format ()
 ~Format ()
 Format (const Format &f)
Formatoperator= (const Format &f)
Formatassign (const Format &f)
bool isNull () const
FormatFontfont () const
void setFont (const FormatFont &font)
FormatAlignmentalignment () const
void setAlignment (const FormatAlignment &alignment)
FormatBordersborders () const
void setBorders (const FormatBorders &border)
FormatBackgroundbackground () const
void setBackground (const FormatBackground &)
UString valueFormat () const
void setValueFormat (const UString &valueFormat)
Formatapply (const Format &f)
bool operator== (const Format &f) const
bool operator!= (const Format &f) const

Constructor & Destructor Documentation

Format::Format  ) 
 

Creates a default format.

Definition at line 582 of file format.cpp.

Format::~Format  ) 
 

Destroys the format.

Definition at line 589 of file format.cpp.

Format::Format const Format f  ) 
 

Creates a copy from another format.

Definition at line 595 of file format.cpp.


Member Function Documentation

FormatAlignment & Format::alignment  )  const
 

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

Definition at line 638 of file format.cpp.

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 679 of file format.cpp.

Format & Format::assign const Format f  ) 
 

Assigns from another value.

Definition at line 608 of file format.cpp.

FormatBackground & Format::background  )  const
 

Retursn a reference to the background information of this format.

Definition at line 658 of file format.cpp.

FormatBorders & Format::borders  )  const
 

Returns a reference to the borders information of this format.

Definition at line 648 of file format.cpp.

FormatFont & Format::font  )  const
 

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

Definition at line 628 of file format.cpp.

bool Format::isNull  )  const
 

Returns true if it is a default format information.

Definition at line 623 of file format.cpp.

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

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

Definition at line 705 of file format.cpp.

Format & Format::operator= const Format f  ) 
 

Assigns from another format.

Definition at line 602 of file format.cpp.

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

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

Definition at line 695 of file format.cpp.

void Format::setAlignment const FormatAlignment alignment  ) 
 

Sets new alignment information for this format.

Definition at line 643 of file format.cpp.

void Format::setBackground const FormatBackground  ) 
 

Sets new background information for this format.

Definition at line 663 of file format.cpp.

void Format::setBorders const FormatBorders border  ) 
 

Sets new borders information for this format.

Definition at line 653 of file format.cpp.

void Format::setFont const FormatFont font  ) 
 

Sets new font information for this format.

Definition at line 633 of file format.cpp.

void Format::setValueFormat const UString valueFormat  ) 
 

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

Definition at line 673 of file format.cpp.

UString Format::valueFormat  )  const
 

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

Definition at line 668 of file format.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys