EPUB export dialog

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@82 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2010-12-30 06:56:54 +00:00
parent 0dcc851a33
commit 1e57f500c9
9 changed files with 120 additions and 83 deletions

View file

@ -2,18 +2,18 @@ Changelog for Writer2LaTeX version 1.0 -> 1.2
---------- version 1.1.9 ---------- ---------- version 1.1.9 ----------
[w2x] *New option include_toc (default true) for EPUB export: If set to false, the table of content will not be exported [w2x] New option include_toc (default true) for EPUB export: If set to false, the table of content will not be exported
[w2x] *New option split_after (default 0) for EPUB export: This sets the number of characters (in thousands) after [w2x] New option split_after (default 0) for EPUB export: This sets the number of characters (in thousands) after
which an automatic split will occur (0 means no automatic split) which an automatic split will occur (0 means no automatic split)
[w2x] *New options use_default_font (default false) and default_font_name (default empty) for EPUB export. [w2x] New options use_default_font (default false) and default_font_name (default empty).
If the former is true, font names are not exported, but the latter will be exported as default font (if non-empty) If the former is true, font names are not exported, but the latter will be exported as default font (if non-empty)
[w2x] *New options relative_font_size (default false) and font_scaling (default 100%) for EPUB export. [w2x] New options relative_font_size (default false) and font_scaling (default 100%) for EPUB export.
If the former is true, relative font sizes are used, scaled by the percentage given by the latter If the former is true, relative font sizes are used, scaled by the percentage given by the latter
[w2x] *EPUB export now has its own export dialog [w2x] EPUB export now has its own export dialog
[all] *API change: Added the method readResource to the Converter interface (only used by EPUB export currently) [all] *API change: Added the method readResource to the Converter interface (only used by EPUB export currently)

View file

@ -20,13 +20,13 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.2 (2010-12-28) * Version 1.2 (2010-12-29)
* *
*/ */
// TODO: Add to doc: // TODO: Add to doc:
// New options relative_font_size, font_scaling, use_default_font, default_font_name, split_after, page_break_split, include_toc // New options relative_font_size, font_scaling, use_default_font, default_font_name, split_after, page_break_split, include_toc
// Also add to list of possible locked options external_toc_depth // Also add to list of possible locked options external_toc_depth, display_hidden_text
package org.openoffice.da.comp.writer2xhtml; package org.openoffice.da.comp.writer2xhtml;
@ -39,7 +39,7 @@ import com.sun.star.uno.XComponentContext;
import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper; import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper;
import org.openoffice.da.comp.w2lcommon.filter.OptionsDialogBase; import org.openoffice.da.comp.w2lcommon.filter.OptionsDialogBase;
/** This class provides a uno component which implements a filter ui for the /** This class provides a UNO component which implements a filter UI for the
* EPUB export * EPUB export
*/ */
public class EpubOptionsDialog extends OptionsDialogBase { public class EpubOptionsDialog extends OptionsDialogBase {
@ -98,7 +98,7 @@ public class EpubOptionsDialog extends OptionsDialogBase {
loadCheckBoxOption(xProps, "IgnoreEmptyParagraphs"); loadCheckBoxOption(xProps, "IgnoreEmptyParagraphs");
loadCheckBoxOption(xProps, "IgnoreDoubleSpaces"); loadCheckBoxOption(xProps, "IgnoreDoubleSpaces");
// Files // Document division
loadCheckBoxOption(xProps, "Split"); loadCheckBoxOption(xProps, "Split");
loadListBoxOption(xProps, "SplitLevel"); loadListBoxOption(xProps, "SplitLevel");
loadCheckBoxOption(xProps, "UsePageBreakSplit"); loadCheckBoxOption(xProps, "UsePageBreakSplit");
@ -106,7 +106,7 @@ public class EpubOptionsDialog extends OptionsDialogBase {
loadCheckBoxOption(xProps, "UseSplitAfter"); loadCheckBoxOption(xProps, "UseSplitAfter");
loadNumericOption(xProps, "SplitAfter"); loadNumericOption(xProps, "SplitAfter");
// Table of contents // Navigation table
loadListBoxOption(xProps, "ExternalTocDepth"); loadListBoxOption(xProps, "ExternalTocDepth");
loadCheckBoxOption(xProps, "IncludeToc"); loadCheckBoxOption(xProps, "IncludeToc");
@ -145,7 +145,7 @@ public class EpubOptionsDialog extends OptionsDialogBase {
saveCheckBoxOption(xProps, helper, "IgnoreEmptyParagraphs", "ignore_empty_paragraphs"); saveCheckBoxOption(xProps, helper, "IgnoreEmptyParagraphs", "ignore_empty_paragraphs");
saveCheckBoxOption(xProps, helper, "IgnoreDoubleSpaces", "ignore_double_spaces"); saveCheckBoxOption(xProps, helper, "IgnoreDoubleSpaces", "ignore_double_spaces");
// Files // Document division
boolean bSplit = saveCheckBoxOption(xProps, "Split"); boolean bSplit = saveCheckBoxOption(xProps, "Split");
short nSplitLevel = saveListBoxOption(xProps, "SplitLevel"); short nSplitLevel = saveListBoxOption(xProps, "SplitLevel");
if (!isLocked("split_level")) { if (!isLocked("split_level")) {
@ -176,17 +176,17 @@ public class EpubOptionsDialog extends OptionsDialogBase {
int nSplitAfter = saveNumericOption(xProps, "SplitAfter"); int nSplitAfter = saveNumericOption(xProps, "SplitAfter");
if (!isLocked("split_after")) { if (!isLocked("split_after")) {
if (bUseSplitAfter) { if (bUseSplitAfter) {
helper.put("split_after", nSplitAfter); helper.put("split_after", Integer.toString(nSplitAfter));
} }
else { else {
helper.put("split_after", 0); helper.put("split_after", "0");
} }
} }
// Table of contents // Navigation table
short nExternalTocDepth = saveListBoxOption(xProps, "ExternalTocDepth"); short nExternalTocDepth = saveListBoxOption(xProps, "ExternalTocDepth");
helper.put("external_toc_depth", nExternalTocDepth+1); helper.put("external_toc_depth", Integer.toString(nExternalTocDepth+1));
saveCheckBoxOption(xProps, "IncludeToc"); saveCheckBoxOption(xProps, helper, "IncludeToc", "include_toc");
} }
@ -251,7 +251,7 @@ public class EpubOptionsDialog extends OptionsDialogBase {
setControlEnabled("IgnoreEmptyParagraphs",!isLocked("ignore_empty_paragraphs")); setControlEnabled("IgnoreEmptyParagraphs",!isLocked("ignore_empty_paragraphs"));
setControlEnabled("IgnoreDoubleSpaces",!isLocked("ignore_double_spaces")); setControlEnabled("IgnoreDoubleSpaces",!isLocked("ignore_double_spaces"));
// Files // Document division
boolean bSplit = getCheckBoxStateAsBoolean("Split"); boolean bSplit = getCheckBoxStateAsBoolean("Split");
setControlEnabled("Split",!isLocked("split_level")); setControlEnabled("Split",!isLocked("split_level"));
setControlEnabled("SplitLevelLabel",!isLocked("split_level") && bSplit); setControlEnabled("SplitLevelLabel",!isLocked("split_level") && bSplit);
@ -267,7 +267,7 @@ public class EpubOptionsDialog extends OptionsDialogBase {
setControlEnabled("SplitAfterLabel",!isLocked("split_after") && bUseSplitAfter); setControlEnabled("SplitAfterLabel",!isLocked("split_after") && bUseSplitAfter);
setControlEnabled("SplitAfter",!isLocked("split_after") && bUseSplitAfter); setControlEnabled("SplitAfter",!isLocked("split_after") && bUseSplitAfter);
// Table of contents // Navigation table
setControlEnabled("ExternalTocDepthLabel", !isLocked("external_toc_depth")); setControlEnabled("ExternalTocDepthLabel", !isLocked("external_toc_depth"));
setControlEnabled("ExternalTocDepth", !isLocked("external_toc_depth")); setControlEnabled("ExternalTocDepth", !isLocked("external_toc_depth"));
setControlEnabled("IncludeToc", !isLocked("include_toc")); setControlEnabled("IncludeToc", !isLocked("include_toc"));

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.2 (2010-12-16) * Version 1.2 (2010-12-29)
* *
*/ */
@ -33,7 +33,7 @@ public class ConverterFactory {
// Version information // Version information
private static final String VERSION = "1.1.9"; private static final String VERSION = "1.1.9";
private static final String DATE = "2010-12-16"; private static final String DATE = "2010-12-29";
/** Return the Writer2LaTeX version in the form /** Return the Writer2LaTeX version in the form
* (major version).(minor version).(patch level)<br/> * (major version).(minor version).(patch level)<br/>

View file

@ -190,15 +190,15 @@ public class OPFWriter extends NewDOMDocument {
} }
} }
// Fall back values for creator and date // Fall back values for identifier, creator and date
if (!bHasIdentifier) {
// Create a universal unique ID
sUID = UUID.randomUUID().toString();
Element identifier = appendElement(contentDOM, metadata, "dc:identifier", sUID);
identifier.setAttribute("id", "BookId");
identifier.setAttribute("opf:scheme", "UUID");
}
if (bUseDublinCore) { if (bUseDublinCore) {
if (!bHasIdentifier) {
// Create a universal unique ID
sUID = UUID.randomUUID().toString();
Element identifier = appendElement(contentDOM, metadata, "dc:identifier", sUID);
identifier.setAttribute("id", "BookId");
identifier.setAttribute("opf:scheme", "UUID");
}
if (!bHasCreator && cr.getMetaData().getCreator().length()>0) { if (!bHasCreator && cr.getMetaData().getCreator().length()>0) {
appendElement(contentDOM, metadata, "dc:creator", cr.getMetaData().getCreator()); appendElement(contentDOM, metadata, "dc:creator", cr.getMetaData().getCreator());
} }

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.2 (2010-05-09) * Version 1.2 (2010-12-29)
* *
*/ */
@ -138,6 +138,9 @@ class StyleConverter extends ConverterHelper {
CSVList props = new CSVList(";"); CSVList props = new CSVList(";");
// text properties only! // text properties only!
getTextSc().cssTextCommon(defaultStyle,props,true); getTextSc().cssTextCommon(defaultStyle,props,true);
if (config.useDefaultFont() && config.defaultFontName().length()>0) {
props.addValue("font-family", "'"+config.defaultFontName()+"'");
}
buf.append(sIndent) buf.append(sIndent)
.append("body {").append(props.toString()).append("}").append(config.prettyPrint() ? "\n" : " "); .append("body {").append(props.toString()).append("}").append(config.prettyPrint() ? "\n" : " ");
} }

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.2 (2010-11-28) * Version 1.2 (2010-12-29)
* *
*/ */
@ -83,7 +83,7 @@ public class TextConverter extends ConverterHelper {
// Some (Sony?) EPUB readers have a limit on the file size of individual files // Some (Sony?) EPUB readers have a limit on the file size of individual files
// In any case very large files could be a performance problem, hence we do automatic splitting // In any case very large files could be a performance problem, hence we do automatic splitting
// after this number of characters. TODO: Make configurable. // after this number of characters. TODO: Make configurable.
private static final int EPUB_CHARACTER_COUNT_TRESHOLD = 150000; private int nSplitAfter = 150000;
private int nPageBreakSplit = XhtmlConfig.NONE; // Should we split at page breaks? private int nPageBreakSplit = XhtmlConfig.NONE; // Should we split at page breaks?
// TODO: Collect soft page breaks between table rows // TODO: Collect soft page breaks between table rows
private boolean bPendingPageBreak = false; // We have encountered a page break which should be inserted asap private boolean bPendingPageBreak = false; // We have encountered a page break which should be inserted asap
@ -145,9 +145,10 @@ public class TextConverter extends ConverterHelper {
public TextConverter(OfficeReader ofr, XhtmlConfig config, Converter converter) { public TextConverter(OfficeReader ofr, XhtmlConfig config, Converter converter) {
super(ofr,config,converter); super(ofr,config,converter);
nSplitAfter = 1000*config.splitAfter();
nPageBreakSplit = config.pageBreakSplit(); nPageBreakSplit = config.pageBreakSplit();
nSplit = config.getXhtmlSplitLevel(); nSplit = config.getXhtmlSplitLevel();
nRepeatLevels = config.getXhtmlRepeatLevels(); nRepeatLevels = converter.isOPS() ? 0 : config.getXhtmlRepeatLevels(); // never repeat headings in EPUB
nExternalTocDepth = config.externalTocDepth(); nExternalTocDepth = config.externalTocDepth();
if (nExternalTocDepth==0) { // A value of zero means auto (i.e. determine from split level) if (nExternalTocDepth==0) { // A value of zero means auto (i.e. determine from split level)
nExternalTocDepth = Math.max(nSplit,1); nExternalTocDepth = Math.max(nSplit,1);
@ -537,7 +538,7 @@ public class TextConverter extends ConverterHelper {
if (getPageBreak(style)) { if (getPageBreak(style)) {
return doMaybeSplit(node, 0); return doMaybeSplit(node, 0);
} }
if (converter.isOPS() && nCharacterCount>EPUB_CHARACTER_COUNT_TRESHOLD) { if (converter.isOPS() && nSplitAfter>0 && nCharacterCount>nSplitAfter) {
return doMaybeSplit(node, 0); return doMaybeSplit(node, 0);
} }
if (nLevel>=0) { if (nLevel>=0) {
@ -1168,25 +1169,29 @@ public class TextConverter extends ConverterHelper {
/* Process table of contents /* Process table of contents
*/ */
private void handleTOC(Node onode, Node hnode) { private void handleTOC(Node onode, Node hnode) {
if (!ofr.getTocReader((Element)onode).isByChapter()) { if (!config.includeToc()) { return; }
nTocFileIndex = converter.getOutFileIndex();
}
converter.setTocFile(null);
Element div = converter.createElement("div"); if (!ofr.getTocReader((Element)onode).isByChapter()) {
hnode.appendChild(div); nTocFileIndex = converter.getOutFileIndex();
}
IndexData data = new IndexData(); converter.setTocFile(null);
data.nOutFileIndex = converter.getOutFileIndex();
data.onode = (Element) onode; Element div = converter.createElement("div");
data.chapter = currentChapter; hnode.appendChild(div);
data.hnode = (Element) div;
indexes.add(data); // to be processed later with generateTOC IndexData data = new IndexData();
data.nOutFileIndex = converter.getOutFileIndex();
data.onode = (Element) onode;
data.chapter = currentChapter;
data.hnode = (Element) div;
indexes.add(data); // to be processed later with generateTOC
} }
private void generateToc(IndexData data) { private void generateToc(IndexData data) {
Element onode = data.onode; if (!config.includeToc()) { return; }
Element onode = data.onode;
Element chapter = data.chapter; Element chapter = data.chapter;
Element div = data.hnode; Element div = data.hnode;

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.2 (2010-12-08) * Version 1.2 (2010-12-29)
* *
*/ */
@ -66,20 +66,25 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
// Export font sizes as percentages? // Export font sizes as percentages?
private boolean bRelativeFontSize = false; private boolean bRelativeFontSize = false;
private String sFontScaling = "100%";
private String sBaseFontSize = "12pt"; private String sBaseFontSize = "12pt";
// Use default font?
private boolean bConvertFont = false;
/** Create a new <code>TextStyleConverter</code> /** Create a new <code>TextStyleConverter</code>
* @param ofr an <code>OfficeReader</code> to read style information from * @param ofr an <code>OfficeReader</code> to read style information from
* @param config the configuration to use * @param config the configuration to use
* @param converter the main <code>Converter</code> class * @param converter the main <code>Converter</code> class
* @param nType the type of xhtml to use * @param nType the type of XHTML to use
*/ */
public TextStyleConverter(OfficeReader ofr, XhtmlConfig config, Converter converter, int nType) { public TextStyleConverter(OfficeReader ofr, XhtmlConfig config, Converter converter, int nType) {
super(ofr,config,converter,nType); super(ofr,config,converter,nType);
this.styleMap = config.getXTextStyleMap(); this.styleMap = config.getXTextStyleMap();
this.bConvertStyles = config.xhtmlFormatting()==XhtmlConfig.CONVERT_ALL || config.xhtmlFormatting()==XhtmlConfig.IGNORE_HARD; this.bConvertStyles = config.xhtmlFormatting()==XhtmlConfig.CONVERT_ALL || config.xhtmlFormatting()==XhtmlConfig.IGNORE_HARD;
this.bConvertHard = config.xhtmlFormatting()==XhtmlConfig.CONVERT_ALL || config.xhtmlFormatting()==XhtmlConfig.IGNORE_STYLES; this.bConvertHard = config.xhtmlFormatting()==XhtmlConfig.CONVERT_ALL || config.xhtmlFormatting()==XhtmlConfig.IGNORE_STYLES;
this.bRelativeFontSize = converter.isOPS() && config.xhtmlConvertToPx(); this.bRelativeFontSize = converter.isOPS() && config.relativeFontSize();
this.sFontScaling = config.fontScaling();
StyleWithProperties defaultStyle = ofr.getDefaultParStyle(); StyleWithProperties defaultStyle = ofr.getDefaultParStyle();
if (defaultStyle!=null) { if (defaultStyle!=null) {
String sFontSize = defaultStyle.getProperty(XMLString.FO_FONT_SIZE,false); String sFontSize = defaultStyle.getProperty(XMLString.FO_FONT_SIZE,false);
@ -87,6 +92,7 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
sBaseFontSize = sFontSize; sBaseFontSize = sFontSize;
} }
} }
this.bConvertFont = !config.useDefaultFont();
} }
/** Apply a link style, using a combination of two text styles /** Apply a link style, using a combination of two text styles
@ -249,7 +255,7 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
CSVList val; CSVList val;
// Font family // Font family
if (bInherit || style.getProperty(XMLString.STYLE_FONT_NAME,false)!=null) { if (bConvertFont && (bInherit || style.getProperty(XMLString.STYLE_FONT_NAME,false)!=null)) {
val = new CSVList(","); // multivalue property! val = new CSVList(","); // multivalue property!
// Get font family information from font declaration or from style // Get font family information from font declaration or from style
s = style.getProperty(XMLString.STYLE_FONT_NAME); s = style.getProperty(XMLString.STYLE_FONT_NAME);
@ -312,7 +318,7 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
} }
if (s!=null) { if (s!=null) {
if (bRelativeFontSize) { if (bRelativeFontSize) {
String sFontSize = Misc.divide(Misc.multiply(s4,s), sBaseFontSize); String sFontSize = Misc.divide(Misc.multiply(sFontScaling, Misc.multiply(s4,s)), sBaseFontSize);
if (!"100%".equals(sFontSize)) props.addValue("font-size", sFontSize); if (!"100%".equals(sFontSize)) props.addValue("font-size", sFontSize);
} }
else { else {
@ -328,7 +334,7 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
} }
else if (s!=null) { else if (s!=null) {
if (bRelativeFontSize) { if (bRelativeFontSize) {
String sFontSize = Misc.divide(s,sBaseFontSize); String sFontSize = Misc.divide(Misc.multiply(sFontScaling, s),sBaseFontSize);
if (!"100%".equals(sFontSize)) props.addValue("font-size", sFontSize); if (!"100%".equals(sFontSize)) props.addValue("font-size", sFontSize);
} }
else { else {

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.2 (2010-11-28) * Version 1.2 (2010-12-28)
* *
*/ */
@ -41,7 +41,7 @@ import writer2latex.util.Misc;
public class XhtmlConfig extends writer2latex.base.ConfigBase { public class XhtmlConfig extends writer2latex.base.ConfigBase {
// Implement configuration methods // Implement configuration methods
protected int getOptionCount() { return 47; } protected int getOptionCount() { return 53; }
protected String getDefaultConfigPath() { return "/writer2latex/xhtml/config/"; } protected String getDefaultConfigPath() { return "/writer2latex/xhtml/config/"; }
// Override setOption: To be backwards compatible, we must accept options // Override setOption: To be backwards compatible, we must accept options
@ -103,33 +103,39 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
private static final int TABLE_FORMATTING = 17; private static final int TABLE_FORMATTING = 17;
private static final int IGNORE_TABLE_DIMENSIONS = 18; private static final int IGNORE_TABLE_DIMENSIONS = 18;
private static final int LIST_FORMATTING = 19; private static final int LIST_FORMATTING = 19;
private static final int USE_DUBLIN_CORE = 20; private static final int USE_DEFAULT_FONT = 20;
private static final int NOTES = 21; private static final int DEFAULT_FONT_NAME = 21;
private static final int DISPLAY_HIDDEN_TEXT = 22; private static final int USE_DUBLIN_CORE = 22;
private static final int CONVERT_TO_PX = 23; private static final int NOTES = 23;
private static final int SCALING = 24; private static final int DISPLAY_HIDDEN_TEXT = 24;
private static final int COLUMN_SCALING = 25; private static final int CONVERT_TO_PX = 25;
private static final int FLOAT_OBJECTS = 26; private static final int SCALING = 26;
private static final int TABSTOP_STYLE = 27; private static final int COLUMN_SCALING = 27;
private static final int FORMULAS = 28; private static final int RELATIVE_FONT_SIZE = 28;
private static final int ENDNOTES_HEADING = 29; private static final int FONT_SCALING = 29;
private static final int EXTERNAL_TOC_DEPTH = 30; private static final int FLOAT_OBJECTS = 30;
private static final int SPLIT_LEVEL = 31; private static final int TABSTOP_STYLE = 31;
private static final int REPEAT_LEVELS = 32; private static final int FORMULAS = 32;
private static final int PAGE_BREAK_SPLIT = 33; private static final int ENDNOTES_HEADING = 33;
private static final int CALC_SPLIT = 34; private static final int EXTERNAL_TOC_DEPTH = 34;
private static final int DISPLAY_HIDDEN_SHEETS = 35; private static final int INCLUDE_TOC = 35;
private static final int DISPLAY_HIDDEN_ROWS_COLS = 36; private static final int SPLIT_LEVEL = 36;
private static final int DISPLAY_FILTERED_ROWS_COLS = 37; private static final int REPEAT_LEVELS = 37;
private static final int APPLY_PRINT_RANGES = 38; private static final int PAGE_BREAK_SPLIT = 38;
private static final int USE_TITLE_AS_HEADING = 39; private static final int SPLIT_AFTER = 39;
private static final int USE_SHEET_NAMES_AS_HEADINGS = 40; private static final int CALC_SPLIT = 40;
private static final int XSLT_PATH = 41; private static final int DISPLAY_HIDDEN_SHEETS = 41;
private static final int SAVE_IMAGES_IN_SUBDIR = 42; private static final int DISPLAY_HIDDEN_ROWS_COLS = 42;
private static final int UPLINK = 43; private static final int DISPLAY_FILTERED_ROWS_COLS = 43;
private static final int DIRECTORY_ICON = 44; private static final int APPLY_PRINT_RANGES = 44;
private static final int DOCUMENT_ICON = 45; private static final int USE_TITLE_AS_HEADING = 45;
private static final int ZEN_HACK = 46; // temporary hack for ePub Zen Garden styles private static final int USE_SHEET_NAMES_AS_HEADINGS = 46;
private static final int XSLT_PATH = 47;
private static final int SAVE_IMAGES_IN_SUBDIR = 48;
private static final int UPLINK = 49;
private static final int DIRECTORY_ICON = 50;
private static final int DOCUMENT_ICON = 51;
private static final int ZEN_HACK = 52; // temporary hack for ePub Zen Garden styles
protected ComplexOption xheading = addComplexOption("heading-map"); protected ComplexOption xheading = addComplexOption("heading-map");
protected ComplexOption xpar = addComplexOption("paragraph-map"); protected ComplexOption xpar = addComplexOption("paragraph-map");
@ -168,12 +174,16 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
else { nValue = CSS1; } else { nValue = CSS1; }
} }
}; };
options[USE_DEFAULT_FONT] = new BooleanOption("use_default_font","true");
options[DEFAULT_FONT_NAME] = new BooleanOption("default_font_name","");
options[USE_DUBLIN_CORE] = new BooleanOption("use_dublin_core","true"); options[USE_DUBLIN_CORE] = new BooleanOption("use_dublin_core","true");
options[NOTES] = new BooleanOption("notes","true"); options[NOTES] = new BooleanOption("notes","true");
options[DISPLAY_HIDDEN_TEXT] = new BooleanOption("display_hidden_text", "false"); options[DISPLAY_HIDDEN_TEXT] = new BooleanOption("display_hidden_text", "false");
options[CONVERT_TO_PX] = new BooleanOption("convert_to_px","true"); options[CONVERT_TO_PX] = new BooleanOption("convert_to_px","true");
options[SCALING] = new Option("scaling","100%"); options[SCALING] = new Option("scaling","100%");
options[COLUMN_SCALING] = new Option("column_scaling","100%"); options[COLUMN_SCALING] = new Option("column_scaling","100%");
options[RELATIVE_FONT_SIZE] = new BooleanOption("relative_font_size","false");
options[FONT_SCALING] = new Option("font_scaling","100%");
options[FLOAT_OBJECTS] = new BooleanOption("float_objects","true"); options[FLOAT_OBJECTS] = new BooleanOption("float_objects","true");
options[TABSTOP_STYLE] = new Option("tabstop_style",""); options[TABSTOP_STYLE] = new Option("tabstop_style","");
options[ENDNOTES_HEADING] = new Option("endnotes_heading",""); options[ENDNOTES_HEADING] = new Option("endnotes_heading","");
@ -197,6 +207,7 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
} }
} }
}; };
options[INCLUDE_TOC] = new BooleanOption("include_toc","true");
options[SPLIT_LEVEL] = new IntegerOption("split_level","0") { options[SPLIT_LEVEL] = new IntegerOption("split_level","0") {
@Override public void setString(String sValue) { @Override public void setString(String sValue) {
super.setString(sValue); super.setString(sValue);
@ -218,6 +229,12 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
else { nValue = NONE; } else { nValue = NONE; }
} }
}; };
options[SPLIT_AFTER] = new IntegerOption("split_after","0") {
@Override public void setString(String sValue) {
super.setString(sValue);
nValue = Misc.getPosInteger(sValue, 0);
}
};
options[CALC_SPLIT] = new BooleanOption("calc_split","false"); options[CALC_SPLIT] = new BooleanOption("calc_split","false");
options[DISPLAY_HIDDEN_SHEETS] = new BooleanOption("display_hidden_sheets", "false"); options[DISPLAY_HIDDEN_SHEETS] = new BooleanOption("display_hidden_sheets", "false");
options[DISPLAY_HIDDEN_ROWS_COLS] = new BooleanOption("display_hidden_rows_cols","false"); options[DISPLAY_HIDDEN_ROWS_COLS] = new BooleanOption("display_hidden_rows_cols","false");
@ -321,20 +338,26 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
public int xhtmlTableFormatting() { return ((XhtmlFormatOption) options[TABLE_FORMATTING]).getValue(); } public int xhtmlTableFormatting() { return ((XhtmlFormatOption) options[TABLE_FORMATTING]).getValue(); }
public boolean xhtmlIgnoreTableDimensions() { return ((BooleanOption) options[IGNORE_TABLE_DIMENSIONS]).getValue(); } public boolean xhtmlIgnoreTableDimensions() { return ((BooleanOption) options[IGNORE_TABLE_DIMENSIONS]).getValue(); }
public int listFormatting() { return ((IntegerOption) options[LIST_FORMATTING]).getValue(); } public int listFormatting() { return ((IntegerOption) options[LIST_FORMATTING]).getValue(); }
public boolean useDefaultFont() { return ((BooleanOption) options[USE_DEFAULT_FONT]).getValue(); }
public String defaultFontName() { return options[DEFAULT_FONT_NAME].getString(); }
public boolean xhtmlUseDublinCore() { return ((BooleanOption) options[USE_DUBLIN_CORE]).getValue(); } public boolean xhtmlUseDublinCore() { return ((BooleanOption) options[USE_DUBLIN_CORE]).getValue(); }
public boolean xhtmlNotes() { return ((BooleanOption) options[NOTES]).getValue(); } public boolean xhtmlNotes() { return ((BooleanOption) options[NOTES]).getValue(); }
public boolean displayHiddenText() { return ((BooleanOption) options[DISPLAY_HIDDEN_TEXT]).getValue(); } public boolean displayHiddenText() { return ((BooleanOption) options[DISPLAY_HIDDEN_TEXT]).getValue(); }
public boolean xhtmlConvertToPx() { return ((BooleanOption) options[CONVERT_TO_PX]).getValue(); } public boolean xhtmlConvertToPx() { return ((BooleanOption) options[CONVERT_TO_PX]).getValue(); }
public String getXhtmlScaling() { return options[SCALING].getString(); } public String getXhtmlScaling() { return options[SCALING].getString(); }
public String getXhtmlColumnScaling() { return options[COLUMN_SCALING].getString(); } public String getXhtmlColumnScaling() { return options[COLUMN_SCALING].getString(); }
public boolean relativeFontSize() { return ((BooleanOption) options[RELATIVE_FONT_SIZE]).getValue(); }
public String fontScaling() { return options[FONT_SCALING].getString(); }
public boolean xhtmlFloatObjects() { return ((BooleanOption) options[FLOAT_OBJECTS]).getValue(); } public boolean xhtmlFloatObjects() { return ((BooleanOption) options[FLOAT_OBJECTS]).getValue(); }
public String getXhtmlTabstopStyle() { return options[TABSTOP_STYLE].getString(); } public String getXhtmlTabstopStyle() { return options[TABSTOP_STYLE].getString(); }
public String getEndnotesHeading() { return options[ENDNOTES_HEADING].getString(); } public String getEndnotesHeading() { return options[ENDNOTES_HEADING].getString(); }
public int formulas() { return ((IntegerOption) options[FORMULAS]).getValue(); } public int formulas() { return ((IntegerOption) options[FORMULAS]).getValue(); }
public int externalTocDepth() { return ((IntegerOption) options[EXTERNAL_TOC_DEPTH]).getValue(); } public int externalTocDepth() { return ((IntegerOption) options[EXTERNAL_TOC_DEPTH]).getValue(); }
public boolean includeToc() { return ((BooleanOption) options[INCLUDE_TOC]).getValue(); }
public int getXhtmlSplitLevel() { return ((IntegerOption) options[SPLIT_LEVEL]).getValue(); } public int getXhtmlSplitLevel() { return ((IntegerOption) options[SPLIT_LEVEL]).getValue(); }
public int getXhtmlRepeatLevels() { return ((IntegerOption) options[REPEAT_LEVELS]).getValue(); } public int getXhtmlRepeatLevels() { return ((IntegerOption) options[REPEAT_LEVELS]).getValue(); }
public int pageBreakSplit() { return ((IntegerOption) options[PAGE_BREAK_SPLIT]).getValue(); } public int pageBreakSplit() { return ((IntegerOption) options[PAGE_BREAK_SPLIT]).getValue(); }
public int splitAfter() { return ((IntegerOption) options[SPLIT_AFTER]).getValue(); }
public boolean xhtmlCalcSplit() { return ((BooleanOption) options[CALC_SPLIT]).getValue(); } public boolean xhtmlCalcSplit() { return ((BooleanOption) options[CALC_SPLIT]).getValue(); }
public boolean xhtmlDisplayHiddenSheets() { return ((BooleanOption) options[DISPLAY_HIDDEN_SHEETS]).getValue(); } public boolean xhtmlDisplayHiddenSheets() { return ((BooleanOption) options[DISPLAY_HIDDEN_SHEETS]).getValue(); }
public boolean displayHiddenRowsCols() { return ((BooleanOption) options[DISPLAY_HIDDEN_ROWS_COLS]).getValue(); } public boolean displayHiddenRowsCols() { return ((BooleanOption) options[DISPLAY_HIDDEN_ROWS_COLS]).getValue(); }

View file

@ -88,7 +88,7 @@
<dlg:menuitem dlg:value="10"/> <dlg:menuitem dlg:value="10"/>
</dlg:menupopup> </dlg:menupopup>
</dlg:menulist> </dlg:menulist>
<dlg:text dlg:id="TocLabel" dlg:tab-index="43" dlg:left="205" dlg:top="162" dlg:width="180" dlg:height="12" dlg:value="Table of contents"/> <dlg:text dlg:id="TocLabel" dlg:tab-index="43" dlg:left="205" dlg:top="162" dlg:width="180" dlg:height="12" dlg:value="Navigation table"/>
<dlg:text dlg:id="DocumentDivisionLabel" dlg:tab-index="31" dlg:left="205" dlg:top="64" dlg:width="180" dlg:height="12" dlg:value="Document division"/> <dlg:text dlg:id="DocumentDivisionLabel" dlg:tab-index="31" dlg:left="205" dlg:top="64" dlg:width="180" dlg:height="12" dlg:value="Document division"/>
</dlg:bulletinboard> </dlg:bulletinboard>
</dlg:window> </dlg:window>