Spreadsheet_Excel_Writer
[ class tree: Spreadsheet_Excel_Writer ] [ index: Spreadsheet_Excel_Writer ] [ all elements ]

Class: Spreadsheet_Excel_Writer_Format

Source Location: /main/inc/lib/pear/Spreadsheet_Excel_Writer/Writer/Format.php

Class Overview

PEAR
   |
   --Spreadsheet_Excel_Writer_Format

Class for generating Excel XF records (formats)


Author(s):

Version:

  • Release: 1.4.11

Copyright:

  • 1997-2006 The PHP Group

Variables

Methods


Inherited Variables

Inherited Methods

Class: PEAR

PEAR::PEAR()
Constructor. Registers this object in $_PEAR_destructor_object_list for destructor emulation if a destructor object exists.
PEAR::delExpect()
This method deletes all occurences of the specified element from the expected error codes stack.
PEAR::expectError()
This method is used to tell which errors you expect to get.
PEAR::getStaticProperty()
If you have a class that's mostly/entirely static, and you need static
PEAR::isError()
Tell whether a value is a PEAR error.
PEAR::loadExtension()
OS independant PHP extension load. Remember to take care on the correct extension name for case sensitive OSes.
PEAR::popErrorHandling()
Pop the last error handler used
PEAR::popExpect()
This method pops one element off the expected error codes stack.
PEAR::pushErrorHandling()
Push a new error handler on top of the error handler options stack. With this you can easily override the actual error handler for some code and restore it later with popErrorHandling.
PEAR::raiseError()
This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. If the $mode and $options parameters are not specified, the object's defaults are used.
PEAR::registerShutdownFunc()
Use this function to register a shutdown method for static classes.
PEAR::setErrorHandling()
Sets how errors generated by this object should be handled.
PEAR::staticPopErrorHandling()
PEAR::staticPushErrorHandling()
PEAR::throwError()
Simpler form of raiseError with fewer options. In most cases message, code and userinfo are enough.
PEAR::_checkDelExpect()
This method checks unsets an error code if available
PEAR::_PEAR()
Destructor (the emulated type of...). Does nothing right now, but is included for forward compatibility, so subclass destructors should always call it.

Class Details

[line 45]
Class for generating Excel XF records (formats)



Tags:

author:  Xavier Noguer <xnoguer@rezebra.com>
version:  Release: 1.4.11
copyright:  1997-2006 The PHP Group


[ Top ]


Class Variables

$font_index =

[line 57]

Index to the FONT record.


Type:   integer


[ Top ]

$_bg_color =

[line 189]

The cell's background color.


Type:   integer


[ Top ]

$_bold =

[line 75]

Bold style


Type:   integer


[ Top ]

$_bottom =

[line 201]

Style of the bottom border of the cell


Type:   integer


[ Top ]

$_bottom_color =

[line 207]

Color of the bottom border of the cell.


Type:   integer


[ Top ]

$_color =

[line 87]

Index to the cell's color


Type:   integer


[ Top ]

$_fg_color =

[line 183]

The cell's foreground color.


Type:   integer


[ Top ]

$_font_charset =

[line 129]

Byte specifiying the font charset.


Type:   integer


[ Top ]

$_font_family =

[line 123]

Byte specifiying the font family.


Type:   integer


[ Top ]

$_font_name =

[line 63]

The font name (ASCII).


Type:   string


[ Top ]

$_font_outline =

[line 105]

Bit specifiying if the font has outline.


Type:   integer


[ Top ]

$_font_script =

[line 117]

2 bytes specifiying the script type for the font.


Type:   integer


[ Top ]

$_font_shadow =

[line 111]

Bit specifiying if the font has shadow.


Type:   integer


[ Top ]

$_font_strikeout =

[line 99]

Bit specifiying if the font has strikeout.


Type:   integer


[ Top ]

$_hidden =

[line 141]

Bit specifying if formulas are hidden.


Type:   integer


[ Top ]

$_italic =

[line 81]

Bit specifiying if the font is italic.


Type:   integer


[ Top ]

$_left =

[line 225]

Style of the left border of the cell


Type:   integer


[ Top ]

$_left_color =

[line 231]

Color of the left border of the cell.


Type:   integer


[ Top ]

$_locked =

[line 147]

Bit specifying if the cell is locked.


Type:   integer


[ Top ]

$_num_format =

[line 135]

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


Type:   integer


[ Top ]

$_pattern =

[line 195]

The cell's background fill pattern.


Type:   integer


[ Top ]

$_right =

[line 237]

Style of the right border of the cell


Type:   integer


[ Top ]

$_right_color =

[line 243]

Color of the right border of the cell.


Type:   integer


[ Top ]

$_rotation =

[line 177]

The two bits specifying the text rotation.


Type:   integer


[ Top ]

$_size =

[line 69]

Height of font (1/20 of a point)


Type:   integer


[ Top ]

$_text_h_align =

[line 153]

The three bits specifying the text horizontal alignment.


Type:   integer


[ Top ]

$_text_justlast =

[line 171]

1 bit, apparently not used.


Type:   integer


[ Top ]

$_text_v_align =

[line 165]

The three bits specifying the text vertical alignment.


Type:   integer


[ Top ]

$_text_wrap =

[line 159]

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


Type:   integer


[ Top ]

$_top =

[line 213]

Style of the top border of the cell


Type:   integer


[ Top ]

$_top_color =

[line 219]

Color of the top border of the cell.


Type:   integer


[ Top ]

$_underline =

[line 93]

The text underline property


Type:   integer


[ Top ]

$_xf_index =

[line 51]

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


Type:   integer


[ Top ]



Class Methods


constructor Spreadsheet_Excel_Writer_Format [line 252]

Spreadsheet_Excel_Writer_Format Spreadsheet_Excel_Writer_Format( $BIFF_version, [integer $index = 0], [array $properties = array()])

Constructor



Tags:

access:  private


Parameters:

integer   $index   the XF index for the format.
array   $properties   array with properties to be set on initialization.
   $BIFF_version  

[ Top ]

method getFont [line 447]

string getFont( )

Generate an Excel BIFF FONT record.



Tags:

return:  The FONT record


[ Top ]

method getFontKey [line 503]

string getFontKey( )

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




Tags:

return:  A key for this font


[ Top ]

method getXf [line 315]

string getXf( string $style)

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



Tags:

return:  The XF record


Parameters:

string   $style   The type of the XF record ('style' or 'cell').

[ Top ]

method getXfIndex [line 519]

integer getXfIndex( )

Returns the index used by Spreadsheet_Excel_Writer_Worksheet::_XF()



Tags:

return:  The index for the XF record


[ Top ]

method setAlign [line 591]

void setAlign( string $location)

Set cell alignment.



Tags:

access:  public


Parameters:

string   $location   alignment for the cell ('left', 'right', etc...).

[ Top ]

method setBgColor [line 908]

void setBgColor( mixed $color)

Sets the cell's background color



Tags:

access:  public


Parameters:

mixed   $color   either a string (like 'blue'), or an integer (range is [8...63]).

[ Top ]

method setBold [line 737]

void setBold( [integer $weight = 1])

Sets the boldness of the text.

Bold has a range 100..1000.

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




Tags:

access:  public


Parameters:

integer   $weight   Weight for the text, 0 maps to 400 (normal text),

[ Top ]

method setBorder [line 810]

void setBorder( integer $style)

Set cells borders to the same style



Tags:

access:  public


Parameters:

integer   $style   style to apply for all cell borders. 1 => thin, 2 => thick.

[ Top ]

method setBorderColor [line 830]

void setBorderColor( mixed $color)

Sets all the cell's borders to the same color



Tags:

access:  public


Parameters:

mixed   $color   The color we are setting. Either a string (like 'blue'), or an integer (range is [8...63]).

[ Top ]

method setBottom [line 765]

void setBottom( integer $style)

Sets the width for the bottom border of the cell



Tags:

access:  public


Parameters:

integer   $style   style of the cell border. 1 => thin, 2 => thick.

[ Top ]

method setBottomColor [line 844]

void setBottomColor( mixed $color)

Sets the cell's bottom border color



Tags:

access:  public


Parameters:

mixed   $color   either a string (like 'blue'), or an integer (range is [8...63]).

[ Top ]

method setColor [line 923]

void setColor( mixed $color)

Sets the cell's color



Tags:

access:  public


Parameters:

mixed   $color   either a string (like 'blue'), or an integer (range is [8...63]).

[ Top ]

method setFgColor [line 893]

void setFgColor( mixed $color)

Sets the cell's foreground color



Tags:

access:  public


Parameters:

mixed   $color   either a string (like 'blue'), or an integer (range is [8...63]).

[ Top ]

method setFontFamily [line 1097]

void setFontFamily( $font_family, string $fontfamily)

Sets the font family name.



Tags:

access:  public


Parameters:

string   $fontfamily   The font family name. Possible values are: 'Times New Roman', 'Arial', 'Courier'.
   $font_family  

[ Top ]

method setHAlign [line 649]

void setHAlign( string $location)

Set cell horizontal alignment.



Tags:

access:  public


Parameters:

string   $location   alignment for the cell ('left', 'right', etc...).

[ Top ]

method setItalic [line 958]

void setItalic( )

Sets the font style as italic



Tags:

access:  public


[ Top ]

method setLeft [line 787]

void setLeft( integer $style)

Sets the width for the left border of the cell



Tags:

access:  public


Parameters:

integer   $style   style of the cell left border. 1 => thin, 2 => thick.

[ Top ]

method setLeftColor [line 868]

void setLeftColor( mixed $color)

Sets the cell's left border color



Tags:

access:  public


Parameters:

mixed   $color   either a string (like 'blue'), or an integer (range is [8...63]).

[ Top ]

method setLocked [line 1075]

void setLocked( )

Locks a cell.



Tags:

access:  public


[ Top ]

method setMerge [line 722]

void setMerge( )

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



Tags:

access:  public


[ Top ]

method setNumFormat [line 1023]

void setNumFormat( integer $num_format)

Sets the numeric format.

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




Tags:

access:  public


Parameters:

integer   $num_format   The numeric format.

[ Top ]

method setOutLine [line 1043]

void setOutLine( )

Sets outlining for a font.



Tags:

access:  public


[ Top ]

method setPattern [line 936]

void setPattern( [integer $arg = 1])

Sets the fill pattern attribute of a cell



Tags:

access:  public


Parameters:

integer   $arg   Optional. Defaults to 1. Meaningful values are: 0-18,
  1. meaning no background.

[ Top ]

method setRight [line 798]

void setRight( integer $style)

Sets the width for the right border of the cell



Tags:

access:  public


Parameters:

integer   $style   style of the cell right border. 1 => thin, 2 => thick.

[ Top ]

method setRightColor [line 880]

void setRightColor( mixed $color)

Sets the cell's right border color



Tags:

access:  public


Parameters:

mixed   $color   either a string (like 'blue'), or an integer (range is [8...63]).

[ Top ]

method setScript [line 1065]

void setScript( integer $script)

Sets the script type of the text



Tags:

access:  public


Parameters:

integer   $script   The value for script type. Possible values are:
  1. => superscript, 2 => subscript.

[ Top ]

method setShadow [line 1053]

void setShadow( )

Sets font as shadow.



Tags:

access:  public


[ Top ]

method setSize [line 969]

void setSize( integer $size)

Sets the font size



Tags:

access:  public


Parameters:

integer   $size   The font size (in pixels I think).

[ Top ]

method setStrikeOut [line 1033]

void setStrikeOut( )

Sets font as strikeout.



Tags:

access:  public


[ Top ]

method setTextRotation [line 991]

void setTextRotation( integer $angle)

Sets the orientation of the text



Tags:

access:  public


Parameters:

integer   $angle   The rotation angle for the text (clockwise). Possible

[ Top ]

method setTextWrap [line 979]

void setTextWrap( )

Sets text wrapping



Tags:

access:  public


[ Top ]

method setTop [line 776]

void setTop( integer $style)

Sets the width for the top border of the cell



Tags:

access:  public


Parameters:

integer   $style   style of the cell top border. 1 => thin, 2 => thick.

[ Top ]

method setTopColor [line 856]

void setTopColor( mixed $color)

Sets the cell's top border color



Tags:

access:  public


Parameters:

mixed   $color   either a string (like 'blue'), or an integer (range is [8...63]).

[ Top ]

method setUnderline [line 948]

void setUnderline( integer $underline)

Sets the underline of the text



Tags:

access:  public


Parameters:

integer   $underline   The value for underline. Possible values are:
  1. => underline, 2 => double underline.

[ Top ]

method setUnLocked [line 1085]

void setUnLocked( )

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



Tags:

access:  public


[ Top ]

method setVAlign [line 689]

void setVAlign( string $location)

Set cell vertical alignment.



Tags:

access:  public


Parameters:

string   $location   alignment for the cell ('top', 'vleft', 'vright', etc...).

[ Top ]

method _getColor [line 533]

integer _getColor( [string $name_color = ''])

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.



Tags:

return:  The color index
access:  private


Parameters:

string   $name_color   name of the color (i.e.: 'blue', 'red', etc..). Optional.

[ Top ]


Documentation generated on Thu, 12 Jun 2008 13:30:22 -0500 by phpDocumentor 1.4.1