]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbase.h
more cleanup:
[lyx.git] / src / insets / insetbase.h
index b69bbbde01b1e0cf00c9bd283620e2141541b4f6..8e1af0aee74e15bd810d3ba2795c16ffb578dbca 100644 (file)
 #ifndef INSETBASE_H
 #define INSETBASE_H
 
-#include "support/docstream.h"
-
 #include "changes.h"
+#include "dimension.h"
+
+#include "support/docstream.h"
 
 #include <memory>
 #include <vector>
@@ -103,7 +104,8 @@ public:
        virtual InsetBase * editXY(LCursor & cur, int x, int y);
 
        /// compute the size of the object returned in dim
-       virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
+       /// \retval true if metrics changed.
+       virtual bool metrics(MetricsInfo & mi, Dimension & dim) const = 0;
        /// draw inset and update (xo, yo)-cache
        virtual void draw(PainterInfo & pi, int x, int y) const = 0;
        /// draw inset selection if necessary
@@ -178,6 +180,9 @@ public:
        /// is called when the cursor leaves this inset
        //  returns true if cursor is now invalid.
        virtual bool notifyCursorLeaves(LCursor &) { return false; }
+       /// is called when the mouse enter or leave this inset
+       /// return true if this inset needs repaint
+       virtual bool setMouseHover(bool) { return false; }
 
        /// request "external features"
        virtual void validate(LaTeXFeatures &) const {}
@@ -443,6 +448,9 @@ protected:
         *  \sa getStatus
         */
        virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+
+       /// Cached dimensions of the inset.
+       mutable Dimension dim_;
 private:
        virtual std::auto_ptr<InsetBase> doClone() const = 0;
 };