4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS
19 /** Used for error messages from LaTeX runs.
21 The edit-operation opens a
22 dialog with the text of the error-message. The inset is displayed as
23 "Error" in a box, and automatically deleted. */
24 class InsetError : public Inset {
28 InsetError(string const &, bool same_id = false);
32 virtual dispatch_result localDispatch(FuncRequest const & cmd);
34 int ascent(BufferView *, LyXFont const &) const;
36 int descent(BufferView *, LyXFont const &) const;
38 int width(BufferView *, LyXFont const &) const;
40 void draw(BufferView *, LyXFont const &, int, float &) const;
42 void write(Buffer const *, std::ostream &) const {}
44 void read(Buffer const *, LyXLex &) {}
46 int latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
48 int ascii(Buffer const *, std::ostream &, int) const { return 0; }
50 int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
52 int docbook(Buffer const *, std::ostream &, bool) const { return 0; }
54 bool autoDelete() const { return true; }
55 /// what appears in the minibuffer when opening
56 string const editMessage() const;
58 void edit(BufferView *, int, int, mouse_button::state);
60 void edit(BufferView * bv, bool front = true);
62 EDITABLE editable() const { return IS_EDITABLE; }
64 Inset * clone(Buffer const &, bool same_id = false) const {
65 return new InsetError(contents, same_id);
68 Inset::Code lyxCode() const { return Inset::ERROR_CODE; }
69 /// We don't want "begin" and "end inset" in lyx-file
70 bool directWrite() const { return true; };
72 string const & getContents() const { return contents; }