1#![allow(dead_code)]
2use hard_xml::{XmlRead, XmlWrite};
3use std::borrow::Cow;
4
5use crate::{
6 __define_enum, __define_struct, __string_enum,
7 document::HeaderFooterReference,
8 formatting::{PageCols, PageGrid, PageMargin, PageSize},
9};
10
11use super::Bidi;
12
13#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
16#[cfg_attr(test, derive(PartialEq))]
17#[xml(tag = "w:sectPr")]
18pub struct SectionProperty<'a> {
19 #[xml(attr = "w:rsidR")]
24 pub rsid_r: Option<Cow<'a, str>>,
25 #[xml(attr = "w:rsidRDefault")]
26 pub rsid_r_default: Option<Cow<'a, str>>,
27
28 #[xml(child = "w:headerReference", child = "w:footerReference")]
29 pub header_footer_references: Vec<HeaderFooterReference<'a>>,
31 #[xml(child = "w:footnotePr")]
33 pub footnote_property: Option<FootnoteProperty>,
34 #[xml(child = "w:endnotePr")]
36 pub endnote_property: Option<EndnoteProperty>,
37 #[xml(child = "w:type")]
39 pub ty: Option<SectionTypeP>,
40 #[xml(child = "w:pgSz")]
41 pub page_size: Option<PageSize>,
42 #[xml(child = "w:pgMar")]
43 pub page_margin: Option<PageMargin>,
44 #[xml(child = "w:paperSrc")]
46 pub paper_source: Option<PaperSource>,
47 #[xml(child = "w:pgBorders")]
49 pub page_borders: Option<PgBorders>,
50 #[xml(child = "w:lnNumType")]
52 pub line_numbering: Option<PgLnNumType>,
53 #[xml(child = "w:pgNumType")]
55 pub page_numbering: Option<PgNumType>,
56 #[xml(child = "w:cols")]
58 pub cols: Option<PageCols>,
59 #[xml(child = "w:formProt")]
61 pub form_prot: Option<FormProt>,
62 #[xml(child = "w:vAlign")]
64 pub v_align: Option<VAlign>,
65 #[xml(child = "w:noEndnote")]
67 pub no_endnote: Option<NoEndnote>,
68 #[xml(child = "w:titlePg")]
70 pub title_page: Option<TitlePage>,
71 #[xml(child = "w:textDirection")]
73 pub text_direction: Option<TextDirection>,
74 #[xml(child = "w:bidi")]
76 pub bidi: Option<Bidi>,
77 #[xml(child = "w:rtlGutter")]
79 pub rtl_gutter: Option<RtlGutter>,
80 #[xml(child = "w:docGrid")]
82 pub grid: Option<PageGrid>,
83 #[xml(child = "w:sectPrChange")]
88 pub revision: Option<Revision<'a>>,
89}
90
91#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
94#[cfg_attr(test, derive(PartialEq))]
95#[xml(tag = "w:sectPr")]
96pub struct PreviousSectionProperty<'a> {
97 #[xml(attr = "w:rsidR")]
102 pub rsid_r: Option<Cow<'a, str>>,
103 #[xml(attr = "w:rsidRDefault")]
104 pub rsid_r_default: Option<Cow<'a, str>>,
105
106 #[xml(child = "w:footnotePr")]
108 pub footnote_property: Option<FootnoteProperty>,
109 #[xml(child = "w:endnotePr")]
111 pub endnote_property: Option<EndnoteProperty>,
112 #[xml(child = "w:type")]
114 pub ty: Option<SectionTypeP>,
115 #[xml(child = "w:pgSz")]
116 pub page_size: Option<PageSize>,
117 #[xml(child = "w:pgMar")]
118 pub page_margin: Option<PageMargin>,
119 #[xml(child = "w:paperSrc")]
121 pub paper_source: Option<PaperSource>,
122 #[xml(child = "w:pgBorders")]
124 pub page_borders: Option<PgBorders>,
125 #[xml(child = "w:lnNumType")]
127 pub line_numbering: Option<PgLnNumType>,
128 #[xml(child = "w:pgNumType")]
130 pub page_numbering: Option<PgNumType>,
131 #[xml(child = "w:cols")]
133 pub cols: Option<PageCols>,
134 #[xml(child = "w:formProt")]
136 pub form_prot: Option<FormProt>,
137 #[xml(child = "w:vAlign")]
139 pub v_align: Option<VAlign>,
140 #[xml(child = "w:noEndnote")]
142 pub no_endnote: Option<NoEndnote>,
143 #[xml(child = "w:titlePg")]
145 pub title_page: Option<TitlePage>,
146 #[xml(child = "w:textDirection")]
148 pub text_direction: Option<TextDirection>,
149 #[xml(child = "w:bidi")]
151 pub bidi: Option<Bidi>,
152 #[xml(child = "w:rtlGutter")]
154 pub rtl_gutter: Option<RtlGutter>,
155 #[xml(child = "w:docGrid")]
157 pub grid: Option<PageGrid>,
158 }
162
163__define_struct! {
164 ("w:pgBorders", PgBorders) {
165 "w:zOrder", z_order, PageBorderZOrder "w:display", display, PageBorderDisplay "w:offsetFrom", offset_from, PageBorderOffset } {
169 "w:top", top, PgTopBorder
170 "w:left", left, PgLeftBorder
171 "w:bottom", bottom, PgBottomBorder
172 "w:right", right, PgRightBorder
173 }
174}
175
176__define_enum! {
177 PageBorderZOrder {
178 Front = "front", Back = "back", }
181}
182
183__define_enum! {
184 PageBorderDisplay {
185 AllPages = "allPages", FirstPage = "firstPage", NotFirstPage = "notFirstPage", }
189}
190
191__define_enum! {
192 PageBorderOffset {
193 Page = "page", Text = "text", }
196}
197
198__define_struct! {
199 ("w:top", PgTopBorder) {
200 "w:val", style, super::BorderStyle
201 "w:color", color, String
202 "w:themeColor", theme_color, crate::formatting::ThemeColor
203 "w:themeTint", theme_tint, String
204 "w:themeShade", theme_shade, String
205 "w:sz", size, isize "w:space", space, isize
207 "w:shadow", shadow, bool
208 "w:frame", frame, bool
209 }
210}
211
212__define_struct! {
213 ("w:bottom", PgBottomBorder) {
214 "w:val", style, super::BorderStyle
215 "w:color", color, String
216 "w:themeColor", theme_color, crate::formatting::ThemeColor
217 "w:themeTint", theme_tint, String
218 "w:themeShade", theme_shade, String
219 "w:sz", size, isize "w:space", space, isize
221 "w:shadow", shadow, bool
222 "w:frame", frame, bool
223 }
224}
225
226__define_struct! {
227 ("w:left", PgLeftBorder) {
228 "w:val", style, super::BorderStyle
229 "w:color", color, String
230 "w:themeColor", theme_color, crate::formatting::ThemeColor
231 "w:themeTint", theme_tint, String
232 "w:themeShade", theme_shade, String
233 "w:sz", size, isize "w:space", space, isize
235 "w:shadow", shadow, bool
236 "w:frame", frame, bool
237 }
238}
239
240__define_struct! {
241 ("w:right", PgRightBorder) {
242 "w:val", style, super::BorderStyle
243 "w:color", color, String
244 "w:themeColor", theme_color, crate::formatting::ThemeColor
245 "w:themeTint", theme_tint, String
246 "w:themeShade", theme_shade, String
247 "w:sz", size, isize "w:space", space, isize
249 "w:shadow", shadow, bool
250 "w:frame", frame, bool
251 }
252}
253
254__define_struct! {
255 ("w:lnNumType", PgLnNumType) {
256 "w:countBy", count_by, isize "w:start", start, isize "w:distance", distance, isize "w:restart", restart, LineNumberRestart }
261}
262
263__define_enum! {
264 LineNumberRestart
265 {
266 NewPage = "newPage", NewSection = "newSection", Continuous = "continuous", }
270}
271
272__define_struct! {
273 ("w:pgNumType", PgNumType) {
274 "w:fmt", fmt, NumberFormat "w:start", start, isize "w:chapStyle", chap_style, isize"w:chapSep", chap_sep, ChapterSep}
279}
280
281__define_enum! {
282 NumberFormat {
283 Decimal = "decimal", UpperRoman = "upperRoman", LowerRoman = "lowerRoman", UpperLetter = "upperLetter", LowerLetter = "lowerLetter", Ordinal = "ordinal", CardinalText = "cardinalText", OrdinalText = "ordinalText", Hex = "hex", Chicago = "chicago", IdeographDigital = "ideographDigital", JapaneseCounting = "japaneseCounting", Aiueo = "aiueo", Iroha = "iroha", DecimalFullWidth = "decimalFullWidth", DecimalHalfWidth = "decimalHalfWidth", JapaneseLegal = "japaneseLegal", JapaneseDigitalTenThousand = "japaneseDigitalTenThousand", DecimalEnclosedCircle = "decimalEnclosedCircle", DecimalFullWidth2 = "decimalFullWidth2", AiueoFullWidth = "aiueoFullWidth", IrohaFullWidth = "irohaFullWidth", DecimalZero = "decimalZero", Bullet = "bullet", Ganada = "ganada", Chosung = "chosung", DecimalEnclosedFullstop = "decimalEnclosedFullstop", DecimalEnclosedParen = "decimalEnclosedParen", DecimalEnclosedCircleChinese = "decimalEnclosedCircleChinese", IdeographEnclosedCircle = "ideographEnclosedCircle", IdeographTraditional = "ideographTraditional", IdeographZodiac = "ideographZodiac", IdeographZodiacTraditional = "ideographZodiacTraditional", TaiwaneseCounting = "taiwaneseCounting", IdeographLegalTraditional = "ideographLegalTraditional", TaiwaneseCountingThousand = "taiwaneseCountingThousand", TaiwaneseDigital = "taiwaneseDigital", ChineseCounting = "chineseCounting", ChineseLegalSimplified = "chineseLegalSimplified", ChineseCountingThousand = "chineseCountingThousand", KoreanDigital = "koreanDigital", KoreanCounting = "koreanCounting", KoreanLegal = "koreanLegal", KoreanDigital2 = "koreanDigital2", VietnameseCounting = "vietnameseCounting", RussianLower = "russianLower", RussianUpper = "russianUpper", None = "none", NumberInDash = "numberInDash", Hebrew1 = "hebrew1", Hebrew2 = "hebrew2", ArabicAlpha = "arabicAlpha", ArabicAbjad = "arabicAbjad", HindiVowels = "hindiVowels", HindiConsonants = "hindiConsonants", HindiNumbers = "hindiNumbers", HindiCounting = "hindiCounting", ThaiLetters = "thaiLetters", ThaiNumbers = "thaiNumbers", ThaiCounting = "thaiCounting", }
344}
345
346__define_enum! {
347 ChapterSep {
348 Hyphen = "hyphen", Period = "period", Colon = "colon", EmDash = "emDash", EnDash = "enDash", }
354}
355
356#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
357#[cfg_attr(test, derive(PartialEq))]
358#[xml(tag = "w:sectPrChange")]
359pub struct Revision<'a> {
360 #[xml(attr = "w:id")]
361 pub id: isize,
362 #[xml(attr = "w:author")]
363 pub author: Cow<'a, str>,
364 #[xml(attr = "w:date")]
365 pub date: Option<Cow<'a, str>>,
366
367 #[xml(child = "w:secPr")]
368 pub section_property: Option<PreviousSectionProperty<'a>>,
369}
370
371#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
372#[cfg_attr(test, derive(PartialEq))]
373#[xml(tag = "w:type")]
374pub struct SectionTypeP {
375 #[xml(attr = "w:val")]
376 pub ty: Option<SectionType>,
377}
378
379#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
380#[cfg_attr(test, derive(PartialEq))]
381#[xml(tag = "w:formProt")]
382pub struct FormProt {
383 #[xml(attr = "w:val")]
384 pub val: Option<bool>,
385}
386
387#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
388#[cfg_attr(test, derive(PartialEq))]
389#[xml(tag = "w:noEndnote")]
390pub struct NoEndnote {
391 #[xml(attr = "w:val")]
392 pub val: Option<bool>,
393}
394
395#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
404#[cfg_attr(test, derive(PartialEq))]
405#[xml(tag = "w:paperSrc")]
406pub struct PaperSource {
407 #[xml(attr = "w:first")]
408 pub first: Option<isize>,
409 #[xml(attr = "w:other")]
410 pub other: Option<isize>,
411}
412
413__define_struct! {
414 ("w:textAlignment", TextAlignment) {
415 "w:val", val, TextAlignmentType
416 }
417}
418
419__define_enum! {
420 TextAlignmentType {
421 Top = "top", Center = "center", Baseline = "baseline", Bottom = "bottom", Auto = "auto", }
427}
428
429__define_struct! {
430 ("w:textboxTightWrap", TextboxTightWrap) {
431 "w:val", val, TextboxTightWrapType
432 }
433}
434
435__define_enum! {
436 TextboxTightWrapType {
437 None = "none", AllLines = "allLines", FirstAndLastLine = "firstAndLastLine", FirstLineOnly = "firstLineOnly", LastLineOnly = "lastLineOnly", }
443}
444
445#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
446#[cfg_attr(test, derive(PartialEq))]
447#[xml(tag = "w:textDirection")]
448pub struct TextDirection {
449 #[xml(attr = "w:val")]
450 pub val: TextDirectionType,
451}
452
453#[derive(Debug, Default, Clone)]
454#[cfg_attr(test, derive(PartialEq))]
455pub enum TextDirectionType {
456 #[default]
457 LrTb, TbRl, BtLr, LrTbV, TbRlV, TbLrV, }
464
465__string_enum! {
466 TextDirectionType {
467 LrTb = "lrTb",
468 TbRl = "tbRl",
469 BtLr = "btLr",
470 LrTbV = "lrTbV",
471 TbRlV = "tbRlV",
472 TbLrV = "tbLrV",
473 }
474}
475
476#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
477#[cfg_attr(test, derive(PartialEq))]
478#[xml(tag = "w:vAlign")]
479pub struct VAlign {
480 #[xml(attr = "w:val")]
481 pub val: VAlignType,
482}
483
484impl From<VAlignType> for VAlign {
485 fn from(al_type: VAlignType) -> Self {
486 Self { val: al_type }
487 }
488}
489
490#[derive(Debug, Default, Clone)]
491#[cfg_attr(test, derive(PartialEq))]
492pub enum VAlignType {
493 #[default]
494 Top, Center, Both, Bottom, }
499
500__string_enum! {
501 VAlignType {
502 Top = "top",
503 Center = "center",
504 Both = "both",
505 Bottom = "bottom",
506 }
507}
508
509#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
510#[cfg_attr(test, derive(PartialEq))]
511#[xml(tag = "w:rtlGutter")]
512pub struct RtlGutter {
513 #[xml(attr = "w:val")]
514 pub val: Option<bool>,
515}
516
517#[derive(Debug, Clone)]
518#[cfg_attr(test, derive(PartialEq))]
519pub enum SectionType {
520 NextPage,
521 NextColumn,
522 Continuous,
523 EvenPage,
524 OddPage,
525}
526
527__string_enum! {
528 SectionType {
529 NextPage = "nextPage",
530 NextColumn = "nextColumn",
531 Continuous = "continuous",
532 EvenPage = "evenPage",
533 OddPage = "oddPage",
534 }
535}
536
537#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
538#[cfg_attr(test, derive(PartialEq))]
539#[xml(tag = "w:titlePg")]
540pub struct TitlePage {}
541
542#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
543#[cfg_attr(test, derive(PartialEq))]
544#[xml(tag = "w:footnotePr")]
545pub struct FootnoteProperty {
546 #[xml(child = "w:pos")]
547 pub position: Option<FootnotePosition>,
548 #[xml(child = "w:numFmt")]
549 pub num_fmt: Option<NumFmt>,
550 #[xml(child = "w:numStart")]
552 pub num_start: Option<NumStart>,
553 #[xml(child = "w:numRestart")]
555 pub num_restart: Option<NumRestart>,
556}
557
558#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
559#[cfg_attr(test, derive(PartialEq))]
560#[xml(tag = "w:endnotePr")]
561pub struct EndnoteProperty {
562 #[xml(child = "w:pos")]
563 pub position: Option<EndnotePosition>,
564 #[xml(child = "w:numFmt")]
565 pub num_fmt: Option<NumFmt>,
566 #[xml(child = "w:numStart")]
568 pub num_start: Option<NumStart>,
569 #[xml(child = "w:numRestart")]
571 pub num_restart: Option<NumRestart>,
572}
573
574#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
575#[cfg_attr(test, derive(PartialEq))]
576#[xml(tag = "w:footnotePr")]
577pub struct FootnoteProperty2 {
578 #[xml(child = "w:pos")]
579 pub position: Option<FootnotePosition>,
580 #[xml(child = "w:numFmt")]
581 pub num_fmt: Option<NumFmt>,
582 #[xml(child = "w:numStart")]
584 pub num_start: Option<NumStart>,
585 #[xml(child = "w:numRestart")]
587 pub num_restart: Option<NumRestart>,
588 #[xml(child = "w:footnote")]
589 pub footnote: Vec<Footnote>,
590}
591
592#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
593#[cfg_attr(test, derive(PartialEq))]
594#[xml(tag = "w:footnote")]
595pub struct Footnote {
596 #[xml(attr = "w:id")]
597 pub id: isize,
598}
599
600#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
601#[cfg_attr(test, derive(PartialEq))]
602#[xml(tag = "w:endnotePr")]
603pub struct EndnoteProperty2 {
604 #[xml(child = "w:pos")]
605 pub position: Option<EndnotePosition>,
606 #[xml(child = "w:numFmt")]
607 pub num_fmt: Option<NumFmt>,
608 #[xml(child = "w:numStart")]
610 pub num_start: Option<NumStart>,
611 #[xml(child = "w:numRestart")]
613 pub num_restart: Option<NumRestart>,
614 #[xml(child = "w:endnote")]
615 pub endnote: Vec<Endnote>,
616}
617
618#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
619#[cfg_attr(test, derive(PartialEq))]
620#[xml(tag = "w:endnote")]
621pub struct Endnote {
622 #[xml(attr = "w:id")]
623 pub id: isize,
624}
625
626#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
627#[cfg_attr(test, derive(PartialEq))]
628#[xml(tag = "w:numRestart")]
629pub struct NumRestart {
630 #[xml(attr = "w:val")]
631 pub val: NumRestartType,
632}
633
634#[derive(Debug, Default, Clone)]
635#[cfg_attr(test, derive(PartialEq))]
636pub enum NumRestartType {
637 #[default]
638 Continuous, EachSect, EachPage, }
642
643__string_enum! {
644 NumRestartType {
645 Continuous = "continuous",
646 EachSect = "eachSect",
647 EachPage = "eachPage",
648 }
649}
650
651#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
652#[cfg_attr(test, derive(PartialEq))]
653#[xml(tag = "w:numStart")]
654pub struct NumStart {
655 #[xml(attr = "w:val")]
656 pub val: Option<isize>,
657}
658
659#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
660#[cfg_attr(test, derive(PartialEq))]
661#[xml(tag = "w:numFmt")]
662pub struct NumFmt {
663 #[xml(attr = "w:val")]
664 pub ty: NumFmtType,
665}
666
667#[derive(Debug, Default, Clone)]
668#[cfg_attr(test, derive(PartialEq))]
669pub enum NumFmtType {
670 #[default]
671 Decimal, UpperRoman, LowerRoman, UpperLetter, LowerLetter, Ordinal, CardinalText, OrdinalText, Hex, Chicago, IdeographDigital, JapaneseCounting, Aiueo, Iroha, DecimalFullWidth, DecimalHalfWidth, JapaneseLegal, JapaneseDigitalTenThousand, DecimalEnclosedCircle, DecimalFullWidth2, AiueoFullWidth, IrohaFullWidth, DecimalZero, Bullet, Ganada, Chosung, DecimalEnclosedFullstop, DecimalEnclosedParen, DecimalEnclosedCircleChinese, IdeographEnclosedCircle, IdeographTraditional, IdeographZodiac, IdeographZodiacTraditional, TaiwaneseCounting, IdeographLegalTraditional, TaiwaneseCountingThousand, TaiwaneseDigital, ChineseCounting, ChineseLegalSimplified, ChineseCountingThousand, KoreanDigital, KoreanCounting, KoreanLegal, KoreanDigital2, VietnameseCounting, RussianLower, RussianUpper, None, NumberInDash, Hebrew1, Hebrew2, ArabicAlpha, ArabicAbjad, HindiVowels, HindiConsonants, HindiNumbers, HindiCounting, ThaiLetters, ThaiNumbers, ThaiCounting, }
732
733__string_enum! {
734 NumFmtType {
735 Decimal = "decimal",
736 UpperRoman = "upperRoman",
737 LowerRoman = "lowerRoman",
738 UpperLetter = "upperLetter",
739 LowerLetter = "lowerLetter",
740 Ordinal = "ordinal",
741 CardinalText = "cardinalText",
742 OrdinalText = "ordinalText",
743 Hex = "hex",
744 Chicago = "chicago",
745 IdeographDigital = "ideographDigital",
746 JapaneseCounting = "japaneseCounting",
747 Aiueo = "aiueo",
748 Iroha = "iroha",
749 DecimalFullWidth = "decimalFullWidth",
750 DecimalHalfWidth = "decimalHalfWidth",
751 JapaneseLegal = "japaneseLegal",
752 JapaneseDigitalTenThousand = "japaneseDigitalTenThousand",
753 DecimalEnclosedCircle = "decimalEnclosedCircle",
754 DecimalFullWidth2 = "decimalFullWidth2",
755 AiueoFullWidth = "aiueoFullWidth",
756 IrohaFullWidth = "irohaFullWidth",
757 DecimalZero = "decimalZero",
758 Bullet = "bullet",
759 Ganada = "ganada",
760 Chosung = "chosung",
761 DecimalEnclosedFullstop = "decimalEnclosedFullstop",
762 DecimalEnclosedParen = "decimalEnclosedParen",
763 DecimalEnclosedCircleChinese = "decimalEnclosedCircleChinese",
764 IdeographEnclosedCircle = "ideographEnclosedCircle",
765 IdeographTraditional = "ideographTraditional",
766 IdeographZodiac = "ideographZodiac",
767 IdeographZodiacTraditional = "ideographZodiacTraditional",
768 TaiwaneseCounting = "taiwaneseCounting",
769 IdeographLegalTraditional = "ideographLegalTraditional",
770 TaiwaneseCountingThousand = "taiwaneseCountingThousand",
771 TaiwaneseDigital = "taiwaneseDigital",
772 ChineseCounting = "chineseCounting",
773 ChineseLegalSimplified = "chineseLegalSimplified",
774 ChineseCountingThousand = "chineseCountingThousand",
775 KoreanDigital = "koreanDigital",
776 KoreanCounting = "koreanCounting",
777 KoreanLegal = "koreanLegal",
778 KoreanDigital2 = "koreanDigital2",
779 VietnameseCounting = "vietnameseCounting",
780 RussianLower = "russianLower",
781 RussianUpper = "russianUpper",
782 None = "none",
783 NumberInDash = "numberInDash",
784 Hebrew1 = "hebrew1",
785 Hebrew2 = "hebrew2",
786 ArabicAlpha = "arabicAlpha",
787 ArabicAbjad = "arabicAbjad",
788 HindiVowels = "hindiVowels",
789 HindiConsonants = "hindiConsonants",
790 HindiNumbers = "hindiNumbers",
791 HindiCounting = "hindiCounting",
792 ThaiLetters = "thaiLetters",
793 ThaiNumbers = "thaiNumbers",
794 ThaiCounting = "thaiCounting",
795 }
796}
797
798#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
799#[cfg_attr(test, derive(PartialEq))]
800#[xml(tag = "w:pos")]
801pub struct FootnotePosition {
802 #[xml(attr = "w:val")]
803 pub val: PositionType,
804}
805
806#[derive(Debug, Default, Clone)]
807#[cfg_attr(test, derive(PartialEq))]
808pub enum PositionType {
809 #[default]
810 PageBottom, BeneathText, SectEnd, DocEnd, }
815
816__string_enum! {
817 PositionType {
818 PageBottom = "pageBottom",
819 BeneathText = "beneathText",
820 SectEnd = "sectEnd",
821 DocEnd = "docEnd",
822 }
823}
824
825#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
826#[cfg_attr(test, derive(PartialEq))]
827#[xml(tag = "w:pos")]
828pub struct EndnotePosition {
829 #[xml(attr = "w:val")]
830 pub val: EndnotePositionType,
831}
832
833#[derive(Debug, Default, Clone)]
834#[cfg_attr(test, derive(PartialEq))]
835pub enum EndnotePositionType {
836 #[default]
837 SectEnd, DocEnd, }
840
841__string_enum! {
842 EndnotePositionType {
843 SectEnd = "sectEnd",
844 DocEnd = "docEnd",
845 }
846}
847
848impl<'a> SectionProperty<'a> {
849 fn first_page_has_diffrent_header_and_footer(&mut self, val: bool) -> &mut Self {
856 if val {
857 self.title_page = Some(TitlePage::default());
858 } else {
859 self.title_page = None;
860 }
861 self
862 }
863}
864
865