]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbutton.h
Clean up InsetGraphics::Cache and rename as GraphicsInset.
[lyx.git] / src / insets / insetbutton.h
index 056c3fe98da65b53f0973d38a95e09472810cc54..04b5cd1df8ceaf3924ec21495356dc68af93e57c 100644 (file)
@@ -1,44 +1,43 @@
 // -*- C++ -*-
-/* This file is part of*
- * ====================================================== 
+/**
+ * \file insetbutton.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
- *      
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 2000 The LyX Team.
+ * \author Asger Alstrup Nielsen
+ * \author Jürgen Vigna
+ * \author Lars Gullik Bjønnes
  *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS
+ */
 
 #ifndef INSET_BUTTON_H
 #define INSET_BUTTON_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "lyxinset.h"
+#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:
        ///
-       InsetButton();
-
-       ///
-       int ascent(Painter &, LyXFont const &) const;
+       void metrics(MetricsInfo &, Dimension &) const;
        ///
-       int descent(Painter &, LyXFont const &) const;
+       void draw(PainterInfo & pi, int x, int y) const;
        ///
-       int width(Painter &, LyXFont const &) 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 getScreenLabel() const = 0;
+       virtual string const getScreenLabel(Buffer const *) const = 0;
+private:
+       mutable boost::weak_ptr<BufferView> view_;
 };
 
 #endif
-