]> git.lyx.org Git - lyx.git/blob - src/mathed/math_symbolinset.h
preview as preview can...
[lyx.git] / src / mathed / math_symbolinset.h
1 // -*- C++ -*-
2 #ifndef MATH_SYMBOLINSET_H
3 #define MATH_SYMBOLINSET_H
4
5 #include "math_diminset.h"
6
7 struct latexkeys;
8
9 // "normal" symbols that don't take limits and don't grow in displayed
10 // formulae
11
12 class MathSymbolInset : public MathDimInset {
13 public:
14         ///
15         explicit MathSymbolInset(latexkeys const *);
16         ///
17         explicit MathSymbolInset(char const *);
18         ///
19         explicit MathSymbolInset(string const &);
20         ///
21         MathInset * clone() const;
22         ///
23         void metrics(MathMetricsInfo & st) const;
24         ///
25         void draw(MathPainterInfo &, int x, int y) const;
26         ///
27         bool isRelOp() const;
28         /// do we take scripts?
29         bool isScriptable() const;
30         /// do we take \limits or \nolimits?
31         bool takesLimits() const;
32         /// identifies SymbolInset as such
33         MathSymbolInset const * asSymbolInset() const { return this; }
34         /// the LaTeX name of the symbol (without the backslash)
35         string name() const;
36         ///
37         bool match(MathInset *) const;
38         /// request "external features"
39         void validate(LaTeXFeatures & features) const;
40         /// identifies complicated things that need braces if used as arg
41         bool needsBraces() const { return false; }
42
43         ///
44         void normalize(NormalStream &) const;
45         ///
46         void maplize(MapleStream &) const;
47         ///
48         void mathmlize(MathMLStream &) const;
49         ///
50         void octavize(OctaveStream &) const;
51         ///
52         void write(WriteStream & os) const;
53         ///
54         void infoize(std::ostream & os) const;
55
56 private:
57         ///
58         latexkeys const * sym_;
59         ///
60         mutable int h_;
61         ///
62         mutable bool scriptable_;
63 };
64 #endif