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"
28 /// \c type defaults to Note
31 void write(std::ostream & os) const;
33 void read(Lexer & lex);
39 /////////////////////////////////////////////////////////////////////////
43 /////////////////////////////////////////////////////////////////////////
45 /// The PostIt note inset, and other annotations
46 class InsetNote : public InsetCollapsable
50 InsetNote(Buffer const &, std::string const &);
54 static std::string params2string(InsetNoteParams const &);
56 static void string2params(std::string const &, InsetNoteParams &);
58 InsetNoteParams const & params() const { return params_; }
61 docstring editMessage() const;
63 InsetCode lyxCode() const { return NOTE_CODE; }
65 docstring name() const;
67 DisplayType display() const;
69 bool noFontChange() const { return params_.type != InsetNoteParams::Note; }
71 * Is the content of this inset part of the output document?
73 * Note that Note insets are not considered part of the
74 * document, even in their 'greyed out' incarnation.
76 bool producesOutput() const { return false; }
78 void write(std::ostream &) const;
80 void read(Lexer & lex);
82 void setButtonLabel();
83 /// show the note dialog
84 bool showInsetDialog(BufferView * bv) const;
86 bool isMacroScope() const;
88 int latex(odocstream &, OutputParams const &) const;
90 int plaintext(odocstream &, OutputParams const &) const;
92 int docbook(odocstream &, OutputParams const &) const;
94 void validate(LaTeXFeatures &) const;
96 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
98 void addToToc(DocIterator const &);
100 void doDispatch(Cursor & cur, FuncRequest & cmd);
102 Inset * clone() const { return new InsetNote(*this); }
103 /// used by the constructors
106 docstring contextMenu(BufferView const & bv, int x, int y) const;
108 friend class InsetNoteParams;
111 InsetNoteParams params_;
115 * Mutate all NoteInsets of "source" type to the "target" type in the document.
116 * Returns true when some inset was changed.
118 bool mutateNotes(lyx::Cursor & cur, std::string const & source, std::string const &target);
122 #endif // INSET_NOTE_H