Package writer2latex.xhtml

# Class Converter

java.lang.Object
writer2latex.base.ConverterBase
writer2latex.xhtml.Converter

All Implemented Interfaces:
  `Converter`

Direct Known Subclasses:
  `EPUB3Converter`, `Html5Converter`, `Xhtml10Converter`, `Xhtml11Converter`, `XhtmlMathMLConverter`

public class Converter extends ConverterBase

This class converts an OpenDocument file to an XHTML(+MathML) or EPUB document.

## Nested Class Summary

## Nested classes/interfaces inherited from class writer2latex.base.ConverterBase

`ConverterBase.TexMathsStyle`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected int`
`nType`

### Fields inherited from class writer2latex.base.ConverterBase

`converterResult, graphicConverter, imageConverter, metaData, odDoc, ofr, sTargetFileName`

## Constructor Summary

Constructors
Constructor
Description
`Converter(int nType)`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addContentEntry(String sTitle, int nLevel, String sTarget)`
`void`
`addEpubNs(Element elm)`
`void`
`addEpubType(Element elm, String sType)`
`void`
`addTarget(Element node, String sId)`
`void`
`changeOutFile(int nIndex)`
`void`
`convertInner()`
`protected Element`
`createElement(String s)`
`Element`
`createLink(String sId)`
`Element`
`createLink(Element onode)`
`Element`
`createTarget(String sId)`
`protected Text`
`createTextNode(String s)`
`Config`
`getConfig()`
Get the interface for the configuration of this converter
`protected String`
`getContentWidth()`
`protected DrawConverter`
`getDrawCv()`
`protected L10n`
`getL10n()`
`protected MathConverter`
`getMathCv()`
`protected int`
`getOutFileIndex()`
`String`
`getOutFileName(int nIndex, boolean bWithExt)`
`Element`
`getPanelNode()`
`protected String`
`getPlainInlineText(Node node)`
`protected writer2latex.xhtml.StyleConverter`
`getStyleCv()`
`protected TableConverter`
`getTableCv()`
`protected TextConverter`
`getTextCv()`
`protected int`
`getType()`
`protected XhtmlConfig`
`getXhtmlConfig()`
`void`
`handleOfficeAnnotation(Node onode, Node hnode)`
`protected Node`
`importNode(Node node, boolean bDeep)`
`boolean`
`isHTML5()`
`boolean`
`isOPS()`
`protected boolean`
`isTopLevel()`
`Element`
`nextOutFile()`
`boolean`
`outFileHasContent()`
`protected void`
`popContentWidth()`
`protected String`
`pushContentWidth(String sWidth)`
`void`
`readResource(File file, String sFileName, String sMediaType)`
Read a style sheet to include with the converted document.
`void`
`readResource(InputStream is, String sFileName, String sMediaType)`
Read a resource to include with the converted document.
`void`
`readStyleSheet(File file)`
Read a style sheet to include with the converted document.
`void`
`readStyleSheet(InputStream is)`
Read a style sheet to include with the converted document.
`void`
`readTemplate(File file)`
Read a template to use as a base for the converted document.
`void`
`readTemplate(InputStream is)`
Read a template to use as a base for the converted document.
`protected void`
`setCoverFile(String sTarget)`
`protected void`
`setCoverImageFile(OutputFile file, String sTarget)`
`protected void`
`setIndexFile(String sTarget)`
`protected void`
`setLofFile(String sTarget)`
`protected void`
`setLotFile(String sTarget)`
`void`
`setOPS(boolean b)`
`protected void`
`setTocFile(String sTarget)`

### Methods inherited from class writer2latex.base.ConverterBase

`addDocument, convert, convert, convert, getEmbeddedObject, getImageCv, getMetaData, getTexMathsEquation, getTexMathsEquation, getTexMathsStyle, setGraphicConverter`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### nType

protected int nType

## Constructor Details

### Converter

public Converter(int nType)

## Method Details

### getConfig

public Config getConfig()
Description copied from interface: `Converter`
Get the interface for the configuration of this converter

Returns:
  the configuration

### getXhtmlConfig

protected XhtmlConfig getXhtmlConfig()

### readTemplate

public void readTemplate(InputStream is) throws IOException
Description copied from interface: `Converter`
Read a template to use as a base for the converted document. The format of the template depends on the `Converter` implementation.

Specified by:
  `readTemplate` in interface `Converter`
Overrides:
  `readTemplate` in class `ConverterBase`
Parameters:
  `is` - an `InputStream` from which to read the template
Throws:
  `IOException` - if some exception occurs while reading the template

### readTemplate

public void readTemplate(File file) throws IOException
Description copied from interface: `Converter`
Read a template to use as a base for the converted document. The format of the template depends on the `Converter` implementation.

Specified by:
  `readTemplate` in interface `Converter`
Overrides:
  `readTemplate` in class `ConverterBase`
Parameters:
  `file` - a file from which to read the template
Throws:
  `IOException` - if the file does not exist or some exception occurs while reading the template

### readStyleSheet

public void readStyleSheet(InputStream is) throws IOException
Description copied from interface: `Converter`
Read a style sheet to include with the converted document. The format of the style sheet depends on the `Converter` implementation.

Specified by:
  `readStyleSheet` in interface `Converter`
Overrides:
  `readStyleSheet` in class `ConverterBase`
Parameters:
  `is` - an `InputStream` from which to read the style sheet
Throws:
  `IOException` - if some exception occurs while reading the style sheet

### readStyleSheet

public void readStyleSheet(File file) throws IOException
Description copied from interface: `Converter`
Read a style sheet to include with the converted document. The format of the style sheet depends on the `Converter` implementation.

Specified by:
  `readStyleSheet` in interface `Converter`
Overrides:
  `readStyleSheet` in class `ConverterBase`
Parameters:
  `file` - a file from which to read the style sheet
Throws:
  `IOException` - if the file does not exist or some exception occurs while reading the style sheet

### readResource

public void readResource(InputStream is, String sFileName, String sMediaType) throws IOException
Description copied from interface: `Converter`
Read a resource to include with the converted document. A resource can be any (binary) file and will be placed in the same directory as the style sheet

Specified by:
  `readResource` in interface `Converter`
Overrides:
  `readResource` in class `ConverterBase`
Parameters:
  `is` - an `InputStream` from which to read the resource
  `sFileName` - the file name to use for the resource
  `sMediaType` - the media type of the resource, if null the media type will be guessed from the file name
Throws:
  `IOException` - if some exception occurs while reading the resource

### readResource

public void readResource(File file, String sFileName, String sMediaType) throws IOException
Description copied from interface: `Converter`
Read a style sheet to include with the converted document. A resource can be any (binary) file and will be placed in the same directory as the style sheet

Specified by:
  `readResource` in interface `Converter`
Overrides:
  `readResource` in class `ConverterBase`
Parameters:
  `file` - a file from which to read the style sheet
  `sFileName` - the file name to use for the resource
  `sMediaType` - the media type of the resource, if null the media type will be guessed from the file name
Throws:
  `IOException` - if the file does not exist or some exception occurs while reading the resource

### getContentWidth

protected String getContentWidth()

### pushContentWidth

protected String pushContentWidth(String sWidth)

### popContentWidth

protected void popContentWidth()

### isTopLevel

protected boolean isTopLevel()

### getStyleCv

protected writer2latex.xhtml.StyleConverter getStyleCv()

### getTextCv

protected TextConverter getTextCv()

### getTableCv

protected TableConverter getTableCv()

### getDrawCv

protected DrawConverter getDrawCv()

### getMathCv

protected MathConverter getMathCv()

### getType

protected int getType()

### isHTML5

public boolean isHTML5()

### getOutFileIndex

protected int getOutFileIndex()

### addContentEntry

protected void addContentEntry(String sTitle, int nLevel, String sTarget)

### setTocFile

protected void setTocFile(String sTarget)

### setLofFile

protected void setLofFile(String sTarget)

### setLotFile

protected void setLotFile(String sTarget)

### setIndexFile

protected void setIndexFile(String sTarget)

### setCoverFile

protected void setCoverFile(String sTarget)

### setCoverImageFile

protected void setCoverImageFile(OutputFile file, String sTarget)

### createElement

protected Element createElement(String s)

### createTextNode

protected Text createTextNode(String s)

### importNode

protected Node importNode(Node node, boolean bDeep)

### getL10n

protected L10n getL10n()

### setOPS

public void setOPS(boolean b)

### isOPS

public boolean isOPS()

### convertInner

public void convertInner() throws IOException

Specified by:
  `convertInner` in class `ConverterBase`
Throws:
  `IOException`

### getPlainInlineText

protected String getPlainInlineText(Node node)

### handleOfficeAnnotation

public void handleOfficeAnnotation(Node onode, Node hnode)

### getOutFileName

public String getOutFileName(int nIndex, boolean bWithExt)

### outFileHasContent

public boolean outFileHasContent()

### changeOutFile

public void changeOutFile(int nIndex)

### getPanelNode

public Element getPanelNode()

### nextOutFile

public Element nextOutFile()

### addEpubNs

public void addEpubNs(Element elm)

### addEpubType

public void addEpubType(Element elm, String sType)

### createTarget

public Element createTarget(String sId)

### addTarget

public void addTarget(Element node, String sId)

### createLink

public Element createLink(String sId)

### createLink

public Element createLink(Element onode)