]> git.lyx.org Git - lyx.git/blobdiff - src/insets/Inset.h
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / Inset.h
index d8c9622fd05fc2fae4175edb58ba786d1cc1fce5..2090a7e369ae0600a21f1c6d79a28c4d20f5a5e6 100644 (file)
@@ -49,6 +49,7 @@ class ParConstIterator;
 class ParIterator;
 class Text;
 class TocList;
+class EmbeddedFile;
 class EmbeddedFiles;
 
 
@@ -119,7 +120,7 @@ public:
 
        /// compute the size of the object returned in dim
        /// \retval true if metrics changed.
-       virtual bool metrics(MetricsInfo & mi, Dimension & dim) const = 0;
+       virtual void 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
@@ -146,6 +147,8 @@ public:
        int yo(BufferView const & bv) const;
        /// set x/y drawing position cache if available
        virtual void setPosCache(PainterInfo const &, int, int) const;
+       ///
+       void setDimCache(MetricsInfo const &, Dimension const &) const;
        /// do we cover screen position x/y?
        virtual bool covers(BufferView const & bv, int x, int y) const;
        /// get the screen positions of the cursor (see note in Cursor.cpp)
@@ -440,8 +443,9 @@ public:
        /// pit is the ParConstIterator of the paragraph containing the inset
        virtual void addToToc(TocList &, Buffer const &, ParConstIterator const &) const {}
        /// report files that can be embedded with the lyx file
-       virtual void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &,
-                       ParConstIterator const &) const {};
+       virtual void registerEmbeddedFiles(Buffer const &, EmbeddedFiles &) const {};
+       /// use embedded or external file after the embedding status of a file is changed
+       virtual void updateEmbeddedFile(Buffer const &, EmbeddedFile const &) {}
        /// Fill keys with BibTeX information
        virtual void fillWithBibKeys(Buffer const &,
                BiblioInfo &, InsetIterator const &) const { return; }
@@ -476,14 +480,8 @@ public:
        /// reject the changes within the inset
        virtual void rejectChanges(BufferParams const &) {};
 
-       /// FIXME: move dim_ out of Inset!
-       Dimension const & dimension() { return dim_; }
-       /// inset width.
-       int width() const { return dim_.wid; }
-       /// inset ascent.
-       int ascent() const { return dim_.asc; }
-       /// inset descent.
-       int descent() const { return dim_.des; }
+       ///
+       virtual Dimension const dimension(BufferView const &) const;
        ///
        int scroll() const { return 0; }
        ///
@@ -518,9 +516,6 @@ protected:
         *  \sa getStatus
         */
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
-
-       /// Cached dimensions of the inset.
-       mutable Dimension dim_;
 };