]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetinclude.h
Enable the external inset to handle unknown templates gracefully.
[lyx.git] / src / insets / insetinclude.h
index 6d9c461593171cb010715ee0851a03e5aefc5558..008779970740297ce3a33c72936de4e0656b6226 100644 (file)
@@ -13,6 +13,7 @@
 #define INSET_INCLUDE_H
 
 #include "insetcommand.h"
+#include "dimension.h"
 
 #include <boost/scoped_ptr.hpp>
 
@@ -57,16 +58,12 @@ public:
        ~InsetInclude();
 
        ///
-       virtual dispatch_result localDispatch(FuncRequest const & cmd); 
+       virtual dispatch_result localDispatch(FuncRequest const & cmd);
 
        /// Override these InsetButton methods if Previewing
-       int ascent(BufferView *, LyXFont const &) const;
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
-       int descent(BufferView *, LyXFont const &) const;
-       ///
-       int width(BufferView *, LyXFont const &) const;
-       ///
-       void draw(BufferView *, LyXFont const &, int, float &) const;
+       void draw(PainterInfo & pi, int x, int y) const;
 
        /// get the parameters
        Params const & params(void) const;
@@ -74,7 +71,7 @@ public:
        void set(Params const & params);
 
        ///
-       virtual Inset * clone(Buffer const &, bool same_id = false) const;
+       virtual Inset * clone() const;
        ///
        Inset::Code lyxCode() const { return Inset::INCLUDE_CODE; }
        /// This returns the list of labels on the child buffer
@@ -91,8 +88,8 @@ public:
        ///
        void read(Buffer const *, LyXLex &);
        ///
-       int latex(Buffer const *, std::ostream &, LatexRunParams const &,
-                 bool fragile, bool free_spc) const;
+       int latex(Buffer const *, std::ostream &,
+                 LatexRunParams const &) const;
        ///
        int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
@@ -131,6 +128,9 @@ private:
        friend class PreviewImpl;
        /// The pointer never changes although *preview_'s contents may.
        boost::scoped_ptr<PreviewImpl> const preview_;
+
+       /// cache
+       mutable Dimension dim_;
 };