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