]> git.lyx.org Git - lyx.git/blob - src/insets/insetnote.h
the spellcheck cleanup
[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
16 #include "insetcollapsable.h"
17
18
19  struct InsetNoteParams {
20         ///
21         void write(std::ostream & os) const;
22         ///
23         void read(LyXLex & lex);
24         ///
25         std::string type;
26 };
27
28
29 /** The PostIt note inset, and other annotations
30
31 */
32 class InsetNote : public InsetCollapsable {
33 public:
34         ///
35
36
37         InsetNote(BufferParams const &, std::string const &);
38         /// Copy constructor
39         InsetNote(InsetNote const &);
40         ///
41         ~InsetNote();
42         ///
43         virtual std::auto_ptr<InsetBase> clone() const;
44         ///
45         std::string const editMessage() const;
46         ///
47         InsetOld::Code lyxCode() const { return InsetOld::NOTE_CODE; }
48         ///
49         void write(Buffer const &, std::ostream &) const;
50         ///
51         void read(Buffer const & buf, LyXLex & lex);
52         ///
53         void setButtonLabel();
54         ///
55         void metrics(MetricsInfo &, Dimension &) const;
56         /// show the note dialog
57         bool showInsetDialog(BufferView * bv) const;
58         ///
59         int latex(Buffer const &, std::ostream &,
60                   LatexRunParams const &) const;
61         ///
62         int linuxdoc(Buffer const &, std::ostream &,
63                      LatexRunParams const &) const;
64         ///
65         int docbook(Buffer const &, std::ostream &,
66                     LatexRunParams const &) const;
67         ///
68         int ascii(Buffer const &, std::ostream &,
69                   LatexRunParams const &) const;
70         ///
71         void validate(LaTeXFeatures &) const;
72         ///
73         InsetNoteParams const & params() const { return params_; }
74 protected:
75         ///
76         virtual
77         DispatchResult
78         priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
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(std::string const & name, 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(std::string const &, InsetNoteParams const &);
103         ///
104         static void string2params(std::string const &, InsetNoteParams &);
105
106 private:
107         ///
108         std::string const name_;
109         ///
110         InsetNote & inset_;
111 };
112
113
114
115 #endif