LibreOffice Module starmath (master) 1
mathmlMo.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20/*
21 Warning: The SvXMLElementExport helper class creates the beginning and
22 closing tags of xml elements in its constructor and destructor, so there's
23 hidden stuff going on, on occasion the ordering of these classes declarations
24 may be significant
25*/
26
27#pragma once
28
29#include <sal/types.h>
30#include <rtl/ustring.hxx>
31#include <utility>
32#include <vector>
33
34// https://www.w3.org/TR/MathML3/appendixc.html
35
36enum class moOpDP : sal_uInt16
37{ // moOperatorDataProperty
38 nonedp = 0x0000,
39 accent = 0x0001,
40 fence = 0x0002,
41 stretchy = 0x0004,
42 symmetric = 0x0008,
43 separator = 0x0010,
44 linebreakstyleAfter = 0x0020,
45 largeop = 0x0080,
46 movablelimits = 0x0100,
47 starmathCustom = 0x0200,
48 starmathCustomMo = 0x0400,
49 stretchyfence = 0x0006,
50 movablelargeop = 0x0180
51};
52
53enum class moOpDF : sal_uInt16
54{ // moOperatorDataForm
55 nonedf = 0x0000,
56 prefix = 0x0001,
57 infix = 0x0002,
58 postfix = 0x0004,
59 prepostfix = 0x0005
60};
61
63{
64 OUString m_motxt;
66 sal_uInt16 m_priority;
67 sal_uInt16 m_lspace;
68 sal_uInt16 m_rspace;
70
71 moOperatorData(OUString motxt, moOpDF form, sal_uInt16 priority, sal_uInt16 lspace,
72 sal_uInt16 rspace, moOpDP properties)
73 : m_motxt(std::move(motxt))
74 , m_form(form)
75 , m_priority(priority)
76 , m_lspace(lspace)
77 , m_rspace(rspace)
79 {
80 }
81};
82
84{
85 return static_cast<moOpDF>(static_cast<sal_uInt16>(a) | static_cast<sal_uInt16>(b));
86}
87
89{
90 return static_cast<moOpDF>(static_cast<sal_uInt16>(a) & static_cast<sal_uInt16>(b));
91}
92
94{
95 return static_cast<moOpDP>(static_cast<sal_uInt16>(a) | static_cast<sal_uInt16>(b));
96}
97
99{
100 return static_cast<moOpDP>(static_cast<sal_uInt16>(a) & static_cast<sal_uInt16>(b));
101}
102
103namespace starmathdatabase
104{
105constexpr size_t MATHML_MO_COUNT = 1100;
106
107extern std::vector<moOperatorData> moOperatorDataDictionary;
108}
109
110/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
uno_Any a
moOpDP
Definition: mathmlMo.hxx:37
@ starmathCustomMo
@ stretchyfence
@ movablelargeop
@ starmathCustom
@ movablelimits
@ linebreakstyleAfter
moOpDF operator&(moOpDF a, moOpDF b)
Definition: mathmlMo.hxx:88
moOpDF operator|(moOpDF a, moOpDF b)
Definition: mathmlMo.hxx:83
moOpDF
Definition: mathmlMo.hxx:54
@ prepostfix
Parses the starmath code and creates the nodes.
Definition: attribute.hxx:191
constexpr size_t MATHML_MO_COUNT
Definition: mathmlMo.hxx:105
std::vector< moOperatorData > moOperatorDataDictionary
sal_uInt16 m_rspace
Definition: mathmlMo.hxx:68
moOperatorData(OUString motxt, moOpDF form, sal_uInt16 priority, sal_uInt16 lspace, sal_uInt16 rspace, moOpDP properties)
Definition: mathmlMo.hxx:71
moOpDF m_form
Definition: mathmlMo.hxx:65
sal_uInt16 m_priority
Definition: mathmlMo.hxx:66
moOpDP m_properties
Definition: mathmlMo.hxx:69
OUString m_motxt
Definition: mathmlMo.hxx:64
sal_uInt16 m_lspace
Definition: mathmlMo.hxx:67