ru.novosoft.dc.rtf.dom
Class DocumentContext

java.lang.Object
  |
  +--ru.novosoft.dc.core.util.Flags
        |
        +--ru.novosoft.dc.rtf.dom.DocumentContext

public class DocumentContext
extends Flags
implements Compatibility

Document context contains document properties.


Fields inherited from interface ru.novosoft.dc.rtf.dom.objects.Compatibility
ALIGN_TABLE_ROWS_TOGETHER, ALLOW_FIELD_END_SELECT, ALLOW_HANGING_PUNCTUATION, ASIAN_BREAK_RULES, CVMME, DONOT_BALANCE_SBCS_DBCS, DONOT_BREAK_WRAPPED_TABLES, DONOT_CENTER_EXACT_LINES, DONOT_LAYOUT_TABLES_RAW_WIDTH, DONOT_SHOW_COMMENTS, DONOT_SHOW_FORMATTING, DONOT_SHOW_MARKUP, DONOT_SHOW_REVIEWING, DONOT_UNDERLINE_TRALING_SPACES, EXPAND_SHIFT_RETURN, HTML_AUTO_SPACING, LAYOUT_TABLE_ROWS_TOGETHER, LINE_BREAKING_RULES, MAC_SMALL_CAPS, NO_AUTO_TAB, NO_BACKSLASH_TO_YEN, NO_COLUMN_BALANCE, NO_EXTERNAL_LEADING, NO_EXTRA_SPACE_AT_SHIFT, NO_LINE_HEIGHT_ADJUST_IN_TABLE, NO_SPACE_FOR_UNDERLINE, OLD_AUTO_SPACING, OLD_AUTOSHAPES_LAYOUT, OLD_BORDER_RULES, OLD_FOOTNOTES_LAYOUT, OLD_LINE_WRAP, OLD_TABLE_BORDERS, PRINT_AS_BLACK, PRINT_BODY_BEFORE_HEADER, REMOVE_PERSONAL_INFO, SHOW_BREAKS_IN_FRAMES, SNAP_GRID_TO_CELL, SUBSTITUTE_FONTS_BY_SIZE, SUPPRESS_BOTTOM_SPACE, SUPPRESS_LINE_SPACING, SUPPRESS_SPACE_AT_BREAK, SUPPRESS_TOP_SPACE, SWAP_BORDERS, THAI_BREAK_RULES, TOP_LINE_PUNCT_COMPRESS, TRANSPARENT_METAFILES, TRUNCATE_EXTRA_SPACE, TRUNCATE_FONT_HEIGHT, USE_LAST_TAB_ALIGNMENT, USE_PRINTER_METRICS, VIEW_NO_BOUND, WORDPERFECT_JUSTIFY, WORDPERFECT_SPACING, WORDPERFECT_TABS, WRAP_TRAILING_SPACES
 
Constructor Summary
DocumentContext(boolean oldMargins)
          Constructor.
 
Method Summary
 FootnoteContext defineFootnoteContext()
          Create a new footnote context if it does not defined yet and return it.
 DocumentVariables defineVariables()
          Create document variables if they are not defined yet and return them.
 void exportTo(org.w3c.dom.Element elem)
          Export the contents of this object to the specified DOM element.
 FootnoteContext footnoteContext()
          Return the footnote context or null if it does not defined.
 int getGutterStyle()
          Return the gutter style.
 int getTabWidth()
          Return the tab width in twips.
 boolean hasWidowOrphan()
          Return true if the widow/orphan control is turned on.
 boolean isTwoSide()
          Return true if two-side layout is set.
 Layout layout()
          Return the document layout parameters.
 void setGutterStyle(int value)
          Set the gutter style: 0 - left gutter (default), 1 - right gutter, (-1) - parallel (top) gutter.
 void setTabWidth(int value)
          Set a tab width in twips (default tab width is 720).
 void twoSide()
          Set two-side layout meaning different left and right headers and footers.
 DocumentVariables variables()
          Return the document variables or null if no variables defined.
 void widowOrphan()
          Turn the widow/orphan control on.
 
Methods inherited from class ru.novosoft.dc.core.util.Flags
clone, equals, flags, has, set, size
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentContext

public DocumentContext(boolean oldMargins)
Constructor. If oldMargins==true, the old values of margins are used while construction the default layout.
Method Detail

layout

public final Layout layout()
Return the document layout parameters.

widowOrphan

public final void widowOrphan()
Turn the widow/orphan control on.

hasWidowOrphan

public final boolean hasWidowOrphan()
Return true if the widow/orphan control is turned on.

setGutterStyle

public final void setGutterStyle(int value)
Set the gutter style: 0 - left gutter (default), 1 - right gutter, (-1) - parallel (top) gutter.

getGutterStyle

public final int getGutterStyle()
Return the gutter style.

twoSide

public final void twoSide()
Set two-side layout meaning different left and right headers and footers.

isTwoSide

public final boolean isTwoSide()
Return true if two-side layout is set.

setTabWidth

public final void setTabWidth(int value)
Set a tab width in twips (default tab width is 720).

getTabWidth

public final int getTabWidth()
Return the tab width in twips.

defineFootnoteContext

public final FootnoteContext defineFootnoteContext()
Create a new footnote context if it does not defined yet and return it.

footnoteContext

public final FootnoteContext footnoteContext()
Return the footnote context or null if it does not defined.

defineVariables

public final DocumentVariables defineVariables()
Create document variables if they are not defined yet and return them.

variables

public final DocumentVariables variables()
Return the document variables or null if no variables defined.

exportTo

public void exportTo(org.w3c.dom.Element elem)
Export the contents of this object to the specified DOM element.