]> git.lyx.org Git - lyx.git/blob - src/insets/inseterror.h
Added linelen to insets-ascii-function, some fixes and new support
[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 "lyxinset.h"
20 #include "LString.h"
21 #include <sigc++/signal_system.h>
22
23 #ifdef SIGC_CXX_NAMESPACES
24 using SigC::Signal0;
25 #endif
26
27 /** Used for error messages from LaTeX runs.
28   
29   The edit-operation opens a 
30   dialog with the text of the error-message. The inset is displayed as 
31   "Error" in a box, and automatically deleted. */
32 class InsetError : public Inset {
33 public:
34         ///
35         explicit
36         InsetError(string const &);
37         ///
38         ~InsetError() { hide(); }
39         ///
40         int ascent(BufferView *, LyXFont const &) const;
41         ///
42         int descent(BufferView *, LyXFont const &) const;
43         ///
44         int width(BufferView *, LyXFont const &) const;
45         ///
46         void draw(BufferView *, LyXFont const &, int, float &, bool) const;
47         ///
48         void Write(Buffer const *, std::ostream &) const {}
49         ///
50         void Read(Buffer const *, LyXLex &) {}
51         ///
52         int Latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
53         ///
54         int Ascii(Buffer const *, std::ostream &, int) const { return 0; }
55         ///
56         int Linuxdoc(Buffer const *, std::ostream &) const { return 0; }
57         ///
58         int DocBook(Buffer const *, std::ostream &) const { return 0; }
59         ///
60         bool AutoDelete() const { return true; }
61         /// what appears in the minibuffer when opening
62         string const EditMessage() const;
63         ///
64         void Edit(BufferView *, int, int, unsigned int);
65         ///
66         EDITABLE Editable() const { return IS_EDITABLE; }
67         ///
68         Inset * Clone() const { return new InsetError(contents); }
69         ///
70         Inset::Code LyxCode() const { return Inset::NO_CODE; }
71         /// We don't want "begin" and "end inset" in lyx-file
72         bool DirectWrite() const { return true; };
73         ///
74         string const & getContents() const { return contents; }
75         ///
76         Signal0<void> hide;
77 private:
78         ///
79         string contents;
80 };
81 #endif