android: Update app-specific/MIME type icons
[LibreOffice.git] / starmath / inc / nodetype.hxx
blobf0bf28cece678169feca6c80caff87b367576aef
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 /**
21 * This file provides definition for the nodetypes.
22 * Also provides analysis of the node functions
25 enum class SmNodeType : int_fast16_t
27 Table, // tree header
28 Brace, // () [] {}
29 Bracebody, // content of () [] {}
30 Oper, // largeop
31 Align, // alignment
32 Attribute, // attributes
33 Font, // fonts
34 UnHor, // unmo
35 BinHor, // binmo
36 BinVer, // over frac
37 BinDiagonal, // slash
38 SubSup, // lsub lsup rsub rsup csub csup
39 Matrix, // binom matrix
40 Place, // <?>
41 Text, // "text"
42 Special, // %glyph
43 GlyphSpecial, // %glyph
44 Math, // operator value
45 Blank, // ~
46 Error, // Syntax error
47 Line, // a line of math until newline
48 Expression, // { content in here }
49 PolyLine, // ^
50 Root, // root node
51 RootSymbol, // 3 of cubic root
52 Rectangle, //just structural
53 VerticalBrace, // vertical {}
54 MathIdent // identities and variables
57 namespace starmathdatabase
59 inline bool isStructuralNode(SmNodeType aNodeTypeName)
61 return aNodeTypeName == SmNodeType::Table || aNodeTypeName == SmNodeType::Line
62 || aNodeTypeName == SmNodeType::UnHor || aNodeTypeName == SmNodeType::BinHor
63 || aNodeTypeName == SmNodeType::BinVer || aNodeTypeName == SmNodeType::BinDiagonal
64 || aNodeTypeName == SmNodeType::SubSup || aNodeTypeName == SmNodeType::Matrix
65 || aNodeTypeName == SmNodeType::Root || aNodeTypeName == SmNodeType::Expression
66 || aNodeTypeName == SmNodeType::Brace || aNodeTypeName == SmNodeType::Bracebody
67 || aNodeTypeName == SmNodeType::Oper || aNodeTypeName == SmNodeType::Align
68 || aNodeTypeName == SmNodeType::Attribute || aNodeTypeName == SmNodeType::Font;
71 inline bool isBinOperatorNode(SmNodeType aNodeTypeName)
73 return aNodeTypeName == SmNodeType::BinHor || aNodeTypeName == SmNodeType::BinVer
74 || aNodeTypeName == SmNodeType::BinDiagonal || aNodeTypeName == SmNodeType::SubSup;
77 inline bool isUnOperatorNode(SmNodeType aNodeTypeName)
79 return aNodeTypeName == SmNodeType::UnHor;
82 inline bool isOperatorNode(SmNodeType aNodeTypeName)
84 return aNodeTypeName == SmNodeType::BinHor || aNodeTypeName == SmNodeType::BinVer
85 || aNodeTypeName == SmNodeType::BinDiagonal || aNodeTypeName == SmNodeType::SubSup
86 || aNodeTypeName == SmNodeType::UnHor || aNodeTypeName == SmNodeType::Oper;
89 inline bool isStandaloneNode(SmNodeType aNodeTypeName)
91 return aNodeTypeName == SmNodeType::Text || aNodeTypeName == SmNodeType::Special
92 || aNodeTypeName == SmNodeType::GlyphSpecial || aNodeTypeName == SmNodeType::Math
93 || aNodeTypeName == SmNodeType::Blank || aNodeTypeName == SmNodeType::MathIdent;
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */