4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
15 #include "insetcollapsable.h"
17 #include "lyxlength.h"
20 struct InsetWrapParams {
22 void write(std::ostream &) const;
29 std::string placement;
37 class InsetWrap : public InsetCollapsable {
40 InsetWrap(BufferParams const &, std::string const &);
44 void write(Buffer const & buf, std::ostream & os) const;
46 void read(Buffer const & buf, LyXLex & lex);
48 void validate(LaTeXFeatures & features) const;
50 InsetBase::Code lyxCode() const { return InsetBase::WRAP_CODE; }
52 int latex(Buffer const &, std::ostream &,
53 OutputParams const &) const;
55 int docbook(Buffer const &, std::ostream &,
56 OutputParams const &) const;
58 std::string const editMessage() const;
60 bool insetAllowed(InsetBase::Code) const;
62 void addToToc(lyx::toc::TocList &, Buffer const &) const;
64 bool showInsetDialog(BufferView *) const;
66 InsetWrapParams const & params() const { return params_; }
69 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
71 virtual std::auto_ptr<InsetBase> doClone() const;
74 InsetWrapParams params_;
79 #include "mailinset.h"
82 class InsetWrapMailer : public MailInset {
85 InsetWrapMailer(InsetWrap & inset);
87 virtual InsetBase & inset() const { return inset_; }
89 virtual std::string const & name() const { return name_; }
91 virtual std::string const inset2string(Buffer const &) const;
93 static void string2params(std::string const &, InsetWrapParams &);
95 static std::string const params2string(InsetWrapParams const &);
98 static std::string const name_;