]> git.lyx.org Git - lyx.git/blob - src/mathed/math_colorinset.h
support for \textcolor
[lyx.git] / src / mathed / math_colorinset.h
1 // -*- C++ -*-
2 /**
3  * \file math_colorinset.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 "math_nestinset.h"
16
17 /// Change colours.
18
19 class MathColorInset : public MathNestInset {
20 public:
21         ///
22         explicit MathColorInset(bool oldstyle);
23         ///
24         std::auto_ptr<InsetBase> clone() const;
25         ///
26         void metrics(MetricsInfo & mi, Dimension & dim) const;
27         /// we write extra braces in any case...
28         bool extraBraces() const { return true; }
29         ///
30         void draw(PainterInfo & pi, int x, int y) const;
31         /// we need package color
32         void validate(LaTeXFeatures & features) const;
33         ///
34         void write(WriteStream & os) const;
35         /// write normalized content
36         void normalize(NormalStream & ns) const;
37         ///
38         void infoize(std::ostream & os) const;
39 private:
40         /// width of '[' in current font
41         mutable int w_;
42         ///
43         bool oldstyle_;
44 };
45
46 #endif