1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#[cfg(feature = "serde")]
use serde::Serialize;
use crate::processed::drawing::common_types::adjust_angle::AdjustAngle;
use crate::processed::drawing::common_types::adjust_coordinate::AdjustCoordinate;
use crate::processed::drawing::common_types::position::Position;
use crate::raw::drawing::shape::adjust_handle_polar::XlsxAdjustHandlePolar;
use crate::raw::drawing::shape::shape_guide::XlsxShapeGuide;
/// https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.drawing.adjusthandlepolar?view=openxml-3.0.1
///
/// This element specifies a polar adjust handle for a custom shape.
///
/// Example
/// ```
/// <a:ahLst>
/// <a:ahPolar gdRefAng="" gdRefR="">
/// <a:pos x="2" y="2"/>
/// </a:ahPolar>
/// </a:ahLst>
/// ```
// tag: ahPolar
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize))]
pub struct AdjustHandlePolar {
/// Position of the adjust handle
pub position: Position,
/// Specifies the name of the guide that is updated with the adjustment angle from this adjust handle.
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
pub angle_guide_ref: Option<String>,
/// Specifies the name of the guide that is updated with the adjustment radius from this adjust handle.
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
pub radial_guid_ref: Option<String>,
/// Specifies the maximum angle position that is allowed for this adjustment handle.
///
/// If max_angle_adjustment and min_angle_adjustment are equal, this adjust handle cannot move angularly
pub max_angle_adjustment: AdjustAngle,
/// Specifies the minimum angle position that is allowed for this adjustment handle.
///
/// If max_angle_adjustment and min_angle_adjustment are equal, this adjust handle cannot move angularly
pub min_angle_adjustment: AdjustAngle,
/// Specifies the maximum radial position that is allowed for this adjustment handle.
///
/// If max_radial_adjustment and min_radial_adjustment are equal, this adjust handle cannot move radially
pub max_radial_adjustment: AdjustCoordinate,
/// Specifies the minimum radial position that is allowed for this adjustment handle.
///
/// If max_radial_adjustment and min_radial_adjustment are equal, this adjust handle cannot move radially
pub min_radial_adjustment: AdjustCoordinate,
}
impl AdjustHandlePolar {
pub(crate) fn from_raw(
raw: XlsxAdjustHandlePolar,
guide_list: Option<Vec<XlsxShapeGuide>>,
) -> Self {
return Self {
position: Position::from_position(raw.clone().position, guide_list.clone()),
angle_guide_ref: raw.clone().angle_guide_ref,
radial_guid_ref: raw.clone().radial_guid_ref,
max_angle_adjustment: AdjustAngle::from_raw(
raw.max_angle_adjustment,
guide_list.clone(),
),
min_angle_adjustment: AdjustAngle::from_raw(
raw.min_angle_adjustment,
guide_list.clone(),
),
max_radial_adjustment: AdjustCoordinate::from_raw(
raw.max_radial_adjustment,
guide_list.clone(),
),
min_radial_adjustment: AdjustCoordinate::from_raw(
raw.min_radial_adjustment,
guide_list.clone(),
),
};
}
}