Zeta Components Manual :: Docs For Class ezcDocumentOdtPcssStyler
Document::ezcDocumentOdtPcssStyler
Class ezcDocumentOdtPcssStyler
PCSS based ODT styler.
This styler is based on the PCSS (simplified CSS rules) styling mechanism. You can use the addStylesheetFile() and addStylesheet() methods to add custom PCSS styles to it. It is used as the default in the ezcDocumentDocbookToOdtConverterOptions.
Source for this file: /Document/src/converters/element_visitor/docbook/odt/styler/pcss.php
Version: | //autogen// |
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
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
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
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
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 |
Exceptions:
Type | Description |
---|---|
ezcDocumentOdtStylerNotInitializedException |
init
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 |