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 {
28 /// \c type defaults to Note
31 void write(std::ostream & os) const;
33 void read(Lexer & lex);
39 /** The PostIt note inset, and other annotations
42 class InsetNote : public InsetCollapsable {
45 InsetNote(BufferParams const &, std::string const &);
49 virtual docstring const editMessage() const;
51 InsetCode lyxCode() const { return NOTE_CODE; }
53 docstring name() const;
55 virtual DisplayType display() const;
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 bool isMacroScope(Buffer const & buf) const;
67 int latex(Buffer const &, odocstream &, OutputParams const &) const;
69 int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
71 int docbook(Buffer const &, odocstream &, OutputParams const &) const;
73 void validate(LaTeXFeatures &) const;
75 InsetNoteParams const & params() const { return params_; }
77 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
78 // Update the counters of this inset and of its contents
79 virtual void updateLabels(Buffer const &, ParIterator const &);
81 InsetNote(InsetNote const &);
83 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
85 friend class InsetNoteParams;
87 virtual Inset * clone() const;
89 /// used by the constructors
92 InsetNoteParams params_;
96 class InsetNoteMailer : public MailInset {
99 InsetNoteMailer(InsetNote & inset);
101 virtual Inset & inset() const { return inset_; }
103 virtual std::string const & name() const { return name_; }
105 virtual std::string const inset2string(Buffer const &) const;
107 static std::string const params2string(InsetNoteParams const &);
109 static void string2params(std::string const &, InsetNoteParams &);
113 static std::string const name_;