]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNote.h
revert r37459 and add a note to the sources:
[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         /// Is the content of this inset part of the output document?
69         bool producesOutput() const
70                 { return params_.type == InsetNoteParams::Greyedout; }
71         ///
72         bool allowSpellCheck() const;
73         ///
74         void write(std::ostream &) const;
75         ///
76         void read(Lexer & lex);
77         /// show the note dialog
78         bool showInsetDialog(BufferView * bv) const;
79         ///
80         bool isMacroScope() const;
81         ///
82         int latex(otexstream &, OutputParams const &) const;
83         ///
84         int plaintext(odocstream &, OutputParams const &) const;
85         ///
86         int docbook(odocstream &, OutputParams const &) const;
87         ///
88         docstring xhtml(XHTMLStream &, OutputParams const &) const;
89         ///
90         void validate(LaTeXFeatures &) const;
91         ///
92         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
93         ///
94         void addToToc(DocIterator const &) const;
95         ///
96         void doDispatch(Cursor & cur, FuncRequest & cmd);
97         ///
98         Inset * clone() const { return new InsetNote(*this); }
99         /// used by the constructors
100         void init();
101         ///
102         docstring contextMenuName() const;
103         ///
104         friend class InsetNoteParams;
105
106         ///
107         InsetNoteParams params_;
108 };
109
110 } // namespace lyx
111
112 #endif // INSET_NOTE_H