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(Buffer const &, std::string const &);
49 InsetNoteParams const & params() const { return params_; }
52 docstring editMessage() const;
54 InsetCode lyxCode() const { return NOTE_CODE; }
56 docstring name() const;
58 virtual DisplayType display() const;
60 bool noFontChange() const { return params_.type != InsetNoteParams::Note; }
62 void write(std::ostream &) const;
64 void read(Lexer & lex);
66 void setButtonLabel();
67 /// show the note dialog
68 bool showInsetDialog(BufferView * bv) const;
70 bool isMacroScope() const;
72 int latex(odocstream &, OutputParams const &) const;
74 int plaintext(odocstream &, OutputParams const &) const;
76 int docbook(odocstream &, OutputParams const &) const;
78 void validate(LaTeXFeatures &) const;
80 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
81 // Update the counters of this inset and of its contents
82 void updateLabels(ParIterator const &);
84 void addToToc(ParConstIterator const &) const;
86 void doDispatch(Cursor & cur, FuncRequest & cmd);
88 Inset * clone() const { return new InsetNote(*this); }
89 /// used by the constructors
92 virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
94 friend class InsetNoteParams;
97 InsetNoteParams params_;
101 class InsetNoteMailer : public MailInset {
104 InsetNoteMailer(InsetNote & inset);
106 virtual Inset & inset() const { return inset_; }
108 virtual std::string const & name() const { return name_; }
110 virtual std::string const inset2string(Buffer const &) const;
112 static std::string const params2string(InsetNoteParams const &);
114 static void string2params(std::string const &, InsetNoteParams &);
118 static std::string const name_;