pub struct FormField {Show 23 fields
pub object: ObjRef,
pub parent: Option<ObjRef>,
pub kids: Vec<ObjRef>,
pub widgets: Vec<Widget>,
pub field_type: Option<FieldType>,
pub partial_name: Option<String>,
pub name: String,
pub alternate_name: Option<String>,
pub mapping_name: Option<String>,
pub flags: FieldFlags,
pub value: Option<Object>,
pub default_value: Option<Object>,
pub default_appearance: Option<String>,
pub quadding: Quadding,
pub default_style: Option<String>,
pub rich_text: Option<String>,
pub max_len: Option<u32>,
pub options: Vec<ChoiceOption>,
pub top_index: u32,
pub selected_indices: Vec<u32>,
pub additional_actions: Option<Dict>,
pub lock: Option<ObjRef>,
pub seed_value: Option<ObjRef>,
}Expand description
One field dictionary (ISO 32000-1 §12.7.3, Table 220) with the inheritable entries taken from the nearest ancestor that has them.
Fields§
§object: ObjRefThe field dictionary’s own reference.
parent: Option<ObjRef>/Parent: the field whose /Kids holds this one, as walked; None
for a root field.
kids: Vec<ObjRef>The /Kids that are fields themselves, in array order.
widgets: Vec<Widget>The widget annotations that draw this field: the /Kids that are
/Subtype /Widget dictionaries without a /T of their own, or the
field itself when its single widget is merged into it.
field_type: Option<FieldType>/FT, inherited; None for a non-terminal field that names none
and for a name Table 220 does not list.
partial_name: Option<String>/T: the partial field name (§12.7.3.2).
name: StringThe fully qualified field name (§12.7.3.2): the partial names from
the root field down, joined by a period; a field without a /T
shares its parent’s name, and a root without one has the empty name.
alternate_name: Option<String>/TU: the name shown to the user in place of the field name.
mapping_name: Option<String>/TM: the name used when the field’s data is exported.
flags: FieldFlags/Ff, inherited; no bit set by default.
value: Option<Object>/V, inherited, resolved one level, in the format of the field’s
type; a merged widget’s own value beats its parent’s.
default_value: Option<Object>/DV, inherited, resolved one level: the value a reset-form action
restores.
default_appearance: Option<String>/DA, inherited (§12.7.3.3, Table 222): the default appearance
string of a variable text field, the interactive form’s document-wide
/DA when neither the field nor an ancestor has one; what it sets
reads through DefaultAppearance::parse.
quadding: Quadding/Q, inherited (§12.7.3.3, Table 222): how a variable text field’s
text is justified, the interactive form’s document-wide /Q when
neither the field nor an ancestor has one, left-justified when none
does or the value is not 0, 1 or 2.
default_style: Option<String>/DS (§12.7.3.3, Table 222): the default style string rich text is
laid out with (§12.7.3.4).
rich_text: Option<String>/RV (§12.7.3.3, Table 222): the rich text value as text, a text
stream read into a string; its markup is not parsed (§12.7.3.4).
max_len: Option<u32>/MaxLen, inherited (§12.7.4.3, Table 229): the most characters a
text field’s text may hold.
options: Vec<ChoiceOption>/Opt, inherited: the options of a choice field (§12.7.4.4, Table
231) or the export values of a check box or radio button
(§12.7.4.2, Table 227); an entry that is neither a text string nor a
pair of them is skipped.
top_index: u32/TI (§12.7.4.4): the index into options of the first option a
scrollable list box shows; 0 by default.
selected_indices: Vec<u32>/I (§12.7.4.4): the indices into options of the selected options
of a multi-select choice field, as written.
additional_actions: Option<Dict>/AA: the field’s additional-actions dictionary, as written.
lock: Option<ObjRef>/Lock (§12.7.4.5, Table 232): the signature field lock dictionary
naming the fields that lock once this field is signed, by reference.
seed_value: Option<ObjRef>/SV (§12.7.4.5, Table 232): the seed value dictionary constraining
a signature applied to this field, by reference.
Implementations§
Source§impl FormField
impl FormField
Sourcepub fn text(&self) -> Option<String>
pub fn text(&self) -> Option<String>
The text of a text field (ISO 32000-1 §12.7.4.3): /V decoded as a
text string. None for a field of another type or without a value.
Which kind of button a button field is (ISO 32000-1 §12.7.4.2,
Table 226): a pushbutton when the Pushbutton flag is set, radio
buttons when Radio is set, a check box otherwise. None for a
field of another type.
Sourcepub fn state(&self) -> Option<&str>
pub fn state(&self) -> Option<&str>
The appearance state a check box or radio button field is in (ISO
32000-1 §12.7.4.2): /V as a name, the one the widgets’ /AP /N
dictionaries key their on and off appearances by, Off when there
is no value (§12.7.4.2.4’s default). None for a pushbutton, which
keeps no value, for another field type, and for a value that is no
name.
Sourcepub fn checked(&self) -> Option<bool>
pub fn checked(&self) -> Option<bool>
Whether a check box is checked (ISO 32000-1 §12.7.4.2.3): its state
is a name other than Off; an absent value is the off state. None
for a field that is no check box.
Sourcepub fn on_widgets(&self) -> Vec<usize>
pub fn on_widgets(&self) -> Vec<usize>
The widgets of a check box or radio button field that are in the on
state (ISO 32000-1 §12.7.4.2.3, §12.7.4.2.4): those whose on state
is the field’s state, as indices into widgets. The same indices
pick the Table 227 export values out of options. Empty for a field
in the off state, a pushbutton, or another field type.