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