]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathColor.h
remove unneeded header.
[lyx.git] / src / mathed / InsetMathColor.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathColor.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_COLORINSET_H
13 #define MATH_COLORINSET_H
14
15 #include "Color.h"
16
17 #include "InsetMathNest.h"
18
19
20 namespace lyx {
21
22 /// Change colours.
23
24 class InsetMathColor : public InsetMathNest {
25 public:
26         /// Create a color inset from LyX color number
27         explicit InsetMathColor(bool oldstyle,
28                 Color_color const & color = Color::none);
29         /// Create a color inset from LaTeX color name
30         explicit InsetMathColor(bool oldstyle, docstring const & color);
31         ///
32         bool metrics(MetricsInfo & mi, Dimension & dim) const;
33         /// we write extra braces in any case...
34         /// FIXME Why? Are they necessary if oldstyle_ == false?
35         bool extraBraces() const { return true; }
36         ///
37         void draw(PainterInfo & pi, int x, int y) const;
38         /// we need package color
39         void validate(LaTeXFeatures & features) const;
40         ///
41         void write(WriteStream & os) const;
42         /// write normalized content
43         void normalize(NormalStream & ns) const;
44         ///
45         void infoize(odocstream & os) const;
46 private:
47         virtual std::auto_ptr<Inset> doClone() const;
48         /// width of '[' in current font
49         mutable int w_;
50         ///
51         bool oldstyle_;
52         /// Our color. Only valid LaTeX colors are allowed.
53         docstring color_;
54 };
55
56
57 } // namespace lyx
58
59 #endif