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);
39 /// Do NOT force inset into LTR environment if surroundings are RTL
40 /// even though insetlayout has (and should have) forceltr true
41 bool forceLTR(OutputParams const &) const override { return false; }
43 std::string contextMenuName() const override
44 { return "context-ert"; }
47 InsetCode lyxCode() const override { return ERT_CODE; }
49 docstring layoutName() const override { return from_ascii("ERT"); }
51 void write(std::ostream & os) const override;
53 int plaintext(odocstringstream & ods, OutputParams const & op,
54 size_t max_length = INT_MAX) const override;
56 void docbook(XMLStream &, OutputParams const &) const override;
58 docstring xhtml(XMLStream &, OutputParams const &) const override;
60 void validate(LaTeXFeatures &) const override {}
61 /// should paragraph indentation be omitted in any case?
62 bool neverIndent() const override { return true; }
64 void doDispatch(Cursor & cur, FuncRequest & cmd) override;
66 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
68 Inset * clone() const override { return new InsetERT(*this); }
70 docstring const buttonLabel(BufferView const & bv) const override;
72 bool allowSpellCheck() const override { return false; }
74 bool insetAllowed(InsetCode code) const override { return code == QUOTE_CODE; }