X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetListings.h;h=902fa0437e64009770293859e2540322c3b53fd9;hb=e8c932ff842ced0b26c205ed6983102b6e7e50c2;hp=d11612282d2be731aa75b306bf8431115f905001;hpb=caa4e94bf02b9d3131bc280390fae44683fd5e9a;p=lyx.git diff --git a/src/insets/InsetListings.h b/src/insets/InsetListings.h index d11612282d..902fa0437e 100644 --- a/src/insets/InsetListings.h +++ b/src/insets/InsetListings.h @@ -12,20 +12,22 @@ #ifndef INSET_LISTINGS_H #define INSET_LISTINGS_H -#include "LaTeXFeatures.h" #include "InsetListingsParams.h" namespace lyx { +class LaTeXFeatures; +struct TexString; + ///////////////////////////////////////////////////////////////////////// // // InsetListings // ///////////////////////////////////////////////////////////////////////// -/// A collapsable text inset for program listings. -class InsetListings : public InsetCollapsable +/// A captionable and collapsable text inset for program listings. +class InsetListings : public InsetCaptionable { public: /// @@ -39,22 +41,20 @@ 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; /// - docstring name() const { return from_ascii("Listings"); } - // Update the counters of this inset and of its contents - void updateLabels(ParIterator const &, UpdateType); + docstring layoutName() const { return from_ascii("Listings"); } /// void write(std::ostream & os) const; /// void read(Lexer & lex); /// - int latex(odocstream &, OutputParams const &) const; + void latex(otexstream &, OutputParams const &) const; /// docstring xhtml(XHTMLStream &, OutputParams const &) const; /// @@ -66,7 +66,7 @@ private: /// InsetListingsParams & params() { return params_; } /// - docstring contextMenu(BufferView const & bv, int x, int y) const; + std::string contextMenuName() const; /// void doDispatch(Cursor & cur, FuncRequest & cmd); /// @@ -76,7 +76,9 @@ 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; } /// InsetListingsParams params_;