]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathCommand.h
BUG 686: delete empty math box with delete/backspace key
[lyx.git] / src / mathed / InsetMathCommand.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathCommand.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/render_button.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(docstring const & name);
29         ///
30         void metrics(MetricsInfo & mi, Dimension & dim) const;
31         ///
32         void draw(PainterInfo & pi, int x, int y) const;
33         ///
34         InsetBase * editXY(LCursor &, int, int);
35         ///
36         void write(WriteStream & os) const;
37         //
38         // void infoize(odocstream & os) const;
39         ///
40         virtual docstring const screenLabel() const;
41         /// generate something that will be understood by the Dialogs.
42         std::string const createDialogStr(std::string const & name) const;
43         ///
44         docstring const & commandname() const { return name_; }
45 private:
46         virtual std::auto_ptr<InsetBase> doClone() const;
47
48         ///
49         docstring name_;
50         ///
51         mutable bool set_label_;
52         ///
53         mutable RenderButton button_;
54 };
55
56
57 } // namespace lyx
58
59 #endif