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