Class Spreadsheet_Excel_Writer_Format

Description

Class for generating Excel XF records (formats)

Located in /libraries/pear/Spreadsheet/Excel/Writer/Format.php (line 45)

PEAR
   |
   --Spreadsheet_Excel_Writer_Format
Variable Summary
 integer $font_index
 integer $_bg_color
 integer $_bold
 integer $_bottom
 integer $_bottom_color
 integer $_color
 integer $_fg_color
 integer $_font_charset
 integer $_font_family
 string $_font_name
 integer $_font_outline
 integer $_font_script
 integer $_font_shadow
 integer $_hidden
 integer $_italic
 integer $_left
 integer $_left_color
 integer $_locked
 integer $_num_format
 integer $_pattern
 integer $_right
 integer $_right_color
 integer $_rotation
 integer $_size
 integer $_text_h_align
 integer $_text_justlast
 integer $_text_v_align
 integer $_text_wrap
 integer $_top
 integer $_top_color
 integer $_underline
 integer $_xf_index
Method Summary
 Spreadsheet_Excel_Writer_Format Spreadsheet_Excel_Writer_Format (mixed $BIFF_version, integer $index, [array $properties = array()])
 string getFont ()
 string getFontKey ()
 string getXf (string $style)
 integer getXfIndex ()
 void setAlign (string $location)
 void setBgColor (mixed $color)
 void setBold ([integer $weight = 1])
 void setBorder (integer $style)
 void setBorderColor (mixed $color)
 void setBottom (integer $style)
 void setBottomColor (mixed $color)
 void setColor (mixed $color)
 void setFgColor (mixed $color)
 void setFontFamily (mixed $font_family, string $fontfamily)
 void setItalic ()
 void setLeft (integer $style)
 void setLeftColor (mixed $color)
 void setLocked ()
 void setMerge ()
 void setNumFormat (integer $num_format)
 void setOutLine ()
 void setPattern ([integer $arg = 1])
 void setRight (integer $style)
 void setRightColor (mixed $color)
 void setScript (integer $script)
 void setShadow ()
 void setSize (integer $size)
 void setStrikeOut ()
 void setTextRotation (integer $angle)
 void setTextWrap ()
 void setTop (integer $style)
 void setTopColor (mixed $color)
 void setUnderline (integer $underline)
 void setUnLocked ()
 integer _getColor ([string $name_color = ''])
Variables
integer $font_index (line 57)

Index to the FONT record.

integer $_bg_color (line 189)

The cell's background color.

integer $_bold (line 75)

Bold style

integer $_bottom (line 201)

Style of the bottom border of the cell

integer $_bottom_color (line 207)

Color of the bottom border of the cell.

integer $_color (line 87)

Index to the cell's color

integer $_fg_color (line 183)

The cell's foreground color.

integer $_font_charset (line 129)

Byte specifiying the font charset.

integer $_font_family (line 123)

Byte specifiying the font family.

string $_font_name (line 63)

The font name (ASCII).

integer $_font_outline (line 105)

Bit specifiying if the font has outline.

integer $_font_script (line 117)

2 bytes specifiying the script type for the font.

integer $_font_shadow (line 111)

Bit specifiying if the font has shadow.

integer $_font_strikeout (line 99)

Bit specifiying if the font has strikeout.

integer $_hidden (line 141)

Bit specifying if formulas are hidden.

integer $_italic (line 81)

Bit specifiying if the font is italic.

integer $_left (line 225)

Style of the left border of the cell

integer $_left_color (line 231)

Color of the left border of the cell.

integer $_locked (line 147)

Bit specifying if the cell is locked.

integer $_num_format (line 135)

An index (2 bytes) to a FORMAT record (number format).

integer $_pattern (line 195)

The cell's background fill pattern.

integer $_right (line 237)

Style of the right border of the cell

integer $_right_color (line 243)

Color of the right border of the cell.

integer $_rotation (line 177)

The two bits specifying the text rotation.

integer $_size (line 69)

Height of font (1/20 of a point)

integer $_text_h_align (line 153)

The three bits specifying the text horizontal alignment.

integer $_text_justlast (line 171)

1 bit, apparently not used.

integer $_text_v_align (line 165)

The three bits specifying the text vertical alignment.

integer $_text_wrap (line 159)

Bit specifying if the text is wrapped at the right border.

integer $_top (line 213)

Style of the top border of the cell

integer $_top_color (line 219)

Color of the top border of the cell.

integer $_underline (line 93)

The text underline property

integer $_xf_index (line 51)

The index given by the workbook when creating a new format.

Methods
Constructor Spreadsheet_Excel_Writer_Format (line 252)

Constructor

  • access: private
Spreadsheet_Excel_Writer_Format Spreadsheet_Excel_Writer_Format (mixed $BIFF_version, integer $index, [array $properties = array()])
  • integer $index: the XF index for the format.
  • array $properties: array with properties to be set on initialization.
getFont (line 452)

Generate an Excel BIFF FONT record.

  • return: The FONT record
string getFont ()
getFontKey (line 510)

Returns a unique hash key for a font.

Used by Spreadsheet_Excel_Writer_Workbook::_storeAllFonts()

The elements that form the key are arranged to increase the probability of generating a unique key. Elements that hold a large range of numbers (eg. _color) are placed between two binary elements such as _italic

  • return: A key for this font
string getFontKey ()
getXf (line 316)

Generate an Excel BIFF XF record (style or cell).

  • return: The XF record
string getXf (string $style)
  • string $style: The type of the XF record ('style' or 'cell').
getXfIndex (line 526)

Returns the index used by Spreadsheet_Excel_Writer_Worksheet::_XF()

  • return: The index for the XF record
integer getXfIndex ()
setAlign (line 598)

Set cell alignment.

  • access: public
void setAlign (string $location)
  • string $location: alignment for the cell ('left', 'right', etc...).
setBgColor (line 841)

Sets the cell's background color

  • access: public
void setBgColor (mixed $color)
  • mixed $color: either a string (like 'blue'), or an integer (range is [8...63]).
setBold (line 670)

Sets the boldness of the text.

Bold has a range 100..1000.

  1. (400) is normal. 1 (700) is bold.

  • access: public
void setBold ([integer $weight = 1])
  • integer $weight: Weight for the text, 0 maps to 400 (normal text),
setBorder (line 743)

Set cells borders to the same style

  • access: public
void setBorder (integer $style)
  • integer $style: style to apply for all cell borders. 1 => thin, 2 => thick.
setBorderColor (line 763)

Sets all the cell's borders to the same color

  • access: public
void setBorderColor (mixed $color)
  • mixed $color: The color we are setting. Either a string (like 'blue'), or an integer (range is [8...63]).
setBottom (line 698)

Sets the width for the bottom border of the cell

  • access: public
void setBottom (integer $style)
  • integer $style: style of the cell border. 1 => thin, 2 => thick.
setBottomColor (line 777)

Sets the cell's bottom border color

  • access: public
void setBottomColor (mixed $color)
  • mixed $color: either a string (like 'blue'), or an integer (range is [8...63]).
setColor (line 856)

Sets the cell's color

  • access: public
void setColor (mixed $color)
  • mixed $color: either a string (like 'blue'), or an integer (range is [8...63]).
setFgColor (line 826)

Sets the cell's foreground color

  • access: public
void setFgColor (mixed $color)
  • mixed $color: either a string (like 'blue'), or an integer (range is [8...63]).
setFontFamily (line 1030)

Sets the font family name.

  • access: public
void setFontFamily (mixed $font_family, string $fontfamily)
  • string $fontfamily: The font family name. Possible values are: 'Times New Roman', 'Arial', 'Courier'.
setItalic (line 891)

Sets the font style as italic

  • access: public
void setItalic ()
setLeft (line 720)

Sets the width for the left border of the cell

  • access: public
void setLeft (integer $style)
  • integer $style: style of the cell left border. 1 => thin, 2 => thick.
setLeftColor (line 801)

Sets the cell's left border color

  • access: public
void setLeftColor (mixed $color)
  • mixed $color: either a string (like 'blue'), or an integer (range is [8...63]).
setLocked (line 1008)

Locks a cell.

  • access: public
void setLocked ()
setMerge (line 655)

This is an alias for the unintuitive setAlign('merge')

  • access: public
void setMerge ()
setNumFormat (line 956)

Sets the numeric format.

It can be date, time, currency, etc...

  • access: public
void setNumFormat (integer $num_format)
  • integer $num_format: The numeric format.
setOutLine (line 976)

Sets outlining for a font.

  • access: public
void setOutLine ()
setPattern (line 869)

Sets the fill pattern attribute of a cell

  • access: public
void setPattern ([integer $arg = 1])
  • integer $arg: Optional. Defaults to 1. Meaningful values are: 0-18,
    1. meaning no background.
setRight (line 731)

Sets the width for the right border of the cell

  • access: public
void setRight (integer $style)
  • integer $style: style of the cell right border. 1 => thin, 2 => thick.
setRightColor (line 813)

Sets the cell's right border color

  • access: public
void setRightColor (mixed $color)
  • mixed $color: either a string (like 'blue'), or an integer (range is [8...63]).
setScript (line 998)

Sets the script type of the text

  • access: public
void setScript (integer $script)
  • integer $script: The value for script type. Possible values are:
    1. => superscript, 2 => subscript.
setShadow (line 986)

Sets font as shadow.

  • access: public
void setShadow ()
setSize (line 902)

Sets the font size

  • access: public
void setSize (integer $size)
  • integer $size: The font size (in pixels I think).
setStrikeOut (line 966)

Sets font as strikeout.

  • access: public
void setStrikeOut ()
setTextRotation (line 924)

Sets the orientation of the text

  • access: public
void setTextRotation (integer $angle)
  • integer $angle: The rotation angle for the text (clockwise). Possible
setTextWrap (line 912)

Sets text wrapping

  • access: public
void setTextWrap ()
setTop (line 709)

Sets the width for the top border of the cell

  • access: public
void setTop (integer $style)
  • integer $style: style of the cell top border. 1 => thin, 2 => thick.
setTopColor (line 789)

Sets the cell's top border color

  • access: public
void setTopColor (mixed $color)
  • mixed $color: either a string (like 'blue'), or an integer (range is [8...63]).
setUnderline (line 881)

Sets the underline of the text

  • access: public
void setUnderline (integer $underline)
  • integer $underline: The value for underline. Possible values are:
    1. => underline, 2 => double underline.
setUnLocked (line 1018)

Unlocks a cell. Useful for unprotecting particular cells of a protected sheet.

  • access: public
void setUnLocked ()
_getColor (line 540)

Used in conjunction with the set_xxx_color methods to convert a color string into a number. Color range is 0..63 but we will restrict it to 8..63 to comply with Gnumeric. Colors 0..7 are repeated in 8..15.

  • return: The color index
  • access: private
integer _getColor ([string $name_color = ''])
  • string $name_color: name of the color (i.e.: 'blue', 'red', etc..). Optional.

Documentation generated on Fri, 11 Feb 2005 18:13:14 +0000 by phpDocumentor 1.3.0RC3