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 #ifndef INCLUDED_STARMATH_SOURCE_MATHMLATTR_HXX
11 #define INCLUDED_STARMATH_SOURCE_MATHMLATTR_HXX
12 
13 #include <rtl/ustring.hxx>
14 #include <sal/types.h>
15 #include <tools/fract.hxx>
16 
17 // MathML 3: 2.1.5.1 Syntax notation used in the MathML specification
18 // <https://www.w3.org/TR/MathML/chapter2.html#id.2.1.5.1>
19 // MathML 2: 2.4.4.2 Attributes with units
20 // <https://www.w3.org/TR/MathML2/chapter2.html#fund.attval>
21 // MathML 3: 2.1.5.2 Length Valued Attributes
22 // <https://www.w3.org/TR/MathML/chapter2.html#fund.units>
23 
24 enum class MathMLLengthUnit {
25     None,
26     Em,
27     Ex,
28     Px,
29     In,
30     Cm,
31     Mm,
32     Pt,
33     Pc,
34     Percent
35 };
36 
37 struct MathMLAttributeLengthValue
38 {
39     Fraction aNumber;
40     MathMLLengthUnit eUnit;
MathMLAttributeLengthValueMathMLAttributeLengthValue41     MathMLAttributeLengthValue()
42         : eUnit(MathMLLengthUnit::None)
43     {
44     }
45 };
46 
47 sal_Int32 ParseMathMLAttributeLengthValue(const OUString &rStr, MathMLAttributeLengthValue& rV);
48 
49 
50 // MathML 3: 3.2.2 Mathematics style attributes common to token elements
51 // <https://www.w3.org/TR/MathML3/chapter3.html#presm.commatt>
52 
53 enum class MathMLMathvariantValue {
54     Normal,
55     Bold,
56     Italic,
57     BoldItalic,
58     DoubleStruck,
59     BoldFraktur,
60     Script,
61     BoldScript,
62     Fraktur,
63     SansSerif,
64     BoldSansSerif,
65     SansSerifItalic,
66     SansSerifBoldItalic,
67     Monospace,
68     Initial,
69     Tailed,
70     Looped,
71     Stretched
72 };
73 
74 bool GetMathMLMathvariantValue(const OUString &rStr, MathMLMathvariantValue& rV);
75 
76 #endif
77 
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
79