]> git.lyx.org Git - lyx.git/blob - src/insets/inseterror.h
The markDirty() and fitCursor() changes
[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
16 #include "inset.h"
17 #include "LString.h"
18
19 /** Used for error messages from LaTeX runs.
20
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 {
25 public:
26         ///
27         explicit
28         InsetError(string const &, bool same_id = false);
29         ///
30         ~InsetError();
31         ///
32         virtual dispatch_result localDispatch(FuncRequest const & cmd);
33         ///
34         int ascent(BufferView *, LyXFont const &) const;
35         ///
36         int descent(BufferView *, LyXFont const &) const;
37         ///
38         int width(BufferView *, LyXFont const &) const;
39         ///
40         void draw(BufferView *, LyXFont const &, int, float &) const;
41         ///
42         void write(Buffer const *, std::ostream &) const {}
43         ///
44         void read(Buffer const *, LyXLex &) {}
45         ///
46         int latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
47         ///
48         int ascii(Buffer const *, std::ostream &, int) const { return 0; }
49         ///
50         int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
51         ///
52         int docbook(Buffer const *, std::ostream &, bool) const { return 0; }
53         ///
54         bool autoDelete() const { return true; }
55         /// what appears in the minibuffer when opening
56         string const editMessage() const;
57         ///
58         void edit(BufferView *, int, int, mouse_button::state);
59         ///
60         void edit(BufferView * bv, bool front = true);
61         ///
62         EDITABLE editable() const { return IS_EDITABLE; }
63         ///
64         Inset * clone(Buffer const &, bool same_id = false) const {
65                 return new InsetError(contents, same_id);
66         }
67         ///
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; };
71         ///
72         string const & getContents() const { return contents; }
73 private:
74         ///
75         string contents;
76 };
77 #endif