sw: clean up Start/EndAction in SwViewShell hierarchy
[LibreOffice.git] / starmath / inc / mathml / def.hxx
blob38073671189c27c0ed13dd631209422c47aedcaf
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #pragma once
12 #include <tools/color.hxx>
14 /* All possible data needed to do the job outside mathml limits */
15 // Ml prefix means it is part of mathml standard
16 // NMl means it is not part of mathml standard but needed info to work
18 /* For now empty, don't know yet what's needed besides default font size. */
19 struct SmGlobalData
23 /* Mhtml length tools */
24 /*************************************************************************************************/
26 enum class SmLengthUnit : uint_fast8_t
28 MlEm,
29 MlEx,
30 MlPx,
31 MlIn,
32 MlCm,
33 MlMm,
34 MlPt,
35 MlPc,
36 MlP, // Percent
37 MlM // Multiplier
40 struct SmLengthValue
42 SmLengthUnit m_aLengthUnit;
43 double m_aLengthValue;
44 // Keeps original text value to avoid numerical error data loss
45 OUString* m_aOriginalText;
48 /* Possible mathml elements */
49 /*************************************************************************************************/
51 enum class SmMlElementType : uint_fast8_t
53 // Used for base element. Means no information contained.
54 NMlEmpty,
55 // Used for structural dependencies. Means no information contained.
56 NMlStructural,
57 NMlSmNode,
58 // Mathml real elements
59 MlMath,
60 MlMi,
61 MlMerror,
62 MlMn,
63 MlMo,
64 MlMrow,
65 MlMtext,
66 MlMstyle
69 /* Possible mathml attributes */
70 /*************************************************************************************************/
72 enum class SmMlAttributeValueType : uint_fast8_t
74 NMlEmpty,
75 MlAccent,
76 MlDir,
77 MlDisplaystyle,
78 MlFence,
79 MlForm,
80 MlHref,
81 MlLspace,
82 MlMathbackground,
83 MlMathcolor,
84 MlMathsize,
85 MlMathvariant,
86 MlMaxsize,
87 MlMinsize,
88 MlMovablelimits,
89 MlRspace,
90 MlSeparator,
91 MlStretchy,
92 MlSymmetric
95 /* Possible values of mathml attributes */
96 /*************************************************************************************************/
98 enum class SmMlAttributeValueEmpty : uint_fast8_t
100 MlEmpty = 0x00
103 enum class SmMlAttributeValueAccent : uint_fast8_t
105 MlFalse = 0x00,
106 MlTrue = 0x01
109 enum class SmMlAttributeValueDir : uint_fast8_t
111 MlLtr = 0x00,
112 MlRtl = 0x01
115 enum class SmMlAttributeValueDisplaystyle : uint_fast8_t
117 MlFalse = 0x00,
118 MlTrue = 0x01
121 enum class SmMlAttributeValueFence : uint_fast8_t
123 MlFalse = 0x00,
124 MlTrue = 0x01
127 enum class SmMlAttributeValueForm : uint_fast8_t
129 MlPrefix = 0x01,
130 MlInfix = 0x02,
131 MlPosfix = 0x04
134 enum class SmMlAttributeValueHref : uint_fast8_t
136 NMlEmpty = 0x00,
137 NMlValid = 0x01
140 enum class SmMlAttributeValueLspace : uint_fast8_t
142 NMlEmpty = 0x00
145 enum class SmMlAttributeValueMathbackground : uint_fast32_t
147 MlTransparent = 0x00,
148 MlRgb = 0x01
151 enum class SmMlAttributeValueMathcolor : uint_fast8_t
153 MlDefault = 0x00,
154 MlRgb = 0x01
157 enum class SmMlAttributeValueMathsize : uint_fast8_t
159 NMlEmpty = 0x00,
162 enum class SmMlAttributeValueMathvariant : uint_fast16_t
164 normal = 0x000,
165 bold = 0x001,
166 italic = 0x002,
167 double_struck = 0x004,
168 script = 0x008,
169 fraktur = 0x010,
170 sans_serif = 0x020,
171 monospace = 0x040,
172 bold_italic = 0x001 | 0x002,
173 bold_fraktur = 0x001 | 0x010,
174 bold_script = 0x001 | 0x008,
175 bold_sans_serif = 0x001 | 0x020,
176 sans_serif_italic = 0x002 | 0x20,
177 sans_serif_bold_italic = 0x001 | 0x002 | 0x020,
178 // Non english
179 initial = 0x080,
180 tailed = 0x100,
181 looped = 0x200,
182 stretched = 0x400
185 enum class SmMlAttributeValueMaxsize : uint_fast8_t
187 MlInfinity = 0x00,
188 MlFinite = 0x01
192 * Specifies whether attached under- and overscripts move to sub- and superscript positions when displaystyle is false.
193 * Source: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo
195 enum class SmMlAttributeValueMovablelimits : uint_fast8_t
197 MlFalse = 0x00,
198 MlTrue = 0x01
201 enum class SmMlAttributeValueRspace : uint_fast8_t
203 NMlEmpty = 0x00
206 enum class SmMlAttributeValueSeparator : uint_fast8_t
208 MlFalse = 0x00,
209 MlTrue = 0x01
212 enum class SmMlAttributeValueStretchy : uint_fast8_t
214 MlFalse = 0x00,
215 MlTrue = 0x01
218 enum class SmMlAttributeValueSymmetric : uint_fast8_t
220 MlFalse = 0x00,
221 MlTrue = 0x01
224 /* Structures for all possible attributes */
225 /*************************************************************************************************/
227 struct SmMlAccent
229 SmMlAttributeValueAccent m_aAccent;
232 struct SmMlDir
234 SmMlAttributeValueDir m_aDir;
237 struct SmMlDisplaystyle
239 SmMlAttributeValueDisplaystyle m_aDisplaystyle;
242 struct SmMlFence
244 SmMlAttributeValueFence m_aFence;
247 struct SmMlForm
249 SmMlAttributeValueForm m_aForm;
252 struct SmMlHref
254 SmMlAttributeValueHref m_aHref;
255 OUString* m_aLnk;
258 struct SmMlLspace
260 SmLengthValue m_aLengthValue;
263 struct SmMlMathbackground
265 SmMlAttributeValueMathbackground m_aMathbackground;
266 Color m_aCol;
269 struct SmMlMathcolor
271 SmMlAttributeValueMathcolor m_aMathcolor;
272 Color m_aCol;
275 struct SmMlMathsize
277 SmLengthValue m_aLengthValue;
280 struct SmMlMathvariant
282 SmMlAttributeValueMathvariant m_aMathvariant;
285 struct SmMlMaxsize
287 SmMlAttributeValueMaxsize m_aMaxsize;
288 SmLengthValue m_aLengthValue;
291 struct SmMlMinsize
293 SmLengthValue m_aLengthValue;
296 struct SmMlMovablelimits
298 SmMlAttributeValueMovablelimits m_aMovablelimits;
301 struct SmMlRspace
303 SmLengthValue m_aLengthValue;
306 struct SmMlSeparator
308 SmMlAttributeValueSeparator m_aSeparator;
311 struct SmMlStretchy
313 SmMlAttributeValueStretchy m_aStretchy;
316 struct SmMlSymmetric
318 SmMlAttributeValueSymmetric m_aSymmetric;
321 /* order attributes */
322 /*************************************************************************************************/
324 struct SmMlAttributePos
326 SmMlAttributeValueType m_aAttributeValueType;
327 uint_fast8_t m_nPos;
330 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */