Skip to main content

ofdsdk/schemas/
page.rs

1//
2// -----------------------------------------------------------------------------
3//  THIS FILE WAS @generated AUTOMATICALLY. DO NOT MODIFY THIS FILE MANUALLY.
4// -----------------------------------------------------------------------------
5//
6
7///该页所使用的模板页。模板页的内容结构和普通页相同,定义在 CommonData 指定的 XML 文件中。一个页可以使用多个模板页。该节点使用时通过 TemplateID 来引用具体的模板,并通过 ZOrder 属性来控制模板在页面中的呈现顺序。
8#[derive(Clone, Debug, Default)]
9pub struct Template {
10  ///引用在文档公用数据 (CommonData) 中定义的模板页标识。
11  pub template_id: crate::schemas::definitions::StRefId,
12  ///控制模板在页面中的呈现顺序,其类型描述和呈现顺序与 Layer 中 Type 的描述和处理一致。如果多个图层的此属性相同,则应根据其出现的顺序来显示,先出现者先绘制。默认值为 Background。
13  pub z_order: Option<TemplateZOrder>,
14  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
15  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
16}
17#[derive(Clone, Debug)]
18pub enum LayerContentChoice {
19  TextObject(Box<TextObject>),
20  PathObject(Box<PathObject>),
21  ImageObject(Box<ImageObject>),
22  CompositeObject(Box<CompositeObject>),
23  PageBlock(Box<PageBlock>),
24}
25///层节点,一页可包含一个或多个层。
26#[derive(Clone, Debug, Default)]
27pub struct Layer {
28  ///层类型描述,预定义的值见表 15。默认为 Body。
29  pub r#type: Option<CtLayerType>,
30  ///图层的绘制参数,引用资源文件中定义的绘制参数标识。
31  pub draw_param: Option<crate::schemas::definitions::StRefId>,
32  pub id: Option<crate::schemas::definitions::StId>,
33  pub xml_children: Vec<LayerContentChoice>,
34  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
35  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
36}
37///页面内容描述。
38#[derive(Clone, Debug, Default)]
39pub struct Content {
40  ///层节点,一页可包含一个或多个层。
41  pub layer: Vec<Layer>,
42  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
43  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
44}
45#[derive(Clone, Debug, Default)]
46pub struct Actions {
47  pub action: Vec<crate::schemas::definitions::CtAction>,
48  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
49  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
50}
51///页对象。
52#[derive(Clone, Debug, Default)]
53pub struct Page {
54  ///该页所使用的模板页。
55  pub template: Vec<Template>,
56  ///页资源,指向该页使用的资源文件。
57  pub page_res: Vec<crate::schemas::definitions::StLoc>,
58  ///定义该页页面区域的大小和位置,仅对该页有效。该节点不出现时则使用模板页中的定义,如果模板页不存在或模板页中没有定义页面区域,则使用文件 CommonData 中的定义。
59  pub area: Option<crate::schemas::definitions::CtPageArea>,
60  ///页面内容描述,该节点不存在时,表示空白页。
61  pub content: Option<Content>,
62  ///与页面关联的动作序列。当存在多个 Action 对象时,所有动作依次执行。
63  pub actions: Option<Actions>,
64  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
65  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
66}
67#[derive(Clone, Debug)]
68pub enum AreaContentChoice {
69  Path(Box<CtPath>),
70  Text(Box<CtText>),
71}
72#[derive(Clone, Debug, Default)]
73pub struct Area {
74  pub draw_param: Option<crate::schemas::definitions::StRefId>,
75  pub ctm: Option<crate::schemas::definitions::StArray>,
76  pub xml_children: Vec<AreaContentChoice>,
77  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
78  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
79}
80#[derive(Clone, Debug, Default)]
81pub struct CtClip {
82  pub area: Vec<Area>,
83  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
84  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
85}
86///文字对象属性,见 11.2。
87#[derive(Clone, Debug, Default)]
88pub struct TextObject {
89  pub boundary: crate::schemas::definitions::StBox,
90  pub name: Option<String>,
91  pub visible: Option<bool>,
92  pub ctm: Option<crate::schemas::definitions::StArray>,
93  pub draw_param: Option<crate::schemas::definitions::StRefId>,
94  pub line_width: Option<f64>,
95  pub cap: Option<CtGraphicUnitCap>,
96  pub join: Option<CtGraphicUnitJoin>,
97  pub miter_limit: Option<f64>,
98  pub dash_offset: Option<f64>,
99  pub dash_pattern: Option<crate::schemas::definitions::StArray>,
100  pub alpha: Option<i32>,
101  ///引用资源文件中定义的字型的标识。
102  pub font: crate::schemas::definitions::StRefId,
103  ///字号,单位为毫米。
104  pub size: f64,
105  ///是否勾边。默认值为 false。
106  pub stroke: Option<bool>,
107  ///是否填充。默认值为 true。
108  pub fill: Option<bool>,
109  ///字型在水平方向的放缩比。默认值为 1.0。例如,当 HScale 值为 0.5 时表示实际显示的字宽为原来字宽的一半。
110  pub h_scale: Option<f64>,
111  ///阅读方向,指定了文字排列的方向,描述见 11.3 文字定位。默认值为 0。
112  pub read_direction: Option<i32>,
113  ///字符方向,指定了文字放置的方式,具体内容见 11.3 文字定位。默认值为 0。
114  pub char_direction: Option<i32>,
115  ///文字对象的粗细值;可选取值为 100、200、300、400、500、600、700、800、900。默认值为 400。
116  pub weight: Option<CtTextWeight>,
117  ///是否是斜体样式。默认值为 false。
118  pub italic: Option<bool>,
119  pub id: crate::schemas::definitions::StId,
120  pub actions: Option<Actions>,
121  pub clips: Option<Clips>,
122  ///填充颜色。默认为黑色。
123  pub fill_color: Option<CtColor>,
124  ///勾边颜色。默认为透明色。
125  pub stroke_color: Option<CtColor>,
126  ///指定字符编码到字符索引之间的变换关系,描述见 11.4 字符变换。
127  pub cg_transform: Vec<CtCgTransform>,
128  ///文字内容,也就是一段字符编码串。如果字符编码不在 XML 编码方式的字符范围之内,应采用“\”加四位十六进制数的格式转义;文字内容中出现的空格也需要转义。若 TextCode 作为占位符使用时,一律采用“¤”(u00A4) 占位。
129  pub text_code: Vec<TextCode>,
130  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
131  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
132}
133///图形对象属性,见 9.1。
134#[derive(Clone, Debug, Default)]
135pub struct PathObject {
136  pub boundary: crate::schemas::definitions::StBox,
137  pub name: Option<String>,
138  pub visible: Option<bool>,
139  pub ctm: Option<crate::schemas::definitions::StArray>,
140  pub draw_param: Option<crate::schemas::definitions::StRefId>,
141  pub line_width: Option<f64>,
142  pub cap: Option<CtGraphicUnitCap>,
143  pub join: Option<CtGraphicUnitJoin>,
144  pub miter_limit: Option<f64>,
145  pub dash_offset: Option<f64>,
146  pub dash_pattern: Option<crate::schemas::definitions::StArray>,
147  pub alpha: Option<i32>,
148  ///图形是否被勾边。默认值为 true。
149  pub stroke: Option<bool>,
150  ///图形是否被填充。默认值为 false。
151  pub fill: Option<bool>,
152  ///图形的填充规则,当 Fill 属性存在时出现。可选值为 NonZero 和 Even-Odd。默认值为 NonZero。
153  pub rule: Option<CtPathRule>,
154  pub id: crate::schemas::definitions::StId,
155  pub actions: Option<Actions>,
156  pub clips: Option<Clips>,
157  ///勾边颜色。默认为黑色。
158  pub stroke_color: Option<CtColor>,
159  ///填充颜色。默认为透明色。
160  pub fill_color: Option<CtColor>,
161  ///图形轮廓数据,由一系列紧缩的操作符和操作数构成。
162  pub abbreviated_data: String,
163  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
164  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
165}
166///图像对象,见第 10 章。带有播放视频动作时,见第 12 章。
167#[derive(Clone, Debug, Default)]
168pub struct ImageObject {
169  pub boundary: crate::schemas::definitions::StBox,
170  pub name: Option<String>,
171  pub visible: Option<bool>,
172  pub ctm: Option<crate::schemas::definitions::StArray>,
173  pub draw_param: Option<crate::schemas::definitions::StRefId>,
174  pub line_width: Option<f64>,
175  pub cap: Option<CtGraphicUnitCap>,
176  pub join: Option<CtGraphicUnitJoin>,
177  pub miter_limit: Option<f64>,
178  pub dash_offset: Option<f64>,
179  pub dash_pattern: Option<crate::schemas::definitions::StArray>,
180  pub alpha: Option<i32>,
181  ///引用资源文件中定义的多媒体的标识。
182  pub resource_id: crate::schemas::definitions::StRefId,
183  ///可替换图像,引用资源文件中定义的多媒体的标识,用于某些情况如高分辨率输出时进行图像替换。
184  pub substitution: Option<crate::schemas::definitions::StRefId>,
185  ///图像蒙版,引用资源文件中定义的多媒体的标识,用作蒙版的图像应是与 ResourceID 指向的图像相同大小的二值图。
186  pub image_mask: Option<crate::schemas::definitions::StRefId>,
187  pub id: String,
188  pub actions: Option<Actions>,
189  pub clips: Option<Clips>,
190  ///图像边框设置。
191  pub border: Option<Border>,
192  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
193  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
194}
195///复合对象,见第 13 章。
196#[derive(Clone, Debug, Default)]
197pub struct CompositeObject {
198  pub boundary: crate::schemas::definitions::StBox,
199  pub name: Option<String>,
200  pub visible: Option<bool>,
201  pub ctm: Option<crate::schemas::definitions::StArray>,
202  pub draw_param: Option<crate::schemas::definitions::StRefId>,
203  pub line_width: Option<f64>,
204  pub cap: Option<CtGraphicUnitCap>,
205  pub join: Option<CtGraphicUnitJoin>,
206  pub miter_limit: Option<f64>,
207  pub dash_offset: Option<f64>,
208  pub dash_pattern: Option<crate::schemas::definitions::StArray>,
209  pub alpha: Option<i32>,
210  ///引用资源文件中定义的矢量图像的标识。
211  pub resource_id: crate::schemas::definitions::StRefId,
212  pub id: crate::schemas::definitions::StId,
213  pub actions: Option<Actions>,
214  pub clips: Option<Clips>,
215  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
216  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
217}
218#[derive(Clone, Debug)]
219pub enum CtPageBlockContentChoice {
220  TextObject(Box<TextObject>),
221  PathObject(Box<PathObject>),
222  ImageObject(Box<ImageObject>),
223  CompositeObject(Box<CompositeObject>),
224  PageBlock(Box<PageBlock>),
225}
226///页面块,可以嵌套。
227#[derive(Clone, Debug, Default)]
228pub struct CtPageBlock {
229  pub xml_children: Vec<CtPageBlockContentChoice>,
230  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
231  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
232}
233#[derive(Clone, Debug)]
234pub enum PageBlockContentChoice {
235  TextObject(Box<TextObject>),
236  PathObject(Box<PathObject>),
237  ImageObject(Box<ImageObject>),
238  CompositeObject(Box<CompositeObject>),
239  PageBlock(Box<PageBlock>),
240}
241///页面块,可以嵌套。
242#[derive(Clone, Debug, Default)]
243pub struct PageBlock {
244  pub id: crate::schemas::definitions::StId,
245  pub xml_children: Vec<PageBlockContentChoice>,
246  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
247  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
248}
249#[derive(Clone, Debug)]
250pub enum CtLayerContentChoice {
251  TextObject(Box<TextObject>),
252  PathObject(Box<PathObject>),
253  ImageObject(Box<ImageObject>),
254  CompositeObject(Box<CompositeObject>),
255  PageBlock(Box<PageBlock>),
256}
257///层节点。
258#[derive(Clone, Debug, Default)]
259pub struct CtLayer {
260  pub r#type: Option<CtLayerType>,
261  pub draw_param: Option<crate::schemas::definitions::StRefId>,
262  pub xml_children: Vec<CtLayerContentChoice>,
263  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
264  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
265}
266#[derive(Clone, Debug, Default)]
267pub struct Clips {
268  pub clip: Vec<CtClip>,
269  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
270  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
271}
272#[derive(Clone, Debug, Default)]
273pub struct CtGraphicUnit {
274  pub boundary: crate::schemas::definitions::StBox,
275  pub name: Option<String>,
276  pub visible: Option<bool>,
277  pub ctm: Option<crate::schemas::definitions::StArray>,
278  pub draw_param: Option<crate::schemas::definitions::StRefId>,
279  pub line_width: Option<f64>,
280  pub cap: Option<CtGraphicUnitCap>,
281  pub join: Option<CtGraphicUnitJoin>,
282  pub miter_limit: Option<f64>,
283  pub dash_offset: Option<f64>,
284  pub dash_pattern: Option<crate::schemas::definitions::StArray>,
285  pub alpha: Option<i32>,
286  pub actions: Option<Actions>,
287  pub clips: Option<Clips>,
288  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
289  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
290}
291///文字内容,也就是一段字符编码串。
292#[derive(Clone, Debug, Default)]
293pub struct TextCode {
294  ///第一个文字的字型原点在对象坐标系下的 X 坐标。当 X 不出现,则采用上一个 TextCode 的 X 值,文字对象中的第一个 TextCode 的 X 属性必选。
295  pub x: Option<f64>,
296  ///第一个文字的字型原点在对象坐标系下的 Y 坐标。当 Y 不出现,则采用上一个 TextCode 的 Y 值,文字对象中的第一个 TextCode 的 Y 属性必选。
297  pub y: Option<f64>,
298  ///double 型数值队列,队列中的每个值代表后一个文字与前一个文字之间在 X 方向的偏移值。DeltaX 不出现时,表示文字的绘制点在 X 方向不做偏移。
299  pub delta_x: Option<crate::schemas::definitions::StArray>,
300  ///double 型数值队列,队列中的每个值代表后一个文字与前一个文字之间在 Y 方向的偏移值。DeltaY 不出现时,表示文字的绘制点在 Y 方向不做偏移。
301  pub delta_y: Option<crate::schemas::definitions::StArray>,
302  pub xml_value: String,
303  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
304  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
305}
306#[derive(Clone, Debug, Default)]
307pub struct CtText {
308  pub boundary: crate::schemas::definitions::StBox,
309  pub name: Option<String>,
310  pub visible: Option<bool>,
311  pub ctm: Option<crate::schemas::definitions::StArray>,
312  pub draw_param: Option<crate::schemas::definitions::StRefId>,
313  pub line_width: Option<f64>,
314  pub cap: Option<CtGraphicUnitCap>,
315  pub join: Option<CtGraphicUnitJoin>,
316  pub miter_limit: Option<f64>,
317  pub dash_offset: Option<f64>,
318  pub dash_pattern: Option<crate::schemas::definitions::StArray>,
319  pub alpha: Option<i32>,
320  pub font: crate::schemas::definitions::StRefId,
321  pub size: f64,
322  pub stroke: Option<bool>,
323  pub fill: Option<bool>,
324  pub h_scale: Option<f64>,
325  pub read_direction: Option<i32>,
326  pub char_direction: Option<i32>,
327  pub weight: Option<CtTextWeight>,
328  pub italic: Option<bool>,
329  pub actions: Option<Actions>,
330  pub clips: Option<Clips>,
331  pub fill_color: Option<CtColor>,
332  pub stroke_color: Option<CtColor>,
333  pub cg_transform: Vec<CtCgTransform>,
334  pub text_code: Vec<TextCode>,
335  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
336  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
337}
338///指定字符编码到字符索引之间的变换关系,描述见 11.4 字符变换。
339#[derive(Clone, Debug, Default)]
340pub struct CtCgTransform {
341  ///TextCode 中字符编码的起始位置,从 0 开始。
342  pub code_position: i32,
343  ///变换关系中字符的数量,该数值应大于或等于 1,否则属于错误描述,默认为 1。
344  pub code_count: Option<i32>,
345  ///变换关系中字形索引的个数,该数值应大于或等于 1,否则属于错误描述,默认为 1。
346  pub glyph_count: Option<i32>,
347  ///变换后的字形索引列表。
348  pub glyphs: Option<crate::schemas::definitions::StArray>,
349  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
350  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
351}
352///图像边框设置。
353#[derive(Clone, Debug, Default)]
354pub struct Border {
355  ///边框线宽,如果为 0 则表示边框不进行绘制。默认值为 0.353 mm。
356  pub line_width: Option<f64>,
357  pub horizonal_corner_radius: Option<f64>,
358  ///边框垂直角半径。默认值为 0。
359  pub vertical_corner_radius: Option<f64>,
360  ///边框虚线重复样式开始的位置,边框的起始点位置为左上角,绕行方向为顺时针。默认值为 0。
361  pub dash_offset: Option<f64>,
362  ///边框虚线重复样式,边框的起始点位置为左上角,绕行方向为顺时针。
363  pub dash_pattern: Option<crate::schemas::definitions::StArray>,
364  ///边框颜色,有关边框颜色描述见 8.3.2 基本颜色。默认为黑色。
365  pub border_color: Option<CtColor>,
366  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
367  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
368}
369#[derive(Clone, Debug, Default)]
370pub struct CtImage {
371  pub boundary: crate::schemas::definitions::StBox,
372  pub name: Option<String>,
373  pub visible: Option<bool>,
374  pub ctm: Option<crate::schemas::definitions::StArray>,
375  pub draw_param: Option<crate::schemas::definitions::StRefId>,
376  pub line_width: Option<f64>,
377  pub cap: Option<CtGraphicUnitCap>,
378  pub join: Option<CtGraphicUnitJoin>,
379  pub miter_limit: Option<f64>,
380  pub dash_offset: Option<f64>,
381  pub dash_pattern: Option<crate::schemas::definitions::StArray>,
382  pub alpha: Option<i32>,
383  pub resource_id: crate::schemas::definitions::StRefId,
384  pub substitution: Option<crate::schemas::definitions::StRefId>,
385  pub image_mask: Option<crate::schemas::definitions::StRefId>,
386  pub actions: Option<Actions>,
387  pub clips: Option<Clips>,
388  pub border: Option<Border>,
389  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
390  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
391}
392#[derive(Clone, Debug, Default)]
393pub struct CtComposite {
394  pub boundary: crate::schemas::definitions::StBox,
395  pub name: Option<String>,
396  pub visible: Option<bool>,
397  pub ctm: Option<crate::schemas::definitions::StArray>,
398  pub draw_param: Option<crate::schemas::definitions::StRefId>,
399  pub line_width: Option<f64>,
400  pub cap: Option<CtGraphicUnitCap>,
401  pub join: Option<CtGraphicUnitJoin>,
402  pub miter_limit: Option<f64>,
403  pub dash_offset: Option<f64>,
404  pub dash_pattern: Option<crate::schemas::definitions::StArray>,
405  pub alpha: Option<i32>,
406  pub resource_id: crate::schemas::definitions::StRefId,
407  pub actions: Option<Actions>,
408  pub clips: Option<Clips>,
409  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
410  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
411}
412#[derive(Clone, Debug, Default)]
413pub struct CtPath {
414  pub boundary: crate::schemas::definitions::StBox,
415  pub name: Option<String>,
416  pub visible: Option<bool>,
417  pub ctm: Option<crate::schemas::definitions::StArray>,
418  pub draw_param: Option<crate::schemas::definitions::StRefId>,
419  pub line_width: Option<f64>,
420  pub cap: Option<CtGraphicUnitCap>,
421  pub join: Option<CtGraphicUnitJoin>,
422  pub miter_limit: Option<f64>,
423  pub dash_offset: Option<f64>,
424  pub dash_pattern: Option<crate::schemas::definitions::StArray>,
425  pub alpha: Option<i32>,
426  pub stroke: Option<bool>,
427  pub fill: Option<bool>,
428  pub rule: Option<CtPathRule>,
429  pub actions: Option<Actions>,
430  pub clips: Option<Clips>,
431  pub stroke_color: Option<CtColor>,
432  pub fill_color: Option<CtColor>,
433  pub abbreviated_data: String,
434  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
435  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
436}
437#[derive(Clone, Debug)]
438pub enum CellContentContentChoice {
439  TextObject(Box<TextObject>),
440  PathObject(Box<PathObject>),
441  ImageObject(Box<ImageObject>),
442  CompositeObject(Box<CompositeObject>),
443  PageBlock(Box<PageBlock>),
444}
445///底纹单元。
446#[derive(Clone, Debug, Default)]
447pub struct CellContent {
448  ///引用资源文件中缩略图图像的标识。
449  pub thumbnail: Option<crate::schemas::definitions::StRefId>,
450  pub xml_children: Vec<CellContentContentChoice>,
451  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
452  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
453}
454///底纹属性。
455#[derive(Clone, Debug, Default)]
456pub struct CtPattern {
457  ///底纹单元的宽度。
458  pub width: f64,
459  ///底纹单元的高度。
460  pub height: f64,
461  ///X 方向底纹单元间距,默认值为底纹单元的宽度。若设定值小于底纹单元的宽度时,应按默认值处理。
462  pub x_step: Option<f64>,
463  ///Y 方向底纹单元间距,默认值为底纹单元的高度。若设定值小于底纹单元的高度时,应按默认值处理。
464  pub y_step: Option<f64>,
465  ///描述底纹单元的映像翻转方式,枚举值,默认值为 Normal。
466  pub reflect_method: Option<CtPatternReflectMethod>,
467  ///底纹单元起始绘制位置,可取值为 Page 或 Object,默认值为 Object。
468  pub relative_to: Option<CtPatternRelativeTo>,
469  ///底纹单元的变换矩阵,用于某些需要对底纹单元进行平移旋转变换的场合,默认为单位矩阵。底纹呈现时先做 XStep、YStep 排列,然后一起做 CTM 处理。
470  pub ctm: Option<crate::schemas::definitions::StArray>,
471  pub cell_content: CellContent,
472  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
473  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
474}
475///颜色段。
476#[derive(Clone, Debug, Default)]
477pub struct Segment {
478  ///用于确定 StartPoint 和 EndPoint 中的各颜色的位置值,取值范围是 [0, 1.0],各段颜色的 Position 值应根据颜色出现的顺序递增。
479  pub position: Option<f64>,
480  ///该段的颜色,应是基本颜色。
481  pub color: CtColor,
482  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
483  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
484}
485///轴向渐变属性。
486#[derive(Clone, Debug, Default)]
487pub struct CtAxialShd {
488  ///渐变绘制的方式,可选值为 Direct、Repeat、Reflect。默认值为 Direct。
489  pub map_type: Option<CtAxialShdMapType>,
490  ///轴线一个渐变区间的长度,当 MapType 的值不等于 Direct 时出现。默认值为轴线长度。
491  pub map_unit: Option<f64>,
492  ///轴线延长线方向是否继续绘制渐变。可选值为 0、1、2、3。
493  pub extend: Option<CtAxialShdExtend>,
494  ///轴线的起始点。
495  pub start_point: crate::schemas::definitions::StPos,
496  ///轴线的结束点。
497  pub end_point: crate::schemas::definitions::StPos,
498  ///颜色段,至少出现两个。
499  pub segment: Vec<Segment>,
500  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
501  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
502}
503///径向渐变属性。
504#[derive(Clone, Debug, Default)]
505pub struct CtRadialShd {
506  ///渐变绘制的方式,可选值为 Direct、Repeat、Reflect。默认值为 Direct。
507  pub map_type: Option<CtRadialShdMapType>,
508  ///渐变区间的长度,当 MapType 的值不等于 Direct 时出现。
509  pub map_unit: Option<f64>,
510  ///渐变椭圆的偏心率。
511  pub eccentricity: Option<f64>,
512  ///渐变椭圆的旋转角度。
513  pub angle: Option<f64>,
514  ///渐变起始点。
515  pub start_point: crate::schemas::definitions::StPos,
516  ///渐变起始半径。
517  pub start_radius: Option<f64>,
518  ///渐变结束点。
519  pub end_point: crate::schemas::definitions::StPos,
520  ///渐变结束半径。
521  pub end_radius: f64,
522  ///是否向外延长绘制渐变。可选值为 0、1、2、3。
523  pub extend: Option<i32>,
524  ///颜色段,至少出现两个。
525  pub segment: Vec<Segment>,
526  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
527  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
528}
529///高洛德渐变控制点。
530#[derive(Clone, Debug, Default)]
531pub struct Point {
532  ///控制点 X 坐标。
533  pub x: f64,
534  ///控制点 Y 坐标。
535  pub y: f64,
536  ///控制点边界标记。
537  pub edge_flag: Option<PointEdgeFlag>,
538  ///控制点颜色。
539  pub color: CtColor,
540  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
541  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
542}
543///高洛德渐变属性。
544#[derive(Clone, Debug, Default)]
545pub struct CtGouraudShd {
546  ///是否向外延长绘制渐变。
547  pub extend: Option<i32>,
548  ///渐变控制点。
549  pub point: Vec<Point>,
550  ///背景颜色。
551  pub back_color: Option<CtColor>,
552  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
553  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
554}
555///格构高洛德渐变控制点。
556#[derive(Clone, Debug, Default)]
557pub struct CtLaGouraudShdPoint {
558  ///控制点 X 坐标。
559  pub x: Option<f64>,
560  ///控制点 Y 坐标。
561  pub y: Option<f64>,
562  ///控制点颜色。
563  pub color: CtColor,
564  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
565  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
566}
567///格构高洛德渐变属性。
568#[derive(Clone, Debug, Default)]
569pub struct CtLaGouraudShd {
570  ///每行顶点数。
571  pub vertices_per_row: i32,
572  ///是否向外延长绘制渐变。
573  pub extend: Option<i32>,
574  ///控制点集合。
575  pub point: Vec<CtLaGouraudShdPoint>,
576  ///背景颜色。
577  pub back_color: Option<CtColor>,
578  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
579  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
580}
581#[derive(Clone, Debug)]
582pub enum CtColorContentChoice {
583  Pattern(Box<CtPattern>),
584  AxialShd(Box<CtAxialShd>),
585  RadialShd(Box<CtRadialShd>),
586  GouraudShd(Box<CtGouraudShd>),
587  LaGourandShd(Box<CtLaGouraudShd>),
588}
589///颜色属性。
590#[derive(Clone, Debug, Default)]
591pub struct CtColor {
592  ///颜色值,指定了当前颜色空间下各通道的取值。Value 的取值应符合“通道 1 通道 2 通道 3 …”格式。此属性不出现时,应采用 Index 属性从颜色空间的调色板中的取值。当二者都不出现时,该颜色各通道的值全部为 0。
593  pub value: Option<crate::schemas::definitions::StArray>,
594  ///调色板中颜色的编号,非负整数,将从当前颜色空间的调色板中取出相应索引的预定义颜色用来绘制。索引从 0 开始。
595  pub index: Option<i32>,
596  ///引用资源文件中颜色空间的标识。默认值为文档设定的颜色空间。
597  pub color_space: Option<crate::schemas::definitions::StRefId>,
598  ///颜色透明度,在 0~255 之间取值。默认为 255,表示完全不透明。
599  pub alpha: Option<i32>,
600  pub xml_children: Vec<CtColorContentChoice>,
601  pub xml_other_attrs: Vec<(std::boxed::Box<str>, std::boxed::Box<str>)>,
602  pub xml_other_children: Vec<(usize, std::boxed::Box<str>)>,
603}
604#[derive(Clone, Debug, Default)]
605pub struct Action(pub crate::schemas::definitions::CtAction);
606impl From<crate::schemas::definitions::CtAction> for Action {
607  fn from(value: crate::schemas::definitions::CtAction) -> Self {
608    Self(value)
609  }
610}
611impl From<Action> for crate::schemas::definitions::CtAction {
612  fn from(value: Action) -> Self {
613    value.0
614  }
615}
616impl std::ops::Deref for Action {
617  type Target = crate::schemas::definitions::CtAction;
618  fn deref(&self) -> &Self::Target {
619    &self.0
620  }
621}
622impl std::ops::DerefMut for Action {
623  fn deref_mut(&mut self) -> &mut Self::Target {
624    &mut self.0
625  }
626}
627#[derive(Clone, Debug, Default)]
628pub struct Path(pub CtPath);
629impl From<CtPath> for Path {
630  fn from(value: CtPath) -> Self {
631    Self(value)
632  }
633}
634impl From<Path> for CtPath {
635  fn from(value: Path) -> Self {
636    value.0
637  }
638}
639impl std::ops::Deref for Path {
640  type Target = CtPath;
641  fn deref(&self) -> &Self::Target {
642    &self.0
643  }
644}
645impl std::ops::DerefMut for Path {
646  fn deref_mut(&mut self) -> &mut Self::Target {
647    &mut self.0
648  }
649}
650#[derive(Clone, Debug, Default)]
651pub struct Text(pub CtText);
652impl From<CtText> for Text {
653  fn from(value: CtText) -> Self {
654    Self(value)
655  }
656}
657impl From<Text> for CtText {
658  fn from(value: Text) -> Self {
659    value.0
660  }
661}
662impl std::ops::Deref for Text {
663  type Target = CtText;
664  fn deref(&self) -> &Self::Target {
665    &self.0
666  }
667}
668impl std::ops::DerefMut for Text {
669  fn deref_mut(&mut self) -> &mut Self::Target {
670    &mut self.0
671  }
672}
673#[derive(Clone, Debug, Default)]
674pub struct Clip(pub CtClip);
675impl From<CtClip> for Clip {
676  fn from(value: CtClip) -> Self {
677    Self(value)
678  }
679}
680impl From<Clip> for CtClip {
681  fn from(value: Clip) -> Self {
682    value.0
683  }
684}
685impl std::ops::Deref for Clip {
686  type Target = CtClip;
687  fn deref(&self) -> &Self::Target {
688    &self.0
689  }
690}
691impl std::ops::DerefMut for Clip {
692  fn deref_mut(&mut self) -> &mut Self::Target {
693    &mut self.0
694  }
695}
696#[derive(Clone, Debug, Default)]
697pub struct FillColor(pub CtColor);
698impl From<CtColor> for FillColor {
699  fn from(value: CtColor) -> Self {
700    Self(value)
701  }
702}
703impl From<FillColor> for CtColor {
704  fn from(value: FillColor) -> Self {
705    value.0
706  }
707}
708impl std::ops::Deref for FillColor {
709  type Target = CtColor;
710  fn deref(&self) -> &Self::Target {
711    &self.0
712  }
713}
714impl std::ops::DerefMut for FillColor {
715  fn deref_mut(&mut self) -> &mut Self::Target {
716    &mut self.0
717  }
718}
719#[derive(Clone, Debug, Default)]
720pub struct StrokeColor(pub CtColor);
721impl From<CtColor> for StrokeColor {
722  fn from(value: CtColor) -> Self {
723    Self(value)
724  }
725}
726impl From<StrokeColor> for CtColor {
727  fn from(value: StrokeColor) -> Self {
728    value.0
729  }
730}
731impl std::ops::Deref for StrokeColor {
732  type Target = CtColor;
733  fn deref(&self) -> &Self::Target {
734    &self.0
735  }
736}
737impl std::ops::DerefMut for StrokeColor {
738  fn deref_mut(&mut self) -> &mut Self::Target {
739    &mut self.0
740  }
741}
742#[derive(Clone, Debug, Default)]
743pub struct CgTransform(pub CtCgTransform);
744impl From<CtCgTransform> for CgTransform {
745  fn from(value: CtCgTransform) -> Self {
746    Self(value)
747  }
748}
749impl From<CgTransform> for CtCgTransform {
750  fn from(value: CgTransform) -> Self {
751    value.0
752  }
753}
754impl std::ops::Deref for CgTransform {
755  type Target = CtCgTransform;
756  fn deref(&self) -> &Self::Target {
757    &self.0
758  }
759}
760impl std::ops::DerefMut for CgTransform {
761  fn deref_mut(&mut self) -> &mut Self::Target {
762    &mut self.0
763  }
764}
765#[derive(Clone, Debug, Default)]
766pub struct BorderColor(pub CtColor);
767impl From<CtColor> for BorderColor {
768  fn from(value: CtColor) -> Self {
769    Self(value)
770  }
771}
772impl From<BorderColor> for CtColor {
773  fn from(value: BorderColor) -> Self {
774    value.0
775  }
776}
777impl std::ops::Deref for BorderColor {
778  type Target = CtColor;
779  fn deref(&self) -> &Self::Target {
780    &self.0
781  }
782}
783impl std::ops::DerefMut for BorderColor {
784  fn deref_mut(&mut self) -> &mut Self::Target {
785    &mut self.0
786  }
787}
788#[derive(Clone, Debug, Default)]
789pub struct Color(pub CtColor);
790impl From<CtColor> for Color {
791  fn from(value: CtColor) -> Self {
792    Self(value)
793  }
794}
795impl From<Color> for CtColor {
796  fn from(value: Color) -> Self {
797    value.0
798  }
799}
800impl std::ops::Deref for Color {
801  type Target = CtColor;
802  fn deref(&self) -> &Self::Target {
803    &self.0
804  }
805}
806impl std::ops::DerefMut for Color {
807  fn deref_mut(&mut self) -> &mut Self::Target {
808    &mut self.0
809  }
810}
811#[derive(Clone, Debug, Default)]
812pub struct BackColor(pub CtColor);
813impl From<CtColor> for BackColor {
814  fn from(value: CtColor) -> Self {
815    Self(value)
816  }
817}
818impl From<BackColor> for CtColor {
819  fn from(value: BackColor) -> Self {
820    value.0
821  }
822}
823impl std::ops::Deref for BackColor {
824  type Target = CtColor;
825  fn deref(&self) -> &Self::Target {
826    &self.0
827  }
828}
829impl std::ops::DerefMut for BackColor {
830  fn deref_mut(&mut self) -> &mut Self::Target {
831    &mut self.0
832  }
833}
834#[derive(Clone, Debug, Default)]
835pub struct Pattern(pub CtPattern);
836impl From<CtPattern> for Pattern {
837  fn from(value: CtPattern) -> Self {
838    Self(value)
839  }
840}
841impl From<Pattern> for CtPattern {
842  fn from(value: Pattern) -> Self {
843    value.0
844  }
845}
846impl std::ops::Deref for Pattern {
847  type Target = CtPattern;
848  fn deref(&self) -> &Self::Target {
849    &self.0
850  }
851}
852impl std::ops::DerefMut for Pattern {
853  fn deref_mut(&mut self) -> &mut Self::Target {
854    &mut self.0
855  }
856}
857#[derive(Clone, Debug, Default)]
858pub struct AxialShd(pub CtAxialShd);
859impl From<CtAxialShd> for AxialShd {
860  fn from(value: CtAxialShd) -> Self {
861    Self(value)
862  }
863}
864impl From<AxialShd> for CtAxialShd {
865  fn from(value: AxialShd) -> Self {
866    value.0
867  }
868}
869impl std::ops::Deref for AxialShd {
870  type Target = CtAxialShd;
871  fn deref(&self) -> &Self::Target {
872    &self.0
873  }
874}
875impl std::ops::DerefMut for AxialShd {
876  fn deref_mut(&mut self) -> &mut Self::Target {
877    &mut self.0
878  }
879}
880#[derive(Clone, Debug, Default)]
881pub struct RadialShd(pub CtRadialShd);
882impl From<CtRadialShd> for RadialShd {
883  fn from(value: CtRadialShd) -> Self {
884    Self(value)
885  }
886}
887impl From<RadialShd> for CtRadialShd {
888  fn from(value: RadialShd) -> Self {
889    value.0
890  }
891}
892impl std::ops::Deref for RadialShd {
893  type Target = CtRadialShd;
894  fn deref(&self) -> &Self::Target {
895    &self.0
896  }
897}
898impl std::ops::DerefMut for RadialShd {
899  fn deref_mut(&mut self) -> &mut Self::Target {
900    &mut self.0
901  }
902}
903#[derive(Clone, Debug, Default)]
904pub struct GouraudShd(pub CtGouraudShd);
905impl From<CtGouraudShd> for GouraudShd {
906  fn from(value: CtGouraudShd) -> Self {
907    Self(value)
908  }
909}
910impl From<GouraudShd> for CtGouraudShd {
911  fn from(value: GouraudShd) -> Self {
912    value.0
913  }
914}
915impl std::ops::Deref for GouraudShd {
916  type Target = CtGouraudShd;
917  fn deref(&self) -> &Self::Target {
918    &self.0
919  }
920}
921impl std::ops::DerefMut for GouraudShd {
922  fn deref_mut(&mut self) -> &mut Self::Target {
923    &mut self.0
924  }
925}
926#[derive(Clone, Debug, Default)]
927pub struct LaGourandShd(pub CtLaGouraudShd);
928impl From<CtLaGouraudShd> for LaGourandShd {
929  fn from(value: CtLaGouraudShd) -> Self {
930    Self(value)
931  }
932}
933impl From<LaGourandShd> for CtLaGouraudShd {
934  fn from(value: LaGourandShd) -> Self {
935    value.0
936  }
937}
938impl std::ops::Deref for LaGourandShd {
939  type Target = CtLaGouraudShd;
940  fn deref(&self) -> &Self::Target {
941    &self.0
942  }
943}
944impl std::ops::DerefMut for LaGourandShd {
945  fn deref_mut(&mut self) -> &mut Self::Target {
946    &mut self.0
947  }
948}
949///模板页的默认图层类型,见表 15。
950#[derive(Clone, Debug, Default)]
951pub enum TemplateZOrder {
952  #[default]
953  Background,
954  Foreground,
955}
956///层类型描述,预定义的值见表 15。默认为 Body。
957#[derive(Clone, Debug, Default)]
958pub enum CtLayerType {
959  #[default]
960  Body,
961  Background,
962  Foreground,
963  Custom,
964}
965#[derive(Clone, Debug, Default)]
966pub enum CtGraphicUnitCap {
967  #[default]
968  Butt,
969  Round,
970  Square,
971}
972#[derive(Clone, Debug, Default)]
973pub enum CtGraphicUnitJoin {
974  #[default]
975  Miter,
976  Round,
977  Bevel,
978}
979///文字对象的粗细值。
980#[derive(Clone, Debug, Default)]
981pub enum CtTextWeight {
982  #[default]
983  _0,
984  _100,
985  _200,
986  _300,
987  _400,
988  _500,
989  _600,
990  _700,
991  _800,
992  _900,
993  _1000,
994}
995///图形的填充规则,当 Fill 属性存在时出现。可选值为 NonZero 和 Even-Odd。默认值为 NonZero。
996#[derive(Clone, Debug, Default)]
997pub enum CtPathRule {
998  #[default]
999  NonZero,
1000  _EvenOdd,
1001}
1002///描述底纹单元的映像翻转方式,枚举值,默认值为 Normal。
1003#[derive(Clone, Debug, Default)]
1004pub enum CtPatternReflectMethod {
1005  #[default]
1006  Normal,
1007  Row,
1008  Column,
1009  RowAndColumn,
1010}
1011///底纹单元起始绘制位置,可取值为 Page 或 Object,默认值为 Object。
1012#[derive(Clone, Debug, Default)]
1013pub enum CtPatternRelativeTo {
1014  #[default]
1015  Page,
1016  Object,
1017}
1018///渐变绘制的方式,可选值为 Direct、Repeat、Reflect。
1019#[derive(Clone, Debug, Default)]
1020pub enum CtAxialShdMapType {
1021  #[default]
1022  Direct,
1023  Repeat,
1024  Reflect,
1025}
1026///轴线延长线方向是否继续绘制渐变。
1027#[derive(Clone, Debug, Default)]
1028pub enum CtAxialShdExtend {
1029  #[default]
1030  _0,
1031  _1,
1032  _2,
1033  _3,
1034}
1035///渐变绘制的方式,可选值为 Direct、Repeat、Reflect。
1036#[derive(Clone, Debug, Default)]
1037pub enum CtRadialShdMapType {
1038  #[default]
1039  Direct,
1040  Repeat,
1041  Reflect,
1042}
1043///控制点边界标记。
1044#[derive(Clone, Debug, Default)]
1045pub enum PointEdgeFlag {
1046  #[default]
1047  _0,
1048  _1,
1049  _2,
1050}