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

Source for file LayoutPack.php

Documentation is available at LayoutPack.php

  1. <?php
  2. /**
  3.  * PHPPowerPoint
  4.  *
  5.  * Copyright (c) 2009 - 2010 PHPPowerPoint
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2.1 of the License, or (at your option) any later version.
  11.  * 
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the Free Software
  19.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  20.  *
  21.  * @category   PHPPowerPoint
  22.  * @package    PHPPowerPoint_Writer_PowerPoint2007
  23.  * @copyright  Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    0.1.0, 2009-04-27
  26.  */
  27.  
  28.  
  29. /**
  30.  * PHPPowerPoint_Writer_PowerPoint2007_LayoutPack
  31.  *
  32.  * @category   PHPPowerPoint
  33.  * @package    PHPPowerPoint_Writer_PowerPoint2007
  34.  * @copyright  Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
  35.  */
  36. {
  37.     /**
  38.      * Master slide.
  39.      * 
  40.      * @var array 
  41.      */
  42.     protected $_masterSlide = array();
  43.     
  44.     /**
  45.      * Array of slide layouts.
  46.      * 
  47.      * These are all an array consisting of:
  48.      * - name (string)
  49.      * - body (string)
  50.      * 
  51.      * @var array 
  52.      */
  53.     protected $_layouts = array();
  54.     
  55.     /**
  56.      * Get master slide.
  57.      * 
  58.      * @return array 
  59.      */
  60.     public function getMasterSlide()
  61.     {
  62.         return $this->_masterSlide;
  63.     }
  64.     
  65.     /**
  66.      * Get array of slide layouts.
  67.      * 
  68.      * These are all an array consisting of:
  69.      * - name (string)
  70.      * - body (string)
  71.      * 
  72.      * @return array 
  73.      */
  74.     public function getLayouts()
  75.     {
  76.         return $this->_layouts;
  77.     }
  78.     
  79.     /**
  80.      * Find specific slide layout.
  81.      * 
  82.      * This is an array consisting of:
  83.      * - name (string)
  84.      * - body (string)
  85.      * 
  86.      * @return array 
  87.      * @throws Exception
  88.      */
  89.     public function findLayout($name '')
  90.     {
  91.         foreach ($this->_layouts as $layout)
  92.         {
  93.             if ($layout['name'== $name)
  94.             {
  95.                 return $layout;
  96.             }
  97.         }
  98.         
  99.         throw new Exception("Could not find slide layout $name in current layout pack.");
  100.     }
  101.     
  102.     /**
  103.      * Find specific slide layout index.
  104.      * 
  105.      * @return int 
  106.      * @throws Exception
  107.      */
  108.     public function findLayoutIndex($name '')
  109.     {
  110.         $i 0;
  111.         foreach ($this->_layouts as $layout)
  112.         {
  113.             if ($layout['name'== $name)
  114.             {
  115.                 return $i;
  116.             }
  117.             
  118.             ++$i;
  119.         }
  120.         
  121.         throw new Exception("Could not find slide layout $name in current layout pack.");
  122.     }
  123. }

Documentation generated on Sat, 25 Apr 2009 11:37:35 +0200 by phpDocumentor 1.4.1