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.
35 class InsetERT : public InsetCollapsible {
38 InsetERT(Buffer *, CollapseStatus status = Open);
40 InsetERT(InsetERT const &);
42 InsetERT & operator=(InsetERT const &);
44 static CollapseStatus string2params(std::string const &);
46 static std::string params2string(CollapseStatus);
48 std::string contextMenuName() const
49 { return "context-ert"; }
52 InsetCode lyxCode() const { return ERT_CODE; }
54 docstring layoutName() const { return from_ascii("ERT"); }
56 void write(std::ostream & os) const;
58 int plaintext(odocstringstream & ods, OutputParams const & op,
59 size_t max_length = INT_MAX) const;
61 int docbook(odocstream &, OutputParams const &) const;
63 docstring xhtml(XHTMLStream &, OutputParams const &) const;
65 void validate(LaTeXFeatures &) const {}
66 /// should paragraph indendation be omitted in any case?
67 bool neverIndent() const { return true; }
69 void doDispatch(Cursor & cur, FuncRequest & cmd);
71 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
73 bool editable() const;
75 bool descendable(BufferView const &) const;
77 Inset * clone() const { return new InsetERT(*this); }
79 docstring const buttonLabel(BufferView const & bv) const;
81 bool allowSpellCheck() const { return false; }
83 unique_ptr<support::TempFile> tempfile_;