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;
56 /// framed and shaded notes are displayed
57 virtual DisplayType display() const;
59 void write(Buffer const &, std::ostream &) const;
61 void read(Buffer const & buf, Lexer & lex);
63 void setButtonLabel();
65 virtual Color_color backgroundColor() const;
66 /// show the note dialog
67 bool showInsetDialog(BufferView * bv) const;
69 int latex(Buffer const &, odocstream &, OutputParams const &) const;
71 int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
73 int docbook(Buffer const &, odocstream &, OutputParams const &) const;
75 void validate(LaTeXFeatures &) const;
77 InsetNoteParams const & params() const { return params_; }
79 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
80 // Update the counters of this inset and of its contents
81 virtual void updateLabels(Buffer const &, ParIterator const &);
83 InsetNote(InsetNote const &);
85 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
87 friend class InsetNoteParams;
89 virtual std::auto_ptr<Inset> doClone() const;
91 /// used by the constructors
94 InsetNoteParams params_;
98 class InsetNoteMailer : public MailInset {
101 InsetNoteMailer(InsetNote & inset);
103 virtual Inset & inset() const { return inset_; }
105 virtual std::string const & name() const { return name_; }
107 virtual std::string const inset2string(Buffer const &) const;
109 static std::string const params2string(InsetNoteParams const &);
111 static void string2params(std::string const &, InsetNoteParams &);
115 static std::string const name_;