Skip to main content

pdfrum_form/
lib.rs

1#![doc = include_str!("../README.md")]
2#![forbid(unsafe_code)]
3#![cfg_attr(docsrs, feature(doc_cfg))]
4// Every position in this crate is derived from an untrusted file's layout:
5// index with `get()`.
6#![warn(clippy::indexing_slicing)]
7
8// The module tree is an implementation detail; the `pub use` block below is
9// the surface. What stays `pub mod` are the modules whose *contents* are the
10// API rather than a namespace a reader passes through.
11
12mod cascade;
13mod commit;
14// `edit::ops`, `field::text`, `field::choice` and `field::toggle` are the pure
15// operations a caller drives without a session; too many to flatten into the
16// root.
17pub mod edit;
18mod error;
19mod event;
20pub mod field;
21mod focus;
22mod geom;
23mod hit;
24mod page;
25mod popup;
26pub mod route;
27/// The `boa`-backed [`Cascade`] — a document's own scripts, run.
28///
29/// Behind the default-off `javascript` feature.
30#[cfg(feature = "javascript")]
31pub mod script;
32mod session;
33mod tab;
34mod update;
35
36pub use cascade::{
37    Cascade, FieldRef, FieldWrites, Keystroke, KeystrokeOutcome, NoScripts, PointerTrigger,
38};
39pub use commit::CommitOutcome;
40pub use edit::{Place, PlaceExt, Range, Selection, UndoItem, UndoStack};
41pub use error::Error;
42pub use event::{Button, Event, Key, Modifiers};
43pub use field::{ChoiceConfig, ChoiceState, FieldState, TextConfig, TextState, ToggleState};
44pub use focus::FocusChange;
45pub use geom::Rotation;
46pub use hit::Permissions;
47pub use page::{PageForm, WidgetInfo, read as read_page};
48pub use popup::{Placement, PopupGeometry, PopupView, ScrollView};
49pub use route::{
50    Context, appearances_on_page, apply, choose, close_popup, focus_field, focus_of, kill_focus,
51    popup_view, replace_selection, scroll_view, scroll_views_on_page,
52};
53#[cfg(feature = "javascript")]
54pub use script::{ScriptCascade, ScriptConfig, TranscriptLine};
55pub use session::{AnnotId, DragAnchor, FieldId, FocusTarget, FormSession, SessionConfig};
56pub use tab::{FocusRing, TabOrder};
57pub use update::{AppearanceUpdate, Response, UpdateKind};