]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetListings.h
Use new rowFlags() values to remove some inset hardcoding.
[lyx.git] / src / insets / InsetListings.h
index 3741f6d0dbd3a1ead79934a9c3b329f7c60ef500..06c310739f76e484ad2b6225f9be65a322c1cc9d 100644 (file)
@@ -18,6 +18,7 @@
 namespace lyx {
 
 class LaTeXFeatures;
+struct TexString;
 
 /////////////////////////////////////////////////////////////////////////
 //
@@ -25,8 +26,8 @@ class LaTeXFeatures;
 //
 /////////////////////////////////////////////////////////////////////////
 
-/// A collapsable text inset for program listings.
-class InsetListings : public InsetCollapsable
+/// A captionable and collapsible text inset for program listings.
+class InsetListings : public InsetCaptionable
 {
 public:
        ///
@@ -40,16 +41,14 @@ public:
 private:
        ///
        bool isLabeled() const { return true; }
-       ///
-       bool noFontChange() const { return true; }
+       /// false is needed since listings do their own font handling.
+       bool inheritFont() const { return false; }
        ///
        InsetCode lyxCode() const { return LISTINGS_CODE; }
        /// lstinline is inlined, normal listing is displayed
-       DisplayType display() const;
+       RowFlags rowFlags() const;
        ///
-       docstring name() const { return from_ascii("Listings"); }
-       // Update the counters of this inset and of its contents
-       void updateBuffer(ParIterator const &, UpdateType);
+       docstring layoutName() const;
        ///
        void write(std::ostream & os) const;
        ///
@@ -57,7 +56,7 @@ private:
        ///
        void latex(otexstream &, OutputParams const &) const;
        ///
-       docstring xhtml(XHTMLStream &, OutputParams const &) const;
+       docstring xhtml(XMLStream &, OutputParams const &) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
@@ -67,7 +66,7 @@ private:
        ///
        InsetListingsParams & params() { return params_; }
        ///
-       docstring contextMenuName() const;
+       std::string contextMenuName() const;
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
@@ -77,9 +76,11 @@ private:
        ///
        docstring const buttonLabel(BufferView const & bv) const;
        ///
-       docstring getCaption(OutputParams const &) const;
+       TexString getCaption(OutputParams const &) const;
+       ///
+       bool insetAllowed(InsetCode c) const { return c == CAPTION_CODE || c == QUOTE_CODE; }
        ///
-       bool insetAllowed(InsetCode c) const { return c == CAPTION_CODE; } 
+       Encoding const * forcedEncoding(Encoding const *, Encoding const *) const;
 
        ///
        InsetListingsParams params_;