]> git.lyx.org Git - lyx.git/blob - src/insets/inseterror.h
Don't remove cell selections after fontchange.
[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-2001 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 "inset.h"
20 #include "LString.h"
21 #include <sigc++/signal_system.h>
22
23 /** Used for error messages from LaTeX runs.
24   
25   The edit-operation opens a 
26   dialog with the text of the error-message. The inset is displayed as 
27   "Error" in a box, and automatically deleted. */
28 class InsetError : public Inset {
29 public:
30         ///
31         explicit
32         InsetError(string const &, bool same_id = false);
33         ///
34         ~InsetError() { hideDialog(); }
35         ///
36         int ascent(BufferView *, LyXFont const &) const;
37         ///
38         int descent(BufferView *, LyXFont const &) const;
39         ///
40         int width(BufferView *, LyXFont const &) const;
41         ///
42         void draw(BufferView *, LyXFont const &, int, float &, bool) const;
43         ///
44         void write(Buffer const *, std::ostream &) const {}
45         ///
46         void read(Buffer const *, LyXLex &) {}
47         ///
48         int latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
49         ///
50         int ascii(Buffer const *, std::ostream &, int) const { return 0; }
51         ///
52         int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
53         ///
54         int docbook(Buffer const *, std::ostream &) const { return 0; }
55         ///
56         bool autoDelete() const { return true; }
57         /// what appears in the minibuffer when opening
58         string const editMessage() const;
59         ///
60         void edit(BufferView *, int, int, unsigned int);
61         ///
62         void edit(BufferView * bv, bool front = true);
63         ///
64         EDITABLE editable() const { return IS_EDITABLE; }
65         ///
66         Inset * clone(Buffer const &, bool same_id = false) const {
67                 return new InsetError(contents, same_id);
68         }
69         ///
70         Inset::Code lyxCode() const { return Inset::ERROR_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         SigC::Signal0<void> hideDialog;
77 private:
78         ///
79         string contents;
80 };
81 #endif