1use hard_xml::{XmlRead, XmlWrite};
2use std::borrow::Cow;
3
4use crate::__xml_test_suites;
5
6#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
8#[cfg_attr(test, derive(PartialEq))]
9#[xml(tag = "w:pict")]
10pub struct Pict<'a> {
11 #[xml(child = "v:shape")]
18 pub shape: Option<Shape<'a>>,
19
20 #[xml(child = "v:rect")]
23 pub rect: Option<Rect<'a>>,
24}
25
26#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
27#[cfg_attr(test, derive(PartialEq))]
28#[xml(tag = "v:shape")]
29pub struct Shape<'a> {
30 #[xml(attr = "id")]
31 pub id: Option<Cow<'a, str>>,
32 #[xml(attr = "style")]
33 pub style: Option<Cow<'a, str>>,
34 #[xml(child = "v:imagedata")]
35 pub image_data: Option<ImageData<'a>>,
36}
37
38#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
39#[cfg_attr(test, derive(PartialEq))]
40#[xml(tag = "v:rect")]
41pub struct Rect<'a> {
42 #[xml(child = "v:imagedata")]
43 pub image_data: Option<ImageData<'a>>,
44}
45
46#[derive(Debug, Default, XmlRead, XmlWrite, Clone)]
47#[cfg_attr(test, derive(PartialEq))]
48#[xml(tag = "v:imagedata")]
49pub struct ImageData<'a> {
50 #[xml(attr = "r:id")]
51 pub id: Option<Cow<'a, str>>,
52 #[xml(attr = "o:title")]
53 pub title: Option<Cow<'a, str>>,
54}
55
56impl<'a> Pict<'a> {
57 }
59
60__xml_test_suites!(Pict, Pict::default(), r#"<w:pict/>"#,);