Public Member Functions | Data Fields

Spreadsheet_Excel_Writer_Format Class Reference

Inheritance diagram for Spreadsheet_Excel_Writer_Format:
Collaboration diagram for Spreadsheet_Excel_Writer_Format:

Public Member Functions

 Spreadsheet_Excel_Writer_Format ($BIFF_version, $index=0, $properties=array())
 Constructor.
 getXf ($style)
 Generate an Excel BIFF XF record (style or cell).
 getFont ()
 Generate an Excel BIFF FONT record.
 getFontKey ()
 Returns a unique hash key for a font.
 getXfIndex ()
 Returns the index used by Spreadsheet_Excel_Writer_Worksheet::_XF().
 _getColor ($name_color= '')
 Used in conjunction with the set_xxx_color methods to convert a color string into a number.
 setAlign ($location)
 Set cell alignment.
 setMerge ()
 This is an alias for the unintuitive setAlign('merge').
 setBold ($weight=1)
 Sets the boldness of the text.
 setBottom ($style)
 Sets the width for the bottom border of the cell.
 setTop ($style)
 Sets the width for the top border of the cell.
 setLeft ($style)
 Sets the width for the left border of the cell.
 setRight ($style)
 Sets the width for the right border of the cell.
 setBorder ($style)
 Set cells borders to the same style.
 setBorderColor ($color)
 Sets all the cell's borders to the same color.
 setBottomColor ($color)
 Sets the cell's bottom border color.
 setTopColor ($color)
 Sets the cell's top border color.
 setLeftColor ($color)
 Sets the cell's left border color.
 setRightColor ($color)
 Sets the cell's right border color.
 setFgColor ($color)
 Sets the cell's foreground color.
 setBgColor ($color)
 Sets the cell's background color.
 setColor ($color)
 Sets the cell's color.
 setPattern ($arg=1)
 Sets the fill pattern attribute of a cell.
 setUnderline ($underline)
 Sets the underline of the text.
 setItalic ()
 Sets the font style as italic.
 setSize ($size)
 Sets the font size.
 setTextWrap ()
 Sets text wrapping.
 setTextRotation ($angle)
 Sets the orientation of the text.
 setNumFormat ($num_format)
 Sets the numeric format.
 setStrikeOut ()
 Sets font as strikeout.
 setOutLine ()
 Sets outlining for a font.
 setShadow ()
 Sets font as shadow.
 setScript ($script)
 Sets the script type of the text.
 setLocked ()
 Locks a cell.
 setUnLocked ()
 Unlocks a cell.
 setFontFamily ($font_family)
 Sets the font family name.

Data Fields

 $_xf_index
 $font_index
 $_font_name
 $_size
 $_bold
 $_italic
 $_color
 $_underline
 $_font_strikeout
 $_font_outline
 $_font_shadow
 $_font_script
 $_font_family
 $_font_charset
 $_num_format
 $_hidden
 $_locked
 $_text_h_align
 $_text_wrap
 $_text_v_align
 $_text_justlast
 $_rotation
 $_fg_color
 $_bg_color
 $_pattern
 $_bottom
 $_bottom_color
 $_top
 $_top_color
 $_left
 $_left_color
 $_right
 $_right_color

Detailed Description

Definition at line 45 of file Format.php.


Member Function Documentation

Spreadsheet_Excel_Writer_Format::_getColor ( 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.

private

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

Definition at line 540 of file Format.php.

Referenced by setBgColor(), setBottomColor(), setColor(), setFgColor(), setLeftColor(), setRightColor(), and setTopColor().

    {
        $colors = array(
                        'aqua'    => 0x0F,
                        'cyan'    => 0x0F,
                        'black'   => 0x08,
                        'blue'    => 0x0C,
                        'brown'   => 0x10,
                        'magenta' => 0x0E,
                        'fuchsia' => 0x0E,
                        'gray'    => 0x17,
                        'grey'    => 0x17,
                        'green'   => 0x11,
                        'lime'    => 0x0B,
                        'navy'    => 0x12,
                        'orange'  => 0x35,
                        'purple'  => 0x14,
                        'red'     => 0x0A,
                        'silver'  => 0x16,
                        'white'   => 0x09,
                        'yellow'  => 0x0D
                       );
    
        // Return the default color, 0x7FFF, if undef,
        if($name_color == '') {
            return(0x7FFF);
        }
    
        // or the color string converted to an integer,
        if(isset($colors[$name_color])) {
            return($colors[$name_color]);
        }
    
        // or the default color if string is unrecognised,
        if(preg_match("/\D/",$name_color)) {
            return(0x7FFF);
        }
    
        // or an index < 8 mapped into the correct range,
        if($name_color < 8) {
            return($name_color + 8);
        }
    
        // or the default color if arg is outside range,
        if($name_color > 63) {
            return(0x7FFF);
        }
    
        // or an integer in the valid range
        return($name_color);
    }

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Format::getFont (  ) 

Generate an Excel BIFF FONT record.

Returns:
string The FONT record

Definition at line 452 of file Format.php.

References $data.

    {
        $dyHeight   = $this->_size * 20;    // Height of font (1/20 of a point)
        $icv        = $this->_color;        // Index to color palette
        $bls        = $this->_bold;         // Bold style
        $sss        = $this->_font_script;  // Superscript/subscript
        $uls        = $this->_underline;    // Underline
        $bFamily    = $this->_font_family;  // Font family
        $bCharSet   = $this->_font_charset; // Character set
        $encoding   = 0;                    // TODO: Unicode support
    
        $cch        = strlen($this->_font_name); // Length of font name
        $record     = 0x31;                      // Record identifier
        if ($this->_BIFF_version == 0x0500) {
            $length     = 0x0F + $cch;            // Record length
        }
        elseif ($this->_BIFF_version == 0x0600) {
            $length     = 0x10 + $cch;
        }
        $reserved   = 0x00;                // Reserved
        $grbit      = 0x00;                // Font attributes
        if ($this->_italic) {
            $grbit     |= 0x02;
        }
        if ($this->_font_strikeout) {
            $grbit     |= 0x08;
        }
        if ($this->_font_outline) {
            $grbit     |= 0x10;
        }
        if ($this->_font_shadow) {
            $grbit     |= 0x20;
        }
    
        $header  = pack("vv",         $record, $length);
        if ($this->_BIFF_version == 0x0500) {
            $data    = pack("vvvvvCCCCC", $dyHeight, $grbit, $icv, $bls,
                                          $sss, $uls, $bFamily,
                                          $bCharSet, $reserved, $cch);
        }
        elseif ($this->_BIFF_version == 0x0600) {
            $data    = pack("vvvvvCCCCCC", $dyHeight, $grbit, $icv, $bls,
                                           $sss, $uls, $bFamily,
                                           $bCharSet, $reserved, $cch, $encoding);
        }
        return($header . $data. $this->_font_name);
    }

Spreadsheet_Excel_Writer_Format::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

Returns:
string A key for this font

Definition at line 510 of file Format.php.

References $key.

    {
        $key  = "$this->_font_name$this->_size";
        $key .= "$this->_font_script$this->_underline";
        $key .= "$this->_font_strikeout$this->_bold$this->_font_outline";
        $key .= "$this->_font_family$this->_font_charset";
        $key .= "$this->_font_shadow$this->_color$this->_italic";
        $key  = str_replace(" ","_",$key);
        return ($key);
    }

Spreadsheet_Excel_Writer_Format::getXf ( style  ) 

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

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

Definition at line 316 of file Format.php.

References $data.

    {
        // Set the type of the XF record and some of the attributes.
        if ($style == "style") {
            $style = 0xFFF5;
        }
        else {
            $style   = $this->_locked;
            $style  |= $this->_hidden << 1;
        }
    
        // Flags to indicate if attributes have been set.
        $atr_num     = ($this->_num_format != 0)?1:0;
        $atr_fnt     = ($this->font_index != 0)?1:0;
        $atr_alc     = ($this->_text_wrap)?1:0;
        $atr_bdr     = ($this->_bottom   ||
                        $this->_top      ||
                        $this->_left     ||
                        $this->_right)?1:0;
        $atr_pat     = (($this->_fg_color != 0x40) ||
                        ($this->_bg_color != 0x41) ||
                        $this->_pattern)?1:0;
        $atr_prot    = $this->_locked | $this->_hidden;
    
        // Zero the default border colour if the border has not been set.
        if ($this->_bottom == 0) {
            $this->_bottom_color = 0;
        }
        if ($this->_top  == 0) {
            $this->_top_color = 0;
        }
        if ($this->_right == 0) {
            $this->_right_color = 0;
        }
        if ($this->_left == 0) {
            $this->_left_color = 0;
        }
        if ($this->_diag == 0) {
            $this->_diag_color = 0;
        }
    
        $record         = 0x00E0;              // Record identifier
        if ($this->_BIFF_version == 0x0500) {
            $length         = 0x0010;              // Number of bytes to follow
        }
        if ($this->_BIFF_version == 0x0600) {
            $length         = 0x0014;
        }
                                               
        $ifnt           = $this->font_index;   // Index to FONT record
        $ifmt           = $this->_num_format;  // Index to FORMAT record
        if ($this->_BIFF_version == 0x0500)
        {
            $align          = $this->_text_h_align;       // Alignment
            $align         |= $this->_text_wrap     << 3;
            $align         |= $this->_text_v_align  << 4;
            $align         |= $this->_text_justlast << 7;
            $align         |= $this->_rotation      << 8;
            $align         |= $atr_num                << 10;
            $align         |= $atr_fnt                << 11;
            $align         |= $atr_alc                << 12;
            $align         |= $atr_bdr                << 13;
            $align         |= $atr_pat                << 14;
            $align         |= $atr_prot               << 15;
 
            $icv            = $this->_fg_color;       // fg and bg pattern colors
            $icv           |= $this->_bg_color      << 7;
     
            $fill           = $this->_pattern;        // Fill and border line style
            $fill          |= $this->_bottom        << 6;
            $fill          |= $this->_bottom_color  << 9;
     
            $border1        = $this->_top;            // Border line style and color
            $border1       |= $this->_left          << 3;
            $border1       |= $this->_right         << 6;
            $border1       |= $this->_top_color     << 9;
     
            $border2        = $this->_left_color;     // Border color
            $border2       |= $this->_right_color   << 7;
         
            $header      = pack("vv",       $record, $length);
            $data        = pack("vvvvvvvv", $ifnt, $ifmt, $style, $align,
                                            $icv, $fill,
                                            $border1, $border2);
        }
        elseif ($this->_BIFF_version == 0x0600)
        {
            $align          = $this->_text_h_align;       // Alignment
            $align         |= $this->_text_wrap     << 3;
            $align         |= $this->_text_v_align  << 4;
            $align         |= $this->_text_justlast << 7;

            $used_attrib    = $atr_num              << 2;
            $used_attrib   |= $atr_fnt              << 3;
            $used_attrib   |= $atr_alc              << 4;
            $used_attrib   |= $atr_bdr              << 5;
            $used_attrib   |= $atr_pat              << 6;
            $used_attrib   |= $atr_prot             << 7;

            $icv            = $this->_fg_color;      // fg and bg pattern colors
            $icv           |= $this->_bg_color      << 7;
   
            $border1        = $this->_left;          // Border line style and color
            $border1       |= $this->_right         << 4;
            $border1       |= $this->_top           << 8;
            $border1       |= $this->_bottom        << 12;
            $border1       |= $this->_left_color    << 16;
            $border1       |= $this->_right_color   << 23;
            $diag_tl_to_rb = 0; // FIXME: add method
            $diag_tr_to_lb = 0; // FIXME: add method
            $border1       |= $diag_tl_to_rb        << 30;
            $border1       |= $diag_tr_to_lb        << 31;
     
            $border2        = $this->_top_color;    // Border color
            $border2       |= $this->_bottom_color   << 7;
            $border2       |= $this->_diag_color     << 14;
            $border2       |= $this->_diag           << 21;
            $border2       |= $this->_pattern        << 26;

            $header      = pack("vv",       $record, $length);

            $rotation      = 0x00;
            $biff8_options = 0x00;
            $data  = pack("vvvC", $ifnt, $ifmt, $style, $align);
            $data .= pack("CCC", $rotation, $biff8_options, $used_attrib);
            $data .= pack("VVv", $border1, $border2, $icv);
        }

        return($header.$data);
    }

Spreadsheet_Excel_Writer_Format::getXfIndex (  ) 

Returns the index used by Spreadsheet_Excel_Writer_Worksheet::_XF().

Returns:
integer The index for the XF record

Definition at line 526 of file Format.php.

    {
        return($this->_xf_index);
    }

Spreadsheet_Excel_Writer_Format::setAlign ( location  ) 

Set cell alignment.

public

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

Definition at line 598 of file Format.php.

Referenced by setMerge().

    {
        if (preg_match("/\d/",$location)) {
            return;                      // Ignore numbers
        }
    
        $location = strtolower($location);
    
        if ($location == 'left') {
            $this->_text_h_align = 1;
        }
        if ($location == 'centre') {
            $this->_text_h_align = 2;
        }
        if ($location == 'center') {
            $this->_text_h_align = 2;
        }
        if ($location == 'right') {
            $this->_text_h_align = 3;
        }
        if ($location == 'fill') {
            $this->_text_h_align = 4;
        }
        if ($location == 'justify') {
            $this->_text_h_align = 5;
        }
        if ($location == 'merge') {
            $this->_text_h_align = 6;
        }
        if ($location == 'equal_space') { // For T.K.
            $this->_text_h_align = 7;
        }
        if ($location == 'top') {
            $this->_text_v_align = 0;
        }
        if ($location == 'vcentre') {
            $this->_text_v_align = 1;
        }
        if ($location == 'vcenter') {
            $this->_text_v_align = 1;
        }
        if ($location == 'bottom') {
            $this->_text_v_align = 2;
        }
        if ($location == 'vjustify') {
            $this->_text_v_align = 3;
        }
        if ($location == 'vequal_space') { // For T.K.
            $this->_text_v_align = 4;
        }
    }

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Format::setBgColor ( color  ) 

Sets the cell's background color.

public

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

Definition at line 841 of file Format.php.

References _getColor().

    {
        $value = $this->_getColor($color);
        $this->_bg_color = $value;
        if ($this->_pattern == 0) { // force color to be seen
            $this->_pattern = 1;
        }
    }

Here is the call graph for this function:

Spreadsheet_Excel_Writer_Format::setBold ( weight = 1  ) 

Sets the boldness of the text.

Bold has a range 100..1000. 0 (400) is normal. 1 (700) is bold.

public

Parameters:
integer $weight Weight for the text, 0 maps to 400 (normal text), 1 maps to 700 (bold text). Valid range is: 100-1000. It's Optional, default is 1 (bold).

Definition at line 670 of file Format.php.

    {
        if($weight == 1) {
            $weight = 0x2BC;  // Bold text
        }
        if($weight == 0) {
            $weight = 0x190;  // Normal text
        }
        if($weight <  0x064) {
            $weight = 0x190;  // Lower bound
        }
        if($weight >  0x3E8) {
            $weight = 0x190;  // Upper bound
        }
        $this->_bold = $weight;
    }

Spreadsheet_Excel_Writer_Format::setBorder ( style  ) 

Set cells borders to the same style.

public

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

Definition at line 743 of file Format.php.

References setBottom(), setLeft(), setRight(), and setTop().

    {
        $this->setBottom($style);
        $this->setTop($style);
        $this->setLeft($style);
        $this->setRight($style);
    }

Here is the call graph for this function:

Spreadsheet_Excel_Writer_Format::setBorderColor ( color  ) 

Sets all the cell's borders to the same color.

public

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

Definition at line 763 of file Format.php.

References setBottomColor(), setLeftColor(), setRightColor(), and setTopColor().

    {
        $this->setBottomColor($color);
        $this->setTopColor($color);
        $this->setLeftColor($color);
        $this->setRightColor($color);
    }

Here is the call graph for this function:

Spreadsheet_Excel_Writer_Format::setBottom ( style  ) 

Sets the width for the bottom border of the cell.

public

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

Definition at line 698 of file Format.php.

Referenced by setBorder().

    {
        $this->_bottom = $style;
    }

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Format::setBottomColor ( color  ) 

Sets the cell's bottom border color.

public

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

Definition at line 777 of file Format.php.

References _getColor().

Referenced by setBorderColor().

    {
        $value = $this->_getColor($color);
        $this->_bottom_color = $value;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Format::setColor ( color  ) 

Sets the cell's color.

public

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

Definition at line 856 of file Format.php.

References _getColor().

    {
        $value = $this->_getColor($color);
        $this->_color = $value;
    }

Here is the call graph for this function:

Spreadsheet_Excel_Writer_Format::setFgColor ( color  ) 

Sets the cell's foreground color.

public

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

Definition at line 826 of file Format.php.

References _getColor().

    {
        $value = $this->_getColor($color);
        $this->_fg_color = $value;
        if ($this->_pattern == 0) { // force color to be seen
            $this->_pattern = 1;
        }
    }

Here is the call graph for this function:

Spreadsheet_Excel_Writer_Format::setFontFamily ( font_family  ) 

Sets the font family name.

public

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

Definition at line 1030 of file Format.php.

    {
        $this->_font_name = $font_family;
    }

Spreadsheet_Excel_Writer_Format::setItalic (  ) 

Sets the font style as italic.

public

Definition at line 891 of file Format.php.

    {
        $this->_italic = 1;
    }

Spreadsheet_Excel_Writer_Format::setLeft ( style  ) 

Sets the width for the left border of the cell.

public

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

Definition at line 720 of file Format.php.

Referenced by setBorder().

    {
        $this->_left = $style;
    }

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Format::setLeftColor ( color  ) 

Sets the cell's left border color.

public

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

Definition at line 801 of file Format.php.

References _getColor().

Referenced by setBorderColor().

    {
        $value = $this->_getColor($color);
        $this->_left_color = $value;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Format::setLocked (  ) 

Locks a cell.

public

Definition at line 1008 of file Format.php.

     {
         $this->_locked = 1;
     }

Spreadsheet_Excel_Writer_Format::setMerge (  ) 

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

public

Definition at line 655 of file Format.php.

References setAlign().

    {
        $this->setAlign('merge');
    }

Here is the call graph for this function:

Spreadsheet_Excel_Writer_Format::setNumFormat ( num_format  ) 

Sets the numeric format.

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

public

Parameters:
integer $num_format The numeric format.

Definition at line 956 of file Format.php.

    {
        $this->_num_format = $num_format;
    }

Spreadsheet_Excel_Writer_Format::setOutLine (  ) 

Sets outlining for a font.

public

Definition at line 976 of file Format.php.

    {
        $this->_font_outline = 1;
    }

Spreadsheet_Excel_Writer_Format::setPattern ( arg = 1  ) 

Sets the fill pattern attribute of a cell.

public

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

Definition at line 869 of file Format.php.

    {
        $this->_pattern = $arg;
    }

Spreadsheet_Excel_Writer_Format::setRight ( style  ) 

Sets the width for the right border of the cell.

public

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

Definition at line 731 of file Format.php.

Referenced by setBorder().

    {
        $this->_right = $style;
    }

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Format::setRightColor ( color  ) 

Sets the cell's right border color.

public

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

Definition at line 813 of file Format.php.

References _getColor().

Referenced by setBorderColor().

    {
        $value = $this->_getColor($color);
        $this->_right_color = $value;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Format::setScript ( script  ) 

Sets the script type of the text.

public

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

Definition at line 998 of file Format.php.

    {
        $this->_font_script = $script;
    }

Spreadsheet_Excel_Writer_Format::setShadow (  ) 

Sets font as shadow.

public

Definition at line 986 of file Format.php.

    {
        $this->_font_shadow = 1;
    }

Spreadsheet_Excel_Writer_Format::setSize ( size  ) 

Sets the font size.

public

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

Definition at line 902 of file Format.php.

    {
        $this->_size = $size;
    }

Spreadsheet_Excel_Writer_Format::setStrikeOut (  ) 

Sets font as strikeout.

public

Definition at line 966 of file Format.php.

    {
        $this->_font_strikeout = 1;
    }

Spreadsheet_Excel_Writer_Format::setTextRotation ( angle  ) 

Sets the orientation of the text.

public

Parameters:
integer $angle The rotation angle for the text (clockwise). Possible values are: 0, 90, 270 and -1 for stacking top-to-bottom.

Definition at line 924 of file Format.php.

    {
        switch ($angle)
        {
            case 0:
                $this->_rotation = 0;
                break;
            case 90:
                $this->_rotation = 3;
                break;
            case 270:
                $this->_rotation = 2;
                break;
            case -1:
                $this->_rotation = 1;
                break;
            default :
                return $this->raiseError("Invalid value for angle.".
                                  " Possible values are: 0, 90, 270 and -1 ".
                                  "for stacking top-to-bottom.");
                $this->_rotation = 0;
                break;
        }
    }

Spreadsheet_Excel_Writer_Format::setTextWrap (  ) 

Sets text wrapping.

public

Definition at line 912 of file Format.php.

    {
        $this->_text_wrap = 1;
    }

Spreadsheet_Excel_Writer_Format::setTop ( style  ) 

Sets the width for the top border of the cell.

public

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

Definition at line 709 of file Format.php.

Referenced by setBorder().

    {
        $this->_top = $style;
    }

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Format::setTopColor ( color  ) 

Sets the cell's top border color.

public

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

Definition at line 789 of file Format.php.

References _getColor().

Referenced by setBorderColor().

    {
        $value = $this->_getColor($color);
        $this->_top_color = $value;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Format::setUnderline ( underline  ) 

Sets the underline of the text.

public

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

Definition at line 881 of file Format.php.

    {
        $this->_underline = $underline;
    }

Spreadsheet_Excel_Writer_Format::setUnLocked (  ) 

Unlocks a cell.

Useful for unprotecting particular cells of a protected sheet.

public

Definition at line 1018 of file Format.php.

    {
        $this->_locked = 0;
    }

Spreadsheet_Excel_Writer_Format::Spreadsheet_Excel_Writer_Format ( BIFF_version,
index = 0,
properties = array() 
)

Constructor.

private

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

Definition at line 252 of file Format.php.

    {
        $this->_xf_index       = $index;
        $this->_BIFF_version   = $BIFF_version;
        $this->font_index      = 0;
        $this->_font_name      = 'Arial';
        $this->_size           = 10;
        $this->_bold           = 0x0190;
        $this->_italic         = 0;
        $this->_color          = 0x7FFF;
        $this->_underline      = 0;
        $this->_font_strikeout = 0;
        $this->_font_outline   = 0;
        $this->_font_shadow    = 0;
        $this->_font_script    = 0;
        $this->_font_family    = 0;
        $this->_font_charset   = 0;
                               
        $this->_num_format     = 0;
                               
        $this->_hidden         = 0;
        $this->_locked         = 0;

        $this->_text_h_align   = 0;
        $this->_text_wrap      = 0;
        $this->_text_v_align   = 2;
        $this->_text_justlast  = 0;
        $this->_rotation       = 0;

        $this->_fg_color       = 0x40;
        $this->_bg_color       = 0x41;

        $this->_pattern        = 0;
                               
        $this->_bottom         = 0;
        $this->_top            = 0;
        $this->_left           = 0;
        $this->_right          = 0;
        $this->_diag           = 0;
                               
        $this->_bottom_color   = 0x40;
        $this->_top_color      = 0x40;
        $this->_left_color     = 0x40;
        $this->_right_color    = 0x40;
        $this->_diag_color     = 0x40;
    
        // Set properties passed to Spreadsheet_Excel_Writer_Workbook::addFormat()
        foreach($properties as $property => $value)
        {
            if(method_exists($this,'set'.ucwords($property)))
            {
                $method_name = 'set'.ucwords($property);
                $this->$method_name($value);
            }
        }
    }


Field Documentation

Spreadsheet_Excel_Writer_Format::$_bg_color

Definition at line 189 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_bold

Definition at line 75 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_bottom

Definition at line 201 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_bottom_color

Definition at line 207 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_color

Definition at line 87 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_fg_color

Definition at line 183 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_font_charset

Definition at line 129 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_font_family

Definition at line 123 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_font_name

Definition at line 63 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_font_outline

Definition at line 105 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_font_script

Definition at line 117 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_font_shadow

Definition at line 111 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_font_strikeout

Definition at line 99 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_hidden

Definition at line 141 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_italic

Definition at line 81 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_left

Definition at line 225 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_left_color

Definition at line 231 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_locked

Definition at line 147 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_num_format

Definition at line 135 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_pattern

Definition at line 195 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_right

Definition at line 237 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_right_color

Definition at line 243 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_rotation

Definition at line 177 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_size

Definition at line 69 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_text_h_align

Definition at line 153 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_text_justlast

Definition at line 171 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_text_v_align

Definition at line 165 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_text_wrap

Definition at line 159 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_top

Definition at line 213 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_top_color

Definition at line 219 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_underline

Definition at line 93 of file Format.php.

Spreadsheet_Excel_Writer_Format::$_xf_index

Definition at line 51 of file Format.php.

Spreadsheet_Excel_Writer_Format::$font_index

Definition at line 57 of file Format.php.


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