Package writer2latex.xhtml
Class Converter
- java.lang.Object
-
- writer2latex.base.ConverterBase
-
- writer2latex.xhtml.Converter
-
- All Implemented Interfaces:
Converter
- Direct Known Subclasses:
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addContentEntry(java.lang.String sTitle, int nLevel, java.lang.String sTarget)
void
addTarget(org.w3c.dom.Element node, java.lang.String sId)
void
changeOutFile(int nIndex)
void
convertInner()
protected org.w3c.dom.Element
createElement(java.lang.String s)
org.w3c.dom.Element
createLink(java.lang.String sId)
org.w3c.dom.Element
createLink(org.w3c.dom.Element onode)
org.w3c.dom.Element
createTarget(java.lang.String sId)
protected org.w3c.dom.Text
createTextNode(java.lang.String s)
Config
getConfig()
Get the interface for the configuration of this converterprotected java.lang.String
getContentWidth()
protected DrawConverter
getDrawCv()
protected L10n
getL10n()
protected MathConverter
getMathCv()
protected int
getOutFileIndex()
java.lang.String
getOutFileName(int nIndex, boolean bWithExt)
org.w3c.dom.Element
getPanelNode()
protected java.lang.String
getPlainInlineText(org.w3c.dom.Node node)
protected writer2latex.xhtml.StyleConverter
getStyleCv()
protected TableConverter
getTableCv()
protected TextConverter
getTextCv()
protected int
getType()
protected XhtmlConfig
getXhtmlConfig()
void
handleOfficeAnnotation(org.w3c.dom.Node onode, org.w3c.dom.Node hnode)
protected org.w3c.dom.Node
importNode(org.w3c.dom.Node node, boolean bDeep)
boolean
isOPS()
protected boolean
isTopLevel()
org.w3c.dom.Element
nextOutFile()
boolean
outFileHasContent()
protected void
popContentWidth()
protected java.lang.String
pushContentWidth(java.lang.String sWidth)
void
readResource(java.io.File file, java.lang.String sFileName, java.lang.String sMediaType)
Read a style sheet to include with the converted document.void
readResource(java.io.InputStream is, java.lang.String sFileName, java.lang.String sMediaType)
Read a resource to include with the converted document.void
readStyleSheet(java.io.File file)
Read a style sheet to include with the converted document.void
readStyleSheet(java.io.InputStream is)
Read a style sheet to include with the converted document.void
readTemplate(java.io.File file)
Read a template to use as a base for the converted document.void
readTemplate(java.io.InputStream is)
Read a template to use as a base for the converted document.protected void
setCoverFile(java.lang.String sTarget)
protected void
setCoverImageFile(OutputFile file, java.lang.String sTarget)
protected void
setIndexFile(java.lang.String sTarget)
protected void
setLofFile(java.lang.String sTarget)
protected void
setLotFile(java.lang.String sTarget)
void
setOPS(boolean b)
protected void
setTocFile(java.lang.String sTarget)
-
Methods inherited from class writer2latex.base.ConverterBase
addDocument, convert, convert, convert, getEmbeddedObject, getImageCv, getMetaData, getTexMathsEquation, getTexMathsEquation, getTexMathsStyle, setGraphicConverter
-
-
-
-
Method Detail
-
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(java.io.InputStream is) throws java.io.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 theConverter
implementation.- Specified by:
readTemplate
in interfaceConverter
- Overrides:
readTemplate
in classConverterBase
- Parameters:
is
- anInputStream
from which to read the template- Throws:
java.io.IOException
- if some exception occurs while reading the template
-
readTemplate
public void readTemplate(java.io.File file) throws java.io.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 theConverter
implementation.- Specified by:
readTemplate
in interfaceConverter
- Overrides:
readTemplate
in classConverterBase
- Parameters:
file
- a file from which to read the template- Throws:
java.io.IOException
- if the file does not exist or some exception occurs while reading the template
-
readStyleSheet
public void readStyleSheet(java.io.InputStream is) throws java.io.IOException
Description copied from interface:Converter
Read a style sheet to include with the converted document. The format of the style sheet depends on theConverter
implementation.- Specified by:
readStyleSheet
in interfaceConverter
- Overrides:
readStyleSheet
in classConverterBase
- Parameters:
is
- anInputStream
from which to read the style sheet- Throws:
java.io.IOException
- if some exception occurs while reading the style sheet
-
readStyleSheet
public void readStyleSheet(java.io.File file) throws java.io.IOException
Description copied from interface:Converter
Read a style sheet to include with the converted document. The format of the style sheet depends on theConverter
implementation.- Specified by:
readStyleSheet
in interfaceConverter
- Overrides:
readStyleSheet
in classConverterBase
- Parameters:
file
- a file from which to read the style sheet- Throws:
java.io.IOException
- if the file does not exist or some exception occurs while reading the style sheet
-
readResource
public void readResource(java.io.InputStream is, java.lang.String sFileName, java.lang.String sMediaType) throws java.io.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 interfaceConverter
- Overrides:
readResource
in classConverterBase
- Parameters:
is
- anInputStream
from which to read the resourcesFileName
- the file name to use for the resourcesMediaType
- the media type of the resource, if null the media type will be guessed from the file name- Throws:
java.io.IOException
- if some exception occurs while reading the resource
-
readResource
public void readResource(java.io.File file, java.lang.String sFileName, java.lang.String sMediaType) throws java.io.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 interfaceConverter
- Overrides:
readResource
in classConverterBase
- Parameters:
file
- a file from which to read the style sheetsFileName
- the file name to use for the resourcesMediaType
- the media type of the resource, if null the media type will be guessed from the file name- Throws:
java.io.IOException
- if the file does not exist or some exception occurs while reading the resource
-
getContentWidth
protected java.lang.String getContentWidth()
-
pushContentWidth
protected java.lang.String pushContentWidth(java.lang.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()
-
getOutFileIndex
protected int getOutFileIndex()
-
addContentEntry
protected void addContentEntry(java.lang.String sTitle, int nLevel, java.lang.String sTarget)
-
setTocFile
protected void setTocFile(java.lang.String sTarget)
-
setLofFile
protected void setLofFile(java.lang.String sTarget)
-
setLotFile
protected void setLotFile(java.lang.String sTarget)
-
setIndexFile
protected void setIndexFile(java.lang.String sTarget)
-
setCoverFile
protected void setCoverFile(java.lang.String sTarget)
-
setCoverImageFile
protected void setCoverImageFile(OutputFile file, java.lang.String sTarget)
-
createElement
protected org.w3c.dom.Element createElement(java.lang.String s)
-
createTextNode
protected org.w3c.dom.Text createTextNode(java.lang.String s)
-
importNode
protected org.w3c.dom.Node importNode(org.w3c.dom.Node node, boolean bDeep)
-
getL10n
protected L10n getL10n()
-
setOPS
public void setOPS(boolean b)
-
isOPS
public boolean isOPS()
-
convertInner
public void convertInner() throws java.io.IOException
- Specified by:
convertInner
in classConverterBase
- Throws:
java.io.IOException
-
getPlainInlineText
protected java.lang.String getPlainInlineText(org.w3c.dom.Node node)
-
handleOfficeAnnotation
public void handleOfficeAnnotation(org.w3c.dom.Node onode, org.w3c.dom.Node hnode)
-
getOutFileName
public java.lang.String getOutFileName(int nIndex, boolean bWithExt)
-
outFileHasContent
public boolean outFileHasContent()
-
changeOutFile
public void changeOutFile(int nIndex)
-
getPanelNode
public org.w3c.dom.Element getPanelNode()
-
nextOutFile
public org.w3c.dom.Element nextOutFile()
-
createTarget
public org.w3c.dom.Element createTarget(java.lang.String sId)
-
addTarget
public void addTarget(org.w3c.dom.Element node, java.lang.String sId)
-
createLink
public org.w3c.dom.Element createLink(java.lang.String sId)
-
createLink
public org.w3c.dom.Element createLink(org.w3c.dom.Element onode)
-
-