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 * ====================================================== */
21 #include <sigc++/signal_system.h>
23 /** Used for error messages from LaTeX runs.
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 {
32 InsetError(string const &);
34 ~InsetError() { hideDialog(); }
36 int ascent(BufferView *, LyXFont const &) const;
38 int descent(BufferView *, LyXFont const &) const;
40 int width(BufferView *, LyXFont const &) const;
42 void draw(BufferView *, LyXFont const &, int, float &, bool) const;
44 void write(Buffer const *, std::ostream &) const {}
46 void read(Buffer const *, LyXLex &) {}
48 int latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
50 int ascii(Buffer const *, std::ostream &, int) const { return 0; }
52 int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
54 int docBook(Buffer const *, std::ostream &) const { return 0; }
56 bool autoDelete() const { return true; }
57 /// what appears in the minibuffer when opening
58 string const editMessage() const;
60 void edit(BufferView *, int, int, unsigned int);
62 EDITABLE editable() const { return IS_EDITABLE; }
64 Inset * clone(Buffer const &) const { return new InsetError(contents); }
66 Inset::Code lyxCode() const { return Inset::ERROR_CODE; }
67 /// We don't want "begin" and "end inset" in lyx-file
68 bool directWrite() const { return true; };
70 string const & getContents() const { return contents; }
72 SigC::Signal0<void> hideDialog;