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// |
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. |
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.
Adds the given PCSS $stylesheet definitions.
Adds the PCSS styles given as a string in $stylesheet to the styler.
Name | Type | Description |
---|---|---|
$stylesheet |
string |
Adds a PCSS stylesheet from the given file.
Reads the given PCSS $file and adds the contained stylesheets to the styler.
Name | Type | Description |
---|---|---|
$file |
string |
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.
Name | Type | Description |
---|---|---|
$docBookElement |
ezcDocumentLocateable | |
$odtElement |
DOMElement |
Type | Description |
---|---|
ezcDocumentOdtStylerNotInitializedException |
Initialize the styler with the given $styleInfo.
This method *must* be called *before* applyStyles() is called at all. Otherwise an exception will be thrown.
Name | Type | Description |
---|---|---|
$odtDocument |
DOMDocument |