4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Lars Gullik Bjønnes
10 * Full author contact details are available in file CREDITS.
16 #include "InsetCollapsible.h"
20 /** A collapsible text inset for LaTeX insertions.
22 To write full ert (including styles and other insets) in a given
25 Note that collapsed_ encompasses both the inline and collapsed button
26 versions of this inset.
31 class InsetERT : public InsetCollapsible {
34 InsetERT(Buffer *, CollapseStatus status = Open);
36 InsetERT(InsetERT const & old);
38 static CollapseStatus string2params(std::string const &);
40 static std::string params2string(CollapseStatus);
42 std::string contextMenuName() const override
43 { return "context-ert"; }
46 InsetCode lyxCode() const override { return ERT_CODE; }
48 docstring layoutName() const override { return from_ascii("ERT"); }
50 void write(std::ostream & os) const override;
52 int plaintext(odocstringstream & ods, OutputParams const & op,
53 size_t max_length = INT_MAX) const override;
55 void docbook(XMLStream &, OutputParams const &) const override;
57 docstring xhtml(XMLStream &, OutputParams const &) const override;
59 void validate(LaTeXFeatures &) const override {}
60 /// should paragraph indentation be omitted in any case?
61 bool neverIndent() const override { return true; }
63 void doDispatch(Cursor & cur, FuncRequest & cmd) override;
65 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
67 Inset * clone() const override { return new InsetERT(*this); }
69 docstring const buttonLabel(BufferView const & bv) const override;
71 bool allowSpellCheck() const override { return false; }
73 bool insetAllowed(InsetCode code) const override { return code == QUOTE_CODE; }