]> git.lyx.org Git - lyx.git/blob - src/insets/RenderButton.h
Fix trailing whitespace in cpp files.
[lyx.git] / src / insets / RenderButton.h
1 // -*- C++ -*-
2 /**
3  * \file RenderButton.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef RENDERBUTTON_H
13 #define RENDERBUTTON_H
14
15 #include "RenderBase.h"
16 #include "Box.h"
17 #include "support/docstring.h"
18
19
20 namespace lyx {
21
22
23 class RenderButton : public RenderBase
24 {
25 public:
26         RenderButton();
27
28         RenderBase * clone(Inset const *) const;
29
30         /// compute the size of the object returned in dim
31         virtual void metrics(MetricsInfo & mi, Dimension & dim) const;
32         /// draw inset and update (xo, yo)-cache
33         virtual void draw(PainterInfo & pi, int x, int y) const;
34
35         /// Provide the text for the button
36         void update(docstring const &, bool editable, bool inherit_font);
37
38         /// The "sensitive area" box, i.e., the button area
39         Box box() const { return button_box_; }
40         ///
41         void setBox(Box b) { button_box_ = b; }
42
43         /// equivalent to dynamic_cast
44         virtual RenderButton * asButton() { return this; }
45
46 private:
47         /// The stored data.
48         docstring text_;
49         bool editable_;
50         bool inherit_font_;
51         Box button_box_;
52 };
53
54
55 } // namespace lyx
56
57 #endif // NOT RENDERBUTTON_H