phpDocumentor OpenDocumentPHP
styles_properties
[ class tree: OpenDocumentPHP ] [ index: OpenDocumentPHP ] [ all elements ]

Source for file TableColumnProperties.php

Documentation is available at TableColumnProperties.php

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /*
  6.  * Created on 01. Aug. 2007 by Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
  7.  */
  8.  
  9. /**
  10.  * TableColumnProperties class file.
  11.  *
  12.  * PHP Version 5
  13.  *  
  14.  * LICENSE:
  15.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16.  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17.  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  18.  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  19.  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  21.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  23.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  25.  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26.  *
  27.  * This software consists of voluntary contributions made by many individuals
  28.  * and is licensed under the GPL. For more information please see
  29.  * <http://opendocumentphp.org>.
  30.  * 
  31.  * $Id: TableColumnProperties.php 260 2007-08-03 13:42:29Z nmarkgraf $
  32.  * 
  33.  * @category    File Formats
  34.  * @package     OpenDocumentPHP
  35.  * @subpackage  styles_properties
  36.  * @author      Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
  37.  * @copyright   Copyright in 2006, 2007 by The OpenDocumentPHP Team
  38.  * @license     http://www.gnu.org/licenses/gpl.html GNU General Public License 2.0.
  39.  * @version     SVN: $Id: TableColumnProperties.php 260 2007-08-03 13:42:29Z nmarkgraf $
  40.  * @link        http://opendocumentphp.org
  41.  * @link        http://www.oasis-open.org/committees/download.php/20493/UCR.pdf OpenDocument Metadata Use Cases and Requirements
  42.  * @since       0.5.3 - 01. Aug. 2007
  43.  */
  44.  
  45. /**
  46.  * 
  47.  */
  48. require_once 'OpenDocumentPHP/util/ODPElement.php';
  49.  
  50. /**
  51.  * TableColumnProperties class.
  52.  * 
  53.  * @category    File Formats
  54.  * @package     OpenDocumentPHP
  55.  * @subpackage  styles_properties
  56.  * @author      Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
  57.  * @copyright   Copyright in 2006, 2007 by The OpenDocumentPHP Team
  58.  * @license     http://www.gnu.org/licenses/gpl.html GNU General Public License 2.0.
  59.  * @version     Release: @package_version@
  60.  * @link        http://opendocumentphp.org
  61.  * @since       0.5.3 - 01. Aug. 2007
  62.  * 
  63.  */
  64. {
  65.     /**
  66.      * Constructor method.
  67.      * 
  68.      * @since       0.5.3 - 01. Aug. 2007
  69.      */
  70.     function __construct($elem=null
  71.     {         
  72.         if (is_null($elem)) {
  73.            parent::__construct('style:table-column-properties'''self::STYLE);
  74.         else {
  75.            parent::__construct($elem);         
  76.         }   
  77.     }
  78.  
  79.     /**
  80.      * Set column width
  81.      *
  82.      * @access  public
  83.      * @param   float|string  $width  column width
  84.      * @since   0.5.3 - 02. Aug. 2007
  85.      */
  86.     public function setColumnWidth($width)
  87.     {
  88.         if (is_float($width)) {
  89.             $this->putStyleAttribute('column-width'"$width".'cm');    
  90.         else {
  91.             $this->putStyleAttribute('column-width'$width);
  92.         }    
  93.     }
  94.  
  95.     /**
  96.      * Set relative column width
  97.      * 
  98.      * @access  public
  99.      * @param   float|string  $width  rel column width
  100.      * @since   0.5.3 - 02. Aug. 2007
  101.      */
  102.     function setRelColumnWidth($width)
  103.     {
  104.         if (is_float($width)) {
  105.             $this->putStyleAttribute('rel-column-width'"$width".'cm');    
  106.         else {
  107.             $this->putStyleAttribute('rel-column-width'$width);
  108.         }
  109.         
  110.     }
  111.  
  112.     /**
  113.      * Set flag, so optimal column width is used (calculated by application).
  114.      * 
  115.      * @access  public
  116.      * @since   0.5.3 - 02. Aug. 2007
  117.      */
  118.     function setUseOptimalColumnWidth()
  119.     {
  120.         $this->putStyleAttribute('use-optimal-column-width''true');
  121.     }
  122. }
  123. ?>

Documentation generated on Wed, 18 Jun 2008 06:32:51 +0200 by phpDocumentor 1.3.2