#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 collapsible text inset for program listings.
+class InsetListings : public InsetCaptionable
{
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;
+ RowFlags rowFlags() const;
///
- docstring name() const { return from_ascii("Listings"); }
- // Update the counters of this inset and of its contents
- void updateLabels(ParIterator const &, bool);
+ docstring layoutName() const;
///
void write(std::ostream & os) const;
///
void read(Lexer & lex);
///
- int latex(odocstream &, OutputParams const &) const;
+ void latex(otexstream &, OutputParams const &) const;
+ ///
+ docstring xhtml(XMLStream &, OutputParams const &) const;
///
- docstring xhtml(XHTMLStream &, OutputParams const &) const;
+ void docbook(XMLStream &, OutputParams const &) const;
///
void validate(LaTeXFeatures &) const;
///
///
InsetListingsParams & params() { return params_; }
///
- docstring contextMenu(BufferView const & bv, int x, int y) const;
+ std::string contextMenuName() const;
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
///
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; }
+ ///
+ Encoding const * forcedEncoding(Encoding const *, Encoding const *) const;
///
InsetListingsParams params_;