]> git.lyx.org Git - lyx.git/blob - src/insets/inseterror.h
ede6b82fcc8176b3e9397768eea6a2f8745f87a8
[lyx.git] / src / insets / inseterror.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-2000 The LyX Team. 
9  *
10  * ====================================================== */
11
12 #ifndef INSET_ERROR_H
13 #define INSET_ERROR_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include FORMS_H_LOCATION
20 #include "lyxinset.h"
21 #include "LString.h"
22 #include "gettext.h"
23
24 /** Used for error messages from LaTeX runs.
25   
26   The edit-operation opens a 
27   dialog with the text of the error-message. The inset is displayed as 
28   "Error" in a box, and automatically deleted. */
29 class InsetError: public Inset {
30 public:
31         ///
32         InsetError(string const & string);
33         ///
34         InsetError();
35         ///
36         ~InsetError();
37         ///
38         int ascent(Painter &, LyXFont const & font) const;
39         ///
40         int descent(Painter &, LyXFont const & font) const;
41         ///
42         int width(Painter &, LyXFont const & font) const;
43         ///
44         void draw(Painter &, LyXFont const & font, int baseline, float & x) const;
45         ///
46         void Write(ostream &) const;
47         ///
48         void Read(LyXLex & lex);
49         ///
50         int Latex(ostream &, signed char fragile) const;
51 #ifndef USE_OSTREAM_ONLY
52         ///
53         int Latex(string & file, signed char fragile) const;
54         ///
55         int Linuxdoc(string & file) const;
56         ///
57         int DocBook(string & file) const;
58 #else
59         ///
60         int Linuxdoc(ostream &) const;
61         ///
62         int DocBook(ostream &) const;
63 #endif
64         ///
65         bool AutoDelete() const;
66         /// what appears in the minibuffer when opening
67         const char * EditMessage() const {return _("Opened error");}
68         ///
69         void Edit(BufferView *, int x, int y, unsigned int button);
70         ///
71         EDITABLE Editable() const;
72         ///
73         Inset * Clone() const;
74         ///
75         Inset::Code LyxCode() const { return Inset::NO_CODE; }
76         /// We don't want "begin" and "end inset" in lyx-file
77         bool DirectWrite() const { return true; };
78         ///
79         static void CloseErrorCB(FL_OBJECT *, long data);
80 private:
81         ///
82         string contents;
83         ///
84         FL_FORM * form;
85         ///
86         FL_OBJECT * strobj;
87 };
88 #endif