Document: ezcDocumentOdtPcssStyler
[ ]
[ Conversion ] [ Styles ]
[ ]
[ ]
[ ]
[ ]
Class: ezcDocumentOdtPcssStyler
|
PCSS based ODT styler. [
source]
Method Summary
|
public ezcDocumentOdtPcssStyler |
__construct(
)
Creates a new ODT document styler. |
|
public void |
addStylesheet(
$stylesheet )
Adds the given PCSS $stylesheet definitions. |
|
public void |
addStylesheetFile(
$file )
Adds a PCSS stylesheet from the given file. |
|
public void |
applyStyles(
$docBookElement, $odtElement )
Applies the given $style to the $odtElement. |
|
public void |
init(
$odtDocument )
Initialize the styler with the given $styleInfo. |
Methods
__construct
ezcDocumentOdtPcssStyler __construct(
)
Creates a new ODT document styler.
Creates a new styler. Note that
init() must be called before
applyStyles() can be used. Otherwise an exception is thrown.
addStylesheet
void addStylesheet(
string
$stylesheet )
Adds the given PCSS $stylesheet definitions.
Adds the PCSS styles given as a string in $stylesheet to the styler.
Parameters
| Name |
Type |
Description |
$stylesheet |
string |
|
addStylesheetFile
void addStylesheetFile(
string
$file )
Adds a PCSS stylesheet from the given file.
Reads the given PCSS $file and adds the contained stylesheets to the styler.
Parameters
| Name |
Type |
Description |
$file |
string |
|
applyStyles
void applyStyles(
$docBookElement,
$odtElement )
Applies the given $style to the $odtElement.
$style is an array of style information as produced by ezcDocumentPcssStyleInferencer::inferenceFormattingRules(). The styling information given in this array is applied to the $odtElement by creating a new anonymous style in the ODT style section and applying the corresponding attributes to reference this style.
Parameters
| Name |
Type |
Description |
$docBookElement |
ezcDocumentLocateable |
|
$odtElement |
DOMElement |
|
Throws
| Class | Description |
ezcDocumentOdtStylerNotInitializedException |
|
init
void init(
$odtDocument )
Initialize the styler with the given $styleInfo.
This method *must* be called *before*
applyStyles() is called at all. Otherwise an exception will be thrown.
Parameters
| Name |
Type |
Description |
$odtDocument |
DOMDocument |
|
Last updated: Tue, 23 Mar 2010