]> git.lyx.org Git - lyx.git/blob - src/mathed/command_inset.h
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / command_inset.h
1 // -*- C++ -*-
2 /**
3  * \file command_inset.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 "math_nestinset.h"
17
18 #include "insets/render_button.h"
19
20
21 /// Inset for things like \name[options]{contents}
22 class CommandInset : public MathNestInset {
23 public:
24         ///
25         explicit CommandInset(std::string const & name);
26         ///
27         void metrics(MetricsInfo & mi, Dimension & dim) const;
28         ///
29         void draw(PainterInfo & pi, int x, int y) const;
30         ///
31         void write(WriteStream & os) const;
32         //
33         // void infoize(std::ostream & os) const;
34         ///
35         virtual std::string const screenLabel() const;
36         /// generate something that will be understood by the Dialogs.
37         std::string const createDialogStr(std::string const & name) const;
38         ///
39         std::string const & commandname() const { return name_; }
40 private:
41         virtual std::auto_ptr<InsetBase> doClone() const;
42
43         ///
44         std::string name_;
45         ///
46         mutable bool set_label_;
47         ///
48         mutable RenderButton button_;
49 };
50
51 #endif