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