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
43 { return "context-ert"; }
46 InsetCode lyxCode() const { return ERT_CODE; }
48 docstring layoutName() const { return from_ascii("ERT"); }
50 void write(std::ostream & os) const;
52 int plaintext(odocstringstream & ods, OutputParams const & op,
53 size_t max_length = INT_MAX) const;
55 int docbook(odocstream &, OutputParams const &) const;
57 docstring xhtml(XHTMLStream &, OutputParams const &) const;
59 void validate(LaTeXFeatures &) const {}
60 /// should paragraph indendation be omitted in any case?
61 bool neverIndent() const { return true; }
63 void doDispatch(Cursor & cur, FuncRequest & cmd);
65 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
67 Inset * clone() const { return new InsetERT(*this); }
69 docstring const buttonLabel(BufferView const & bv) const;
71 bool allowSpellCheck() const { return false; }
73 bool insetAllowed(InsetCode code) const { return code == QUOTE_CODE; }
75 unique_ptr<support::TempFile> tempfile_;