writer2latex.xhtml

Class TextStyleConverter


public class TextStyleConverter
extends StyleWithPropertiesConverterHelper

This class converts OpenDocument text styles to CSS2 styles. This includes conversion of text properties in other styles (paragraph, cell, graphic and presentation styles).

Field Summary

Fields inherited from class writer2latex.xhtml.StyleConverterHelper

bConvertHard, bConvertStyles, nType, styleMap, styleNames

Fields inherited from class writer2latex.xhtml.ConverterHelper

config, converter, ofr

Constructor Summary

TextStyleConverter(OfficeReader ofr, Config config, Converter converter, int nType)
Create a new TextStyleConverter

Method Summary

void
applyAnchorStyle(String sStyleName, String sVisitedStyleName, StyleInfo info)
Apply a link style, using a combination of two text styles
void
applyProperties(StyleWithProperties style, CSVList props, boolean bInherit)
Convert formatting properties for a specific text style.
void
cssText(StyleWithProperties style, CSVList props, boolean bInherit)
void
cssTextBackground(StyleWithProperties style, CSVList props, boolean bInherit)
void
cssTextCommon(StyleWithProperties style, CSVList props, boolean bInherit)
String
getDefaultTagName(StyleWithProperties style)
Create default tag name to represent a text
String
getStyleDeclarations(String sIndent)
Convert style information for used styles
OfficeStyleFamily
getStyles()
Get the family of text (character) styles
boolean
isBold(StyleWithProperties style)
boolean
isFixed(StyleWithProperties style)
boolean
isItalics(StyleWithProperties style)
boolean
isSubscript(StyleWithProperties style)
boolean
isSuperscript(StyleWithProperties style)

Methods inherited from class writer2latex.xhtml.StyleWithPropertiesConverterHelper

applyProperties, applyStyle, getClassNamePrefix, getDefaultTagName, getStyleDeclarations

Methods inherited from class writer2latex.xhtml.StyleConverterHelper

applyDirection, applyLang, colScale, getStyleDeclarations, getStyles, scale

Methods inherited from class writer2latex.xhtml.ConverterHelper

applyStyle, getCellSc, getDrawCv, getFrameSc, getListSc, getMathCv, getPageSc, getParSc, getPresentationSc, getRowSc, getSectionSc, getStyleCv, getTableCv, getTableSc, getTextCv, getTextSc

Constructor Details

TextStyleConverter

public TextStyleConverter(OfficeReader ofr,
                          Config config,
                          Converter converter,
                          int nType)
Create a new TextStyleConverter
Parameters:
ofr - an OfficeReader to read style information from
config - the configuration to use
converter - the main Converter class
nType - the type of xhtml to use

Method Details

applyAnchorStyle

public void applyAnchorStyle(String sStyleName,
                             String sVisitedStyleName,
                             StyleInfo info)
Apply a link style, using a combination of two text styles
Parameters:
sStyleName - name of the OpenDocument style
sVisitedStyleName - name of the OpenDocument style for visited links
info - the StyleInfo object to add information to

applyProperties

public void applyProperties(StyleWithProperties style,
                            CSVList props,
                            boolean bInherit)
Convert formatting properties for a specific text style.
Overrides:
applyProperties in interface StyleWithPropertiesConverterHelper
Parameters:
style - the style to convert
props - the CSVList object to add information to
bInherit - true if properties should be inherited from parent style(s)

cssText

public void cssText(StyleWithProperties style,
                    CSVList props,
                    boolean bInherit)

cssTextBackground

public void cssTextBackground(StyleWithProperties style,
                              CSVList props,
                              boolean bInherit)

cssTextCommon

public void cssTextCommon(StyleWithProperties style,
                          CSVList props,
                          boolean bInherit)

getDefaultTagName

public String getDefaultTagName(StyleWithProperties style)
Create default tag name to represent a text
Overrides:
getDefaultTagName in interface StyleWithPropertiesConverterHelper
Parameters:
style - to use
Returns:
the tag name.

getStyleDeclarations

public String getStyleDeclarations(String sIndent)
Convert style information for used styles
Overrides:
getStyleDeclarations in interface StyleWithPropertiesConverterHelper
Parameters:
sIndent - a String of spaces to add before each line

getStyles

public OfficeStyleFamily getStyles()
Get the family of text (character) styles
Overrides:
getStyles in interface StyleConverterHelper
Returns:
the style family

isBold

public boolean isBold(StyleWithProperties style)

isFixed

public boolean isFixed(StyleWithProperties style)

isItalics

public boolean isItalics(StyleWithProperties style)

isSubscript

public boolean isSubscript(StyleWithProperties style)

isSuperscript

public boolean isSuperscript(StyleWithProperties style)