]> git.lyx.org Git - lyx.git/blob - src/insets/InsetNote.h
remove remaining MailInsets.
[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 const &, 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         docstring editMessage() const;
62         ///
63         InsetCode lyxCode() const { return NOTE_CODE; }
64         ///
65         docstring name() const;
66         ///
67         DisplayType display() const;
68         ///
69         bool noFontChange() const { return params_.type != InsetNoteParams::Note; }
70         ///
71         void write(std::ostream &) const;
72         ///
73         void read(Lexer & lex);
74         ///
75         void setButtonLabel();
76         /// show the note dialog
77         bool showInsetDialog(BufferView * bv) const;
78         ///
79         bool isMacroScope() const;
80         ///
81         int latex(odocstream &, OutputParams const &) const;
82         ///
83         int plaintext(odocstream &, OutputParams const &) const;
84         ///
85         int docbook(odocstream &, OutputParams const &) const;
86         ///
87         void validate(LaTeXFeatures &) const;
88         ///
89         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
90         // Update the counters of this inset and of its contents
91         void updateLabels(ParIterator const &);
92         ///
93         void addToToc(ParConstIterator const &) const;
94         ///
95         void doDispatch(Cursor & cur, FuncRequest & cmd);
96         ///
97         Inset * clone() const { return new InsetNote(*this); }
98         /// used by the constructors
99         void init();
100         ///
101         docstring contextMenu(BufferView const & bv, int x, int y) const;
102         ///
103         friend class InsetNoteParams;
104
105         ///
106         InsetNoteParams params_;
107 };
108
109
110 } // namespace lyx
111
112 #endif // INSET_NOTE_H