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;
64 /** returns false if, when outputting LaTeX, font changes should
65 be closed before generating this inset. This is needed for
66 insets that may contain several paragraphs */
67 bool inheritFont() const override { return params_.type == InsetNoteParams::Note; }
68 /// Is the content of this inset part of the output document?
69 bool producesOutput() const override
70 { return params_.type == InsetNoteParams::Greyedout; }
72 bool allowSpellCheck() const override;
74 FontInfo getFont() const override;
76 void write(std::ostream &) const override;
78 void read(Lexer & lex) override;
79 /// show the note dialog
80 bool showInsetDialog(BufferView * bv) const override;
82 bool isMacroScope() const override;
84 void latex(otexstream &, OutputParams const &) const override;
86 int plaintext(odocstringstream & ods, OutputParams const & op,
87 size_t max_length = INT_MAX) const override;
89 void docbook(XMLStream &, OutputParams const &) const override;
91 docstring xhtml(XMLStream &, OutputParams const &) const override;
93 void validate(LaTeXFeatures &) const override;
95 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
97 void doDispatch(Cursor & cur, FuncRequest & cmd) override;
99 Inset * clone() const override { return new InsetNote(*this); }
100 /// used by the constructors
103 std::string contextMenuName() const override;
105 friend class InsetNoteParams;
108 InsetNoteParams params_;
113 #endif // INSET_NOTE_H