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