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

Class: OpenDocument_Document

Source Location: /OpenDocument-0.2.1/OpenDocument/Document.php

Class Overview


Base for all document classes.


Author(s):

Variables

Methods


Child classes:

Inherited Variables

Inherited Methods


Class Details

[line 41]
Base for all document classes.


[ Top ]


Class Variables

$children =

[line 132]

Collection of children objects
  • Access: protected

Type:   ArrayIterator


[ Top ]

$contentDOM =

[line 69]

DOM document for content
  • Access: protected

Type:   DOMDocument


[ Top ]

$contentXPath =

[line 76]

DOMXPath object for content
  • Access: protected

Type:   DOMXPath


[ Top ]

$cursor =

[line 48]

DOMNode of content node
  • Access: protected

Type:   DOMNode


[ Top ]

$fonts =

[line 62]

DOMNode with fonts declarations
  • Access: protected

Type:   DOMNode


[ Top ]

$metaDOM =

[line 83]

DOMDocument for meta information
  • Access: protected

Type:   DOMDocument


[ Top ]

$metaXPath =

[line 90]

DOMXPath for meta information
  • Access: protected

Type:   DOMXPath


[ Top ]

$settingsDOM =

[line 97]

DOMDocument for settings
  • Access: protected

Type:   DOMDocument


[ Top ]

$settingsXPath =

[line 104]

DOMXPath for settings
  • Access: protected

Type:   DOMXPath


[ Top ]

$storage =  null

[line 125]

Storage driver object
  • Access: protected



[ Top ]

$styles =

[line 55]

DOMNode with style information
  • Access: protected

Type:   DOMNode


[ Top ]

$stylesDOM =

[line 111]

DOMDocument for styles
  • Access: protected

Type:   DOMDocument


[ Top ]

$stylesXPath =

[line 118]

DOMXPath for styles
  • Access: protected

Type:   DOMXPath


[ Top ]



Method Detail

__construct (Constructor)   [line 143]

OpenDocument_Document __construct( OpenDocument_Storage $storage)

Constructor
  • Throws: OpenDocument_Exception
  • Access: public

Overridden in child classes as:

OpenDocument_Debug_Text::__construct()

Parameters:

string   $storage     Storage object

[ Top ]

addFont   [line 509]

void addFont( string $font_name, [string $font_family = ''])

Add new font declaration
  • Access: public

Parameters:

string   $font_name     Name of font
string   $font_family     Name of font family

[ Top ]

applyStyle   [line 331]

string applyStyle( string $style_name, string $name, mixed $value, OpenDocument_StyledElement $object)

Apply style information to object.

If object has no style information yet, then create new style node. If object style information is similar to other object's style info, then apply the same style name. And if object old style information was not shared with other objects then delete old style info. Otherwise leave old style info or just add new style description

  • Return: Name of style that has been applied
  • Access: public

Parameters:

string   $style_name     Name of style to apply
string   $name     Name of property to set (e.g. 'fo:font-weight')
mixed   $value     Value of property
OpenDocument_StyledElement   $object     Object to apply style to

[ Top ]

compareChildNodes   [line 585]

bool compareChildNodes( $node1, $node2)

Compare DOMNode children
  • Return: True if they are equal
  • Access: protected

Parameters:

DOMNode   $node1     First DOM node
DOMNode   $node2     Second DOM node

[ Top ]

compareNodes   [line 532]

bool compareNodes( mixed $node1, mixed $node2)

Compare two DOMNode nodes and check if they are equal
  • Return: True if both are equal
  • Access: protected

Parameters:

mixed   $node1     First DOM node
mixed   $node2     Second DOM node

[ Top ]

compareStyles   [line 473]

bool compareStyles( string $style_name1, string $style_name2)

Check if two style info are similar
  • Return: True if both styles equal each other
  • Access: protected

Parameters:

string   $style_name1     Name of first style
string   $style_name2     Name of second style

[ Top ]

deleteElement   [line 262]

void deleteElement( OpenDocument_Element $element)

Delete document child element
  • Access: public

Parameters:

OpenDocument_Element   $element     Element to remove

[ Top ]

getChildren   [line 218]

ArrayIterator getChildren( )

Get children list
  • Access: public

[ Top ]

getChildrenByName   [line 620]

array getChildrenByName( $node, string $name)

Get DOMNode children by name
  • Access: protected

Parameters:

DOMNode   $node     Parent node
string   $name     Name of children tags

[ Top ]

getDOM   [line 669]

DOMDocument getDOM( string $type)

Returns the internal DOM document of the given type.

Should be used for debugging and internal development purposes only - e.g. unit testing.

  • Return: Desired DOM document
  • Throws: OpenDocument_Exception If the type is unknown.
  • Access: public

Parameters:

string   $type     DOM to fetch: styles, manifest, settings, content, meta

[ Top ]

getFonts   [line 489]

array getFonts( )

Get array of declared font names
  • Return: Array of font nodes
  • Access: protected

[ Top ]

getStyle   [line 423]

array getStyle( string $style_name, $properties)

Get array of style values
  • Return: Key-value array of properties and their values
  • Access: public

Parameters:

string   $style_name     Name of style to retrieve properties from
array   $properties     Array of namespace-prefixed properties to retrieve

[ Top ]

getStyleNode   [line 451]

DOMNode getStyleNode( string $style_name)

Get style node
  • Return: Style node
  • Access: protected

Overridden in child classes as:

OpenDocument_Debug_Text::getStyleNode()
Get style node

Parameters:

string   $style_name     Name of style

[ Top ]

getXPath   [line 692]

DOMXPath getXPath( string $type)

Returns the internal XPath object of the given type.

Should be used for debugging and internal development purposes only - e.g. unit testing.

  • Return: Desired xpath object
  • Throws: OpenDocument_Exception If the type is unknown.
  • Access: public

Parameters:

string   $type     XPath to fetch: styles, manifest, settings, content, meta

[ Top ]

listChildren   [line 230]

void listChildren( )

Fills $this->children with all DOMNodes
  • Access: protected

Overridden in child classes as:

OpenDocument_Document_Text::listChildren()
Fills $this->children with all DOMNodes

[ Top ]

open   [line 159]

void open( OpenDocument_Storage $storage)

Open the given file
  • Access: public

Parameters:

string   $storage     Storage object

[ Top ]

save   [line 645]

void save( [string $filename = null])

Save changes in document or save as a new document or under another name.
  • Throws: OpenDocument_Exception
  • Access: public

Parameters:

string   $filename     Name to save document as. If no name given, the name that was used to open the file is used.

[ Top ]

setMax   [line 275]

void setMax( )

Set maximum values of style name suffixes
  • Access: protected

Overridden in child classes as:

OpenDocument_Document_Text::setMax()
Set maximum values of style name suffixes

[ Top ]

__get   [line 202]

mixed __get( string $name)

Provide read only access to cursor private variable
  • Return: Variable contents
  • Access: public

Parameters:

string   $name     Variable to read

[ Top ]


Documentation generated on Tue, 23 Oct 2012 12:00:07 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.