]> git.lyx.org Git - lyx.git/blob - src/insets/inseterror.h
998a755cfcaed778e4b0d6334318e344c83a3a27
[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 #ifdef USE_PAINTER
38         ///
39         int ascent(Painter &, LyXFont const & font) const;
40         ///
41         int descent(Painter &, LyXFont const & font) const;
42         ///
43         int width(Painter &, LyXFont const & font) const;
44         ///
45         void draw(Painter &, LyXFont const & font,
46                   int baseline, float & x) const;
47 #else
48         ///
49         int Ascent(LyXFont const & font) const;
50         ///
51         int Descent(LyXFont const & font) const;
52         ///
53         int Width(LyXFont const & font) const;
54         ///
55         void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
56 #endif
57         ///
58         void Write(ostream &);
59         ///
60         void Read(LyXLex & lex);
61         ///
62         int Latex(ostream &, signed char fragile);
63         ///
64         int Latex(string & file, signed char fragile);
65         ///
66         int Linuxdoc(string & file);
67         ///
68         int DocBook(string & file);
69         ///
70         bool AutoDelete() const;
71         /// what appears in the minibuffer when opening
72         char const * EditMessage() const {return _("Opened error");}
73         ///
74         void Edit(int, int);
75         ///
76         unsigned char Editable() const;
77         ///
78         Inset * Clone() const;
79         ///
80         Inset::Code LyxCode() const { return Inset::NO_CODE; }
81         /// We don't want "begin" and "end inset" in lyx-file
82         bool DirectWrite() const { return true; };
83         ///
84         static void CloseErrorCB(FL_OBJECT *, long data);
85 private:
86         ///
87         string contents;
88         ///
89         FL_FORM * form;
90         ///
91         FL_OBJECT * strobj;
92 };
93 #endif