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.
29 class InsetERT : public InsetCollapsible {
32 InsetERT(Buffer *, CollapseStatus status = Open);
34 InsetERT(InsetERT const & old);
36 static CollapseStatus string2params(std::string const &);
38 static std::string params2string(CollapseStatus);
40 std::string contextMenuName() const override
41 { return "context-ert"; }
44 InsetCode lyxCode() const override { return ERT_CODE; }
46 docstring layoutName() const override { return from_ascii("ERT"); }
48 void write(std::ostream & os) const override;
50 int plaintext(odocstringstream & ods, OutputParams const & op,
51 size_t max_length = INT_MAX) const override;
53 void docbook(XMLStream &, OutputParams const &) const override;
55 docstring xhtml(XMLStream &, OutputParams const &) const override;
57 void validate(LaTeXFeatures &) const override {}
58 /// should paragraph indentation be omitted in any case?
59 bool neverIndent() const override { return true; }
61 void doDispatch(Cursor & cur, FuncRequest & cmd) override;
63 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
65 Inset * clone() const override { return new InsetERT(*this); }
67 docstring const buttonLabel(BufferView const & bv) const override;
69 bool allowSpellCheck() const override { return false; }
71 bool insetAllowed(InsetCode code) const override { return code == QUOTE_CODE; }