]> git.lyx.org Git - lyx.git/blob - src/insets/render_button.h
ws changes only
[lyx.git] / src / insets / render_button.h
1 // -*- C++ -*-
2 /**
3  * \file render_button.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 RENDER_BUTTON_H
13 #define RENDER_BUTTON_H
14
15 #include "render_base.h"
16 #include "box.h"
17 #include <string>
18
19
20 class RenderButton : public RenderBase
21 {
22 public:
23         RenderButton();
24
25         RenderBase * clone() const;
26
27         /// compute the size of the object returned in dim
28         virtual void metrics(MetricsInfo & mi, Dimension & dim) const;
29         /// draw inset and update (xo, yo)-cache
30         virtual void draw(PainterInfo & pi, int x, int y) const;
31
32         /// Provide the text for the button
33         void update(std::string const &, bool editable);
34
35         /// The "sensitive area" box, i.e., the button area
36         Box box() const { return button_box_; }
37         ///
38         void setBox(Box b) { button_box_ = b; }
39
40 private:
41         /// The stored data.
42         std::string text_;
43         bool editable_;
44         Box button_box_;
45 };
46
47 #endif // NOT RENDER_BUTTON_H