]> git.lyx.org Git - lyx.git/blob - src/mathed/CommandInset.h
Make Buffer argument mandatory in most of the InsetMath based class... boring work...
[lyx.git] / src / mathed / CommandInset.h
1 // -*- C++ -*-
2 /**
3  * \file CommandInset.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
13 #ifndef COMMAND_INSET_H
14 #define COMMAND_INSET_H
15
16 #include "InsetMathNest.h"
17
18 #include "insets/RenderButton.h"
19
20
21 namespace lyx {
22
23
24 /// Inset for things like \name[options]{contents}
25 class CommandInset : public InsetMathNest {
26 public:
27         ///
28         explicit CommandInset(Buffer * buf, docstring const & name,
29                 bool needs_math_mode = true);
30         ///
31         void metrics(MetricsInfo & mi, Dimension & dim) const;
32         ///
33         void draw(PainterInfo & pi, int x, int y) const;
34         ///
35         Inset * editXY(Cursor &, int, int);
36         ///
37         void write(WriteStream & os) const;
38         //
39         // void infoize(odocstream & os) const;
40         ///
41         virtual docstring const screenLabel() const;
42         ///
43         docstring const & commandname() const { return name_; }
44         ///
45         bool isActive() const { return false; }
46
47 private:
48         virtual Inset * clone() const;
49
50         ///
51         docstring name_;
52         ///
53         bool needs_math_mode_;
54         ///
55         mutable bool set_label_;
56         ///
57         mutable RenderButton button_;
58 };
59
60
61 } // namespace lyx
62
63 #endif