X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetListings.h;h=41be4394ceb9a8c9431946c11b993395e6dbdebc;hb=eeb36e808c9726fd3689926a3c20457e3b801341;hp=fc2ba3bd5ad564461236726684f24300604a2d88;hpb=43207c17bcfa0a20bd61d3d45263c26c38424809;p=lyx.git diff --git a/src/insets/InsetListings.h b/src/insets/InsetListings.h index fc2ba3bd5a..41be4394ce 100644 --- a/src/insets/InsetListings.h +++ b/src/insets/InsetListings.h @@ -12,21 +12,22 @@ #ifndef INSET_LISTINGS_H #define INSET_LISTINGS_H -#include "LaTeXFeatures.h" -#include "InsetERT.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 collapsible text inset for program listings. +class InsetListings : public InsetCaptionable { public: /// @@ -39,45 +40,49 @@ public: static std::string params2string(InsetListingsParams const &); private: /// - bool isLabeled() const { return true; } - /// - bool noFontChange() const { return true; } + bool isLabeled() const override { return true; } + /// false is needed since listings do their own font handling. + bool inheritFont() const override { return false; } /// - InsetCode lyxCode() const { return LISTINGS_CODE; } + InsetCode lyxCode() const override { return LISTINGS_CODE; } /// lstinline is inlined, normal listing is displayed - DisplayType display() const; + RowFlags rowFlags() const override; + /// + docstring layoutName() const override; /// - docstring name() const { return from_ascii("Listings"); } - // Update the counters of this inset and of its contents - void updateLabels(ParIterator const &, bool); + void write(std::ostream & os) const override; /// - void write(std::ostream & os) const; + void read(Lexer & lex) override; /// - void read(Lexer & lex); + void latex(otexstream &, OutputParams const &) const override; /// - int latex(odocstream &, OutputParams const &) const; + docstring xhtml(XMLStream &, OutputParams const &) const override; /// - docstring xhtml(XHTMLStream &, OutputParams const &) const; + void docbook(XMLStream &, OutputParams const &) const override; /// - void validate(LaTeXFeatures &) const; + void validate(LaTeXFeatures &) const override; /// - bool showInsetDialog(BufferView *) const; + bool showInsetDialog(BufferView *) const override; /// InsetListingsParams const & params() const { return params_; } /// InsetListingsParams & params() { return params_; } /// - docstring contextMenu(BufferView const & bv, int x, int y) const; + std::string contextMenuName() const override; + /// + void doDispatch(Cursor & cur, FuncRequest & cmd) override; + /// + bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override; /// - void doDispatch(Cursor & cur, FuncRequest & cmd); + Inset * clone() const override { return new InsetListings(*this); } /// - bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; + docstring const buttonLabel(BufferView const & bv) const override; /// - Inset * clone() const { return new InsetListings(*this); } + TexString getCaption(OutputParams const &) const; /// - docstring const buttonLabel(BufferView const & bv) const; + bool insetAllowed(InsetCode c) const override { return c == CAPTION_CODE || c == QUOTE_CODE; } /// - docstring getCaption(OutputParams const &) const; + Encoding const * forcedEncoding(Encoding const *, Encoding const *) const override; /// InsetListingsParams params_;