X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetListings.h;h=4be28f850dd942c108d5e83b021f3e9e7f1927a1;hb=23abb5aaa36af07aadfa5e565869104778ba0d6d;hp=a1eeeda315958f6560dfd286b523db2d71e30e89;hpb=f9b81e51e943bcaac885d74edbce41a9d74ad3dd;p=lyx.git diff --git a/src/insets/InsetListings.h b/src/insets/InsetListings.h index a1eeeda315..4be28f850d 100644 --- a/src/insets/InsetListings.h +++ b/src/insets/InsetListings.h @@ -12,25 +12,26 @@ #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: /// - InsetListings(Buffer const &, InsetListingsParams const & par = InsetListingsParams()); + InsetListings(Buffer *, InsetListingsParams const & par = InsetListingsParams()); /// ~InsetListings(); /// @@ -40,22 +41,22 @@ public: private: /// bool isLabeled() 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 &); + docstring layoutName() const; /// void write(std::ostream & os) const; /// void read(Lexer & lex); /// - docstring editMessage() const; + void latex(otexstream &, OutputParams const &) const; /// - int latex(odocstream &, OutputParams const &) const; + docstring xhtml(XHTMLStream &, OutputParams const &) const; /// void validate(LaTeXFeatures &) const; /// @@ -65,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); /// @@ -73,9 +74,13 @@ private: /// Inset * clone() const { return new InsetListings(*this); } /// - void setButtonLabel(); + docstring const buttonLabel(BufferView const & bv) const; + /// + TexString getCaption(OutputParams const &) const; + /// + bool insetAllowed(InsetCode c) const { return c == CAPTION_CODE || c == QUOTE_CODE; } /// - docstring getCaption(OutputParams const &) const; + Encoding const * forcedEncoding(Encoding const *, Encoding const *) const; /// InsetListingsParams params_;