]> git.lyx.org Git - lyx.git/blob - src/mathed/MathParser.h
Change the interface to a paragraph's layout. We still store a LayoutPtr, but now...
[lyx.git] / src / mathed / MathParser.h
1 // -*- C++ -*-
2 /**
3  * \file MathParser.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author André Pönitz
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef MATH_PARSER_H
14 #define MATH_PARSER_H
15
16 #include "support/types.h"
17 #include "support/docstring.h"
18
19
20 namespace lyx {
21
22 class MathAtom;
23 class MathData;
24 class InsetMathGrid;
25 class Lexer;
26
27
28 ///
29 class latexkeys {
30 public:
31         /// name of the macro or primitive
32         docstring name;
33         /// name of a inset that handles that macro
34         docstring inset;
35         /**
36          * The string or symbol to draw.
37          * This is a string of length 1 if \p name is a known symbol, and
38          * the corresponding font is available. In this case it is
39          * NO UCS4 STRING! The only "character" of the string simply denotes
40          * the code point of the symbol in the font. Therefore you have to
41          * be very careful if you pass \c draw to any function that takes a
42          * docstring argument.
43          * If \p name is a known symbol, but the corresponding font is not
44          * available, or if it is a function name, then \c draw contains a
45          * regular UCS4 string (actuallay \c draw == \c name) that is painted
46          * on screen.
47          */
48         docstring draw;
49         /// operator/..., fontname e
50         docstring extra;
51         /// how is this called as XML entity in MathML?
52         docstring xmlname;
53         /// required LaTeXFeatures
54         docstring requires;
55 };
56
57
58 /// check whether this is a well-known (La)TeX macro or primitive
59 latexkeys const * in_word_set(docstring const & str);
60
61 /// parse formula from a string
62 bool mathed_parse_normal(MathAtom &, docstring const &);
63 /// ... the LyX lexxer
64 bool mathed_parse_normal(MathAtom &, Lexer &);
65 /// parse formula from a string into a grid
66 void mathed_parse_normal(InsetMathGrid &, docstring const &);
67
68 /// parse a single cell from a string
69 void mathed_parse_cell(MathData & ar, docstring const &);
70 /// parse a single cell from a stream. Only use this for reading from .lyx
71 /// file format, for the reason see Parser::tokenize(std::istream &).
72 void mathed_parse_cell(MathData & ar, std::istream &);
73
74 void initParser();
75
76
77 } // namespace lyx
78
79 #endif