]> git.lyx.org Git - lyx.git/blobdiff - src/insets/Inset.h
Fix text frame drawing.
[lyx.git] / src / insets / Inset.h
index 25c343850d68f307bbfe51445a5e956f53bbf3be..6b2b14a7310c12f99beecbb4fbfd210dfff44cb1 100644 (file)
@@ -15,8 +15,6 @@
 #ifndef INSETBASE_H
 #define INSETBASE_H
 
-//#include "BiblioInfo.h"
-#include "Changes.h"
 #include "Dimension.h"
 
 #include "support/docstream.h"
@@ -30,25 +28,28 @@ class BiblioInfo;
 class Buffer;
 class BufferParams;
 class BufferView;
-class ParIterator;
-class ParConstIterator;
+class Change;
+class Color_color;
+class Cursor;
 class CursorSlice;
-class InsetIterator;
 class FuncRequest;
 class FuncStatus;
+class InsetIterator;
 class InsetLayout;
 class InsetMath;
 class InsetText;
 class LaTeXFeatures;
-class Color_color;
-class Cursor;
 class Lexer;
-class Text;
+class MathAtom;
 class MetricsInfo;
-class Dimension;
-class PainterInfo;
 class OutputParams;
+class PainterInfo;
+class Paragraph;
+class ParConstIterator;
+class ParIterator;
+class Text;
 class TocList;
+class EmbeddedFiles;
 
 
 namespace graphics { class PreviewLoader; }
@@ -77,8 +78,6 @@ public:
 
        /// virtual base class destructor
        virtual ~Inset() {}
-       /// replicate ourselves
-       std::auto_ptr<Inset> clone() const;
 
        /// identification as math inset
        virtual InsetMath * asInsetMath() { return 0; }
@@ -440,6 +439,9 @@ public:
        /// Add an entry to the TocList
        /// 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 {};
        /// Fill keys with BibTeX information
        virtual void fillWithBibKeys(Buffer const &,
                BiblioInfo &, InsetIterator const &) const { return; }
@@ -474,6 +476,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.
@@ -497,6 +501,11 @@ public:
 protected:
        Inset();
 
+       /// replicate ourselves
+       friend class Paragraph;
+       friend class MathAtom;
+       virtual Inset * clone() const = 0;
+
        /** The real dispatcher.
         *  Gets normally called from Cursor::dispatch(). Cursor::dispatch()
         *  assumes the common case of 'LFUN handled, need update'.
@@ -512,8 +521,6 @@ protected:
 
        /// Cached dimensions of the inset.
        mutable Dimension dim_;
-private:
-       virtual std::auto_ptr<Inset> doClone() const = 0;
 };