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.
17 #include "insetcollapsable.h"
19 /** A collapsable text inset for LaTeX insertions.
21 To write full ert (including styles and other insets) in a given
24 Note that collapsed_ encompasses both the inline and collapsed button
25 versions of this inset.
30 class InsetERT : public InsetCollapsable {
33 InsetERT(BufferParams const &, CollapseStatus status = Open);
36 InsetERT(BufferParams const &,
37 Language const *, std::string const & contents, CollapseStatus status);
42 InsetBase::Code lyxCode() const { return InsetBase::ERT_CODE; }
44 void write(Buffer const & buf, std::ostream & os) const;
46 void read(Buffer const & buf, LyXLex & lex);
48 virtual lyx::docstring const editMessage() const;
50 bool insetAllowed(InsetBase::Code code) const;
52 int latex(Buffer const &, lyx::odocstream &,
53 OutputParams const &) const;
55 int plaintext(Buffer const &, lyx::odocstream &,
56 OutputParams const & runparams) const;
58 int docbook(Buffer const &, std::ostream &,
59 OutputParams const & runparams) const;
61 void validate(LaTeXFeatures &) const {}
63 void metrics(MetricsInfo &, Dimension &) const;
65 void draw(PainterInfo & pi, int x, int y) const;
67 bool showInsetDialog(BufferView *) const;
69 void getDrawFont(LyXFont &) const;
71 bool forceDefaultParagraphs(idx_type) const { return true; }
72 /// should paragraph indendation be ommitted in any case?
73 bool neverIndent() const { return true; }
75 InsetERT(InsetERT const &);
77 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
79 bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
81 virtual std::auto_ptr<InsetBase> doClone() const;
85 void setButtonLabel();
87 bool allowSpellCheck() const { return false; }
91 #include "mailinset.h"
93 class InsetERTMailer : public MailInset {
96 InsetERTMailer(InsetERT & inset);
98 virtual InsetBase & inset() const { return inset_; }
100 virtual std::string const & name() const { return name_; }
102 virtual std::string const inset2string(Buffer const &) const;
104 static void string2params(std::string const &,
105 InsetCollapsable::CollapseStatus &);
107 static std::string const params2string(InsetCollapsable::CollapseStatus);
110 static std::string const name_;