Skip to main content

StyleLookup

Trait StyleLookup 

Source
pub trait StyleLookup {
Show 15 methods // Provided methods fn char_bold(&self, _id: CharShapeIndex) -> Option<bool> { ... } fn char_italic(&self, _id: CharShapeIndex) -> Option<bool> { ... } fn char_underline(&self, _id: CharShapeIndex) -> Option<UnderlineType> { ... } fn char_strikeout(&self, _id: CharShapeIndex) -> Option<bool> { ... } fn char_superscript(&self, _id: CharShapeIndex) -> Option<bool> { ... } fn char_subscript(&self, _id: CharShapeIndex) -> Option<bool> { ... } fn char_font_name(&self, _id: CharShapeIndex) -> Option<&str> { ... } fn char_font_size(&self, _id: CharShapeIndex) -> Option<HwpUnit> { ... } fn char_text_color(&self, _id: CharShapeIndex) -> Option<Color> { ... } fn para_alignment(&self, _id: ParaShapeIndex) -> Option<Alignment> { ... } fn para_list_type(&self, _id: ParaShapeIndex) -> Option<&str> { ... } fn style_name(&self, _id: StyleIndex) -> Option<&str> { ... } fn style_heading_level(&self, _id: StyleIndex) -> Option<u8> { ... } fn image_resolve_filename(&self, _key: &str) -> Option<&str> { ... } fn image_data(&self, _key: &str) -> Option<&[u8]> { ... }
}
Expand description

Trait for querying resolved style properties by index.

This is the bridge between format-specific style stores and format-independent consumers (like the Markdown encoder). Each method takes a branded index and returns Option<T>, where None means the property is unavailable or unsupported.

§Default Implementations

Every method defaults to None, so an empty implementation is valid:

use hwpforge_core::StyleLookup;
use hwpforge_foundation::CharShapeIndex;

struct NoopStore;
impl StyleLookup for NoopStore {}

let store = NoopStore;
assert!(store.char_bold(CharShapeIndex::new(0)).is_none());

Provided Methods§

Source

fn char_bold(&self, _id: CharShapeIndex) -> Option<bool>

Returns whether the character shape at id is bold.

Source

fn char_italic(&self, _id: CharShapeIndex) -> Option<bool>

Returns whether the character shape at id is italic.

Source

fn char_underline(&self, _id: CharShapeIndex) -> Option<UnderlineType>

Returns the underline type of the character shape at id.

Source

fn char_strikeout(&self, _id: CharShapeIndex) -> Option<bool>

Returns whether the character shape at id has strikeout.

Source

fn char_superscript(&self, _id: CharShapeIndex) -> Option<bool>

Returns whether the character shape at id is superscript.

Source

fn char_subscript(&self, _id: CharShapeIndex) -> Option<bool>

Returns whether the character shape at id is subscript.

Source

fn char_font_name(&self, _id: CharShapeIndex) -> Option<&str>

Returns the font name of the character shape at id.

Source

fn char_font_size(&self, _id: CharShapeIndex) -> Option<HwpUnit>

Returns the font size (in HwpUnit) of the character shape at id.

Source

fn char_text_color(&self, _id: CharShapeIndex) -> Option<Color>

Returns the text color of the character shape at id.

Source

fn para_alignment(&self, _id: ParaShapeIndex) -> Option<Alignment>

Returns the horizontal alignment of the paragraph shape at id.

Source

fn para_list_type(&self, _id: ParaShapeIndex) -> Option<&str>

Returns the list type for a paragraph shape: "BULLET", "NUMBER", or None.

Returns None if the paragraph has no list heading or if the heading type is NONE / OUTLINE.

Source

fn style_name(&self, _id: StyleIndex) -> Option<&str>

Returns the Korean name of the style at id.

Source

fn style_heading_level(&self, _id: StyleIndex) -> Option<u8>

Returns the heading level (1–6) of the style at id, if it is a heading style. Returns None for non-heading styles.

Source

fn image_resolve_filename(&self, _key: &str) -> Option<&str>

Resolves a binaryItemIDRef (e.g. "BinData/image1") to the actual filename with extension (e.g. "image1.png").

Returns None if no matching image is found.

Source

fn image_data(&self, _key: &str) -> Option<&[u8]>

Returns the raw binary data for the image identified by key.

key is typically a path like "image1.jpg". Returns None if the image is not available or if the implementor does not store image data.

Implementors§