Source for file DefaultStyle.php
Documentation is available at DefaultStyle.php
* Created on 21.01.2007 by Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
* PHP versions 5.2 or better.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This software consists of voluntary contributions made by many individuals
* and is licensed under the GPL. For more information please see
* <http://opendocumentphp.org>.
* $Id: DefaultStyle.php 256 2007-08-01 14:16:10Z nmarkgraf $
require_once 'OpenDocumentPHP/util/ODPElement.php';
require_once 'OpenDocumentPHP/styles/properties/TextProperties.php';
require_once 'OpenDocumentPHP/styles/properties/ParagraphProperties.php';
require_once 'OpenDocumentPHP/styles/properties/GraphicProperties.php';
require_once 'OpenDocumentPHP/styles/properties/TableProperties.php';
require_once 'OpenDocumentPHP/styles/properties/TableRowProperties.php';
require_once 'OpenDocumentPHP/util/Validator.php';
* @author Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
* @copyright Copyright in 2006, 2007 by The OpenDocumentPHP Team
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License 2.0.
* @version $Revision: 256 $
* @package OpenDocumentPHP
* @since 0.5.0 - 08.02.2007
* @since 0.5.2 - 30. Feb. 2007
function __construct($elem= null, $value= null, $namespace= null)
parent::__construct('style:default-style', '', self::STYLE);
if ($elem instanceof DOMElement) {
* @var ParagraphProperties
private $paragraphProp = null;
private $textProp = null;
* @since 0.5.0 - 08.02.2007
* @param string $value Must be a value out of 'ruby','control', 'presentation',
* 'drawing-page', 'default', 'chart', 'table-page',
* 'table-cell', 'table-row', 'table-column',
* 'section', 'text', 'table', 'paragraph' or 'graphic'.
//$this->setAttributeNS(self :: STYLE, 'style:family', $value);
* @since 0.5.0 - 08.02.2007
* Checks if the current default style has an paragraph-properties
* @return bool True if there is an <style:paragraph-properties> tag as child of the current <style:default-style> tag.
* @since 0.5.2 - 04.03.2007
return $this->hasChildNS(self :: STYLE, 'paragraph-properties');
* Checks if the current default style has an text-properties
* @return bool True if there is an <style:text-properties> tag as child of the current <style:default-style> tag.
* @since 0.5.2 - 04.03.2007
return $this->hasChildNS(self :: STYLE, 'text-properties');
* Checks if the current default style has an graphic-properties
* @return bool True if there is an <style:graphic-properties> tag as child of the current <style:default-style> tag.
* @since 0.5.2 - 04.03.2007
return $this->hasChildNS(self :: STYLE, 'graphic-properties');
* Retrieve a <style:paragraph-properties> tag.
* If it does not exists, create on and add it as a child.
* @since 0.5.2 - 03.03.2007
* @todo Replace the else path by something which uses $this->getChild(..)!
if (is_null($this->paragraphProp)) {
// Look up <style:paragraph-properties> in current child list.
// Get the found properties, and set class attribute.
// If not found, create a new on
return $this->paragraphProp;
* Retrieve a <style:text-properties> tag.
* If it does not exists, create on and add it as a child.
* @since 0.5.2 - 03.03.2007
* @todo Replace the else path by something which uses $this->getChild(..)!
* Look up <style:text-properties> in current child list.
// Get the found properties, and set class attribute.
// If not found, create a new on
* Retrieve a <style:graphic-properties> tag.
* If it does not exists, create on and add it as a child.
* @since 0.5.2 - 03.03.2007
* @todo Replace the else path by something which uses $this->getChild(..)!
// Look up <style:graphic-properties> in current child list.
// Get the found properties, and set class attribute.
// If not found, create a new on
return $this->graphicProp;
|