|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwriter2latex.office.OfficeReader
public class OfficeReader
This class reads and collects global information about an OOo document. This includes styles, forms, information about indexes and references etc.
Constructor Summary | |
---|---|
OfficeReader(OfficeDocument oooDoc,
boolean bAllParagraphsAreSoft)
Constructor; read a document |
Method Summary | |
---|---|
void |
addFigureSequenceName(java.lang.String sName)
Add a sequence name for figure captions. |
void |
addTableSequenceName(java.lang.String sName)
Add a sequence name for table captions. |
boolean |
bookmarkInHeading(java.lang.String sName)
Is this bookmark contained in a heading? |
StyleWithProperties |
getCellStyle(java.lang.String sName)
|
OfficeStyleFamily |
getCellStyles()
|
static int |
getCharacterCount(org.w3c.dom.Node node)
Counts the number of characters (text nodes) in this element excluding footnotes etc. |
StyleWithProperties |
getColumnStyle(java.lang.String sName)
|
OfficeStyleFamily |
getColumnStyles()
|
org.w3c.dom.Element |
getContent()
Get the content element In the old file format this means the office:body element
In the OpenDocument format this means a office:text ,
office:spreadsheet or office:presentation
element. |
StyleWithProperties |
getDefaultCellStyle()
|
StyleWithProperties |
getDefaultDrawingPageStyle()
|
StyleWithProperties |
getDefaultFrameStyle()
|
StyleWithProperties |
getDefaultParStyle()
|
StyleWithProperties |
getDefaultPresentationStyle()
|
StyleWithProperties |
getDrawingPageStyle(java.lang.String sName)
|
OfficeStyleFamily |
getDrawingPageStyles()
|
PropertySet |
getEndnotesConfiguration()
|
MasterPage |
getFirstMasterPage()
Returns the first master page used in the document. |
FontDeclaration |
getFontDeclaration(java.lang.String sName)
Get a specific font declaration |
OfficeStyleFamily |
getFontDeclarations()
Get the collection of all font declarations. |
PropertySet |
getFootnotesConfiguration()
|
FormsReader |
getForms()
Get the forms belonging to this document. |
StyleWithProperties |
getFrameStyle(java.lang.String sName)
|
OfficeStyleFamily |
getFrameStyles()
|
StyleWithProperties |
getHeadingStyle(int nLevel)
Returns the paragraph style associated with headings of a specific level. |
ListStyle |
getListStyle(java.lang.String sName)
|
OfficeStyleFamily |
getListStyles()
|
java.lang.String |
getMajorityLanguage()
Return the iso language used in most paragaph styles (in a well-structured document this will be the default language) TODO: Base on content rather than style |
MasterPage |
getMasterPage(java.lang.String sName)
|
OfficeStyleFamily |
getMasterPages()
|
static char |
getNextChar(org.w3c.dom.Node node)
Return the next character in logical order |
ListStyle |
getOutlineStyle()
|
PageLayout |
getPageLayout(java.lang.String sName)
|
OfficeStyleFamily |
getPageLayouts()
|
StyleWithProperties |
getParStyle(java.lang.String sName)
|
OfficeStyleFamily |
getParStyles()
|
StyleWithProperties |
getPresentationStyle(java.lang.String sName)
|
OfficeStyleFamily |
getPresentationStyles()
|
StyleWithProperties |
getRowStyle(java.lang.String sName)
|
OfficeStyleFamily |
getRowStyles()
|
StyleWithProperties |
getSectionStyle(java.lang.String sName)
|
OfficeStyleFamily |
getSectionStyles()
|
java.lang.String |
getSequenceFromRef(java.lang.String sRefName)
Get the sequence name associated with a reference name |
java.lang.String |
getSequenceName(org.w3c.dom.Element par)
Get the sequence name associated with a paragraph |
TableReader |
getTableReader(org.w3c.dom.Element node)
Read a table from a table:table node |
StyleWithProperties |
getTableStyle(java.lang.String sName)
|
OfficeStyleFamily |
getTableStyles()
|
java.lang.String |
getTextContent(org.w3c.dom.Node node)
|
StyleWithProperties |
getTextStyle(java.lang.String sName)
|
OfficeStyleFamily |
getTextStyles()
|
TocReader |
getTocReader(org.w3c.dom.Element onode)
Returns a reader for a specific toc |
boolean |
hasBookmarkRefTo(java.lang.String sName)
Is there a reference to this bookmark? |
boolean |
hasEndnoteRefTo(java.lang.String sId)
Is there a reference to this endnote? |
boolean |
hasFootnoteRefTo(java.lang.String sId)
Is there a reference to this footnote id? |
boolean |
hasLinkTo(java.lang.String sName)
Is there a link to this sequence anchor name? |
boolean |
hasReferenceRefTo(java.lang.String sName)
Is there a reference to this reference mark? |
boolean |
hasSequenceRefTo(java.lang.String sId)
Is there a reference to this sequence field? |
static boolean |
isDrawElement(org.w3c.dom.Node node)
Checks, if a node is an element in the draw namespace |
boolean |
isFigureSequenceName(java.lang.String sName)
Does this sequence name belong to a lof? |
boolean |
isIndexSourceStyle(java.lang.String sStyleName)
Is this style used in some toc as an index source style? |
boolean |
isInPackage(java.lang.String sUrl)
Checks whether this url is internal to the package |
static boolean |
isNoteElement(org.w3c.dom.Node node)
Checks, if a node is an element representing a note (footnote/endnote) |
boolean |
isOpenDocument()
Is this an OASIS OpenDocument or an OOo 1.0 document? |
boolean |
isPackageFormat()
Checks whether or not this document is in package format |
boolean |
isPresentation()
Is this a presentation document? |
static boolean |
isSingleParagraph(org.w3c.dom.Node node)
Checks, if this node contains at most one element, and that this is a paragraph. |
boolean |
isSpreadsheet()
Is this a spreadsheet document? |
static boolean |
isTableElement(org.w3c.dom.Node node)
Checks, if a node is an element in the table namespace |
boolean |
isTableSequenceName(java.lang.String sName)
Does this sequence name belong to a lot? |
boolean |
isText()
Is this an text document? |
static boolean |
isTextElement(org.w3c.dom.Node node)
Checks, if a node is an element in the text namespace |
static boolean |
isWhitespace(java.lang.String s)
Checks, if this text is whitespace |
static boolean |
isWhitespaceContent(org.w3c.dom.Node node)
Checks, if the only text content of this node is whitespace |
boolean |
referenceMarkInHeading(java.lang.String sName)
Is this reference mark contained in a heading? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OfficeReader(OfficeDocument oooDoc, boolean bAllParagraphsAreSoft)
Method Detail |
---|
public static boolean isTextElement(org.w3c.dom.Node node)
node
- the node to check
public static boolean isTableElement(org.w3c.dom.Node node)
node
- the node to check
public static boolean isDrawElement(org.w3c.dom.Node node)
node
- the node to check
public static boolean isNoteElement(org.w3c.dom.Node node)
node
- the node to check
public static boolean isSingleParagraph(org.w3c.dom.Node node)
node
- the node to check
public static boolean isWhitespaceContent(org.w3c.dom.Node node)
Checks, if the only text content of this node is whitespace
node
- the node to check (should be a paragraph node or a child
of a paragraph node)
public static boolean isWhitespace(java.lang.String s)
Checks, if this text is whitespace
s
- the String to check
public static int getCharacterCount(org.w3c.dom.Node node)
node
- the node to count in
public java.lang.String getTextContent(org.w3c.dom.Node node)
public static char getNextChar(org.w3c.dom.Node node)
public boolean isPackageFormat()
public boolean isInPackage(java.lang.String sUrl)
sUrl
- the url to check
public OfficeStyleFamily getFontDeclarations()
Get the collection of all font declarations.
OfficeStyleFamily
of font declarationspublic FontDeclaration getFontDeclaration(java.lang.String sName)
Get a specific font declaration
sName
- the name of the font declaration
FontDeclaration
representing the fontpublic OfficeStyleFamily getTextStyles()
public StyleWithProperties getTextStyle(java.lang.String sName)
public OfficeStyleFamily getParStyles()
public StyleWithProperties getParStyle(java.lang.String sName)
public StyleWithProperties getDefaultParStyle()
public OfficeStyleFamily getSectionStyles()
public StyleWithProperties getSectionStyle(java.lang.String sName)
public OfficeStyleFamily getTableStyles()
public StyleWithProperties getTableStyle(java.lang.String sName)
public OfficeStyleFamily getColumnStyles()
public StyleWithProperties getColumnStyle(java.lang.String sName)
public OfficeStyleFamily getRowStyles()
public StyleWithProperties getRowStyle(java.lang.String sName)
public OfficeStyleFamily getCellStyles()
public StyleWithProperties getCellStyle(java.lang.String sName)
public StyleWithProperties getDefaultCellStyle()
public OfficeStyleFamily getFrameStyles()
public StyleWithProperties getFrameStyle(java.lang.String sName)
public StyleWithProperties getDefaultFrameStyle()
public OfficeStyleFamily getPresentationStyles()
public StyleWithProperties getPresentationStyle(java.lang.String sName)
public StyleWithProperties getDefaultPresentationStyle()
public OfficeStyleFamily getDrawingPageStyles()
public StyleWithProperties getDrawingPageStyle(java.lang.String sName)
public StyleWithProperties getDefaultDrawingPageStyle()
public OfficeStyleFamily getListStyles()
public ListStyle getListStyle(java.lang.String sName)
public OfficeStyleFamily getPageLayouts()
public PageLayout getPageLayout(java.lang.String sName)
public OfficeStyleFamily getMasterPages()
public MasterPage getMasterPage(java.lang.String sName)
public ListStyle getOutlineStyle()
public PropertySet getFootnotesConfiguration()
public PropertySet getEndnotesConfiguration()
public StyleWithProperties getHeadingStyle(int nLevel)
Returns the paragraph style associated with headings of a specific
level. Returns null
if no such style is known.
In principle, different styles can be used for each heading, in practice the same (soft) style is used for all headings of a specific level.
nLevel
- the level of the heading
StyleWithProperties
object representing the stylepublic MasterPage getFirstMasterPage()
Returns the first master page used in the document. If no master page is used explicitly, the first master page found in the styles is returned. Returns null if no master pages exists.
MasterPage
object representing the master pagepublic java.lang.String getMajorityLanguage()
public TocReader getTocReader(org.w3c.dom.Element onode)
Returns a reader for a specific toc
onode
- the text:table-of-content-node
public boolean isIndexSourceStyle(java.lang.String sStyleName)
Is this style used in some toc as an index source style?
sStyleName
- the name of the style
public boolean isFigureSequenceName(java.lang.String sName)
Does this sequence name belong to a lof?
sName
- the name of the sequence
public boolean isTableSequenceName(java.lang.String sName)
Does this sequence name belong to a lot?
sName
- the name of the sequence
public void addTableSequenceName(java.lang.String sName)
Add a sequence name for table captions.
OpenDocument has a very weak notion of table captions: A caption is a paragraph containing a text:sequence element. Moreover, the only source to identify which sequence number to use is the list(s) of tables. If there's no list of tables, captions cannot be identified. Thus this method lets the user add a sequence name to identify the table captions.
sName
- the name to addpublic void addFigureSequenceName(java.lang.String sName)
Add a sequence name for figure captions.
OpenDocument has a very weak notion of figure captions: A caption is a paragraph containing a text:sequence element. Moreover, the only source to identify which sequence number to use is the list(s) of figures. If there's no list of figures, captions cannot be identified. Thus this method lets the user add a sequence name to identify the figure captions.
sName
- the name to addpublic java.lang.String getSequenceName(org.w3c.dom.Element par)
Get the sequence name associated with a paragraph
par
- the paragraph to look up
public java.lang.String getSequenceFromRef(java.lang.String sRefName)
Get the sequence name associated with a reference name
sRefName
- the reference name to use
public boolean hasFootnoteRefTo(java.lang.String sId)
Is there a reference to this footnote id?
sId
- the id of the footnote
public boolean hasEndnoteRefTo(java.lang.String sId)
Is there a reference to this endnote?
sId
- the id of the endnote
public boolean referenceMarkInHeading(java.lang.String sName)
sName
- the name of the reference mark
public boolean hasReferenceRefTo(java.lang.String sName)
sName
- the name of the reference mark
public boolean bookmarkInHeading(java.lang.String sName)
sName
- the name of the bookmark
public boolean hasBookmarkRefTo(java.lang.String sName)
Is there a reference to this bookmark?
sName
- the name of the bookmark
public boolean hasSequenceRefTo(java.lang.String sId)
Is there a reference to this sequence field?
sId
- the id of the sequence field
public boolean hasLinkTo(java.lang.String sName)
Is there a link to this sequence anchor name?
sName
- the name of the anchor
public boolean isOpenDocument()
Is this an OASIS OpenDocument or an OOo 1.0 document?
public boolean isText()
Is this an text document?
public boolean isSpreadsheet()
Is this a spreadsheet document?
public boolean isPresentation()
Is this a presentation document?
public org.w3c.dom.Element getContent()
Get the content element
In the old file format this means the office:body
element
In the OpenDocument format this means a office:text
,
office:spreadsheet
or office:presentation
element.
Element
public FormsReader getForms()
Get the forms belonging to this document.
FormsReader
representing the formspublic TableReader getTableReader(org.w3c.dom.Element node)
Read a table from a table:table node
node
- the table:table Element node
TableReader
object representing the table
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |