update SEP definition

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1147385 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-07-16 09:10:57 +00:00
parent de1e4e61d5
commit 07eb383363
3 changed files with 491 additions and 207 deletions

View File

@ -18,7 +18,6 @@
package org.apache.poi.hwpf.model.types; package org.apache.poi.hwpf.model.types;
import org.apache.poi.hdf.model.hdftypes.HDFType;
import org.apache.poi.hwpf.usermodel.BorderCode; import org.apache.poi.hwpf.usermodel.BorderCode;
import org.apache.poi.hwpf.usermodel.DateAndTime; import org.apache.poi.hwpf.usermodel.DateAndTime;
@ -29,86 +28,250 @@ import org.apache.poi.hwpf.usermodel.DateAndTime;
* *
* @author S. Ryan Ackley * @author S. Ryan Ackley
*/ */
public abstract class SEPAbstractType implements HDFType { public abstract class SEPAbstractType
{
protected byte field_1_bkc; protected byte field_1_bkc;
protected boolean field_2_fTitlePage; /** No break */
protected boolean field_3_fAutoPgn; /**/public final static byte BKC_NO_BREAK = 0;
protected byte field_4_nfcPgn; /** New column */
protected boolean field_5_fUnlocked; /**/public final static byte BKC_NEW_COLUMN = 1;
protected byte field_6_cnsPgn; /** New page */
protected boolean field_7_fPgnRestart; /**/public final static byte BKC_NEW_PAGE = 2;
protected boolean field_8_fEndNote; /** Even page */
protected byte field_9_lnc; /**/public final static byte BKC_EVEN_PAGE = 3;
protected byte field_10_grpfIhdt; /** Odd page */
protected int field_11_nLnnMod; /**/public final static byte BKC_ODD_PAGE = 4;
protected int field_12_dxaLnn; protected boolean field_2_fTitlePage;
protected int field_13_dxaPgn; protected boolean field_3_fAutoPgn;
protected int field_14_dyaPgn; protected byte field_4_nfcPgn;
protected boolean field_15_fLBetween; /** Arabic */
protected byte field_16_vjc; /**/public final static byte NFCPGN_ARABIC = 0;
protected int field_17_dmBinFirst; /** Roman (upper case) */
protected int field_18_dmBinOther; /**/public final static byte NFCPGN_ROMAN_UPPER_CASE = 1;
protected int field_19_dmPaperReq; /** Roman (lower case) */
protected BorderCode field_20_brcTop; /**/public final static byte NFCPGN_ROMAN_LOWER_CASE = 2;
protected BorderCode field_21_brcLeft; /** Letter (upper case) */
protected BorderCode field_22_brcBottom; /**/public final static byte NFCPGN_LETTER_UPPER_CASE = 3;
protected BorderCode field_23_brcRight; /** Letter (lower case) */
protected boolean field_24_fPropMark; /**/public final static byte NFCPGN_LETTER_LOWER_CASE = 4;
protected int field_25_ibstPropRMark; protected boolean field_5_fUnlocked;
protected DateAndTime field_26_dttmPropRMark; protected byte field_6_cnsPgn;
protected int field_27_dxtCharSpace; protected boolean field_7_fPgnRestart;
protected int field_28_dyaLinePitch; protected boolean field_8_fEndNote;
protected int field_29_clm; protected byte field_9_lnc;
protected int field_30_unused2; protected byte field_10_grpfIhdt;
protected byte field_31_dmOrientPage; protected int field_11_nLnnMod;
protected byte field_32_iHeadingPgn; protected int field_12_dxaLnn;
protected int field_33_pgnStart; protected int field_13_dxaPgn;
protected int field_34_lnnMin; protected int field_14_dyaPgn;
protected int field_35_wTextFlow; protected boolean field_15_fLBetween;
protected short field_36_unused3; protected byte field_16_vjc;
protected int field_37_pgbProp; protected int field_17_dmBinFirst;
protected short field_38_unused4; protected int field_18_dmBinOther;
protected int field_39_xaPage; protected int field_19_dmPaperReq;
protected int field_40_yaPage; protected BorderCode field_20_brcTop;
protected int field_41_xaPageNUp; protected BorderCode field_21_brcLeft;
protected int field_42_yaPageNUp; protected BorderCode field_22_brcBottom;
protected int field_43_dxaLeft; protected BorderCode field_23_brcRight;
protected int field_44_dxaRight; protected boolean field_24_fPropMark;
protected int field_45_dyaTop; protected int field_25_ibstPropRMark;
protected int field_46_dyaBottom; protected DateAndTime field_26_dttmPropRMark;
protected int field_47_dzaGutter; protected int field_27_dxtCharSpace;
protected int field_48_dyaHdrTop; protected int field_28_dyaLinePitch;
protected int field_49_dyaHdrBottom; protected int field_29_clm;
protected int field_50_ccolM1; protected int field_30_unused2;
protected boolean field_51_fEvenlySpaced; protected boolean field_31_dmOrientPage;
protected byte field_52_unused5; /**/public final static boolean DMORIENTPAGE_LANDSCAPE = false;
protected int field_53_dxaColumns; /**/public final static boolean DMORIENTPAGE_PORTRAIT = true;
protected int[] field_54_rgdxaColumn; protected byte field_32_iHeadingPgn;
protected int field_55_dxaColumnWidth; protected int field_33_pgnStart;
protected byte field_56_dmOrientFirst; protected int field_34_lnnMin;
protected byte field_57_fLayout; protected int field_35_wTextFlow;
protected short field_58_unused6; protected short field_36_unused3;
protected byte[] field_59_olstAnm; protected int field_37_pgbProp;
protected short field_38_unused4;
protected int field_39_xaPage;
protected int field_40_yaPage;
protected int field_41_xaPageNUp;
protected int field_42_yaPageNUp;
protected int field_43_dxaLeft;
protected int field_44_dxaRight;
protected int field_45_dyaTop;
protected int field_46_dyaBottom;
protected int field_47_dzaGutter;
protected int field_48_dyaHdrTop;
protected int field_49_dyaHdrBottom;
protected int field_50_ccolM1;
protected boolean field_51_fEvenlySpaced;
protected byte field_52_unused5;
protected int field_53_dxaColumns;
protected int[] field_54_rgdxaColumn;
protected int field_55_dxaColumnWidth;
protected byte field_56_dmOrientFirst;
protected byte field_57_fLayout;
protected short field_58_unused6;
protected byte[] field_59_olstAnm;
protected SEPAbstractType()
public SEPAbstractType()
{ {
this.field_1_bkc = 2;
} this.field_8_fEndNote = true;
this.field_13_dxaPgn = 720;
/** this.field_14_dyaPgn = 720;
* Size of record (exluding 4 byte header) this.field_31_dmOrientPage = true;
*/ this.field_33_pgnStart = 1;
public int getSize() this.field_39_xaPage = 12240;
{ this.field_40_yaPage = 15840;
return 4 + + 1 + 0 + 0 + 1 + 0 + 1 + 0 + 0 + 1 + 1 + 2 + 4 + 2 + 2 + 0 + 1 + 2 + 2 + 2 + 4 + 4 + 4 + 4 + 0 + 2 + 4 + 4 + 4 + 2 + 2 + 1 + 1 + 2 + 2 + 2 + 2 + 2 + 2 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 2 + 0 + 1 + 4 + 356 + 4 + 1 + 1 + 2 + 212; this.field_41_xaPageNUp = 12240;
this.field_42_yaPageNUp = 15840;
this.field_43_dxaLeft = 1800;
this.field_44_dxaRight = 1800;
this.field_45_dyaTop = 1440;
this.field_46_dyaBottom = 1440;
this.field_48_dyaHdrTop = 720;
this.field_49_dyaHdrBottom = 720;
this.field_51_fEvenlySpaced = true;
this.field_53_dxaColumns = 720;
} }
public String toString()
{
StringBuilder builder = new StringBuilder();
builder.append("[SEP]\n");
builder.append(" .bkc = ");
builder.append(" (").append(getBkc()).append(" )\n");
builder.append(" .fTitlePage = ");
builder.append(" (").append(getFTitlePage()).append(" )\n");
builder.append(" .fAutoPgn = ");
builder.append(" (").append(getFAutoPgn()).append(" )\n");
builder.append(" .nfcPgn = ");
builder.append(" (").append(getNfcPgn()).append(" )\n");
builder.append(" .fUnlocked = ");
builder.append(" (").append(getFUnlocked()).append(" )\n");
builder.append(" .cnsPgn = ");
builder.append(" (").append(getCnsPgn()).append(" )\n");
builder.append(" .fPgnRestart = ");
builder.append(" (").append(getFPgnRestart()).append(" )\n");
builder.append(" .fEndNote = ");
builder.append(" (").append(getFEndNote()).append(" )\n");
builder.append(" .lnc = ");
builder.append(" (").append(getLnc()).append(" )\n");
builder.append(" .grpfIhdt = ");
builder.append(" (").append(getGrpfIhdt()).append(" )\n");
builder.append(" .nLnnMod = ");
builder.append(" (").append(getNLnnMod()).append(" )\n");
builder.append(" .dxaLnn = ");
builder.append(" (").append(getDxaLnn()).append(" )\n");
builder.append(" .dxaPgn = ");
builder.append(" (").append(getDxaPgn()).append(" )\n");
builder.append(" .dyaPgn = ");
builder.append(" (").append(getDyaPgn()).append(" )\n");
builder.append(" .fLBetween = ");
builder.append(" (").append(getFLBetween()).append(" )\n");
builder.append(" .vjc = ");
builder.append(" (").append(getVjc()).append(" )\n");
builder.append(" .dmBinFirst = ");
builder.append(" (").append(getDmBinFirst()).append(" )\n");
builder.append(" .dmBinOther = ");
builder.append(" (").append(getDmBinOther()).append(" )\n");
builder.append(" .dmPaperReq = ");
builder.append(" (").append(getDmPaperReq()).append(" )\n");
builder.append(" .brcTop = ");
builder.append(" (").append(getBrcTop()).append(" )\n");
builder.append(" .brcLeft = ");
builder.append(" (").append(getBrcLeft()).append(" )\n");
builder.append(" .brcBottom = ");
builder.append(" (").append(getBrcBottom()).append(" )\n");
builder.append(" .brcRight = ");
builder.append(" (").append(getBrcRight()).append(" )\n");
builder.append(" .fPropMark = ");
builder.append(" (").append(getFPropMark()).append(" )\n");
builder.append(" .ibstPropRMark = ");
builder.append(" (").append(getIbstPropRMark()).append(" )\n");
builder.append(" .dttmPropRMark = ");
builder.append(" (").append(getDttmPropRMark()).append(" )\n");
builder.append(" .dxtCharSpace = ");
builder.append(" (").append(getDxtCharSpace()).append(" )\n");
builder.append(" .dyaLinePitch = ");
builder.append(" (").append(getDyaLinePitch()).append(" )\n");
builder.append(" .clm = ");
builder.append(" (").append(getClm()).append(" )\n");
builder.append(" .unused2 = ");
builder.append(" (").append(getUnused2()).append(" )\n");
builder.append(" .dmOrientPage = ");
builder.append(" (").append(getDmOrientPage()).append(" )\n");
builder.append(" .iHeadingPgn = ");
builder.append(" (").append(getIHeadingPgn()).append(" )\n");
builder.append(" .pgnStart = ");
builder.append(" (").append(getPgnStart()).append(" )\n");
builder.append(" .lnnMin = ");
builder.append(" (").append(getLnnMin()).append(" )\n");
builder.append(" .wTextFlow = ");
builder.append(" (").append(getWTextFlow()).append(" )\n");
builder.append(" .unused3 = ");
builder.append(" (").append(getUnused3()).append(" )\n");
builder.append(" .pgbProp = ");
builder.append(" (").append(getPgbProp()).append(" )\n");
builder.append(" .unused4 = ");
builder.append(" (").append(getUnused4()).append(" )\n");
builder.append(" .xaPage = ");
builder.append(" (").append(getXaPage()).append(" )\n");
builder.append(" .yaPage = ");
builder.append(" (").append(getYaPage()).append(" )\n");
builder.append(" .xaPageNUp = ");
builder.append(" (").append(getXaPageNUp()).append(" )\n");
builder.append(" .yaPageNUp = ");
builder.append(" (").append(getYaPageNUp()).append(" )\n");
builder.append(" .dxaLeft = ");
builder.append(" (").append(getDxaLeft()).append(" )\n");
builder.append(" .dxaRight = ");
builder.append(" (").append(getDxaRight()).append(" )\n");
builder.append(" .dyaTop = ");
builder.append(" (").append(getDyaTop()).append(" )\n");
builder.append(" .dyaBottom = ");
builder.append(" (").append(getDyaBottom()).append(" )\n");
builder.append(" .dzaGutter = ");
builder.append(" (").append(getDzaGutter()).append(" )\n");
builder.append(" .dyaHdrTop = ");
builder.append(" (").append(getDyaHdrTop()).append(" )\n");
builder.append(" .dyaHdrBottom = ");
builder.append(" (").append(getDyaHdrBottom()).append(" )\n");
builder.append(" .ccolM1 = ");
builder.append(" (").append(getCcolM1()).append(" )\n");
builder.append(" .fEvenlySpaced = ");
builder.append(" (").append(getFEvenlySpaced()).append(" )\n");
builder.append(" .unused5 = ");
builder.append(" (").append(getUnused5()).append(" )\n");
builder.append(" .dxaColumns = ");
builder.append(" (").append(getDxaColumns()).append(" )\n");
builder.append(" .rgdxaColumn = ");
builder.append(" (").append(getRgdxaColumn()).append(" )\n");
builder.append(" .dxaColumnWidth = ");
builder.append(" (").append(getDxaColumnWidth()).append(" )\n");
builder.append(" .dmOrientFirst = ");
builder.append(" (").append(getDmOrientFirst()).append(" )\n");
builder.append(" .fLayout = ");
builder.append(" (").append(getFLayout()).append(" )\n");
builder.append(" .unused6 = ");
builder.append(" (").append(getUnused6()).append(" )\n");
builder.append(" .olstAnm = ");
builder.append(" (").append(getOlstAnm()).append(" )\n");
builder.append("[/SEP]\n");
return builder.toString();
}
/** /**
* Get the bkc field for the SEP record. * Break code.
*
* @return One of
* <li>{@link #BKC_NO_BREAK}
* <li>{@link #BKC_NEW_COLUMN}
* <li>{@link #BKC_NEW_PAGE}
* <li>{@link #BKC_EVEN_PAGE}
* <li>{@link #BKC_ODD_PAGE}
*/ */
public byte getBkc() public byte getBkc()
{ {
@ -116,7 +279,15 @@ public abstract class SEPAbstractType implements HDFType {
} }
/** /**
* Set the bkc field for the SEP record. * Break code.
*
* @param field_1_bkc
* One of
* <li>{@link #BKC_NO_BREAK}
* <li>{@link #BKC_NEW_COLUMN}
* <li>{@link #BKC_NEW_PAGE}
* <li>{@link #BKC_EVEN_PAGE}
* <li>{@link #BKC_ODD_PAGE}
*/ */
public void setBkc(byte field_1_bkc) public void setBkc(byte field_1_bkc)
{ {
@ -124,7 +295,7 @@ public abstract class SEPAbstractType implements HDFType {
} }
/** /**
* Get the fTitlePage field for the SEP record. * Set to 1 when a title page is to be displayed.
*/ */
public boolean getFTitlePage() public boolean getFTitlePage()
{ {
@ -132,7 +303,7 @@ public abstract class SEPAbstractType implements HDFType {
} }
/** /**
* Set the fTitlePage field for the SEP record. * Set to 1 when a title page is to be displayed.
*/ */
public void setFTitlePage(boolean field_2_fTitlePage) public void setFTitlePage(boolean field_2_fTitlePage)
{ {
@ -140,7 +311,7 @@ public abstract class SEPAbstractType implements HDFType {
} }
/** /**
* Get the fAutoPgn field for the SEP record. * Only for Macintosh compatibility, used only during open, when 1, sep.dxaPgn and sep.dyaPgn are valid page number locations.
*/ */
public boolean getFAutoPgn() public boolean getFAutoPgn()
{ {
@ -148,7 +319,7 @@ public abstract class SEPAbstractType implements HDFType {
} }
/** /**
* Set the fAutoPgn field for the SEP record. * Only for Macintosh compatibility, used only during open, when 1, sep.dxaPgn and sep.dyaPgn are valid page number locations.
*/ */
public void setFAutoPgn(boolean field_3_fAutoPgn) public void setFAutoPgn(boolean field_3_fAutoPgn)
{ {
@ -156,7 +327,14 @@ public abstract class SEPAbstractType implements HDFType {
} }
/** /**
* Get the nfcPgn field for the SEP record. * Page number format code.
*
* @return One of
* <li>{@link #NFCPGN_ARABIC}
* <li>{@link #NFCPGN_ROMAN_UPPER_CASE}
* <li>{@link #NFCPGN_ROMAN_LOWER_CASE}
* <li>{@link #NFCPGN_LETTER_UPPER_CASE}
* <li>{@link #NFCPGN_LETTER_LOWER_CASE}
*/ */
public byte getNfcPgn() public byte getNfcPgn()
{ {
@ -164,7 +342,15 @@ public abstract class SEPAbstractType implements HDFType {
} }
/** /**
* Set the nfcPgn field for the SEP record. * Page number format code.
*
* @param field_4_nfcPgn
* One of
* <li>{@link #NFCPGN_ARABIC}
* <li>{@link #NFCPGN_ROMAN_UPPER_CASE}
* <li>{@link #NFCPGN_ROMAN_LOWER_CASE}
* <li>{@link #NFCPGN_LETTER_UPPER_CASE}
* <li>{@link #NFCPGN_LETTER_LOWER_CASE}
*/ */
public void setNfcPgn(byte field_4_nfcPgn) public void setNfcPgn(byte field_4_nfcPgn)
{ {
@ -589,16 +775,25 @@ public abstract class SEPAbstractType implements HDFType {
/** /**
* Get the dmOrientPage field for the SEP record. * Get the dmOrientPage field for the SEP record.
*
* @return One of
* <li>{@link #DMORIENTPAGE_LANDSCAPE}
* <li>{@link #DMORIENTPAGE_PORTRAIT}
*/ */
public byte getDmOrientPage() public boolean getDmOrientPage()
{ {
return field_31_dmOrientPage; return field_31_dmOrientPage;
} }
/** /**
* Set the dmOrientPage field for the SEP record. * Set the dmOrientPage field for the SEP record.
*
* @param field_31_dmOrientPage
* One of
* <li>{@link #DMORIENTPAGE_LANDSCAPE}
* <li>{@link #DMORIENTPAGE_PORTRAIT}
*/ */
public void setDmOrientPage(byte field_31_dmOrientPage) public void setDmOrientPage(boolean field_31_dmOrientPage)
{ {
this.field_31_dmOrientPage = field_31_dmOrientPage; this.field_31_dmOrientPage = field_31_dmOrientPage;
} }
@ -1051,9 +1246,4 @@ public abstract class SEPAbstractType implements HDFType {
this.field_59_olstAnm = field_59_olstAnm; this.field_59_olstAnm = field_59_olstAnm;
} }
} // END OF CLASS } // END OF CLASS

View File

@ -1,86 +1,102 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- <!--
==================================================================== ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership. this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0 The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
==================================================================== ====================================================================
--> -->
<record id="0x101B" name="SEP" package="org.apache.poi.hwpf.model.types"> <record id="0x101B" name="SEP" fromfile="false" package="org.apache.poi.hwpf.model.types">
<suffix>AbstractType</suffix> <suffix>AbstractType</suffix>
<extends>HDFType</extends> <extends>HDFType</extends>
<description>Section Properties.</description> <description>Section Properties.</description>
<author>S. Ryan Ackley</author> <author>S. Ryan Ackley</author>
<fields> <fields>
<field type="byte" size="1" name="bkc"/> <field type="byte" size="1" name="bkc" default="2" description="Break code">
<field type="boolean" size="0" name="fTitlePage"/> <const type="byte" value="0" name="NO_BREAK" description="No break"/>
<field type="boolean" size="0" name="fAutoPgn"/> <const type="byte" value="1" name="NEW_COLUMN" description="New column"/>
<field type="byte" size="1" name="nfcPgn"/> <const type="byte" value="2" name="NEW_PAGE" description="New page"/>
<field type="boolean" size="0" name="fUnlocked"/> <const type="byte" value="3" name="EVEN_PAGE" description="Even page"/>
<field type="byte" size="1" name="cnsPgn"/> <const type="byte" value="4" name="ODD_PAGE" description="Odd page"/>
<field type="boolean" size="0" name="fPgnRestart"/> </field>
<field type="boolean" size="0" name="fEndNote"/> <field type="boolean" size="1" name="fTitlePage" description="Set to 1 when a title page is to be displayed"/>
<field type="byte" size="1" name="lnc"/> <field type="boolean" size="1" name="fAutoPgn"
<field type="byte" size="1" name="grpfIhdt"/> description="Only for Macintosh compatibility, used only during open, when 1, sep.dxaPgn and sep.dyaPgn are valid page number locations"/>
<field type="int" size="2" name="nLnnMod"/> <field type="byte" size="1" name="nfcPgn" description="Page number format code">
<field type="int" size="4" name="dxaLnn"/> <const type="byte" name="ARABIC" value="0" description="Arabic"/>
<field type="int" size="2" name="dxaPgn"/> <const type="byte" name="ROMAN_UPPER_CASE" value="1" description="Roman (upper case)"/>
<field type="int" size="2" name="dyaPgn"/> <const type="byte" name="ROMAN_LOWER_CASE" value="2" description="Roman (lower case)"/>
<field type="boolean" size="0" name="fLBetween"/> <const type="byte" name="LETTER_UPPER_CASE" value="3" description="Letter (upper case)"/>
<field type="byte" size="1" name="vjc"/> <const type="byte" name="LETTER_LOWER_CASE" value="4" description="Letter (lower case)"/>
<field type="int" size="2" name="dmBinFirst"/> </field>
<field type="int" size="2" name="dmBinOther"/> <field type="boolean" size="1" name="fUnlocked"/>
<field type="int" size="2" name="dmPaperReq"/> <field type="byte" size="1" name="cnsPgn"/>
<field type="BorderCode" size="4" name="brcTop"/> <field type="boolean" size="1" name="fPgnRestart"/>
<field type="BorderCode" size="4" name="brcLeft"/> <field type="boolean" size="1" default="true" name="fEndNote"/>
<field type="BorderCode" size="4" name="brcBottom"/> <field type="byte" size="1" name="lnc"/>
<field type="BorderCode" size="4" name="brcRight"/> <field type="byte" size="1" name="grpfIhdt"/>
<field type="boolean" size="0" name="fPropMark"/> <field type="int" size="2" name="nLnnMod"/>
<field type="int" size="2" name="ibstPropRMark"/> <field type="int" size="4" name="dxaLnn"/>
<field type="DateAndTime" size="4" name="dttmPropRMark"/> <field type="int" size="2" default="720" name="dxaPgn"/>
<field type="int" size="4" name="dxtCharSpace"/> <field type="int" size="2" default="720" name="dyaPgn"/>
<field type="int" size="4" name="dyaLinePitch"/> <field type="boolean" size="0" name="fLBetween"/>
<field type="int" size="2" name="clm"/> <field type="byte" size="1" name="vjc"/>
<field type="int" size="2" name="unused2"/> <field type="int" size="2" name="dmBinFirst"/>
<field type="byte" size="1" name="dmOrientPage"/> <field type="int" size="2" name="dmBinOther"/>
<field type="byte" size="1" name="iHeadingPgn"/> <field type="int" size="2" name="dmPaperReq"/>
<field type="int" size="2" name="pgnStart"/> <field type="BorderCode" size="4" name="brcTop"/>
<field type="int" size="2" name="lnnMin"/> <field type="BorderCode" size="4" name="brcLeft"/>
<field type="int" size="2" name="wTextFlow"/> <field type="BorderCode" size="4" name="brcBottom"/>
<field type="short" size="2" name="unused3"/> <field type="BorderCode" size="4" name="brcRight"/>
<field type="int" size="2" name="pgbProp"/> <field type="boolean" size="1" name="fPropMark"/>
<field type="short" size="2" name="unused4"/> <field type="int" size="2" name="ibstPropRMark"/>
<field type="int" size="4" name="xaPage"/> <field type="DateAndTime" size="4" name="dttmPropRMark"/>
<field type="int" size="4" name="yaPage"/> <field type="int" size="4" name="dxtCharSpace"/>
<field type="int" size="4" name="xaPageNUp"/> <field type="int" size="4" name="dyaLinePitch"/>
<field type="int" size="4" name="yaPageNUp"/> <field type="int" size="2" name="clm"/>
<field type="int" size="4" name="dxaLeft"/> <field type="int" size="2" name="unused2"/>
<field type="int" size="4" name="dxaRight"/> <field type="boolean" size="1" default="true" name="dmOrientPage">
<field type="int" size="4" name="dyaTop"/> <const type="boolean" name="LANDSCAPE" value="false"/>
<field type="int" size="4" name="dyaBottom"/> <const type="boolean" name="PORTRAIT" value="true"/>
<field type="int" size="4" name="dzaGutter"/> </field>
<field type="int" size="4" name="dyaHdrTop"/> <field type="byte" size="1" name="iHeadingPgn"/>
<field type="int" size="4" name="dyaHdrBottom"/> <field type="int" size="2" default="1" name="pgnStart"/>
<field type="int" size="2" name="ccolM1"/> <field type="int" size="2" name="lnnMin"/>
<field type="boolean" size="0" name="fEvenlySpaced"/> <field type="int" size="2" name="wTextFlow"/>
<field type="byte" size="1" name="unused5"/> <field type="short" size="2" name="unused3"/>
<field type="int" size="4" name="dxaColumns"/> <field type="int" size="2" name="pgbProp"/>
<field type="int[]" size="356" name="rgdxaColumn"/> <field type="short" size="2" name="unused4"/>
<field type="int" size="4" name="dxaColumnWidth"/> <field type="int" size="4" default="12240" name="xaPage"/>
<field type="byte" size="1" name="dmOrientFirst"/> <field type="int" size="4" default="15840" name="yaPage"/>
<field type="byte" size="1" name="fLayout"/> <field type="int" size="4" default="12240" name="xaPageNUp"/>
<field type="short" size="2" name="unused6"/> <field type="int" size="4" default="15840" name="yaPageNUp"/>
<field type="byte[]" size="212" name="olstAnm"/> <field type="int" size="4" default="1800" name="dxaLeft"/>
<field type="int" size="4" default="1800" name="dxaRight"/>
<field type="int" size="4" default="1440" name="dyaTop"/>
<field type="int" size="4" default="1440" name="dyaBottom"/>
<field type="int" size="4" name="dzaGutter"/>
<field type="int" size="4" default="720" name="dyaHdrTop"/>
<field type="int" size="4" default="720" name="dyaHdrBottom"/>
<field type="int" size="2" name="ccolM1"/>
<field type="boolean" size="0" default="true" name="fEvenlySpaced"/>
<field type="byte" size="1" name="unused5"/>
<field type="int" size="4" default="720" name="dxaColumns"/>
<field type="int[]" size="356" name="rgdxaColumn"/>
<field type="int" size="4" name="dxaColumnWidth"/>
<field type="byte" size="1" name="dmOrientFirst"/>
<field type="byte" size="1" name="fLayout"/>
<field type="short" size="2" name="unused6"/>
<field type="byte[]" size="212" name="olstAnm"/>
</fields> </fields>
</record> </record>

View File

@ -31,38 +31,66 @@
package <xsl:value-of select="@package"/>; package <xsl:value-of select="@package"/>;
</xsl:if> </xsl:if>
import org.apache.poi.util.BitField; import org.apache.poi.util.BitField;
import org.apache.poi.util.LittleEndian; import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.StringUtil; import org.apache.poi.util.StringUtil;
import org.apache.poi.util.HexDump; import org.apache.poi.util.HexDump;
import org.apache.poi.hdf.model.hdftypes.HDFType;
import org.apache.poi.hwpf.usermodel.*; import org.apache.poi.hwpf.usermodel.*;
/** /**
* <xsl:value-of select="/record/description"/> * <xsl:value-of select="/record/description"/>
* NOTE: This source is automatically generated please do not modify this file. Either subclass or * NOTE: This source is automatically generated please do not modify this file. Either subclass or
* remove the record in src/records/definitions. * remove the record in src/types/definitions.
<xsl:apply-templates select="author"/> <xsl:apply-templates select="author"/><xsl:text>
*/ */
public abstract class <xsl:value-of select="@name"/>AbstractType public abstract class </xsl:text><xsl:value-of select="@name"/><xsl:text>AbstractType
implements HDFType
{ {
<xsl:for-each select="//fields/field"> protected <xsl:value-of select="@type"/><xsl:text> field_</xsl:text><xsl:value-of select="position()"/>_<xsl:value-of select="@name"/>; </xsl:text>
<xsl:apply-templates select="./bit|./const"/> <xsl:for-each select="//fields/field">
</xsl:for-each> <xsl:call-template name="indent"/>
<xsl:text>protected </xsl:text>
<xsl:value-of select="@type"/>
<xsl:text> field_</xsl:text>
<xsl:value-of select="position()"/>
<xsl:text>_</xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>;</xsl:text>
<xsl:call-template name="linebreak"/>
<xsl:apply-templates select="./bit|./const"/>
</xsl:for-each>
public <xsl:value-of select="@name"/>AbstractType() <xsl:call-template name="linebreak"/>
{
<xsl:for-each select="//fields/field"><xsl:if test="@default"> <xsl:call-template name="indent"/>
<xsl:text> </xsl:text> <xsl:text>protected </xsl:text>
<xsl:value-of select="recutil:getFieldName(position(),@name,0)"/> = <xsl:value-of select="@default"/>; <xsl:value-of select="@name"/>
</xsl:if></xsl:for-each> <xsl:text>AbstractType()</xsl:text>
} <xsl:call-template name="linebreak"/>
<xsl:if test='//@fromfile="true"'> <xsl:call-template name="indent"/>
protected void fillFields(byte [] data, int offset) <xsl:text>{</xsl:text>
{ <xsl:call-template name="linebreak"/>
<xsl:for-each select="//fields/field">
<!-- we don't include @default condition in for-each to preserve position() -->
<xsl:if test="@default">
<xsl:call-template name="indent"/>
<xsl:call-template name="indent"/>
<xsl:text>this.</xsl:text>
<xsl:value-of select="recutil:getFieldName(position(),@name,0)"/>
<xsl:text> = </xsl:text>
<xsl:value-of select="@default"/>
<xsl:text>;</xsl:text>
<xsl:call-template name="linebreak"/>
</xsl:if>
</xsl:for-each>
<xsl:call-template name="indent"/>
<xsl:text>}</xsl:text>
<xsl:call-template name="linebreak"/>
<xsl:call-template name="linebreak"/>
<xsl:if test='/@fromfile="true"'>
protected void fillFields(byte[] data, int offset)
{
<xsl:variable name="fieldIterator" select="field:new()"/> <xsl:variable name="fieldIterator" select="field:new()"/>
<xsl:for-each select="//fields/field"> <xsl:for-each select="//fields/field">
<xsl:text> </xsl:text><xsl:value-of select="recutil:getFieldName(position(),@name,30)"/> = <xsl:value-of select="field:fillDecoder($fieldIterator,@size,@type)"/>; <xsl:text> </xsl:text><xsl:value-of select="recutil:getFieldName(position(),@name,30)"/> = <xsl:value-of select="field:fillDecoder($fieldIterator,@size,@type)"/>;
@ -76,17 +104,6 @@ public abstract class <xsl:value-of select="@name"/>AbstractType
<xsl:text> </xsl:text><xsl:value-of select="field:serialiseEncoder($fieldIterator,position(),@name,@size,@type)"/>; <xsl:text> </xsl:text><xsl:value-of select="field:serialiseEncoder($fieldIterator,position(),@name,@size,@type)"/>;
</xsl:for-each> </xsl:for-each>
} }
</xsl:if>
public String toString()
{
StringBuffer buffer = new StringBuffer();
buffer.append("[<xsl:value-of select="@name"/>]\n");
<xsl:apply-templates select="//field" mode="tostring"/>
buffer.append("[/<xsl:value-of select="@name"/>]\n");
return buffer.toString();
}
/** /**
* Size of record (exluding 4 byte header) * Size of record (exluding 4 byte header)
@ -99,16 +116,36 @@ public abstract class <xsl:value-of select="@name"/>AbstractType
<xsl:value-of select="field:calcSize($fieldIterator,position(),@name,@size,@type)"/> <xsl:value-of select="field:calcSize($fieldIterator,position(),@name,@size,@type)"/>
</xsl:for-each>; </xsl:for-each>;
} }
</xsl:if>
<xsl:call-template name="linebreak"/>
<xsl:call-template name="indent"/>
<xsl:text>public String toString()
{
StringBuilder builder = new StringBuilder();
</xsl:text>
<xsl:call-template name="indent"/>
<xsl:call-template name="indent"/>
<xsl:text>builder.append("[</xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>]\n");</xsl:text>
<xsl:call-template name="linebreak"/>
<xsl:apply-templates select="//field" mode="tostring"/>
<xsl:call-template name="linebreak"/>
<xsl:call-template name="indent"/>
<xsl:call-template name="indent"/>
<xsl:text>builder.append("[/</xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>]\n");
return builder.toString();
}
</xsl:text>
<xsl:apply-templates select="//field" mode="getset"/> <xsl:apply-templates select="//field" mode="getset"/>
<xsl:apply-templates select="//field" mode="bits"/> <xsl:apply-templates select="//field" mode="bits"/>
<xsl:text>
} // END OF CLASS } // END OF CLASS
</xsl:text>
</xsl:template> </xsl:template>
<xsl:template match = "field" mode="bits"> <xsl:template match = "field" mode="bits">
@ -139,13 +176,44 @@ public abstract class <xsl:value-of select="@name"/>AbstractType
<xsl:template match = "bit" > private static BitField <xsl:value-of select="@name"/> = new BitField(<xsl:value-of select="@mask"/>); <xsl:template match = "bit" > private static BitField <xsl:value-of select="@name"/> = new BitField(<xsl:value-of select="@mask"/>);
</xsl:template> </xsl:template>
<xsl:template match = "const"> public final static <xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/> = <xsl:value-of select="@value"/>;
</xsl:template>
<xsl:template match = "const" mode="listconsts"> <xsl:template match="const">
<xsl:text> <xsl:if test="@description">
* </xsl:text> <xsl:call-template name="indent"/>
<xsl:value-of select="recutil:getConstName(../@name,@name,0)"/></xsl:template> <xsl:text>/** </xsl:text>
<xsl:value-of select="@description"/>
<xsl:text> */</xsl:text>
<xsl:call-template name="linebreak"/>
</xsl:if>
<xsl:call-template name="indent"/>
<xsl:text>/**/</xsl:text>
<xsl:text>public final static </xsl:text>
<xsl:value-of select="@type"/>
<xsl:text> </xsl:text>
<xsl:value-of select="recutil:getConstName(../@name,@name,0)"/>
<xsl:text> = </xsl:text>
<xsl:value-of select="@value"/>
<xsl:text>;</xsl:text>
<xsl:call-template name="linebreak"/>
</xsl:template>
<xsl:template match="const" mode="listconsts">
<xsl:call-template name="linebreak"/>
<xsl:call-template name="indent"/>
<xsl:text> * &lt;li&gt;{@link #</xsl:text>
<xsl:value-of select="recutil:getConstName(../@name,@name,0)"/>
<xsl:text>}</xsl:text>
</xsl:template>
<xsl:template name="linebreak">
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template name="indent">
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="field" mode="getset"> <xsl:template match="field" mode="getset">
/** /**
* <xsl:choose> * <xsl:choose>
@ -195,11 +263,21 @@ public abstract class <xsl:value-of select="@name"/>AbstractType
} }
</xsl:template> </xsl:template>
<xsl:template match="field" mode="tostring"> <xsl:template match="field" mode="tostring">
buffer.append(" .<xsl:value-of select="recutil:getFieldName(@name,20)"/> = "); <xsl:call-template name="indent"/>
buffer.append(" (").append(get<xsl:value-of select="recutil:getFieldName1stCap(@name,0)"/>()).append(" )\n"); <xsl:call-template name="indent"/>
<xsl:apply-templates select="bit" mode="bittostring"/> <xsl:text>builder.append(" .</xsl:text>
</xsl:template> <xsl:value-of select="recutil:getFieldName(@name,20)"/>
<xsl:text> = ");</xsl:text>
<xsl:call-template name="linebreak"/>
<xsl:call-template name="indent"/>
<xsl:call-template name="indent"/>
<xsl:text>builder.append(" (").append(get</xsl:text>
<xsl:value-of select="recutil:getFieldName1stCap(@name,0)"/>
<xsl:text>()).append(" )\n");</xsl:text>
<xsl:apply-templates select="bit" mode="bittostring"/>
<xsl:call-template name="linebreak"/>
</xsl:template>
<xsl:template match="bit" mode="bittostring"> buffer.append(" .<xsl:value-of select="recutil:getFieldName(@name,20)"/> = ").append(<xsl:value-of select="recutil:getBitFieldFunction(@name, @mask, ../@type, 'false')"/>()).append('\n'); <xsl:template match="bit" mode="bittostring"> buffer.append(" .<xsl:value-of select="recutil:getFieldName(@name,20)"/> = ").append(<xsl:value-of select="recutil:getBitFieldFunction(@name, @mask, ../@type, 'false')"/>()).append('\n');
</xsl:template> </xsl:template>