]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetListings.h
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetListings.h
index 1d02c7cd4fe6136421c6a78ec28c904f0620d0ae..3e5fbd54e21b3e7b3503129414575f20378ffa51 100644 (file)
@@ -24,18 +24,20 @@ namespace lyx {
  */
 
 
-class InsetListings : public InsetERT {
+class InsetListings : public InsetCollapsable {
 public:
        ///
        InsetListings(BufferParams const &, InsetListingsParams const & par = InsetListingsParams());
        ///
        ~InsetListings();
        ///
-       Inset::Code lyxCode() const { return Inset::LISTINGS_CODE; }
+       InsetCode lyxCode() const { return LISTINGS_CODE; }
        /// lstinline is inlined, normal listing is displayed
-       virtual bool display() const;
+       virtual DisplayType display() const;
        ///
        docstring name() const { return from_ascii("Listings"); }
+       // Update the counters of this inset and of its contents
+       virtual void updateLabels(Buffer const &, ParIterator const &);
        ///
        void write(Buffer const & buf, std::ostream & os) const;
        ///
@@ -43,14 +45,14 @@ public:
        ///
        virtual docstring const editMessage() const;
        ///
+       bool isMacroScope(Buffer const &) const { return true; }
+       ///
        int latex(Buffer const &, odocstream &, OutputParams const &) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
        bool showInsetDialog(BufferView *) const;
        ///
-       void getDrawFont(Font &) const;
-       ///
        InsetListingsParams const & params() const { return params_; }
        ///
        InsetListingsParams & params() { return params_; }
@@ -61,12 +63,12 @@ protected:
        ///
        bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
 private:
-       virtual std::auto_ptr<Inset> doClone() const;
-       ///
-       void init();
+       virtual Inset * clone() const;
        ///
        void setButtonLabel();
        ///
+       docstring getCaption(Buffer const &, OutputParams const &) const;
+       ///
        InsetListingsParams params_;
 };