]> git.lyx.org Git - lyx.git/blob - src/insets/inseterror.h
Make it compile when USE_BOOST_FORMAT is unset
[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 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "inset.h"
20 #include "LString.h"
21
22 #include <boost/signals/signal0.hpp>
23
24 /** Used for error messages from LaTeX runs.
25
26   The edit-operation opens a
27   dialog with the text of the error-message. The inset is displayed as
28   "Error" in a box, and automatically deleted. */
29 class InsetError : public Inset {
30 public:
31         ///
32         explicit
33         InsetError(string const &, bool same_id = false);
34         ///
35         ~InsetError() { hideDialog(); }
36         ///
37         int ascent(BufferView *, LyXFont const &) const;
38         ///
39         int descent(BufferView *, LyXFont const &) const;
40         ///
41         int width(BufferView *, LyXFont const &) const;
42         ///
43         void draw(BufferView *, LyXFont const &, int, float &, bool) const;
44         ///
45         void write(Buffer const *, std::ostream &) const {}
46         ///
47         void read(Buffer const *, LyXLex &) {}
48         ///
49         int latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
50         ///
51         int ascii(Buffer const *, std::ostream &, int) const { return 0; }
52         ///
53         int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
54         ///
55         int docbook(Buffer const *, std::ostream &, bool) const { return 0; }
56         ///
57         bool autoDelete() const { return true; }
58         /// what appears in the minibuffer when opening
59         string const editMessage() const;
60         ///
61         void edit(BufferView *, int, int, mouse_button::state);
62         ///
63         void edit(BufferView * bv, bool front = true);
64         ///
65         EDITABLE editable() const { return IS_EDITABLE; }
66         ///
67         Inset * clone(Buffer const &, bool same_id = false) const {
68                 return new InsetError(contents, same_id);
69         }
70         ///
71         Inset::Code lyxCode() const { return Inset::ERROR_CODE; }
72         /// We don't want "begin" and "end inset" in lyx-file
73         bool directWrite() const { return true; };
74         ///
75         string const & getContents() const { return contents; }
76         ///
77         boost::signal0<void> hideDialog;
78 private:
79         ///
80         string contents;
81 };
82 #endif