Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/openpyxl/drawing/properties.py: 73%
90 statements
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2023-07-17 14:22 -0600
1# Copyright (c) 2010-2022 openpyxl
3from openpyxl.xml.constants import DRAWING_NS
4from openpyxl.descriptors.serialisable import Serialisable
5from openpyxl.descriptors import (
6 Typed,
7 Bool,
8 Integer,
9 Set,
10 String,
11 Alias,
12 NoneSet,
13)
14from openpyxl.descriptors.excel import ExtensionList as OfficeArtExtensionList
16from .geometry import GroupTransform2D, Scene3D
17from .text import Hyperlink
20class GroupShapeProperties(Serialisable):
22 tagname = "grpSpPr"
24 bwMode = NoneSet(values=(['clr', 'auto', 'gray', 'ltGray', 'invGray',
25 'grayWhite', 'blackGray', 'blackWhite', 'black', 'white', 'hidden']))
26 xfrm = Typed(expected_type=GroupTransform2D, allow_none=True)
27 scene3d = Typed(expected_type=Scene3D, allow_none=True)
28 extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
30 def __init__(self,
31 bwMode=None,
32 xfrm=None,
33 scene3d=None,
34 extLst=None,
35 ):
36 self.bwMode = bwMode
37 self.xfrm = xfrm
38 self.scene3d = scene3d
39 self.extLst = extLst
42class GroupLocking(Serialisable):
44 tagname = "grpSpLocks"
45 namespace = DRAWING_NS
47 noGrp = Bool(allow_none=True)
48 noUngrp = Bool(allow_none=True)
49 noSelect = Bool(allow_none=True)
50 noRot = Bool(allow_none=True)
51 noChangeAspect = Bool(allow_none=True)
52 noMove = Bool(allow_none=True)
53 noResize = Bool(allow_none=True)
54 noChangeArrowheads = Bool(allow_none=True)
55 noEditPoints = Bool(allow_none=True)
56 noAdjustHandles = Bool(allow_none=True)
57 noChangeArrowheads = Bool(allow_none=True)
58 noChangeShapeType = Bool(allow_none=True)
59 extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
61 __elements__ = ()
63 def __init__(self,
64 noGrp=None,
65 noUngrp=None,
66 noSelect=None,
67 noRot=None,
68 noChangeAspect=None,
69 noChangeArrowheads=None,
70 noMove=None,
71 noResize=None,
72 noEditPoints=None,
73 noAdjustHandles=None,
74 noChangeShapeType=None,
75 extLst=None,
76 ):
77 self.noGrp = noGrp
78 self.noUngrp = noUngrp
79 self.noSelect = noSelect
80 self.noRot = noRot
81 self.noChangeAspect = noChangeAspect
82 self.noChangeArrowheads = noChangeArrowheads
83 self.noMove = noMove
84 self.noResize = noResize
85 self.noEditPoints = noEditPoints
86 self.noAdjustHandles = noAdjustHandles
87 self.noChangeShapeType = noChangeShapeType
90class NonVisualGroupDrawingShapeProps(Serialisable):
92 tagname = "cNvGrpSpPr"
94 grpSpLocks = Typed(expected_type=GroupLocking, allow_none=True)
95 extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
97 __elements__ = ("grpSpLocks",)
99 def __init__(self,
100 grpSpLocks=None,
101 extLst=None,
102 ):
103 self.grpSpLocks = grpSpLocks
106class NonVisualDrawingShapeProps(Serialisable):
108 tagname = "cNvSpPr"
110 spLocks = Typed(expected_type=GroupLocking, allow_none=True)
111 txBax = Bool(allow_none=True)
112 extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
114 __elements__ = ("spLocks", "txBax")
116 def __init__(self,
117 spLocks=None,
118 txBox=None,
119 extLst=None,
120 ):
121 self.spLocks = spLocks
122 self.txBox = txBox
125class NonVisualDrawingProps(Serialisable):
127 tagname = "cNvPr"
129 id = Integer()
130 name = String()
131 descr = String(allow_none=True)
132 hidden = Bool(allow_none=True)
133 title = String(allow_none=True)
134 hlinkClick = Typed(expected_type=Hyperlink, allow_none=True)
135 hlinkHover = Typed(expected_type=Hyperlink, allow_none=True)
136 extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
138 __elements__ = ["hlinkClick", "hlinkHover"]
140 def __init__(self,
141 id=None,
142 name=None,
143 descr=None,
144 hidden=None,
145 title=None,
146 hlinkClick=None,
147 hlinkHover=None,
148 extLst=None,
149 ):
150 self.id = id
151 self.name = name
152 self.descr = descr
153 self.hidden = hidden
154 self.title = title
155 self.hlinkClick = hlinkClick
156 self.hlinkHover = hlinkHover
157 self.extLst = extLst
159class NonVisualGroupShape(Serialisable):
161 tagname = "nvGrpSpPr"
163 cNvPr = Typed(expected_type=NonVisualDrawingProps)
164 cNvGrpSpPr = Typed(expected_type=NonVisualGroupDrawingShapeProps)
166 __elements__ = ("cNvPr", "cNvGrpSpPr")
168 def __init__(self,
169 cNvPr=None,
170 cNvGrpSpPr=None,
171 ):
172 self.cNvPr = cNvPr
173 self.cNvGrpSpPr = cNvGrpSpPr