]> git.lyx.org Git - lyx.git/blob - src/mathed/math_symbolinset.h
the DocIterator stuff
[lyx.git] / src / mathed / math_symbolinset.h
1 // -*- C++ -*-
2 /**
3  * \file math_symbolinset.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef MATH_SYMBOLINSET_H
13 #define MATH_SYMBOLINSET_H
14
15 #include "math_inset.h"
16
17 struct latexkeys;
18
19
20 /** "normal" symbols that don't take limits and don't grow in displayed
21  *  formulae.
22  */
23 class MathSymbolInset : public MathInset {
24 public:
25         ///
26         explicit MathSymbolInset(latexkeys const * l);
27         ///
28         explicit MathSymbolInset(char const * name);
29         ///
30         explicit MathSymbolInset(std::string const & name);
31         ///
32         virtual std::auto_ptr<InsetBase> clone() const;
33         ///
34         void metrics(MetricsInfo & mi, Dimension & dim) const;
35         ///
36         void draw(PainterInfo &, int x, int y) const;
37         ///
38         int width() const { return width_; }
39
40         ///
41         bool isRelOp() const;
42         /// do we take scripts?
43         bool isScriptable() const;
44         /// do we take \limits or \nolimits?
45         bool takesLimits() const;
46         /// identifies SymbolInset as such
47         MathSymbolInset const * asSymbolInset() const { return this; }
48         /// the LaTeX name of the symbol (without the backslash)
49         std::string name() const;
50         /// request "external features"
51         void validate(LaTeXFeatures & features) const;
52
53         ///
54         void normalize(NormalStream &) const;
55         ///
56         void maple(MapleStream &) const;
57         ///
58         void maxima(MaximaStream &) const;
59         ///
60         void mathematica(MathematicaStream &) const;
61         ///
62         void mathmlize(MathMLStream &) const;
63         ///
64         void octave(OctaveStream &) const;
65         ///
66         void write(WriteStream & os) const;
67         ///
68         void infoize2(std::ostream & os) const;
69
70 private:
71         ///
72         latexkeys const * sym_;
73         ///
74         mutable int h_;
75         /// cached width
76         mutable int width_;
77         ///
78         mutable bool scriptable_;
79 };
80 #endif