4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
15 #include "InsetCollapsable.h"
16 #include "MailInset.h"
21 class InsetNoteParams {
30 /// \c type defaults to Note
33 void write(std::ostream & os) const;
35 void read(Lexer & lex);
41 /** The PostIt note inset, and other annotations
44 class InsetNote : public InsetCollapsable {
47 InsetNote(BufferParams const &, std::string const &);
51 virtual docstring const editMessage() const;
53 Inset::Code lyxCode() const { return Inset::NOTE_CODE; }
55 docstring name() const { return from_ascii("Note"); }
57 void write(Buffer const &, std::ostream &) const;
59 void read(Buffer const & buf, Lexer & lex);
61 void setButtonLabel();
62 /// show the note dialog
63 bool showInsetDialog(BufferView * bv) const;
65 int latex(Buffer const &, odocstream &, OutputParams const &) const;
67 int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
69 int docbook(Buffer const &, odocstream &, OutputParams const &) const;
71 void validate(LaTeXFeatures &) const;
73 InsetNoteParams const & params() const { return params_; }
75 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
77 InsetNote(InsetNote const &);
79 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
81 friend class InsetNoteParams;
83 virtual std::auto_ptr<Inset> doClone() const;
85 /// used by the constructors
88 InsetNoteParams params_;
92 class InsetNoteMailer : public MailInset {
95 InsetNoteMailer(InsetNote & inset);
97 virtual Inset & inset() const { return inset_; }
99 virtual std::string const & name() const { return name_; }
101 virtual std::string const inset2string(Buffer const &) const;
103 static std::string const params2string(InsetNoteParams const &);
105 static void string2params(std::string const &, InsetNoteParams &);
109 static std::string const name_;