docx_rust/document/
theme.rs

1//! Theme part
2//!
3//! The corresponding ZIP item is `/word/theme/theme{n}.xml`.
4//!
5#![allow(unused_must_use)]
6#![allow(unused_imports)]
7use hard_xml::{XmlRead, XmlResult, XmlWrite, XmlWriter};
8use std::borrow::Cow;
9use std::io::Write;
10
11use crate::schema::{SCHEMA_DRAWINGML, SCHEMA_MAIN, SCHEMA_WORDML_14};
12use crate::{__define_struct, __define_struct_vec, __string_enum, __xml_test_suites, write_attr};
13
14/// The root element of the main document part.
15#[derive(Debug, Default, XmlRead, Clone)]
16#[cfg_attr(test, derive(PartialEq))]
17#[xml(tag = "a:theme")]
18pub struct Theme<'a> {
19    #[xml(attr = "name")]
20    pub name: Option<Cow<'a, str>>,
21    #[xml(child = "a:themeElements")]
22    pub elements: ThemeElements<'a>,
23    #[xml(child = "a:objectDefaults")]
24    pub defaults: Option<ObjectDefaults>,
25    #[xml(child = "a:extraClrSchemeLst")]
26    pub extra_clr_scheme_lst: Option<ExtraClrSchemeLst>,
27    #[xml(child = "a:custClrLst")]
28    pub cust_clr_lst: Option<CustClrLst<'a>>,
29    #[xml(child = "a:extLst")]
30    pub ext_lst: Option<ExtLst>,
31}
32
33#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
34#[cfg_attr(test, derive(PartialEq))]
35#[xml(tag = "a:custClrLst")]
36pub struct CustClrLst<'a> {
37    #[xml(child = "a:custClr")]
38    pub contents: Vec<CustClr<'a>>,
39}
40
41#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
42#[cfg_attr(test, derive(PartialEq))]
43#[xml(tag = "a:dk1")]
44pub struct Dk1<'a> {
45    #[xml(attr = "name")]
46    pub name: Option<Cow<'a, str>>,
47
48    #[xml(
49        child = "a:scrgbClr",
50        child = "a:srgbClr",
51        child = "a:hslClr",
52        child = "a:sysClr",
53        child = "a:schemeClr",
54        child = "a:prstClr"
55    )]
56    pub custom_color: Vec<CustClrChoice>,
57}
58
59#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
60#[cfg_attr(test, derive(PartialEq))]
61#[xml(tag = "a:lt1")]
62pub struct Lt1<'a> {
63    #[xml(attr = "name")]
64    pub name: Option<Cow<'a, str>>,
65
66    #[xml(
67        child = "a:scrgbClr",
68        child = "a:srgbClr",
69        child = "a:hslClr",
70        child = "a:sysClr",
71        child = "a:schemeClr",
72        child = "a:prstClr"
73    )]
74    pub custom_color: Vec<CustClrChoice>,
75}
76
77#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
78#[cfg_attr(test, derive(PartialEq))]
79#[xml(tag = "a:dk2")]
80pub struct Dk2<'a> {
81    #[xml(attr = "name")]
82    pub name: Option<Cow<'a, str>>,
83
84    #[xml(
85        child = "a:scrgbClr",
86        child = "a:srgbClr",
87        child = "a:hslClr",
88        child = "a:sysClr",
89        child = "a:schemeClr",
90        child = "a:prstClr"
91    )]
92    pub custom_color: Vec<CustClrChoice>,
93}
94
95#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
96#[cfg_attr(test, derive(PartialEq))]
97#[xml(tag = "a:lt2")]
98pub struct Lt2<'a> {
99    #[xml(attr = "name")]
100    pub name: Option<Cow<'a, str>>,
101
102    #[xml(
103        child = "a:scrgbClr",
104        child = "a:srgbClr",
105        child = "a:hslClr",
106        child = "a:sysClr",
107        child = "a:schemeClr",
108        child = "a:prstClr"
109    )]
110    pub custom_color: Vec<CustClrChoice>,
111}
112
113#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
114#[cfg_attr(test, derive(PartialEq))]
115#[xml(tag = "a:accent1")]
116pub struct Accent1<'a> {
117    #[xml(attr = "name")]
118    pub name: Option<Cow<'a, str>>,
119
120    #[xml(
121        child = "a:scrgbClr",
122        child = "a:srgbClr",
123        child = "a:hslClr",
124        child = "a:sysClr",
125        child = "a:schemeClr",
126        child = "a:prstClr"
127    )]
128    pub custom_color: Vec<CustClrChoice>,
129}
130
131#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
132#[cfg_attr(test, derive(PartialEq))]
133#[xml(tag = "a:accent2")]
134pub struct Accent2<'a> {
135    #[xml(attr = "name")]
136    pub name: Option<Cow<'a, str>>,
137
138    #[xml(
139        child = "a:scrgbClr",
140        child = "a:srgbClr",
141        child = "a:hslClr",
142        child = "a:sysClr",
143        child = "a:schemeClr",
144        child = "a:prstClr"
145    )]
146    pub custom_color: Vec<CustClrChoice>,
147}
148
149#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
150#[cfg_attr(test, derive(PartialEq))]
151#[xml(tag = "a:accent3")]
152pub struct Accent3<'a> {
153    #[xml(attr = "name")]
154    pub name: Option<Cow<'a, str>>,
155
156    #[xml(
157        child = "a:scrgbClr",
158        child = "a:srgbClr",
159        child = "a:hslClr",
160        child = "a:sysClr",
161        child = "a:schemeClr",
162        child = "a:prstClr"
163    )]
164    pub custom_color: Vec<CustClrChoice>,
165}
166
167#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
168#[cfg_attr(test, derive(PartialEq))]
169#[xml(tag = "a:accent4")]
170pub struct Accent4<'a> {
171    #[xml(attr = "name")]
172    pub name: Option<Cow<'a, str>>,
173
174    #[xml(
175        child = "a:scrgbClr",
176        child = "a:srgbClr",
177        child = "a:hslClr",
178        child = "a:sysClr",
179        child = "a:schemeClr",
180        child = "a:prstClr"
181    )]
182    pub custom_color: Vec<CustClrChoice>,
183}
184
185#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
186#[cfg_attr(test, derive(PartialEq))]
187#[xml(tag = "a:accent5")]
188pub struct Accent5<'a> {
189    #[xml(attr = "name")]
190    pub name: Option<Cow<'a, str>>,
191
192    #[xml(
193        child = "a:scrgbClr",
194        child = "a:srgbClr",
195        child = "a:hslClr",
196        child = "a:sysClr",
197        child = "a:schemeClr",
198        child = "a:prstClr"
199    )]
200    pub custom_color: Vec<CustClrChoice>,
201}
202
203#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
204#[cfg_attr(test, derive(PartialEq))]
205#[xml(tag = "a:accent6")]
206pub struct Accent6<'a> {
207    #[xml(attr = "name")]
208    pub name: Option<Cow<'a, str>>,
209
210    #[xml(
211        child = "a:scrgbClr",
212        child = "a:srgbClr",
213        child = "a:hslClr",
214        child = "a:sysClr",
215        child = "a:schemeClr",
216        child = "a:prstClr"
217    )]
218    pub custom_color: Vec<CustClrChoice>,
219}
220
221#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
222#[cfg_attr(test, derive(PartialEq))]
223#[xml(tag = "a:hlink")]
224pub struct HLink<'a> {
225    #[xml(attr = "name")]
226    pub name: Option<Cow<'a, str>>,
227
228    #[xml(
229        child = "a:scrgbClr",
230        child = "a:srgbClr",
231        child = "a:hslClr",
232        child = "a:sysClr",
233        child = "a:schemeClr",
234        child = "a:prstClr"
235    )]
236    pub custom_color: Vec<CustClrChoice>,
237}
238
239#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
240#[cfg_attr(test, derive(PartialEq))]
241#[xml(tag = "a:folHlink")]
242pub struct FolHlink<'a> {
243    #[xml(attr = "name")]
244    pub name: Option<Cow<'a, str>>,
245
246    #[xml(
247        child = "a:scrgbClr",
248        child = "a:srgbClr",
249        child = "a:hslClr",
250        child = "a:sysClr",
251        child = "a:schemeClr",
252        child = "a:prstClr"
253    )]
254    pub custom_color: Vec<CustClrChoice>,
255}
256
257#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
258#[cfg_attr(test, derive(PartialEq))]
259#[xml(tag = "a:custClr")]
260pub struct CustClr<'a> {
261    #[xml(attr = "name")]
262    pub name: Option<Cow<'a, str>>,
263
264    #[xml(
265        child = "a:scrgbClr",
266        child = "a:srgbClr",
267        child = "a:hslClr",
268        child = "a:sysClr",
269        child = "a:schemeClr",
270        child = "a:prstClr"
271    )]
272    pub custom_color: Vec<CustClrChoice>,
273}
274
275#[derive(Debug, XmlRead, XmlWrite, Clone)]
276#[cfg_attr(test, derive(PartialEq))]
277pub enum CustClrChoice {
278    ///  RGB Color Model - Percentage Variant
279    #[xml(tag = "a:scrgbClr")]
280    ScrgbClr(ScrgbClr),
281    ///  RGB Color Model - Hex Variant
282    #[xml(tag = "a:srgbClr")]
283    SrgbClr(SrgbClr),
284    ///  Hue, Saturation, Luminance Color Model
285    #[xml(tag = "a:hslClr")]
286    HslClr(HslClr),
287    ///  System Color
288    #[xml(tag = "a:sysClr")]
289    SysClr(SysClr),
290    ///  Scheme Color
291    #[xml(tag = "a:schemeClr")]
292    SchemeClr(SchemeClr),
293    ///  Preset Color
294    #[xml(tag = "a:prstClr")]
295    PrstClr(PrstClr),
296}
297
298#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
299#[cfg_attr(test, derive(PartialEq))]
300#[xml(tag = "a:scrgbClr")]
301pub struct ScrgbClr {
302    #[xml(attr = "r")]
303    pub r: u8,
304    #[xml(attr = "g")]
305    pub g: u8,
306    #[xml(attr = "b")]
307    pub b: u8,
308}
309
310#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
311#[cfg_attr(test, derive(PartialEq))]
312#[xml(tag = "a:srgbClr")]
313pub struct SrgbClr {
314    #[xml(attr = "val")]
315    pub value: Option<String>,
316    #[xml(child = "a:alpha")]
317    pub alpha: Option<Alpha>,
318}
319
320#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
321#[cfg_attr(test, derive(PartialEq))]
322#[xml(tag = "a:alpha")]
323pub struct Alpha {
324    #[xml(attr = "val")]
325    pub value: usize,
326}
327
328#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
329#[cfg_attr(test, derive(PartialEq))]
330#[xml(tag = "a:hslClr")]
331pub struct HslClr {
332    #[xml(attr = "hue")]
333    pub hue: Option<isize>,
334    #[xml(attr = "sat")]
335    pub sat: Option<isize>,
336    #[xml(attr = "lum")]
337    pub lum: Option<isize>,
338}
339
340#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
341#[cfg_attr(test, derive(PartialEq))]
342#[xml(tag = "a:sysClr")]
343pub struct SysClr {
344    #[xml(attr = "val")]
345    pub val: SysClrType,
346    #[xml(attr = "lastClr")]
347    pub last_color: Option<String>,
348}
349
350#[derive(Debug, Default, Clone)]
351#[cfg_attr(test, derive(PartialEq))]
352pub enum SysClrType {
353    #[default]
354    ScrollBar, //Scroll Bar System Color.
355    Background,              //Background System Color.
356    ActiveCaption,           //Active Caption System Color.
357    InactiveCaption,         //Inactive Caption System Color.
358    Menu,                    //Menu System Color.
359    Window,                  //Window System Color.
360    WindowFrame,             //Window Frame System Color.
361    MenuText,                //Menu Text System Color.
362    WindowText,              //Window Text System Color.
363    CaptionText,             //Caption Text System Color.
364    ActiveBorder,            //Active Border System Color.
365    InactiveBorder,          //Inactive Border System Color.
366    AppWorkspace,            //Application Workspace System Color.
367    Highlight,               //Highlight System Color.
368    HighlightText,           //Highlight Text System Color.
369    BtnFace,                 //Button Face System Color.
370    BtnShadow,               //Button Shadow System Color.
371    GrayText,                //Gray Text System Color.
372    BtnText,                 //Button Text System Color.
373    InactiveCaptionText,     //Inactive Caption Text System Color.
374    BtnHighlight,            //Button Highlight System Color.
375    TdDkShadow,              //3D Dark System Color.
376    TdLight,                 //3D Light System Color.
377    InfoText,                //Info Text System Color.
378    InfoBk,                  //Info Back System Color.
379    HotLight,                //Hot Light System Color.
380    GradientActiveCaption,   //Gradient Active Caption System Color.
381    GradientInactiveCaption, //Gradient Inactive Caption System Color.
382    MenuHighlight,           //Menu Highlight System Color.
383    MenuBar,                 //Menu Bar System Color.
384}
385
386__string_enum! {
387    SysClrType {
388        ScrollBar = "scrollBar",
389        Background = "background",
390        ActiveCaption = "activeCaption",
391        InactiveCaption = "inactiveCaption",
392        Menu = "menu",
393        Window = "window",
394        WindowFrame = "windowFrame",
395        MenuText = "menuText",
396        WindowText = "windowText",
397        CaptionText = "captionText",
398        ActiveBorder = "activeBorder",
399        InactiveBorder = "inactiveBorder",
400        AppWorkspace = "appWorkspace",
401        Highlight = "highlight",
402        HighlightText = "highlightText",
403        BtnFace = "btnFace",
404        BtnShadow = "btnShadow",
405        GrayText = "grayText",
406        BtnText = "btnText",
407        InactiveCaptionText = "inactiveCaptionText",
408        BtnHighlight = "btnHighlight",
409        TdDkShadow = "3dDkShadow",
410        TdLight = "3dLight",
411        InfoText = "infoText",
412        InfoBk = "infoBk",
413        HotLight = "hotLight",
414        GradientActiveCaption = "gradientActiveCaption",
415        GradientInactiveCaption = "gradientInactiveCaption",
416        MenuHighlight = "menuHighlight",
417        MenuBar = "menuBar",
418    }
419}
420
421#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
422#[cfg_attr(test, derive(PartialEq))]
423#[xml(tag = "a:schemeClr")]
424pub struct SchemeClr {
425    #[xml(attr = "val")]
426    pub val: SchemeClrType,
427    #[xml(child = "a:lumMod")]
428    pub lum_mod: Option<LuminanceModulation>,
429    #[xml(child = "a:satMod")]
430    pub sat_mod: Option<SaturationModulation>,
431    #[xml(child = "a:tint")]
432    pub tint: Option<Tint>,
433    #[xml(child = "a:shade")]
434    pub shade: Option<Shade>,
435}
436
437#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
438#[cfg_attr(test, derive(PartialEq))]
439#[xml(tag = "a:lumMod")]
440pub struct LuminanceModulation {
441    #[xml(attr = "val")]
442    pub val: isize,
443}
444
445#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
446#[cfg_attr(test, derive(PartialEq))]
447#[xml(tag = "a:satMod")]
448pub struct SaturationModulation {
449    #[xml(attr = "val")]
450    pub val: isize,
451}
452
453#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
454#[cfg_attr(test, derive(PartialEq))]
455#[xml(tag = "a:tint")]
456pub struct Tint {
457    #[xml(attr = "val")]
458    pub val: isize,
459}
460
461#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
462#[cfg_attr(test, derive(PartialEq))]
463#[xml(tag = "a:shade")]
464pub struct Shade {
465    #[xml(attr = "val")]
466    pub val: isize,
467}
468
469#[derive(Debug, Default, Clone)]
470#[cfg_attr(test, derive(PartialEq))]
471pub enum SchemeClrType {
472    #[default]
473    Bg1, //Background Color 1.
474    Tx1,      //Text Color 1.
475    Bg2,      //Background Color 2.
476    Tx2,      //Text Color 2.
477    Accent1,  //Accent Color 1.
478    Accent2,  //Accent Color 2.
479    Accent3,  //Accent Color 3.
480    Accent4,  //Accent Color 4.
481    Accent5,  //Accent Color 5.
482    Accent6,  //Accent Color 6.
483    Hlink,    //Hyperlink Color.
484    FolHlink, //Followed Hyperlink Color.
485    PhClr,    //Style Color.
486    Dk1,      //Dark Color 1.
487    Lt1,      //Light Color 1.
488    Dk2,      //Dark Color 2.
489    Lt2,      //Light Color 2.
490}
491
492__string_enum! {
493    SchemeClrType {
494        Bg1 = "bg1",
495        Tx1 = "tx1",
496        Bg2 = "bg2",
497        Tx2 = "tx2",
498        Accent1 = "accent1",
499        Accent2 = "accent2",
500        Accent3 = "accent3",
501        Accent4 = "accent4",
502        Accent5 = "accent5",
503        Accent6 = "accent6",
504        Hlink = "hlink",
505        FolHlink = "folHlink",
506        PhClr = "phClr",
507        Dk1 = "dk1",
508        Lt1 = "lt1",
509        Dk2 = "dk2",
510        Lt2 = "lt2",
511    }
512}
513
514#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
515#[cfg_attr(test, derive(PartialEq))]
516#[xml(tag = "a:prstClr")]
517pub struct PrstClr {
518    #[xml(attr = "val")]
519    pub val: Option<PrstClrType>,
520}
521
522#[derive(Debug, Default, Clone)]
523#[cfg_attr(test, derive(PartialEq))]
524pub enum PrstClrType {
525    #[default]
526    AliceBlue, //Alice Blue Preset Color.
527    AntiqueWhite,      //Antique White Preset Color.
528    Aqua,              //Aqua Preset Color.
529    Aquamarine,        //Aquamarine Preset Color.
530    Azure,             //Azure Preset Color.
531    Beige,             //Beige Preset Color.
532    Bisque,            //Bisque Preset Color.
533    Black,             //Black Preset Color.
534    BlanchedAlmond,    //Blanched Almond Preset Color.
535    Blue,              //Blue Preset Color.
536    BlueViolet,        //Blue Violet Preset Color.
537    Brown,             //Brown Preset Color.
538    BurlyWood,         //Burly Wood Preset Color.
539    CadetBlue,         //Cadet Blue Preset Color.
540    Chartreuse,        //Chartreuse Preset Color.
541    Chocolate,         //Chocolate Preset Color.
542    Coral,             //Coral Preset Color.
543    CornflowerBlue,    //Cornflower Blue Preset Color.
544    Cornsilk,          //Cornsilk Preset Color.
545    Crimson,           //Crimson Preset Color.
546    Cyan,              //Cyan Preset Color.
547    DkBlue,            //Dark Blue Preset Color.
548    DkCyan,            //Dark Cyan Preset Color.
549    DkGoldenrod,       //Dark Goldenrod Preset Color.
550    DkGray,            //Dark Gray Preset Color.
551    DkGreen,           //Dark Green Preset Color.
552    DkKhaki,           //Dark Khaki Preset Color.
553    DkMagenta,         //Dark Magenta Preset Color.
554    DkOliveGreen,      //Dark Olive Green Preset Color.
555    DkOrange,          //Dark Orange Preset Color.
556    DkOrchid,          //Dark Orchid Preset Color.
557    DkRed,             //Dark Red Preset Color.
558    DkSalmon,          //Dark Salmon Preset Color.
559    DkSeaGreen,        //Dark Sea Green Preset Color.
560    DkSlateBlue,       //Dark Slate Blue Preset Color.
561    DkSlateGray,       //Dark Slate Gray Preset Color.
562    DkTurquoise,       //Dark Turquoise Preset Color.
563    DkViolet,          //Dark Violet Preset Color.
564    DeepPink,          //Deep Pink Preset Color.
565    DeepSkyBlue,       //Deep Sky Blue Preset Color.
566    DimGray,           //Dim Gray Preset Color.
567    DodgerBlue,        //Dodger Blue Preset Color.
568    Firebrick,         //Firebrick Preset Color.
569    FloralWhite,       //Floral White Preset Color.
570    ForestGreen,       //Forest Green Preset Color.
571    Fuchsia,           //Fuchsia Preset Color.
572    Gainsboro,         //Gainsboro Preset Color.
573    GhostWhite,        //Ghost White Preset Color.
574    Gold,              //Gold Preset Color.
575    Goldenrod,         //Goldenrod Preset Color.
576    Gray,              //Gray Preset Color.
577    Green,             //Green Preset Color.
578    GreenYellow,       //Green Yellow Preset Color.
579    Honeydew,          //Honeydew Preset Color.
580    HotPink,           //Hot Pink Preset Color.
581    IndianRed,         //Indian Red Preset Color.
582    Indigo,            //Indigo Preset Color.
583    Ivory,             //Ivory Preset Color.
584    Khaki,             //Khaki Preset Color.
585    Lavender,          //Lavender Preset Color.
586    LavenderBlush,     //Lavender Blush Preset Color.
587    LawnGreen,         //Lawn Green Preset Color.
588    LemonChiffon,      //Lemon Chiffon Preset Color.
589    LtBlue,            //Light Blue Preset Color.
590    LtCoral,           //Light Coral Preset Color.
591    LtCyan,            //Light Cyan Preset Color.
592    LtGoldenrodYellow, //Light Goldenrod Yellow Preset Color.
593    LtGray,            //Light Gray Preset Color.
594    LtGreen,           //Light Green Preset Color.
595    LtPink,            //Light Pink Preset Color.
596    LtSalmon,          //Light Salmon Preset Color.
597    LtSeaGreen,        //Light Sea Green Preset Color.
598    LtSkyBlue,         //Light Sky Blue Preset Color.
599    LtSlateGray,       //Light Slate Gray Preset Color.
600    LtSteelBlue,       //Light Steel Blue Preset Color.
601    LtYellow,          //Light Yellow Preset Color.
602    Lime,              //Lime Preset Color.
603    LimeGreen,         //Lime Green Preset Color.
604    Linen,             //Linen Preset Color.
605    Magenta,           //Magenta Preset Color.
606    Maroon,            //Maroon Preset Color.
607    MedAquamarine,     //Medium Aquamarine Preset Color.
608    MedBlue,           //Medium Blue Preset Color.
609    MedOrchid,         //Medium Orchid Preset Color.
610    MedPurple,         //Medium Purple Preset Color.
611    MedSeaGreen,       //Medium Sea Green Preset Color.
612    MedSlateBlue,      //Medium Slate Blue Preset Color.
613    MedSpringGreen,    //Medium Spring Green Preset Color.
614    MedTurquoise,      //Medium Turquoise Preset Color.
615    MedVioletRed,      //Medium Violet Red Preset Color.
616    MidnightBlue,      //Midnight Blue Preset Color.
617    MintCream,         //Mint Cream Preset Color.
618    MistyRose,         //Misty Rose Preset Color.
619    Moccasin,          //Moccasin Preset Color.
620    NavajoWhite,       //Navajo White Preset Color.
621    Navy,              //Navy Preset Color.
622    OldLace,           //Old Lace Preset Color.
623    Olive,             //Olive Preset Color.
624    OliveDrab,         //Olive Drab Preset Color.
625    Orange,            //Orange Preset Color.
626    OrangeRed,         //Orange Red Preset Color.
627    Orchid,            //Orchid Preset Color.
628    PaleGoldenrod,     //Pale Goldenrod Preset Color.
629    PaleGreen,         //Pale Green Preset Color.
630    PaleTurquoise,     //Pale Turquoise Preset Color.
631    PaleVioletRed,     //Pale Violet Red Preset Color.
632    PapayaWhip,        //Papaya Whip Preset Color.
633    PeachPuff,         //Peach Puff Preset Color.
634    Peru,              //Peru Preset Color.
635    Pink,              //Pink Preset Color.
636    Plum,              //Plum Preset Color.
637    PowderBlue,        //Powder Blue Preset Color.
638    Purple,            //Purple Preset Color.
639    Red,               //Red Preset Color.
640    RosyBrown,         //Rosy Brown Preset Color.
641    RoyalBlue,         //Royal Blue Preset Color.
642    SaddleBrown,       //Saddle Brown Preset Color.
643    Salmon,            //Salmon Preset Color.
644    SandyBrown,        //Sandy Brown Preset Color.
645    SeaGreen,          //Sea Green Preset Color.
646    SeaShell,          //Sea Shell Preset Color.
647    Sienna,            //Sienna Preset Color.
648    Silver,            //Silver Preset Color.
649    SkyBlue,           //Sky Blue Preset Color.
650    SlateBlue,         //Slate Blue Preset Color.
651    SlateGray,         //Slate Gray Preset Color.
652    Snow,              //Snow Preset Color.
653    SpringGreen,       //Spring Green Preset Color.
654    SteelBlue,         //Steel Blue Preset Color.
655    Tan,               //Tan Preset Color.
656    Teal,              //Teal Preset Color.
657    Thistle,           //Thistle Preset Color.
658    Tomato,            //Tomato Preset Color.
659    Turquoise,         //Turquoise Preset Color.
660    Violet,            //Violet Preset Color.
661    Wheat,             //Wheat Preset Color.
662    White,             //White Preset Color.
663    WhiteSmoke,        //White Smoke Preset Color.
664    Yellow,            //Yellow Preset Color.
665    YellowGreen,       //Yellow Green Preset Color.
666}
667
668__string_enum! {
669    PrstClrType {
670        AliceBlue = "aliceBlue",
671        AntiqueWhite = "antiqueWhite",
672        Aqua = "aqua",
673        Aquamarine = "aquamarine",
674        Azure = "azure",
675        Beige = "beige",
676        Bisque = "bisque",
677        Black = "black",
678        BlanchedAlmond = "blanchedAlmond",
679        Blue = "blue",
680        BlueViolet = "blueViolet",
681        Brown = "brown",
682        BurlyWood = "burlyWood",
683        CadetBlue = "cadetBlue",
684        Chartreuse = "chartreuse",
685        Chocolate = "chocolate",
686        Coral = "coral",
687        CornflowerBlue = "cornflowerBlue",
688        Cornsilk = "cornsilk",
689        Crimson = "crimson",
690        Cyan = "cyan",
691        DkBlue = "dkBlue",
692        DkCyan = "dkCyan",
693        DkGoldenrod = "dkGoldenrod",
694        DkGray = "dkGray",
695        DkGreen = "dkGreen",
696        DkKhaki = "dkKhaki",
697        DkMagenta = "dkMagenta",
698        DkOliveGreen = "dkOliveGreen",
699        DkOrange = "dkOrange",
700        DkOrchid = "dkOrchid",
701        DkRed = "dkRed",
702        DkSalmon = "dkSalmon",
703        DkSeaGreen = "dkSeaGreen",
704        DkSlateBlue = "dkSlateBlue",
705        DkSlateGray = "dkSlateGray",
706        DkTurquoise = "dkTurquoise",
707        DkViolet = "dkViolet",
708        DeepPink = "deepPink",
709        DeepSkyBlue = "deepSkyBlue",
710        DimGray = "dimGray",
711        DodgerBlue = "dodgerBlue",
712        Firebrick = "firebrick",
713        FloralWhite = "floralWhite",
714        ForestGreen = "forestGreen",
715        Fuchsia = "fuchsia",
716        Gainsboro = "gainsboro",
717        GhostWhite = "ghostWhite",
718        Gold = "gold",
719        Goldenrod = "goldenrod",
720        Gray = "gray",
721        Green = "green",
722        GreenYellow = "greenYellow",
723        Honeydew = "honeydew",
724        HotPink = "hotPink",
725        IndianRed = "indianRed",
726        Indigo = "indigo",
727        Ivory = "ivory",
728        Khaki = "khaki",
729        Lavender = "lavender",
730        LavenderBlush = "lavenderBlush",
731        LawnGreen = "lawnGreen",
732        LemonChiffon = "lemonChiffon",
733        LtBlue = "ltBlue",
734        LtCoral = "ltCoral",
735        LtCyan = "ltCyan",
736        LtGoldenrodYellow = "ltGoldenrodYellow",
737        LtGray = "ltGray",
738        LtGreen = "ltGreen",
739        LtPink = "ltPink",
740        LtSalmon = "ltSalmon",
741        LtSeaGreen = "ltSeaGreen",
742        LtSkyBlue = "ltSkyBlue",
743        LtSlateGray = "ltSlateGray",
744        LtSteelBlue = "ltSteelBlue",
745        LtYellow = "ltYellow",
746        Lime = "lime",
747        LimeGreen = "limeGreen",
748        Linen = "linen",
749        Magenta = "magenta",
750        Maroon = "maroon",
751        MedAquamarine = "medAquamarine",
752        MedBlue = "medBlue",
753        MedOrchid = "medOrchid",
754        MedPurple = "medPurple",
755        MedSeaGreen = "medSeaGreen",
756        MedSlateBlue = "medSlateBlue",
757        MedSpringGreen = "medSpringGreen",
758        MedTurquoise = "medTurquoise",
759        MedVioletRed = "medVioletRed",
760        MidnightBlue = "midnightBlue",
761        MintCream = "mintCream",
762        MistyRose = "mistyRose",
763        Moccasin = "moccasin",
764        NavajoWhite = "navajoWhite",
765        Navy = "navy",
766        OldLace = "oldLace",
767        Olive = "olive",
768        OliveDrab = "oliveDrab",
769        Orange = "orange",
770        OrangeRed = "orangeRed",
771        Orchid = "orchid",
772        PaleGoldenrod = "paleGoldenrod",
773        PaleGreen = "paleGreen",
774        PaleTurquoise = "paleTurquoise",
775        PaleVioletRed = "paleVioletRed",
776        PapayaWhip = "papayaWhip",
777        PeachPuff = "peachPuff",
778        Peru = "peru",
779        Pink = "pink",
780        Plum = "plum",
781        PowderBlue = "powderBlue",
782        Purple = "purple",
783        Red = "red",
784        RosyBrown = "rosyBrown",
785        RoyalBlue = "royalBlue",
786        SaddleBrown = "saddleBrown",
787        Salmon = "salmon",
788        SandyBrown = "sandyBrown",
789        SeaGreen = "seaGreen",
790        SeaShell = "seaShell",
791        Sienna = "sienna",
792        Silver = "silver",
793        SkyBlue = "skyBlue",
794        SlateBlue = "slateBlue",
795        SlateGray = "slateGray",
796        Snow = "snow",
797        SpringGreen = "springGreen",
798        SteelBlue = "steelBlue",
799        Tan = "tan",
800        Teal = "teal",
801        Thistle = "thistle",
802        Tomato = "tomato",
803        Turquoise = "turquoise",
804        Violet = "violet",
805        Wheat = "wheat",
806        White = "white",
807        WhiteSmoke = "whiteSmoke",
808        Yellow = "yellow",
809        YellowGreen = "yellowGreen",
810    }
811}
812
813#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
814#[cfg_attr(test, derive(PartialEq))]
815#[xml(tag = "a:themeElements")]
816pub struct ThemeElements<'a> {
817    #[xml(child = "a:clrScheme")]
818    pub clr_scheme: ClrScheme<'a>,
819    #[xml(child = "a:fontScheme")]
820    pub font_scheme: FontScheme<'a>,
821    #[xml(child = "a:fmtScheme")]
822    pub fmt_scheme: FmtScheme<'a>,
823    #[xml(child = "a:extLst")]
824    pub ext_lst: Option<ExtLst>,
825}
826
827#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
828#[cfg_attr(test, derive(PartialEq))]
829#[xml(tag = "a:clrScheme")]
830pub struct ClrScheme<'a> {
831    #[xml(attr = "name")]
832    pub name: Cow<'a, str>,
833
834    ///    Dark 1
835    #[xml(child = "a:dk1")]
836    pub dk1: Dk1<'a>,
837    ///    Light 1
838    #[xml(child = "a:lt1")]
839    pub lt1: Lt1<'a>,
840    ///    Dark 2
841    #[xml(child = "a:dk2")]
842    pub dk2: Dk2<'a>,
843    ///    Light 2
844    #[xml(child = "a:lt2")]
845    pub lt2: Lt2<'a>,
846    ///    Accent
847    #[xml(child = "a:accent1")]
848    pub accent1: Accent1<'a>,
849    ///    Accent 2
850    #[xml(child = "a:accent2")]
851    pub accent2: Accent2<'a>,
852    ///    Accent 3
853    #[xml(child = "a:accent3")]
854    pub accent3: Accent3<'a>,
855    ///    Accent 4
856    #[xml(child = "a:accent4")]
857    pub accent4: Accent4<'a>,
858    ///    Accent 5
859    #[xml(child = "a:accent5")]
860    pub accent5: Accent5<'a>,
861    ///    Accent 6
862    #[xml(child = "a:accent6")]
863    pub accent6: Accent6<'a>,
864    ///    Hyperlink
865    #[xml(child = "a:hlink")]
866    pub hlink: HLink<'a>,
867    ///    Followed Hyperlink
868    #[xml(child = "a:folHlink")]
869    pub fol_hlink: FolHlink<'a>,
870    ///    Extension List
871    #[xml(child = "a:extLst")]
872    pub ext_lst: Option<ExtLst>,
873}
874
875#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
876#[cfg_attr(test, derive(PartialEq))]
877#[xml(tag = "a:fontScheme")]
878pub struct FontScheme<'a> {
879    #[xml(attr = "name")]
880    pub name: Option<Cow<'a, str>>,
881    #[xml(child = "a:majorFont")]
882    pub major_font: MajorFont<'a>,
883    #[xml(child = "a:minorFont")]
884    pub minor_font: MinorFont<'a>,
885    #[xml(child = "a:extLst")]
886    pub ext_lst: Option<ExtLst>,
887}
888
889#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
890#[cfg_attr(test, derive(PartialEq))]
891#[xml(tag = "a:majorFont")]
892pub struct MajorFont<'a> {
893    #[xml(child = "a:latin")]
894    pub latin: Latin<'a>,
895    #[xml(child = "a:ea")]
896    pub ea: EA<'a>,
897    #[xml(child = "a:cs")]
898    pub cs: CS<'a>,
899    #[xml(child = "a:font")]
900    pub fonts: Vec<Font<'a>>,
901    #[xml(child = "a:extLst")]
902    pub ext_lst: Option<ExtLst>,
903}
904
905#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
906#[cfg_attr(test, derive(PartialEq))]
907#[xml(tag = "a:minorFont")]
908pub struct MinorFont<'a> {
909    #[xml(child = "a:latin")]
910    pub latin: Latin<'a>,
911    #[xml(child = "a:ea")]
912    pub ea: EA<'a>,
913    #[xml(child = "a:cs")]
914    pub cs: CS<'a>,
915    #[xml(child = "a:font")]
916    pub fonts: Vec<Font<'a>>,
917    #[xml(child = "a:extLst")]
918    pub ext_lst: Option<ExtLst>,
919}
920
921#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
922#[cfg_attr(test, derive(PartialEq))]
923#[xml(tag = "a:ea")]
924pub struct EA<'a> {
925    #[xml(attr = "typeface")]
926    pub typeface: Option<Cow<'a, str>>,
927    #[xml(attr = "panose")]
928    pub panose: Option<Cow<'a, str>>,
929    #[xml(attr = "pitchFamily")]
930    pub pitch_family: Option<i8>,
931    #[xml(attr = "charset")]
932    pub charset: Option<i8>,
933}
934
935#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
936#[cfg_attr(test, derive(PartialEq))]
937#[xml(tag = "a:cs")]
938pub struct CS<'a> {
939    #[xml(attr = "typeface")]
940    pub typeface: Option<Cow<'a, str>>,
941    #[xml(attr = "panose")]
942    pub panose: Option<Cow<'a, str>>,
943    #[xml(attr = "pitchFamily")]
944    pub pitch_family: Option<i8>,
945    #[xml(attr = "charset")]
946    pub charset: Option<i8>,
947}
948
949#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
950#[cfg_attr(test, derive(PartialEq))]
951#[xml(tag = "a:latin")]
952pub struct Latin<'a> {
953    #[xml(attr = "typeface")]
954    pub typeface: Option<Cow<'a, str>>,
955    #[xml(attr = "panose")]
956    pub panose: Option<Cow<'a, str>>,
957    #[xml(attr = "pitchFamily")]
958    pub pitch_family: Option<i8>,
959    #[xml(attr = "charset")]
960    pub charset: Option<i8>,
961}
962
963#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
964#[cfg_attr(test, derive(PartialEq))]
965#[xml(tag = "a:font")]
966pub struct Font<'a> {
967    #[xml(attr = "script")]
968    pub script: Cow<'a, str>,
969    #[xml(attr = "typeface")]
970    pub typeface: Cow<'a, str>,
971}
972
973#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
974#[cfg_attr(test, derive(PartialEq))]
975#[xml(tag = "a:fmtScheme")]
976pub struct FmtScheme<'a> {
977    #[xml(attr = "name")]
978    pub name: Option<Cow<'a, str>>,
979    #[xml(child = "a:fillStyleLst")]
980    pub fill_style_lst: FillStyleLst,
981    #[xml(child = "a:lnStyleLst")]
982    pub in_style_lst: LineStyleList,
983    #[xml(child = "a:effectStyleLst")]
984    pub effect_style_lst: EffectStyleLst,
985    #[xml(child = "a:bgFillStyleLst")]
986    pub bg_fill_style_lst: BgFillStyleLst,
987}
988
989__define_struct_vec! {
990    ("a:fillStyleLst", FillStyleLst, FillStyleLstChoice) {} {
991        "a:noFill", NoFill    //No Fill
992        "a:solidFill", SolidFill    //Solid Fill
993        "a:gradFill", GradFill    //Gradient Fill
994        //"a:blipFill", blipFill    //Picture Fill
995        //"a:pattFill", pattFill    //Pattern Fill
996        "a:grpFill", GrpFill    //Group Fill
997    }
998}
999
1000__define_struct! {
1001    ("a:noFill", NoFill) {
1002
1003    }
1004}
1005
1006__define_struct! {
1007    ("a:grpFill", GrpFill) {
1008
1009    }
1010}
1011
1012__define_struct_vec! {
1013    ("a:solidFill", SolidFill, SolidFillChoice) {} {
1014        "a:scrgbClr", ScrgbClr
1015        "a:srgbClr", SrgbClr
1016        "a:hslClr", HslClr
1017        "a:sysClr", SysClr
1018        "a:schemeClr", SchemeClr
1019        "a:prstClr", PrstClr
1020    }
1021}
1022
1023#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1024#[cfg_attr(test, derive(PartialEq))]
1025#[xml(tag = "a:gradFill")]
1026pub struct GradFill {
1027    #[xml(attr = "rotWithShape")]
1028    pub rotate_with_shape: bool,
1029    #[xml(child = "a:lin")]
1030    pub linear_gradient_fill: Option<LinearGradientFill>,
1031    #[xml(child = "a:gsLst")]
1032    pub gradient_stop_list: Option<GradientStopList>,
1033}
1034
1035#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1036#[cfg_attr(test, derive(PartialEq))]
1037#[xml(tag = "a:gsLst")]
1038pub struct GradientStopList {
1039    #[xml(child = "a:gs")]
1040    pub gradient_stop: Vec<GradientStop>,
1041}
1042
1043__define_struct_vec! {
1044    ("a:gs", GradientStop, GradientStopChoice) {
1045        "pos", position, isize
1046    } {
1047        "a:scrgbClr", ScrgbClr
1048        "a:srgbClr", SrgbClr
1049        "a:hslClr", HslClr
1050        "a:sysClr", SysClr
1051        "a:schemeClr", SchemeClr
1052        "a:prstClr", PrstClr
1053    }
1054}
1055
1056#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1057#[cfg_attr(test, derive(PartialEq))]
1058#[xml(tag = "a:lin")]
1059pub struct LinearGradientFill {
1060    #[xml(attr = "ang")]
1061    pub angle: isize,
1062    #[xml(attr = "scaled")]
1063    pub scaled: bool,
1064}
1065
1066#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1067#[cfg_attr(test, derive(PartialEq))]
1068#[xml(tag = "a:lnStyleLst")]
1069pub struct LineStyleList {
1070    #[xml(child = "a:ln")]
1071    pub outline: Vec<Outline>,
1072}
1073
1074__define_struct_vec! {
1075    ("a:ln", Outline, OutlineChoice) {
1076        "w", line_with, isize
1077        "cap", cap, CapType
1078        "cmpd", cmpd, CompoundLineType
1079        "algn", algn, PenAlignment
1080    } {
1081        "a:solidFill", SolidFill
1082        "a:prstDash", PresetDash
1083        "a:miter", MiterLineJoin
1084    }
1085}
1086
1087#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1088#[cfg_attr(test, derive(PartialEq))]
1089#[xml(tag = "a:prstDash")]
1090pub struct PresetDash {
1091    #[xml(attr = "val")]
1092    pub val: PresetDashType,
1093}
1094
1095#[derive(Debug, Default, Clone)]
1096#[cfg_attr(test, derive(PartialEq))]
1097pub enum PresetDashType {
1098    #[default]
1099    Solid,
1100    Dot,
1101    Dash,
1102    LargeDash,
1103    LargeDashDot,
1104    LargeDashDotDot,
1105    SystemDot,
1106    SystemDash,
1107    SystemDashDot,
1108    SystemDashDotDot,
1109}
1110
1111__string_enum! {
1112    PresetDashType {
1113        Solid = "solid",
1114        Dot = "dot",
1115        Dash = "dash",
1116        LargeDash = "lgDash",
1117        LargeDashDot = "lgDashDot",
1118        LargeDashDotDot = "lgDashDotDot",
1119        SystemDot = "sysDot",
1120        SystemDash = "sysDash",
1121        SystemDashDot = "sysDashDot",
1122        SystemDashDotDot = "sysDashDotDot",
1123    }
1124}
1125
1126#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1127#[cfg_attr(test, derive(PartialEq))]
1128#[xml(tag = "a:miter")]
1129pub struct MiterLineJoin {
1130    #[xml(attr = "lim")]
1131    pub limit: isize,
1132}
1133
1134#[derive(Debug, Default, Clone)]
1135#[cfg_attr(test, derive(PartialEq))]
1136pub enum PenAlignment {
1137    #[default]
1138    Center,
1139    Insert,
1140}
1141
1142__string_enum! {
1143    PenAlignment {
1144        Center = "ctr",
1145        Insert = "in",
1146    }
1147}
1148
1149#[derive(Debug, Default, Clone)]
1150#[cfg_attr(test, derive(PartialEq))]
1151pub enum CapType {
1152    #[default]
1153    Square,
1154    Round,
1155    Flat,
1156}
1157
1158__string_enum! {
1159    CapType {
1160        Square = "sq",
1161        Round = "rnd",
1162        Flat = "flat",
1163    }
1164}
1165
1166#[derive(Debug, Default, Clone)]
1167#[cfg_attr(test, derive(PartialEq))]
1168pub enum CompoundLineType {
1169    #[default]
1170    Single,
1171    Double,
1172    ThickThin,
1173    ThinThick,
1174    Triple,
1175}
1176
1177__string_enum! {
1178    CompoundLineType {
1179        Single = "sng",
1180        Double = "dbl",
1181        ThickThin = "thickThin",
1182        ThinThick = "thinThick",
1183        Triple = "tri",
1184    }
1185}
1186
1187#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1188#[cfg_attr(test, derive(PartialEq))]
1189#[xml(tag = "a:effectStyleLst")]
1190pub struct EffectStyleLst {
1191    #[xml(child = "a:effectStyle")]
1192    pub effect_styles: Vec<EffectStyle>,
1193}
1194
1195__define_struct_vec! {
1196    ("a:effectStyle", EffectStyle, EffectStyleChoice) {} {
1197        "a:effectLst", EffectList
1198    }
1199}
1200
1201__define_struct_vec! {
1202    ("a:effectLst", EffectList, EffectListChoice) {} {
1203        "a:outerShdw", OuterShadow
1204        // "a:prstShdw", PresetShadow
1205        // "a:reflection", Reflection
1206        // "a:softEdge", SoftEdge
1207        // "a:glow", Glow
1208    }
1209}
1210
1211#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1212#[cfg_attr(test, derive(PartialEq))]
1213#[xml(tag = "a:outerShdw")]
1214pub struct OuterShadow {
1215    #[xml(attr = "blurRad")]
1216    pub blur_radius: Option<isize>,
1217    #[xml(attr = "dist")]
1218    pub distance: Option<isize>,
1219    #[xml(attr = "dir")]
1220    pub direction: Option<isize>,
1221    #[xml(attr = "algn")]
1222    pub alignment: Option<PenAlignment>,
1223    #[xml(attr = "kx")]
1224    pub kx: Option<isize>,
1225    #[xml(attr = "ky")]
1226    pub ky: Option<isize>,
1227    #[xml(attr = "rotWithShape")]
1228    pub rotate_with_shape: Option<bool>,
1229    #[xml(child = "a:hslClr")]
1230    pub hsl_color: Option<HslClr>,
1231    #[xml(child = "a:prstClr")]
1232    pub prst_color: Option<PrstClr>,
1233    #[xml(child = "a:schemeClr")]
1234    pub scheme_color: Option<SchemeClr>,
1235    #[xml(child = "a:scrgbClr")]
1236    pub scrgb_color: Option<ScrgbClr>,
1237    #[xml(child = "a:srgbClr")]
1238    pub srgb_color: Option<SrgbClr>,
1239    #[xml(child = "a:sysClr")]
1240    pub sys_color: Option<SysClr>,
1241}
1242
1243__define_struct_vec! {
1244    ("a:bgFillStyleLst", BgFillStyleLst, BgFillStyleLstChoice) {} {
1245        "a:noFill", NoFill    //No Fill
1246        "a:solidFill", SolidFill    //Solid Fill
1247        "a:gradFill", GradFill    //Gradient Fill
1248        //"a:blipFill", blipFill    //Picture Fill
1249        //"a:pattFill", pattFill    //Pattern Fill
1250        "a:grpFill", GrpFill    //Group Fill
1251    }
1252}
1253
1254#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1255#[cfg_attr(test, derive(PartialEq))]
1256#[xml(tag = "a:objectDefaults")]
1257pub struct ObjectDefaults {}
1258
1259#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1260#[cfg_attr(test, derive(PartialEq))]
1261#[xml(tag = "a:extraClrSchemeLst")]
1262pub struct ExtraClrSchemeLst {}
1263
1264#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
1265#[cfg_attr(test, derive(PartialEq))]
1266#[xml(tag = "a:extLst")]
1267pub struct ExtLst {
1268    #[xml(child = "a:ext")]
1269    pub ext: Vec<ExtAny>,
1270}
1271
1272__define_struct! {
1273    ("a:ext", ExtAny) {
1274        "uri", uri, String
1275    }
1276}
1277
1278impl<'a> XmlWrite for Theme<'a> {
1279    fn to_writer<W: Write>(&self, writer: &mut XmlWriter<W>) -> XmlResult<()> {
1280        let Theme {
1281            name,
1282            elements,
1283            defaults,
1284            extra_clr_scheme_lst,
1285            cust_clr_lst,
1286            ext_lst,
1287        } = self;
1288
1289        log::debug!("[Theme] Started writing.");
1290        let _ = write!(writer.inner, "{}", crate::schema::SCHEMA_XML);
1291
1292        writer.write_element_start("a:theme")?;
1293
1294        writer.write_attribute("xmlns:a", SCHEMA_DRAWINGML)?;
1295
1296        if let Some(n) = name {
1297            writer.write_attribute("name", n)?;
1298        }
1299
1300        writer.write_element_end_open()?;
1301
1302        elements.to_writer(writer)?;
1303        write_attr(defaults, writer)?;
1304        write_attr(extra_clr_scheme_lst, writer)?;
1305        write_attr(cust_clr_lst, writer)?;
1306        write_attr(ext_lst, writer)?;
1307
1308        writer.write_element_end_close("a:theme")?;
1309
1310        log::debug!("[Theme] Finished writing.");
1311
1312        Ok(())
1313    }
1314}
1315
1316__xml_test_suites!(
1317    Theme,
1318    Theme::default(),
1319    format!(
1320        r#"{}<a:theme xmlns:a="{}"><a:themeElements><a:clrScheme name=""><a:dk1/><a:lt1/><a:dk2/><a:lt2/><a:accent1/><a:accent2/><a:accent3/><a:accent4/><a:accent5/><a:accent6/><a:hlink/><a:folHlink/></a:clrScheme><a:fontScheme><a:majorFont><a:latin/><a:ea/><a:cs/></a:majorFont><a:minorFont><a:latin/><a:ea/><a:cs/></a:minorFont></a:fontScheme><a:fmtScheme><a:fillStyleLst/><a:lnStyleLst/><a:effectStyleLst/><a:bgFillStyleLst/></a:fmtScheme></a:themeElements></a:theme>"#,
1321        crate::schema::SCHEMA_XML,
1322        SCHEMA_DRAWINGML,
1323    )
1324    .as_str(),
1325);