]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbase.h
more cleanup:
[lyx.git] / src / insets / insetbase.h
index dd8651928a93a410f184e30f5c68b8264dda436d..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 {}
@@ -201,7 +206,7 @@ public:
                OutputParams const &) const { return 0; };
 
        /** This enum indicates by which means the inset can be modified:
-       - NOT_EDITABLE: the inset's content can not be modified at all
+       - NOT_EDITABLE: the inset's content cannot be modified at all
          (e.g. printindex, insetspecialchar)
        - IS_EDITABLE: content can be edited via dialog (e.g. bibtex, index, url)
        - HIGHLY_EDITABLE: content can be edited on screen (normally means that
@@ -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;
 };