pub struct HeaderFooter {
pub paragraphs: Vec<Paragraph>,
pub apply_page_type: ApplyPageType,
pub vert_align: VerticalAlign,
pub text_width: HwpUnit,
pub text_height: HwpUnit,
}Expand description
A header or footer region containing paragraphs.
In HWPX, headers and footers appear as <hp:header> / <hp:footer>
elements inside <hp:ctrl> in the section body. Each contains its own
paragraphs and an ApplyPageType controlling which pages it applies to.
§Examples
use hwpforge_core::section::HeaderFooter;
use hwpforge_core::paragraph::Paragraph;
use hwpforge_foundation::{ApplyPageType, ParaShapeIndex};
let hf = HeaderFooter::new(
vec![Paragraph::new(ParaShapeIndex::new(0))],
ApplyPageType::Both,
);
assert_eq!(hf.paragraphs.len(), 1);
assert_eq!(hf.apply_page_type, ApplyPageType::Both);Fields§
§paragraphs: Vec<Paragraph>Paragraphs composing the header/footer content.
apply_page_type: ApplyPageTypeWhich pages this header/footer applies to.
vert_align: VerticalAlign컨테이너(subList) 세로 정렬 (W5-α H1 — 일반 꼬리말 실측 = BOTTOM).
밴드 안에서 문단 블록을 어디에 앉히는지 결정한다 — 렌더 재생의
필수 입력. HWPX <hp:subList vertAlign>.
text_width: HwpUnit컨테이너 텍스트 폭 (HWPX <hp:subList textWidth>, 0 = 위임).
text_height: HwpUnit컨테이너 텍스트 높이 (HWPX <hp:subList textHeight>, 0 = 위임).
밴드(margin.header/footer)와 다를 수 있다 — 초과 시 동작은 실측 전이므로 렌더는 fail-closed 로 다룬다 (W5-a).
Implementations§
Sourcepub fn new(paragraphs: Vec<Paragraph>, apply_page_type: ApplyPageType) -> Self
pub fn new(paragraphs: Vec<Paragraph>, apply_page_type: ApplyPageType) -> Self
Creates a new header/footer with the given paragraphs and page scope.
컨테이너 기하는 기본값(Top/0/0 = 위임)으로 시작한다 — wire 승격은 디코더가 채운다.
Sourcepub fn all_pages(paragraphs: Vec<Paragraph>) -> Self
pub fn all_pages(paragraphs: Vec<Paragraph>) -> Self
Creates a header/footer applied to all pages (both odd and even).
This is the most common case for simple documents that use a single header or footer on every page.
§Examples
use hwpforge_core::section::HeaderFooter;
use hwpforge_core::paragraph::Paragraph;
use hwpforge_foundation::{ApplyPageType, ParaShapeIndex};
let hf = HeaderFooter::all_pages(vec![Paragraph::new(ParaShapeIndex::new(0))]);
assert_eq!(hf.apply_page_type, ApplyPageType::Both);
assert_eq!(hf.paragraphs.len(), 1);Trait Implementations§
Source§fn clone(&self) -> HeaderFooter
fn clone(&self) -> HeaderFooter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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§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 more