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);
35 InsetERT(BufferParams const &,
36 Language const *, std::string const & contents, CollapseStatus status);
40 InsetBase::Code lyxCode() const { return InsetBase::ERT_CODE; }
42 void write(Buffer const & buf, std::ostream & os) const;
44 std::string const editMessage() const;
46 bool insetAllowed(InsetBase::Code code) const;
48 int latex(Buffer const &, std::ostream &,
49 OutputParams const &) const;
51 int plaintext(Buffer const &, std::ostream &,
52 OutputParams const & runparams) const;
54 int linuxdoc(Buffer const &, std::ostream &,
55 OutputParams const &) const;
57 int docbook(Buffer const &, std::ostream &,
58 OutputParams const & runparams) const;
60 void validate(LaTeXFeatures &) const {}
62 void metrics(MetricsInfo &, Dimension &) const;
64 void draw(PainterInfo & pi, int x, int y) const;
66 bool showInsetDialog(BufferView *) const;
68 void getDrawFont(LyXFont &) const;
70 bool forceDefaultParagraphs(InsetBase const *) const { return true; }
71 /// should paragraph indendation be ommitted in any case?
72 bool neverIndent() const { return true; }
74 InsetERT(InsetERT const &);
76 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
78 bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
80 virtual std::auto_ptr<InsetBase> doClone() const;
84 void setButtonLabel();
86 bool allowSpellCheck() const { return false; }
90 #include "mailinset.h"
92 class InsetERTMailer : public MailInset {
95 InsetERTMailer(InsetERT & inset);
97 virtual InsetBase & inset() const { return inset_; }
99 virtual std::string const & name() const { return name_; }
101 virtual std::string const inset2string(Buffer const &) const;
103 static void string2params(std::string const &,
104 InsetCollapsable::CollapseStatus &);
106 static std::string const params2string(InsetCollapsable::CollapseStatus);
109 static std::string const name_;