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 "InsetCollapsable.h"
17 #include "MailInset.h"
22 /** A collapsable text inset for LaTeX insertions.
24 To write full ert (including styles and other insets) in a given
27 Note that collapsed_ encompasses both the inline and collapsed button
28 versions of this inset.
33 class InsetERT : public InsetCollapsable {
36 InsetERT(Buffer const &, CollapseStatus status = Open);
41 InsetCode lyxCode() const { return ERT_CODE; }
43 docstring name() const { return from_ascii("ERT"); }
45 void write(std::ostream & os) const;
47 docstring editMessage() const;
49 bool insetAllowed(InsetCode code) const;
51 int latex(odocstream &, OutputParams const &) const;
53 int plaintext(odocstream &, OutputParams const &) const;
55 int docbook(odocstream &, OutputParams const &) const;
57 void validate(LaTeXFeatures &) const {}
59 void draw(PainterInfo & pi, int x, int y) const;
61 bool showInsetDialog(BufferView *) const;
63 virtual bool forceEmptyLayout(idx_type = 0) const { return true; }
65 virtual bool allowParagraphCustomization(idx_type = 0) const { return false; }
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 Inset * clone() const { return new InsetERT(*this); }
75 void setButtonLabel();
77 bool allowSpellCheck() const { return false; }
81 class InsetERTMailer : public MailInset {
84 InsetERTMailer(InsetERT & inset);
86 virtual Inset & inset() const { return inset_; }
88 virtual std::string const & name() const { return name_; }
90 virtual std::string const inset2string(Buffer const &) const;
92 static void string2params(std::string const &,
93 InsetCollapsable::CollapseStatus &);
95 static std::string const params2string(InsetCollapsable::CollapseStatus);
98 static std::string const name_;