]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNote.h
Rename InsetXXX::contextMenu to InsetXXX::contextMenuName. Now this function doesn...
[lyx.git] / src / insets / InsetNote.h
1 // -*- C++ -*-
2 /**
3  * \file InsetNote.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSET_NOTE_H
13 #define INSET_NOTE_H
14
15 #include "InsetCollapsable.h"
16
17
18 namespace lyx {
19
20 class InsetNoteParams
21 {
22 public:
23         enum Type {
24                 Note,
25                 Comment,
26                 Greyedout
27         };
28         /// \c type defaults to Note
29         InsetNoteParams();
30         ///
31         void write(std::ostream & os) const;
32         ///
33         void read(Lexer & lex);
34         ///
35         Type type;
36 };
37
38
39 /////////////////////////////////////////////////////////////////////////
40 //
41 // InsetNote
42 //
43 /////////////////////////////////////////////////////////////////////////
44
45 /// The PostIt note inset, and other annotations
46 class InsetNote : public InsetCollapsable
47 {
48 public:
49         ///
50         InsetNote(Buffer *, std::string const &);
51         ///
52         ~InsetNote();
53         ///
54         static std::string params2string(InsetNoteParams const &);
55         ///
56         static void string2params(std::string const &, InsetNoteParams &);
57         ///
58         InsetNoteParams const & params() const { return params_; }
59 private:
60         ///
61         InsetCode lyxCode() const { return NOTE_CODE; }
62         ///
63         docstring name() const;
64         ///
65         DisplayType display() const;
66         ///
67         bool noFontChange() const { return params_.type != InsetNoteParams::Note; }
68         /*!
69          * Is the content of this inset part of the output document?
70          *
71          * Note that Note insets are not considered part of the
72          * document, even in their 'greyed out' incarnation.
73          */
74         bool producesOutput() const { return false; }
75         ///
76         bool allowSpellCheck() const;
77         ///
78         void write(std::ostream &) const;
79         ///
80         void read(Lexer & lex);
81         ///
82         void setButtonLabel();
83         /// show the note dialog
84         bool showInsetDialog(BufferView * bv) const;
85         ///
86         bool isMacroScope() const;
87         ///
88         int latex(odocstream &, OutputParams const &) const;
89         ///
90         int plaintext(odocstream &, OutputParams const &) const;
91         ///
92         int docbook(odocstream &, OutputParams const &) const;
93         ///
94         docstring xhtml(XHTMLStream &, OutputParams const &) const;
95         ///
96         void validate(LaTeXFeatures &) const;
97         ///
98         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
99         ///
100         void addToToc(DocIterator const &);
101         ///
102         void doDispatch(Cursor & cur, FuncRequest & cmd);
103         ///
104         Inset * clone() const { return new InsetNote(*this); }
105         /// used by the constructors
106         void init();
107         ///
108         docstring contextMenuName() const;
109         ///
110         friend class InsetNoteParams;
111
112         ///
113         InsetNoteParams params_;
114 };
115
116 } // namespace lyx
117
118 #endif // INSET_NOTE_H