]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInclude.h
* the old cursor is stored before dispatch and then used after moving
[lyx.git] / src / insets / InsetInclude.h
index 93fa887e14625cce795a9b8c5d43709c7fb24eae..873521592e0029eba0bd483603bfa28f6162321b 100644 (file)
@@ -16,6 +16,7 @@
 #include "InsetCommandParams.h"
 #include "RenderButton.h"
 #include "MailInset.h"
+#include "Counters.h"
 
 #include "support/FileName.h"
 
@@ -30,7 +31,7 @@ class RenderMonitoredPreview;
 
 
 /// for including tex/lyx files
-class InsetInclude : public InsetOld {
+class InsetInclude : public Inset {
 public:
        ///
        InsetInclude(InsetCommandParams const &);
@@ -41,13 +42,13 @@ public:
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       virtual bool display() const;
+       virtual DisplayType display() const;
 
        /// get the parameters
        InsetCommandParams const & params() const;
 
        ///
-       InsetBase::Code lyxCode() const { return InsetBase::INCLUDE_CODE; }
+       Inset::Code lyxCode() const { return Inset::INCLUDE_CODE; }
        /** Fills \c list
         *  \param buffer the Buffer containing this inset.
         *  \param list the list of labels in the child buffer.
@@ -79,32 +80,35 @@ public:
        ///
        void write(Buffer const &, std::ostream &) const;
        ///
-       void read(Buffer const &, LyXLex &);
+       void read(Buffer const &, Lexer &);
        ///
        int latex(Buffer const &, odocstream &,
-                 OutputParams const &) const;
+                 OutputParams const &) const;
        ///
        int plaintext(Buffer const &, odocstream &,
-                     OutputParams const &) const;
+                     OutputParams const &) const;
        ///
        int docbook(Buffer const &, odocstream &,
-                   OutputParams const &) const;
+                   OutputParams const &) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
        void addPreview(graphics::PreviewLoader &) const;
        ///
-       void addToToc(TocList &, Buffer const &) const;
+       void addToToc(TocList &, Buffer const &, ParConstIterator &) const;
        ///
        void updateLabels(Buffer const & buffer) const;
        ///
-       bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
+       bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
+       /// if this inset contains lstinputlisting and has a caption,
+       /// update internal counter and passed counter
+       void updateCounter(Counters & counters);
 protected:
        InsetInclude(InsetInclude const &);
        ///
-       virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
-       virtual std::auto_ptr<InsetBase> doClone() const;
+       virtual std::auto_ptr<Inset> doClone() const;
 
        /** Slot receiving a signal that the external file has changed
         *  and the preview should be regenerated.
@@ -120,7 +124,7 @@ private:
        ///
        void write(std::ostream &) const;
        ///
-       void read(LyXLex &);
+       void read(Lexer &);
 
        /// the parameters
        InsetCommandParams params_;
@@ -133,6 +137,7 @@ private:
        /// cache
        mutable bool set_label_;
        mutable RenderButton button_;
+       int counter_;
 };
 
 
@@ -141,7 +146,7 @@ public:
        ///
        InsetIncludeMailer(InsetInclude & inset);
        ///
-       virtual InsetBase & inset() const { return inset_; }
+       virtual Inset & inset() const { return inset_; }
        ///
        virtual std::string const & name() const { return name_; }
        ///