StyleProcessor

This class process the CSS properties and transform them into their equivalent ODF properties

package

Docxpresso

subpackage

Parser

Methods

Construct

__construct(\Docxpresso\Parser\DOMNode $styleNode, \Docxpresso\Parser\DOMNode $mainStyleNode = NULL, \Docxpresso\Parser\DOMNode $styleStyleNode = NULL) 
access

public

Arguments

$styleNode

\Docxpresso\Parser\DOMNode

$mainStyleNode

\Docxpresso\Parser\DOMNode

$styleStyleNode

\Docxpresso\Parser\DOMNode

This method generates the style node associated with a graphic

_generateGraphicStyle(\Docxpresso\Parser\DOMNode $styleNode, array $style, string $target = '') : void
access

private

Arguments

$styleNode

\Docxpresso\Parser\DOMNode

$style

array

$target

string

This method generates the style node associated with a list

_generateListStyle(\Docxpresso\Parser\DOMNode $styleNode, array $listType, array $listStyle) : void
access

private

Arguments

$styleNode

\Docxpresso\Parser\DOMNode

$listType

array

$listStyle

array

This method generates the style node associated with a paragraph

_generateParagraphStyle(\Docxpresso\Parser\DOMNode $styleNode, array $style) : void
access

private

Arguments

$styleNode

\Docxpresso\Parser\DOMNode

$style

array

This method generates the style node associated with a table cell

_generateTableCellStyle(\Docxpresso\Parser\DOMNode $styleNode, array $style) : void
access

private

Arguments

$styleNode

\Docxpresso\Parser\DOMNode

$style

array

This method generates the style node associated with a table column

_generateTableColumnStyle(\Docxpresso\Parser\DOMNode $styleNode, array $style) : void
access

private

Arguments

$styleNode

\Docxpresso\Parser\DOMNode

$style

array

This method generates the style node associated with a table row

_generateTableRowStyle(\Docxpresso\Parser\DOMNode $styleNode, array $style) : void
access

private

Arguments

$styleNode

\Docxpresso\Parser\DOMNode

$style

array

This method generates the style node associated with a table

_generateTableStyle(\Docxpresso\Parser\DOMNode $styleNode, array $style) : void
access

private

Arguments

$styleNode

\Docxpresso\Parser\DOMNode

$style

array

This method generates the style node associated with plain text

_generateTextStyle(\Docxpresso\Parser\DOMNode $styleNode, array $style) : void
access

private

Arguments

$styleNode

\Docxpresso\Parser\DOMNode

$style

array

This method generates the style node associated with a paragraph

_genericStyle(\Docxpresso\Parser\DOMNode $styleNode, array $style, string $styleName, array $styleArray) : void
access

private

Arguments

$styleNode

\Docxpresso\Parser\DOMNode

$style

array

$styleName

string

$styleArray

array

Parses the different CSS breaks in ODF style

_parseBreaks(\Docxpresso\Parser\DOMNode $node, string $style, string $attribute, string $value) : void
access

private

Arguments

$node

\Docxpresso\Parser\DOMNode

$style

string

$attribute

string

$value

string

Parses the height in ODF style

_parseHeight(\Docxpresso\Parser\DOMNode $node, string $style, string $attribute, string $value) : void
access

private

Arguments

$node

\Docxpresso\Parser\DOMNode

$style

string

$attribute

string

$value

string

Parses the different CSS list properties in ODF style

_parseList(\Docxpresso\Parser\DOMNode $node, string $attribute, string $value) : void
access

private

Arguments

$node

\Docxpresso\Parser\DOMNode

$attribute

string

$value

string

Parses the different CSS text decoration styles properties in ODF style

_parseTextDecoration(\Docxpresso\Parser\DOMNode $node, string $style, string $attribute, string $value) : void
access

private

Arguments

$node

\Docxpresso\Parser\DOMNode

$style

string

$attribute

string

$value

string

Parses the width in ODF style

_parseWidth(\Docxpresso\Parser\DOMNode $node, string $style, string $attribute, string $value) : void
access

private

Arguments

$node

\Docxpresso\Parser\DOMNode

$style

string

$attribute

string

$value

string

Sets certain CSS props in standard ODF format

ODFStyles(array $style) 
static
access

public

static

Arguments

$style

array

This method preprocess some CSS properties like border that should be stated in shorthand notation for direct parsing

preprocessCSSStyles(string $props) : array
access

public

Arguments

$props

string

Response

array

This method process the CSS type styles for the list

processListStyle(string $listId, array $style, string $target = 'document') : void
access

public

Arguments

$listId

string

$style

array

$target

string

This method process the CSS type styles to create the corresponding style nodes in the ODF document

processSingleStyle(string $type, string $styleId, mixed $style, string $target = 'document') : void
access

public

Arguments

$type

string

$styleId

string

$style

mixed

$target

string

This method process the CSS type styles to create the corresponding style nodes in the ODF document

processStyles() : void
access

private

Properties

background style properties

bgStyles : array
static
access

public

static
var

Type(s)

array

chart style properties

chartStyles : array
static
access

public

static
var

Type(s)

array

This array holds the relationship between CSS properties and ODF style properties.

CSSODF : array
static

Sometimes the relationship is one-to-one but in many cases a CSS property may map to different ODF style properties depending on the type of ODF node or even its value. If the property is mapped into an integer it is a reference for further parsing thrugh the _context array(check this statement)

access

public

static
var

Type(s)

array

graphic style properties

graphicStyles : array
static
access

public

static
var

Type(s)

array

header and footer style properties

headerFooterStyles : array
static
access

public

static
var

Type(s)

array

page style properties

pageStyles : array
static
access

public

static
var

Type(s)

array

paragraph style properties

pStyles : array
static
access

public

static
var

Type(s)

array

ODF style families

styleFamilies : array
static
access

public

static
var

Type(s)

array

table style properties

tableStyles : array
static
access

public

static
var

Type(s)

array

table cell style properties

tableCellStyles : array
static
access

public

static
var

Type(s)

array

table column style properties

tableColumnStyles : array
static
access

public

static
var

Type(s)

array

table row style properties

tableRowStyles : array
static
access

public

static
var

Type(s)

array

text style properties

textStyles : array
static
access

public

static
var

Type(s)

array

instance of the ParseCSSProperties class

_cssParser : \Docxpresso\Parser\ParseCSSProperties
access

private

var

Type(s)

\Docxpresso\Parser\ParseCSSProperties

sides

_sides : array
access

private

var

Type(s)

array

style node reference

_styleNode : \Docxpresso\Parser\DOMNode
access

public

static
var

Type(s)

\Docxpresso\Parser\DOMNode