]> git.lyx.org Git - lyx.git/blob - src/insets/inseterror.h
fix #832
[lyx.git] / src / insets / inseterror.h
1 // -*- C++ -*-
2 /**
3  * \file inseterror.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef INSET_ERROR_H
13 #define INSET_ERROR_H
14
15 #include "inset.h"
16 #include "LString.h"
17
18 /** Used for error messages from LaTeX runs.
19
20   The edit-operation opens a
21   dialog with the text of the error-message. The inset is displayed as
22   "Error" in a box, and automatically deleted. */
23 class InsetError : public Inset {
24 public:
25         ///
26         explicit
27         InsetError(string const &, bool same_id = false);
28         ///
29         ~InsetError();
30         ///
31         virtual dispatch_result localDispatch(FuncRequest const & cmd);
32         ///
33         int ascent(BufferView *, LyXFont const &) const;
34         ///
35         int descent(BufferView *, LyXFont const &) const;
36         ///
37         int width(BufferView *, LyXFont const &) const;
38         ///
39         void draw(BufferView *, LyXFont const &, int, float &) const;
40         ///
41         void write(Buffer const *, std::ostream &) const {}
42         ///
43         void read(Buffer const *, LyXLex &) {}
44         ///
45         int latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
46         ///
47         int ascii(Buffer const *, std::ostream &, int) const { return 0; }
48         ///
49         int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
50         ///
51         int docbook(Buffer const *, std::ostream &, bool) const { return 0; }
52         ///
53         bool autoDelete() const { return true; }
54         /// what appears in the minibuffer when opening
55         string const editMessage() const;
56         ///
57         EDITABLE editable() const { return IS_EDITABLE; }
58         ///
59         Inset * clone(Buffer const &, bool same_id = false) const {
60                 return new InsetError(contents, same_id);
61         }
62         ///
63         Inset::Code lyxCode() const { return Inset::ERROR_CODE; }
64         /// We don't want "begin" and "end inset" in lyx-file
65         bool directWrite() const { return true; };
66         ///
67         string const & getContents() const { return contents; }
68 private:
69         ///
70         string contents;
71 };
72 #endif