Skip to main content

LayoutEngine

Struct LayoutEngine 

Source
pub struct LayoutEngine<'a> { /* private fields */ }
Expand description

The layout engine.

Implementations§

Source§

impl<'a> LayoutEngine<'a>

Source

pub fn new(form: &'a FormTree) -> Self

Source

pub fn layout_with_profile( &self, root: FormNodeId, ) -> Result<(LayoutDom, LayoutProfile)>

Perform layout and collect pagination diagnostics for each emitted page.

Source

pub fn layout(&self, root: FormNodeId) -> Result<LayoutDom>

Perform layout on the entire form tree starting from the root node.

XFA Spec 3.3 §8.6 — The Layout Algorithm (p288): content-driven single traversal of the Form DOM, placing nodes into the Layout DOM. When a container fills, traverse to the next container (§8.7 splitting, §8.8 pagination).

Supports multi-page pagination: when content overflows a page’s content area, remaining nodes are placed on subsequent pages. The last page template is repeated as needed for overflow content.

TODO §8.8: simplexPaginated/duplexPaginated, pagePosition/oddOrEven/ blankOrNotBlank qualifications, termination processing (last/only page).

Source

pub fn compute_extent(&self, id: FormNodeId) -> Size

Compute the outer extent (total bounding box) of a form node.

When available is provided, growable dimensions may expand to fill the available space (XFA §8: growable objects fill the parent container).

Source

pub fn compute_extent_with_override( &self, id: FormNodeId, children_override: Option<&[FormNodeId]>, ) -> Size

Auto Trait Implementations§

§

impl<'a> Freeze for LayoutEngine<'a>

§

impl<'a> RefUnwindSafe for LayoutEngine<'a>

§

impl<'a> Send for LayoutEngine<'a>

§

impl<'a> Sync for LayoutEngine<'a>

§

impl<'a> Unpin for LayoutEngine<'a>

§

impl<'a> UnsafeUnpin for LayoutEngine<'a>

§

impl<'a> UnwindSafe for LayoutEngine<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.