]> git.lyx.org Git - lyx.git/blob - src/insets/insetnote.h
03261e7862fc09b8c5d16b1d676e492ca747a27b
[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         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 &, string const &);
38         /// Copy constructor
39         InsetNote(InsetNote const &);
40         ///
41         ~InsetNote();
42         ///
43         InsetBase * clone() const;
44         ///
45         string const editMessage() const;
46         ///
47         Inset::Code lyxCode() const { return Inset::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         dispatch_result InsetNote::localDispatch(FuncRequest const &);
56         ///
57         int latex(Buffer const *, std::ostream &,
58                         LatexRunParams const &) const;
59         ///
60         int linuxdoc(Buffer const *, std::ostream &) const;
61         ///
62         int docbook(Buffer const *, std::ostream &, bool) const;
63         ///
64         int ascii(Buffer const *, std::ostream &, int) const;
65         ///
66         void validate(LaTeXFeatures &) const;
67         ///
68         InsetNoteParams const & params() const { return params_; }
69
70 private:
71         friend class InsetNoteParams;
72
73         /// used by the constructors
74         void init();
75         ///
76         InsetNoteParams params_;
77 };
78
79 #include "mailinset.h"
80
81 class InsetNoteMailer : public MailInset {
82 public:
83         ///
84         InsetNoteMailer(string const & name, InsetNote & inset);
85         ///
86         virtual InsetBase & inset() const { return inset_; }
87         ///
88         virtual string const & name() const { return name_; }
89         ///
90         virtual string const inset2string() const;
91         ///
92         static string const params2string(string const &, InsetNoteParams const &);
93         ///
94         static void string2params(string const &, InsetNoteParams &);
95
96 private:
97         ///
98         string const name_;
99         ///
100         InsetNote & inset_;
101 };
102
103
104
105 #endif