2 /* This file is part of*
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
22 #include <boost/signals/signal0.hpp>
24 /** Used for error messages from LaTeX runs.
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 {
33 InsetError(string const &, bool same_id = false);
35 ~InsetError() { hideDialog(); }
37 int ascent(BufferView *, LyXFont const &) const;
39 int descent(BufferView *, LyXFont const &) const;
41 int width(BufferView *, LyXFont const &) const;
43 void draw(BufferView *, LyXFont const &, int, float &, bool) const;
45 void write(Buffer const *, std::ostream &) const {}
47 void read(Buffer const *, LyXLex &) {}
49 int latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
51 int ascii(Buffer const *, std::ostream &, int) const { return 0; }
53 int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
55 int docbook(Buffer const *, std::ostream &, bool) const { return 0; }
57 bool autoDelete() const { return true; }
58 /// what appears in the minibuffer when opening
59 string const editMessage() const;
61 void edit(BufferView *, int, int, mouse_button::state);
63 void edit(BufferView * bv, bool front = true);
65 EDITABLE editable() const { return IS_EDITABLE; }
67 Inset * clone(Buffer const &, bool same_id = false) const {
68 return new InsetError(contents, same_id);
71 Inset::Code lyxCode() const { return Inset::ERROR_CODE; }
72 /// We don't want "begin" and "end inset" in lyx-file
73 bool directWrite() const { return true; };
75 string const & getContents() const { return contents; }
77 boost::signal0<void> hideDialog;