]> git.lyx.org Git - lyx.git/blobdiff - src/insets/Inset.h
More requires --> required, for C++2a.
[lyx.git] / src / insets / Inset.h
index ae5af7cc784aedc26ff4ab0b6ea41171ddb74b19..ab35584e126c06a830b3cee11fa294ec4008c474 100644 (file)
@@ -202,6 +202,17 @@ public:
        /// https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg199001.html
        virtual Inset * editXY(Cursor & cur, int x, int y);
 
+       /// The default margin inside text insets
+       static int textOffset(BufferView const *) { return 4; }
+       ///
+       virtual int topOffset(BufferView const *bv) const { return textOffset(bv); }
+       ///
+       virtual int bottomOffset(BufferView const *bv) const { return textOffset(bv); }
+       ///
+       virtual int leftOffset(BufferView const *bv) const { return textOffset(bv); }
+       ///
+       virtual int rightOffset(BufferView const *bv) const { return textOffset(bv); }
+
        /// compute the size of the object returned in dim
        virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
        /// draw inset and update (xo, yo)-cache
@@ -594,6 +605,8 @@ public:
         */
        virtual bool resetFontEdit() const;
 
+       /// does the inset contain changes ?
+       virtual bool isChanged() const { return false; }
        /// set the change for the entire inset
        virtual void setChange(Change const &) {}
        /// accept the changes within the inset
@@ -608,8 +621,6 @@ public:
        virtual ColorCode backgroundColor(PainterInfo const &) const;
        ///
        virtual ColorCode labelColor() const;
-       //
-       enum { TEXT_TO_INSET_OFFSET = 4 };
 
        /// Determine the action of backspace and delete: do we select instead of
        /// deleting if not already selected?