3 * \file InsetListings.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSET_LISTINGS_H
13 #define INSET_LISTINGS_H
15 #include "LaTeXFeatures.h"
17 #include "InsetListingsParams.h"
22 /////////////////////////////////////////////////////////////////////////
26 /////////////////////////////////////////////////////////////////////////
28 /// A collapsable text inset for program listings.
29 class InsetListings : public InsetCollapsable
33 InsetListings(Buffer const &, InsetListingsParams const & par = InsetListingsParams());
37 static void string2params(std::string const &, InsetListingsParams &);
39 static std::string params2string(InsetListingsParams const &);
42 bool isLabeled() const { return true; }
44 InsetCode lyxCode() const { return LISTINGS_CODE; }
45 /// lstinline is inlined, normal listing is displayed
46 DisplayType display() const;
48 docstring name() const { return from_ascii("Listings"); }
49 // Update the counters of this inset and of its contents
50 void updateLabels(ParIterator const &);
52 void write(std::ostream & os) const;
54 void read(Lexer & lex);
56 docstring editMessage() const;
58 int latex(odocstream &, OutputParams const &) const;
60 void validate(LaTeXFeatures &) const;
62 bool showInsetDialog(BufferView *) const;
64 InsetListingsParams const & params() const { return params_; }
66 InsetListingsParams & params() { return params_; }
68 docstring contextMenu(BufferView const & bv, int x, int y) const;
70 void doDispatch(Cursor & cur, FuncRequest & cmd);
72 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
74 Inset * clone() const { return new InsetListings(*this); }
76 docstring const buttonLabel(BufferView const & bv) const;
78 docstring getCaption(OutputParams const &) const;
81 InsetListingsParams params_;
86 #endif // INSET_LISTINGS_H