<?xml version="1.0"?>
<!--
    ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements. See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    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 obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    ====================================================================
-->
<record fromfile="true" name="FFDataBase" package="org.apache.poi.hwpf.model.types">
	<suffix>AbstractType</suffix>
	<description>The FFData structure specifies form field data for a text
		box, check box, or drop-down list box. &lt;p&gt;Class and fields
		descriptions are quoted from [MS-DOC] -- v20121003 Word (.doc) Binary
		File Format; Copyright (c) 2012 Microsoft Corporation; Release:
		October 8, 2012
	</description>
	<author>Sergey Vladimirov; according to [MS-DOC] -- v20121003 Word
		(.doc) Binary File Format; Copyright (c) 2012 Microsoft Corporation;
		Release: October 8, 2012
	</author>
	<fields>
		<field type="long" size="4" name="version"
			description="An unsigned integer that MUST be 0xFFFFFFFF" />
		<field type="short" size="2" name="bits"
			description="An FFDataBits that specifies the type and state of this form field">
			<bit mask="0x0003" name="iType"
				description="An unsigned integer that specifies the type of the form field. ">
				<const type="byte" value="0" name="Text"
					description="Specifies that the form field is a textbox." />
				<const type="byte" value="1" name="Chck"
					description="Specifies that the form field is a checkbox." />
				<const type="byte" value="2" name="Drop"
					description="Specifies that the form field is a dropdown list box." />
			</bit>
			<bit mask="0x007C" name="iRes"
				description="An unsigned integer. If iType is iTypeText (0), then iRes MUST be 0. If iType is iTypeChck (1), iRes specifies the state of the checkbox and MUST be 0 (unchecked), 1 (checked), or 25 (undefined). Undefined checkboxes are treated as unchecked. If iType is iTypeDrop (2), iRes specifies the current selected list box item. A value of 25 specifies the selection is undefined. Otherwise, iRes is a zero-based index into FFData.hsttbDropList." />
			<bit mask="0x0080" name="fOwnHelp"
				description="A bit that specifies whether the form field has custom help text in FFData.xstzHelpText. If fOwnHelp is 0, FFData.xstzHelpText contains an empty or auto-generated string." />
			<bit mask="0x0100" name="fOwnStat"
				description="A bit that specifies whether the form field has custom status bar text in FFData.xstzStatText. If fOwnStat is 0, FFData.xstzStatText contains an empty or auto-generated string." />
			<bit mask="0x0200" name="fProt"
				description="A bit that specifies whether the form field is protected and its value cannot be changed." />
			<bit mask="0x0400" name="iSize"
				description="A bit that specifies whether the size of a checkbox is automatically determined by the text size where the checkbox is located. This value MUST be 0 if iType is not iTypeChck (1)." />
			<bit mask="0x3800" name="iTypeTxt"
				description="An unsigned integer that specifies the type of the textbox. If iType is not iTypeText (0), iTypeTxt MUST be 0 and MUST be ignored." >
				<const type="byte" value="0" name="Reg"
					description="Specifies that the textbox value is regular text." />
				<const type="byte" value="0" name="Num"
					description="Specifies that the textbox value is a number." />
				<const type="byte" value="0" name="Date"
					description="Specifies that the textbox value is a date or time." />
				<const type="byte" value="0" name="CurDate"
					description="Specifies that the textbox value is the current date." />
				<const type="byte" value="0" name="CurTime"
					description="Specifies that the textbox value is the current time." />
				<const type="byte" value="0" name="Calc"
					description="Specifies that the textbox value is calculated from an expression. The expression is given by FFData.xstzTextDef." />
			</bit>
			<bit mask="0x4000" name="fRecalc"
				description="A bit that specifies whether the value of the field is automatically calculated after the field is modified." />
			<bit mask="0x8000" name="fHasListBox"
				description="A bit that specifies that the form field has a list box. This value MUST be 1 if iType is iTypeDrop (2). Otherwise, this value MUST be 0." />
		</field>
		<field type="int" size="2" name="cch"
			description="An unsigned integer that specifies the maximum length, in characters, of the value of the textbox. This value MUST NOT exceed 32767. A value of 0 means there is no maximum length of the value of the textbox. If bits.iType is not iTypeText (0), this value MUST be 0." />
		<field type="int" size="2" name="hps"
			description="An unsigned integer. If bits.iType is iTypeChck (1), hps specifies the size, in half-points, of the checkbox and MUST be between 2 and 3168, inclusive. If bits.iType is not iTypeChck (1), hps is undefined and MUST be ignored." />
	</fields>
</record>
