]> git.lyx.org Git - lyx.git/blob - src/insets/insetbutton.h
fix #832
[lyx.git] / src / insets / insetbutton.h
1 // -*- C++ -*-
2 /**
3  * \file insetbutton.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Asger Alstrup Nielsen
8  * \author Jürgen Vigna
9  * \author Lars Gullik Bjønnes
10  *
11  * Full author contact details are available in file CREDITS
12  */
13
14 #ifndef INSET_BUTTON_H
15 #define INSET_BUTTON_H
16
17
18 #include "inset.h"
19 #include "LString.h"
20 #include <boost/weak_ptr.hpp>
21
22 /** Used to provide an inset that looks like a button.
23  */
24 class InsetButton: public Inset {
25 public:
26         ///
27         int ascent(BufferView *, LyXFont const &) const;
28         ///
29         int descent(BufferView *, LyXFont const &) const;
30         ///
31         int width(BufferView *, LyXFont const &) const;
32         ///
33         void draw(BufferView *, LyXFont const &, int, float &) const;
34         ///
35         dispatch_result localDispatch(FuncRequest const & cmd);
36
37 protected:
38         ///
39         virtual void cache(BufferView *) const;
40         ///
41         virtual BufferView * view() const;
42         /// This should provide the text for the button
43         virtual string const getScreenLabel(Buffer const *) const = 0;
44 private:
45         mutable boost::weak_ptr<BufferView> view_;
46 };
47
48 #endif