]> git.lyx.org Git - lyx.git/blob - src/insets/insetinfo.h
Added copy constructor to inset.h and used it in most insets which permit
[lyx.git] / src / insets / insetinfo.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *       
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2001 the LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef INSET_INFO_H
13 #define INSET_INFO_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "inset.h"
20 #include FORMS_H_LOCATION
21 #include "LString.h"
22 #include "lyxfont.h"
23
24 /** Info. Handles the note insets.
25   
26   This class handles the note insets. The edit operation bringes up
27   a dialog, where the user can type a note about life or something
28   else of interest. When collapsed, the inset is displayed as "Note"
29   in a yellow box. Currently, the Read-function is a terrible hack. 
30   Some day in the distant future, this will hopefully be obsoleted by 
31   a true comment-environment. */
32 class InsetInfo : public Inset {
33 public:
34         ///
35         InsetInfo();
36         ///
37         explicit
38         InsetInfo(string const & string);
39         ///
40         ~InsetInfo();
41         ///
42         int ascent(BufferView *, LyXFont const &) const;
43         ///
44         int descent(BufferView *, LyXFont const &) const;
45         ///
46         int width(BufferView *, LyXFont const &) const;
47         ///
48         void draw(BufferView *, LyXFont const &, int, float &, bool) const;
49         ///
50         void write(Buffer const *, std::ostream &) const;
51         ///
52         void read(Buffer const *, LyXLex & lex);
53         ///
54         int latex(Buffer const *, std::ostream &,
55                   bool fragile, bool free_spc) const;
56         ///
57         int ascii(Buffer const *, std::ostream &, int linelen) const;
58         ///
59         int linuxdoc(Buffer const *, std::ostream &) const;
60         ///
61         int docBook(Buffer const *, std::ostream &) const;
62         /// what appears in the minibuffer when opening
63         string const editMessage() const;
64         ///
65         void edit(BufferView *, int, int, unsigned int);
66         ///
67         void edit(BufferView * bv, bool front = true);
68         ///
69         EDITABLE editable() const;
70         ///
71         Inset::Code lyxCode() const;
72         ///
73         virtual Inset * clone(Buffer const &, bool same_id = false) const;
74         ///
75         static void closeInfoCB(FL_OBJECT *, long data);
76 private:
77         ///
78         string contents;
79         ///
80         FL_FORM * form;
81         ///
82         FL_OBJECT * strobj;
83         ///
84         LyXFont labelfont;
85 };
86 #endif