X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetListings.h;h=41be4394ceb9a8c9431946c11b993395e6dbdebc;hb=eeb36e808c9726fd3689926a3c20457e3b801341;hp=18125dc3bb6f0a765eb4cc2a27b4667f809a73e0;hpb=f176a18434d40eead5f5a64234db9445053cbf76;p=lyx.git diff --git a/src/insets/InsetListings.h b/src/insets/InsetListings.h index 18125dc3bb..41be4394ce 100644 --- a/src/insets/InsetListings.h +++ b/src/insets/InsetListings.h @@ -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: /// @@ -39,47 +40,49 @@ public: static std::string params2string(InsetListingsParams const &); private: /// - bool isLabeled() const { return true; } + bool isLabeled() const override { return true; } /// false is needed since listings do their own font handling. - bool inheritFont() const { return false; } + 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 name() const { return from_ascii("Listings"); } - // Update the counters of this inset and of its contents - void updateBuffer(ParIterator const &, UpdateType); + docstring layoutName() const override; /// - void write(std::ostream & os) const; + void write(std::ostream & os) const override; /// - void read(Lexer & lex); + void read(Lexer & lex) override; /// - void latex(otexstream &, OutputParams const &) const; + void latex(otexstream &, OutputParams const &) const override; /// - docstring xhtml(XHTMLStream &, OutputParams const &) const; + docstring xhtml(XMLStream &, OutputParams const &) const override; /// - void validate(LaTeXFeatures &) const; + void docbook(XMLStream &, OutputParams const &) const override; /// - bool showInsetDialog(BufferView *) const; + void validate(LaTeXFeatures &) const override; + /// + bool showInsetDialog(BufferView *) const override; /// InsetListingsParams const & params() const { return params_; } /// InsetListingsParams & params() { return params_; } /// - docstring contextMenuName() const; + std::string contextMenuName() const override; + /// + void doDispatch(Cursor & cur, FuncRequest & cmd) override; /// - void doDispatch(Cursor & cur, FuncRequest & cmd); + bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override; /// - bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; + Inset * clone() const override { return new InsetListings(*this); } /// - Inset * clone() const { return new InsetListings(*this); } + docstring const buttonLabel(BufferView const & bv) const override; /// - docstring const buttonLabel(BufferView const & bv) const; + TexString getCaption(OutputParams const &) const; /// - docstring getCaption(OutputParams const &) const; + bool insetAllowed(InsetCode c) const override { return c == CAPTION_CODE || c == QUOTE_CODE; } /// - bool insetAllowed(InsetCode c) const { return c == CAPTION_CODE; } + Encoding const * forcedEncoding(Encoding const *, Encoding const *) const override; /// InsetListingsParams params_;