]> git.lyx.org Git - lyx.git/blob - src/insets/insetbutton.h
Clean up InsetGraphics::Cache and rename as GraphicsInset.
[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 #include "inset.h"
18 #include "LString.h"
19 #include <boost/weak_ptr.hpp>
20
21 /** Used to provide an inset that looks like a button.
22  */
23 class InsetButton: public Inset {
24 public:
25         ///
26         void metrics(MetricsInfo &, Dimension &) const;
27         ///
28         void draw(PainterInfo & pi, int x, int y) const;
29         ///
30         dispatch_result localDispatch(FuncRequest const & cmd);
31
32 protected:
33         ///
34         virtual void cache(BufferView *) const;
35         ///
36         virtual BufferView * view() const;
37         /// This should provide the text for the button
38         virtual string const getScreenLabel(Buffer const *) const = 0;
39 private:
40         mutable boost::weak_ptr<BufferView> view_;
41 };
42
43 #endif