pub struct ParentFieldConfig { /* private fields */ }Expand description
Configuration for creating parent container fields.
Parent fields are non-terminal fields in a hierarchy that don’t have
a widget annotation but contain child fields via the /Kids array.
§Example
ⓘ
use pdf_oxide::editor::ParentFieldConfig;
// Create a parent field for address components
let config = ParentFieldConfig::new("address")
.with_flags(0); // Optional inherited flags
editor.add_parent_field(config)?;
editor.add_child_field("address", 0, TextFieldWidget::new("street", rect))?;Implementations§
Source§impl ParentFieldConfig
impl ParentFieldConfig
Sourcepub fn with_field_type(self, ft: FormFieldType) -> Self
pub fn with_field_type(self, ft: FormFieldType) -> Self
Set the field type to inherit to children.
Sourcepub fn with_flags(self, flags: u32) -> Self
pub fn with_flags(self, flags: u32) -> Self
Set field flags to inherit to children.
Common flag bits:
- Bit 1: ReadOnly
- Bit 2: Required
- Bit 3: NoExport
Sourcepub fn with_default_value(self, value: FormFieldValue) -> Self
pub fn with_default_value(self, value: FormFieldValue) -> Self
Set the default value to inherit to children.
Sourcepub fn with_tooltip(self, tooltip: impl Into<String>) -> Self
pub fn with_tooltip(self, tooltip: impl Into<String>) -> Self
Set the tooltip for this parent field.
Sourcepub fn with_parent(self, parent_name: impl Into<String>) -> Self
pub fn with_parent(self, parent_name: impl Into<String>) -> Self
Set the parent field name (for nested parents).
Trait Implementations§
Source§impl Clone for ParentFieldConfig
impl Clone for ParentFieldConfig
Source§fn clone(&self) -> ParentFieldConfig
fn clone(&self) -> ParentFieldConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParentFieldConfig
impl RefUnwindSafe for ParentFieldConfig
impl Send for ParentFieldConfig
impl Sync for ParentFieldConfig
impl Unpin for ParentFieldConfig
impl UnsafeUnpin for ParentFieldConfig
impl UnwindSafe for ParentFieldConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more