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 "InsetCollapsible.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 InsetCollapsible
50 InsetNote(Buffer *, 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 InsetCode lyxCode() const override { return NOTE_CODE; }
63 docstring layoutName() const override;
65 bool inheritFont() const override { return params_.type == InsetNoteParams::Note; }
66 /// Is the content of this inset part of the output document?
67 bool producesOutput() const override
68 { return params_.type == InsetNoteParams::Greyedout; }
70 bool allowSpellCheck() const override;
72 FontInfo getFont() const override;
74 void write(std::ostream &) const override;
76 void read(Lexer & lex) override;
77 /// show the note dialog
78 bool showInsetDialog(BufferView * bv) const override;
80 bool isMacroScope() const override;
82 void latex(otexstream &, OutputParams const &) const override;
84 int plaintext(odocstringstream & ods, OutputParams const & op,
85 size_t max_length = INT_MAX) const override;
87 void docbook(XMLStream &, OutputParams const &) const override;
89 docstring xhtml(XMLStream &, OutputParams const &) const override;
91 void validate(LaTeXFeatures &) const override;
93 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
95 void doDispatch(Cursor & cur, FuncRequest & cmd) override;
97 Inset * clone() const override { return new InsetNote(*this); }
98 /// used by the constructors
101 std::string contextMenuName() const override;
103 friend class InsetNoteParams;
106 InsetNoteParams params_;
111 #endif // INSET_NOTE_H