]> git.lyx.org Git - lyx.git/blob - src/mathed/MathSupport.h
Use context-sensitive command termination
[lyx.git] / src / mathed / MathSupport.h
1 // -*- C++ -*-
2 /**
3  * \file MathSupport.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_SUPPORT_H
14 #define MATH_SUPPORT_H
15
16 #include "MathParser_flags.h"
17 #include "support/strfwd.h"
18
19 namespace lyx {
20
21 class MetricsBase;
22 class MetricsInfo;
23 class PainterInfo;
24 class FontInfo;
25 class Dimension;
26 class MathData;
27 class MathAtom;
28 class InsetMath;
29 class latexkeys;
30
31
32 int mathed_font_em(FontInfo const &);
33
34 int mathed_mu(FontInfo const & font, double mu);
35
36 int mathed_thinmuskip(FontInfo const & font);
37
38 int mathed_medmuskip(FontInfo const & font);
39
40 int mathed_thickmuskip(FontInfo const & font);
41
42 int mathed_char_width(FontInfo const &, char_type c);
43
44 int mathed_char_kerning(FontInfo const &, char_type c);
45
46 void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
47         docstring const & name);
48
49 void mathed_string_dim(FontInfo const & font,
50                        docstring const & s,
51                        Dimension & dim);
52
53 int mathed_string_width(FontInfo const &, docstring const & s);
54
55 void mathedSymbolDim(MetricsBase & mb, Dimension & dim, latexkeys const * sym);
56
57 void mathedSymbolDraw(PainterInfo & pi, int x, int y, latexkeys const * sym);
58
59 void metricsStrRedBlack(MetricsInfo & mi, Dimension & dim, docstring const & s);
60
61 void drawStrRed(PainterInfo & pi, int x, int y, docstring const & s);
62 void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & s);
63
64 void math_font_max_dim(FontInfo const &, int & asc, int & desc);
65
66 void augmentFont(FontInfo & f, std::string const & cmd);
67
68 bool isFontName(std::string const & name);
69
70 bool isMathFont(std::string const & name);
71
72 bool isTextFont(std::string const & name);
73
74 bool isAlphaSymbol(MathAtom const & at);
75
76 // converts single cell to string
77 docstring asString(MathData const & ar);
78 // converts single inset to string
79 docstring asString(InsetMath const &);
80 docstring asString(MathAtom const &);
81 // converts string to single cell
82 void asArray(docstring const &, MathData &, Parse::flags f = Parse::NORMAL);
83
84 } // namespace lyx
85
86 #endif