#ifndef INSET_BUTTON_H
#define INSET_BUTTON_H
-#ifdef __GNUG__
-#pragma interface
-#endif
-
#include "inset.h"
#include "LString.h"
+#include <boost/weak_ptr.hpp>
/** Used to provide an inset that looks like a button.
*/
class InsetButton: public Inset {
public:
///
- int ascent(BufferView *, LyXFont const &) const;
- ///
- int descent(BufferView *, LyXFont const &) const;
+ void metrics(MetricsInfo &, Dimension &) const;
///
- int width(BufferView *, LyXFont const &) const;
+ void draw(PainterInfo & pi, int x, int y) const;
///
- void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+ dispatch_result localDispatch(FuncRequest const & cmd);
protected:
+ ///
+ virtual void cache(BufferView *) const;
+ ///
+ virtual BufferView * view() const;
/// This should provide the text for the button
virtual string const getScreenLabel(Buffer const *) const = 0;
+private:
+ mutable boost::weak_ptr<BufferView> view_;
};
#endif