pub struct TabDef {
pub id: u32,
pub auto_tab_left: bool,
pub auto_tab_right: bool,
pub stops: Vec<TabStop>,
}Expand description
A single tab property definition.
Maps to HWPX <hh:tabPr>.
Fields§
§id: u32Tab property ID (0-based).
auto_tab_left: boolAuto-insert tab at left margin.
auto_tab_right: boolAuto-insert tab at right margin.
stops: Vec<TabStop>Explicit tab stops.
Implementations§
Source§impl TabDef
impl TabDef
Sourcepub const BUILTIN_COUNT: u32 = 3
pub const BUILTIN_COUNT: u32 = 3
Number of built-in tab definitions reserved by modern Hancom HWPX.
Sourcepub const FIRST_CUSTOM_ID: u32 = Self::BUILTIN_COUNT
pub const FIRST_CUSTOM_ID: u32 = Self::BUILTIN_COUNT
First ID available for user-defined/custom tab definitions.
Sourcepub fn defaults() -> [Self; 3]
pub fn defaults() -> [Self; 3]
Returns the 3 default tab properties (한글 Modern).
Matches golden fixture tests/fixtures/textbox.hwpx:
- id=0: no auto tabs (default for most paragraphs)
- id=1:
autoTabLeft=1(outline numbering auto-indent) - id=2:
autoTabRight=1(right-aligned tab)
Sourcepub fn is_builtin_id(id: u32) -> bool
pub fn is_builtin_id(id: u32) -> bool
Returns true when id points at a built-in Hancom tab definition.
Sourcepub fn is_custom_id(id: u32) -> bool
pub fn is_custom_id(id: u32) -> bool
Returns true when id points at a custom/user-defined tab definition.
Sourcepub fn merged_with_defaults<'a>(
tabs: impl IntoIterator<Item = &'a Self>,
) -> Vec<Self>
pub fn merged_with_defaults<'a>( tabs: impl IntoIterator<Item = &'a Self>, ) -> Vec<Self>
Returns built-in tab definitions merged with explicit overrides/custom tabs.
Built-in ids 0..=2 are always present in the result. Incoming
definitions with the same ids override the built-in defaults.
Sourcepub fn reference_is_known(
id: u32,
known_custom_ids: impl IntoIterator<Item = u32>,
) -> bool
pub fn reference_is_known( id: u32, known_custom_ids: impl IntoIterator<Item = u32>, ) -> bool
Returns true when id resolves to either a built-in definition or one
of the provided custom definition ids.
Sourcepub fn clamp_position_from_unsigned(raw: u64) -> HwpUnit
pub fn clamp_position_from_unsigned(raw: u64) -> HwpUnit
Clamps an unsigned raw tab position into the valid HwpUnit range.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TabDef
impl<'de> Deserialize<'de> for TabDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for TabDef
impl JsonSchema for TabDef
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl Eq for TabDef
impl StructuralPartialEq for TabDef
Auto Trait Implementations§
impl Freeze for TabDef
impl RefUnwindSafe for TabDef
impl Send for TabDef
impl Sync for TabDef
impl Unpin for TabDef
impl UnsafeUnpin for TabDef
impl UnwindSafe for TabDef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.