Moodle  2.2.1
http://www.collinsharper.com
Format Class Reference

Public Member Functions

 Format ($index=0, $properties=array())
 get_xf ($style)
 get_font ()
 get_font_key ()
 get_xf_index ()
 _get_color ($name_color= '')
 set_align ($location)
 set_merge ()
 set_bold ($weight=1)
 set_bottom ($style)
 set_top ($style)
 set_left ($style)
 set_right ($style)
 set_border ($style)
 set_border_color ($color)
 set_bottom_color ($color)
 set_top_color ($color)
 set_left_color ($color)
 set_right_color ($color)
 set_fg_color ($color)
 set_bg_color ($color)
 set_color ($color)
 set_pattern ($arg=1)
 set_underline ($underline)
 set_italic ()
 set_size ($size)
 set_num_format ($num_format)
 set_text_wrap ($text_wrap=1)

Detailed Description

Definition at line 42 of file Format.php.


Member Function Documentation

_get_color ( 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.

Parameters:
string$name_colorname of the color (i.e.: 'blue', 'red', etc..). Optional.
Returns:
integer The color index

Definition at line 270 of file Format.php.

Here is the caller graph for this function:

Format ( index = 0,
properties = array() 
)

Constructor

public

Parameters:
integer$indexthe XF index for the format.
array$propertiesarray with properties to be set on initialization.

Definition at line 51 of file Format.php.

get_font ( )

Generate an Excel BIFF FONT record.

See also:
Workbook::_store_all_fonts()
Returns:
string The FONT record

Definition at line 196 of file Format.php.

Returns a unique hash key for a font. Used by Workbook->_store_all_fonts()

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

Returns:
string A key for this font

Definition at line 241 of file Format.php.

get_xf ( style)

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

Parameters:
string$styleThe type of the XF record ('style' or 'cell').
Returns:
string The XF record

Definition at line 112 of file Format.php.

Returns the index used by Worksheet->_XF()

Returns:
integer The index for the XF record

Definition at line 257 of file Format.php.

set_align ( location)

Set cell alignment.

public

Parameters:
string$locationalignment for the cell ('left', 'right', etc...).

Definition at line 328 of file Format.php.

Here is the caller graph for this function:

set_bg_color ( color)

Sets the cell's background color

public

Parameters:
mixed$coloreither a string (like 'blue'), or an integer (like 0x41).

Definition at line 552 of file Format.php.

Here is the call graph for this function:

set_bold ( weight = 1)

Bold has a range 0x64..0x3E8. 0x190 is normal. 0x2BC is bold.

public

Parameters:
integer$weightWeight for the text, 0 maps to 0x190, 1 maps to 0x2BC. It's Optional, default is 1 (bold).

Definition at line 384 of file Format.php.

set_border ( style)

Set cells borders to the same style

public

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

Definition at line 457 of file Format.php.

Here is the call graph for this function:

set_border_color ( color)

Sets all the cell's borders to the same color

public

Parameters:
mixed$colorThe color we are setting. Either a string (like 'blue'), or an integer (like 0x41).

Definition at line 477 of file Format.php.

Here is the call graph for this function:

set_bottom ( style)

Sets the bottom border of the cell

public

Parameters:
integer$stylestyle of the cell border. 1 => thin, 2 => thick.

Definition at line 412 of file Format.php.

Here is the caller graph for this function:

set_bottom_color ( color)

Sets the cell's bottom border color

public

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

Definition at line 491 of file Format.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_color ( color)

Sets the cell's color

public

Parameters:
mixed$coloreither a string (like 'blue'), or an integer (like 0x41).

Definition at line 564 of file Format.php.

Here is the call graph for this function:

set_fg_color ( color)

Sets the cell's foreground color

public

Parameters:
mixed$coloreither a string (like 'blue'), or an integer (like 0x41).

Definition at line 540 of file Format.php.

Here is the call graph for this function:

Sets the font style as italic

public

Definition at line 598 of file Format.php.

set_left ( style)

Sets the left border of the cell

public

Parameters:
integer$stylestyle of the cell left border. 1 => thin, 2 => thick.

Definition at line 434 of file Format.php.

Here is the caller graph for this function:

set_left_color ( color)

Sets the cell's left border color

public

Parameters:
mixed$coloreither a string (like 'blue'), or an integer (like 0x41).

Definition at line 515 of file Format.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_merge ( )

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

public

Definition at line 371 of file Format.php.

Here is the call graph for this function:

set_num_format ( num_format)

Sets the num format

public

Parameters:
integer$num_formatThe num format.

Definition at line 620 of file Format.php.

set_pattern ( arg = 1)

Sets the pattern attribute of a cell

public

Parameters:
integer$argOptional. Defaults to 1.

Definition at line 576 of file Format.php.

set_right ( style)

Sets the right border of the cell

public

Parameters:
integer$stylestyle of the cell right border. 1 => thin, 2 => thick.

Definition at line 445 of file Format.php.

Here is the caller graph for this function:

set_right_color ( color)

Sets the cell's right border color

public

Parameters:
mixed$coloreither a string (like 'blue'), or an integer (like 0x41).

Definition at line 527 of file Format.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_size ( size)

Sets the font size

public

Parameters:
integer$sizeThe font size (in pixels I think).

Definition at line 609 of file Format.php.

set_text_wrap ( text_wrap = 1)

Sets text wrapping

public

Parameters:
integer$text_wrapOptional. 0 => no text wrapping, 1 => text wrapping. Defaults to 1.

Definition at line 632 of file Format.php.

set_top ( style)

Sets the top border of the cell

public

Parameters:
integer$stylestyle of the cell top border. 1 => thin, 2 => thick.

Definition at line 423 of file Format.php.

Here is the caller graph for this function:

set_top_color ( color)

Sets the cell's top border color

public

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

Definition at line 503 of file Format.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_underline ( underline)

Sets the underline of the text

public

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

Definition at line 588 of file Format.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations