Public Member Functions | Data Fields

Spreadsheet_Excel_Writer_Validator Class Reference

Public Member Functions

 Spreadsheet_Excel_Writer_Validator (&$parser)
 setPrompt ($promptTitle="\x00", $promptDescription="\x00", $showPrompt=true)
 setError ($errorTitle="\x00", $errorDescription="\x00", $showError=true)
 allowBlank ()
 onInvalidStop ()
 onInvalidWarn ()
 onInvalidInfo ()
 setFormula1 ($formula)
 setFormula2 ($formula)
 _getOptions ()
 _getData ()

Data Fields

 $_type
 $_style
 $_fixedList
 $_blank
 $_incell
 $_showprompt
 $_showerror
 $_title_prompt
 $_descr_prompt
 $_title_error
 $_descr_error
 $_operator
 $_formula1
 $_formula2
 $_parser

Detailed Description

Definition at line 48 of file Validator.php.


Member Function Documentation

Spreadsheet_Excel_Writer_Validator::_getData (  ) 

Definition at line 172 of file Validator.php.

References $data, and _getOptions().

   {
      $title_prompt_len = strlen($this->_title_prompt);
      $descr_prompt_len = strlen($this->_descr_prompt);
      $title_error_len = strlen($this->_title_error);
      $descr_error_len = strlen($this->_descr_error);
      
      $formula1_size = strlen($this->_formula1);
      $formula2_size = strlen($this->_formula2);

      $data  = pack("V", $this->_getOptions());
      $data .= pack("vC", $title_prompt_len, 0x00) . $this->_title_prompt;
      $data .= pack("vC", $title_error_len, 0x00) . $this->_title_error;
      $data .= pack("vC", $descr_prompt_len, 0x00) . $this->_descr_prompt;
      $data .= pack("vC", $descr_error_len, 0x00) . $this->_descr_error;

      $data .= pack("vv", $formula1_size, 0x0000) . $this->_formula1;
      $data .= pack("vv", $formula2_size, 0x0000) . $this->_formula2;

      return $data;
   }

Here is the call graph for this function:

Spreadsheet_Excel_Writer_Validator::_getOptions (  ) 

Definition at line 153 of file Validator.php.

Referenced by _getData().

   {
      $options = $this->_type;
      $options |= $this->_style << 3;
      if($this->_fixedList)
         $options |= 0x80;
      if($this->_blank)
         $options |= 0x100;
      if(!$this->_incell)
         $options |= 0x200;
      if($this->_showprompt)
         $options |= 0x40000;
      if($this->_showerror)
         $options |= 0x80000;
      $options |= $this->_operator << 20;
      
      return $options;
   }

Here is the caller graph for this function:

Spreadsheet_Excel_Writer_Validator::allowBlank (  ) 

Definition at line 103 of file Validator.php.

   {
      $this->_blank = true;
   }

Spreadsheet_Excel_Writer_Validator::onInvalidInfo (  ) 

Definition at line 118 of file Validator.php.

    {
        $this->_style = 0x02;
    }

Spreadsheet_Excel_Writer_Validator::onInvalidStop (  ) 

Definition at line 108 of file Validator.php.

   {
      $this->_style = 0x00;
   }

Spreadsheet_Excel_Writer_Validator::onInvalidWarn (  ) 

Definition at line 113 of file Validator.php.

    {
        $this->_style = 0x01;
    }

Spreadsheet_Excel_Writer_Validator::setError ( errorTitle = "\x00",
errorDescription = "\x00",
showError = true 
)

Definition at line 96 of file Validator.php.

   {
      $this->_showerror = $showError;
      $this->_title_error = $errorTitle;
      $this->_descr_error = $errorDescription;
   }

Spreadsheet_Excel_Writer_Validator::setFormula1 ( formula  ) 

Definition at line 123 of file Validator.php.

    {
        // Parse the formula using the parser in Parser.php
        $error = $this->_parser->parse($formula);
        if (PEAR::isError($error)) {
            return $this->_formula1;
        }

        $this->_formula1 = $this->_parser->toReversePolish();
        if (PEAR::isError($this->_formula1)) {
            return $this->_formula1;
        }
        return true;
    }

Spreadsheet_Excel_Writer_Validator::setFormula2 ( formula  ) 

Definition at line 138 of file Validator.php.

    {
        // Parse the formula using the parser in Parser.php
        $error = $this->_parser->parse($formula);
        if (PEAR::isError($error)) {
            return $this->_formula2;
        }

        $this->_formula2 = $this->_parser->toReversePolish();
        if (PEAR::isError($this->_formula2)) {
            return $this->_formula2;
        }
        return true;
    }

Spreadsheet_Excel_Writer_Validator::setPrompt ( promptTitle = "\x00",
promptDescription = "\x00",
showPrompt = true 
)

Definition at line 89 of file Validator.php.

   {
      $this->_showprompt = $showPrompt;
      $this->_title_prompt = $promptTitle;
      $this->_descr_prompt = $promptDescription;
   }

Spreadsheet_Excel_Writer_Validator::Spreadsheet_Excel_Writer_Validator ( &$  parser  ) 

Definition at line 70 of file Validator.php.

    {
        $this->_parser       = $parser;
        $this->_type         = 0x01; // FIXME: add method for setting datatype
        $this->_style        = 0x00;
        $this->_fixedList    = false;
        $this->_blank        = false;
        $this->_incell       = false;
        $this->_showprompt   = false;
        $this->_showerror    = true;
        $this->_title_prompt = "\x00";
        $this->_descr_prompt = "\x00";
        $this->_title_error  = "\x00";
        $this->_descr_error  = "\x00";
        $this->_operator     = 0x00; // default is equal
        $this->_formula1    = "";
        $this->_formula2    = "";
    }


Field Documentation

Spreadsheet_Excel_Writer_Validator::$_blank

Definition at line 53 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_descr_error

Definition at line 60 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_descr_prompt

Definition at line 58 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_fixedList

Definition at line 52 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_formula1

Definition at line 62 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_formula2

Definition at line 63 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_incell

Definition at line 54 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_operator

Definition at line 61 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_parser

Definition at line 68 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_showerror

Definition at line 56 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_showprompt

Definition at line 55 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_style

Definition at line 51 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_title_error

Definition at line 59 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_title_prompt

Definition at line 57 of file Validator.php.

Spreadsheet_Excel_Writer_Validator::$_type

Definition at line 50 of file Validator.php.


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