]> git.lyx.org Git - lyx.git/blob - src/insets/insetnote.h
* insettabular.[Ch]: remove remains of the 'update' mechanism,
[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 INSETNOTE_H
13 #define INSETNOTE_H
14
15 #include "insetcollapsable.h"
16
17
18 struct InsetNoteParams {
19         enum Type {
20                 Note,
21                 Comment,
22                 Greyedout
23         };
24         /// \c type defaults to Note
25         InsetNoteParams();
26         ///
27         void write(std::ostream & os) const;
28         ///
29         void read(LyXLex & lex);
30         ///
31         Type type;
32 };
33
34
35 /** The PostIt note inset, and other annotations
36
37 */
38 class InsetNote : public InsetCollapsable {
39 public:
40         ///
41         InsetNote(BufferParams const &, std::string const &);
42         /// Copy constructor
43         InsetNote(InsetNote const &);
44         ///
45         ~InsetNote();
46         ///
47         virtual std::auto_ptr<InsetBase> clone() const;
48         ///
49         std::string const editMessage() const;
50         ///
51         InsetOld::Code lyxCode() const { return InsetOld::NOTE_CODE; }
52         ///
53         void write(Buffer const &, std::ostream &) const;
54         ///
55         void read(Buffer const & buf, LyXLex & lex);
56         ///
57         void setButtonLabel();
58         /// show the note dialog
59         bool showInsetDialog(BufferView * bv) const;
60         ///
61         int latex(Buffer const &, std::ostream &,
62                OutputParams const &) const;
63         ///
64         int linuxdoc(Buffer const &, std::ostream &,
65                OutputParams const &) const;
66         ///
67         int docbook(Buffer const &, std::ostream &,
68                OutputParams const &) const;
69         ///
70         int plaintext(Buffer const &, std::ostream &,
71                OutputParams const &) const;
72         ///
73         void validate(LaTeXFeatures &) const;
74         ///
75         InsetNoteParams const & params() const { return params_; }
76 protected:
77         ///
78         virtual void priv_dispatch(LCursor & cur, FuncRequest const & cmd);
79 private:
80         friend class InsetNoteParams;
81
82         /// used by the constructors
83         void init();
84         ///
85         InsetNoteParams params_;
86 };
87
88
89 #include "mailinset.h"
90
91 class InsetNoteMailer : public MailInset {
92 public:
93         ///
94         InsetNoteMailer(InsetNote & inset);
95         ///
96         virtual InsetBase & inset() const { return inset_; }
97         ///
98         virtual std::string const & name() const { return name_; }
99         ///
100         virtual std::string const inset2string(Buffer const &) const;
101         ///
102         static std::string const params2string(InsetNoteParams const &);
103         ///
104         static void string2params(std::string const &, InsetNoteParams &);
105
106 private:
107         ///
108         static std::string const name_;
109         ///
110         InsetNote & inset_;
111 };
112
113 #endif