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
17 #include "dimension.h"
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 &);
32 virtual dispatch_result localDispatch(FuncRequest const & cmd);
34 void metrics(MetricsInfo &, Dimension &) const;
36 void draw(PainterInfo & pi, int x, int y) const;
38 void write(Buffer const *, std::ostream &) const {}
40 void read(Buffer const *, LyXLex &) {}
42 int latex(Buffer const *, std::ostream &,
43 LatexRunParams const &) const { return 0; }
45 int ascii(Buffer const *, std::ostream &, int) const { return 0; }
47 int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
49 int docbook(Buffer const *, std::ostream &, bool) const { return 0; }
51 bool autoDelete() const { return true; }
52 /// what appears in the minibuffer when opening
53 string const editMessage() const;
55 EDITABLE editable() const { return IS_EDITABLE; }
57 InsetBase * clone() const {
58 return new InsetError(contents);
61 Inset::Code lyxCode() const { return Inset::ERROR_CODE; }
62 /// We don't want "begin" and "end inset" in lyx-file
63 bool directWrite() const { return true; };
65 string const & getContents() const { return contents; }
70 mutable Dimension dim_;