LibreOffice Module starmath (master) 1
def.hxx
Go to the documentation of this file.
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.
4 *
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 */
9
10#pragma once
11
12#include <tools/color.hxx>
13
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
17
18/* For now empty, don't know yet what's needed besides default font size. */
20{
21};
22
23/* Mhtml length tools */
24/*************************************************************************************************/
25
26enum class SmLengthUnit : uint_fast8_t
27{
28 MlEm,
29 MlEx,
30 MlPx,
31 MlIn,
32 MlCm,
33 MlMm,
34 MlPt,
35 MlPc,
36 MlP, // Percent
37 MlM // Multiplier
38};
39
41{
44 // Keeps original text value to avoid numerical error data loss
45 OUString* m_aOriginalText;
46};
47
48/* Possible mathml elements */
49/*************************************************************************************************/
50
51enum class SmMlElementType : uint_fast8_t
52{
53 // Used for base element. Means no information contained.
55 // Used for structural dependencies. Means no information contained.
58 // Mathml real elements
59 MlMath,
60 MlMi,
62 MlMn,
63 MlMo,
64 MlMrow,
65 MlMtext,
67};
68
69/* Possible mathml attributes */
70/*************************************************************************************************/
71
72enum class SmMlAttributeValueType : uint_fast8_t
73{
76 MlDir,
78 MlFence,
79 MlForm,
80 MlHref,
93};
94
95/* Possible values of mathml attributes */
96/*************************************************************************************************/
97
98enum class SmMlAttributeValueEmpty : uint_fast8_t
99{
100 MlEmpty = 0x00
101};
102
103enum class SmMlAttributeValueAccent : uint_fast8_t
104{
105 MlFalse = 0x00,
106 MlTrue = 0x01
107};
108
109enum class SmMlAttributeValueDir : uint_fast8_t
110{
111 MlLtr = 0x00,
112 MlRtl = 0x01
113};
114
115enum class SmMlAttributeValueDisplaystyle : uint_fast8_t
116{
117 MlFalse = 0x00,
118 MlTrue = 0x01
119};
120
121enum class SmMlAttributeValueFence : uint_fast8_t
122{
123 MlFalse = 0x00,
124 MlTrue = 0x01
125};
126
127enum class SmMlAttributeValueForm : uint_fast8_t
128{
129 MlPrefix = 0x01,
130 MlInfix = 0x02,
131 MlPosfix = 0x04
132};
133
134enum class SmMlAttributeValueHref : uint_fast8_t
135{
136 NMlEmpty = 0x00,
137 NMlValid = 0x01
138};
139
140enum class SmMlAttributeValueLspace : uint_fast8_t
141{
142 NMlEmpty = 0x00
143};
144
145enum class SmMlAttributeValueMathbackground : uint_fast32_t
146{
147 MlTransparent = 0x00,
148 MlRgb = 0x01
149};
150
151enum class SmMlAttributeValueMathcolor : uint_fast8_t
152{
153 MlDefault = 0x00,
154 MlRgb = 0x01
155};
156
157enum class SmMlAttributeValueMathsize : uint_fast8_t
158{
159 NMlEmpty = 0x00,
160};
161
162enum class SmMlAttributeValueMathvariant : uint_fast16_t
163{
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
183};
184
185enum class SmMlAttributeValueMaxsize : uint_fast8_t
186{
187 MlInfinity = 0x00,
188 MlFinite = 0x01
189};
190
191/*
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
194 */
195enum class SmMlAttributeValueMovablelimits : uint_fast8_t
196{
197 MlFalse = 0x00,
198 MlTrue = 0x01
199};
200
201enum class SmMlAttributeValueRspace : uint_fast8_t
202{
203 NMlEmpty = 0x00
204};
205
206enum class SmMlAttributeValueSeparator : uint_fast8_t
207{
208 MlFalse = 0x00,
209 MlTrue = 0x01
210};
211
212enum class SmMlAttributeValueStretchy : uint_fast8_t
213{
214 MlFalse = 0x00,
215 MlTrue = 0x01
216};
217
218enum class SmMlAttributeValueSymmetric : uint_fast8_t
219{
220 MlFalse = 0x00,
221 MlTrue = 0x01
222};
223
224/* Structures for all possible attributes */
225/*************************************************************************************************/
226
228{
230};
231
233{
235};
236
238{
240};
241
243{
245};
246
248{
250};
251
253{
255 OUString* m_aLnk;
256};
257
259{
261};
262
264{
267};
268
270{
273};
274
276{
278};
279
281{
283};
284
286{
289};
290
292{
294};
295
297{
299};
300
302{
304};
305
307{
309};
310
312{
314};
315
317{
319};
320
321/* order attributes */
322/*************************************************************************************************/
323
325{
327 uint_fast8_t m_nPos;
328};
329
330/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
sal_Int16 script
SmMlAttributeValueRspace
Definition: def.hxx:202
SmLengthUnit
Definition: def.hxx:27
SmMlAttributeValueDisplaystyle
Definition: def.hxx:116
SmMlAttributeValueFence
Definition: def.hxx:122
SmMlElementType
Definition: def.hxx:52
SmMlAttributeValueMathcolor
Definition: def.hxx:152
SmMlAttributeValueType
Definition: def.hxx:73
SmMlAttributeValueForm
Definition: def.hxx:128
SmMlAttributeValueMathbackground
Definition: def.hxx:146
SmMlAttributeValueEmpty
Definition: def.hxx:99
SmMlAttributeValueDir
Definition: def.hxx:110
SmMlAttributeValueSeparator
Definition: def.hxx:207
SmMlAttributeValueSymmetric
Definition: def.hxx:219
SmMlAttributeValueAccent
Definition: def.hxx:104
SmMlAttributeValueMathvariant
Definition: def.hxx:163
SmMlAttributeValueMovablelimits
Definition: def.hxx:196
SmMlAttributeValueMathsize
Definition: def.hxx:158
SmMlAttributeValueLspace
Definition: def.hxx:141
SmMlAttributeValueStretchy
Definition: def.hxx:213
SmMlAttributeValueHref
Definition: def.hxx:135
SmMlAttributeValueMaxsize
Definition: def.hxx:186
bold
SmLengthUnit m_aLengthUnit
Definition: def.hxx:42
OUString * m_aOriginalText
Definition: def.hxx:45
double m_aLengthValue
Definition: def.hxx:43
SmMlAttributeValueAccent m_aAccent
Definition: def.hxx:229
SmMlAttributeValueType m_aAttributeValueType
Definition: def.hxx:326
uint_fast8_t m_nPos
Definition: def.hxx:327
Definition: def.hxx:233
SmMlAttributeValueDir m_aDir
Definition: def.hxx:234
SmMlAttributeValueDisplaystyle m_aDisplaystyle
Definition: def.hxx:239
SmMlAttributeValueFence m_aFence
Definition: def.hxx:244
SmMlAttributeValueForm m_aForm
Definition: def.hxx:249
SmMlAttributeValueHref m_aHref
Definition: def.hxx:254
OUString * m_aLnk
Definition: def.hxx:255
SmLengthValue m_aLengthValue
Definition: def.hxx:260
SmMlAttributeValueMathbackground m_aMathbackground
Definition: def.hxx:265
Color m_aCol
Definition: def.hxx:272
SmMlAttributeValueMathcolor m_aMathcolor
Definition: def.hxx:271
SmLengthValue m_aLengthValue
Definition: def.hxx:277
SmMlAttributeValueMathvariant m_aMathvariant
Definition: def.hxx:282
SmMlAttributeValueMaxsize m_aMaxsize
Definition: def.hxx:287
SmLengthValue m_aLengthValue
Definition: def.hxx:288
SmLengthValue m_aLengthValue
Definition: def.hxx:293
SmMlAttributeValueMovablelimits m_aMovablelimits
Definition: def.hxx:298
SmLengthValue m_aLengthValue
Definition: def.hxx:303
SmMlAttributeValueSeparator m_aSeparator
Definition: def.hxx:308
SmMlAttributeValueStretchy m_aStretchy
Definition: def.hxx:313
SmMlAttributeValueSymmetric m_aSymmetric
Definition: def.hxx:318