mod checkbox;
mod choice_fields;
mod field_flags;
mod form_appearance;
mod push_button;
mod radio_button;
mod text_field;
pub use checkbox::CheckboxWidget;
pub use choice_fields::{ChoiceOption, ComboBoxWidget, ListBoxWidget};
pub use field_flags::{
ButtonFieldFlags, ChoiceFieldFlags, FieldFlags, TextAlignment, TextFieldFlags,
};
pub use form_appearance::FormAppearanceGenerator;
pub use push_button::{FormAction, PushButtonWidget, SubmitFormFlags};
pub use radio_button::{RadioButtonGroup, RadioButtonWidget};
pub use text_field::TextFieldWidget;
use crate::geometry::Rect;
use crate::object::{Object, ObjectRef};
use std::collections::HashMap;
pub trait FormFieldWidget {
fn field_name(&self) -> &str;
fn rect(&self) -> Rect;
fn build_field_dict(&self) -> HashMap<String, Object>;
fn build_widget_dict(&self, page_ref: ObjectRef) -> HashMap<String, Object>;
fn field_type(&self) -> &'static str;
fn field_flags(&self) -> u32;
fn needs_appearance(&self) -> bool {
true
}
}
#[derive(Debug, Clone)]
pub struct FormFieldEntry {
pub widget_dict: HashMap<String, Object>,
pub field_dict: HashMap<String, Object>,
pub name: String,
pub rect: Rect,
pub field_type: String,
}