1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of*
|
2002-03-21 17:09:55 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2000-02-10 17:53:36 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
2002-03-21 17:09:55 +00:00
|
|
|
* Copyright 1995-2001 The LyX Team.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifndef INSET_ERROR_H
|
|
|
|
#define INSET_ERROR_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
#include "inset.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
#include "LString.h"
|
2002-05-29 16:21:03 +00:00
|
|
|
|
|
|
|
#include <boost/signals/signal0.hpp>
|
2000-09-22 15:09:51 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/** Used for error messages from LaTeX runs.
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
|
|
The edit-operation opens a
|
|
|
|
dialog with the text of the error-message. The inset is displayed as
|
1999-09-27 18:44:28 +00:00
|
|
|
"Error" in a box, and automatically deleted. */
|
2000-07-15 23:51:46 +00:00
|
|
|
class InsetError : public Inset {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
explicit
|
2001-07-06 15:57:54 +00:00
|
|
|
InsetError(string const &, bool same_id = false);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-02-19 16:01:31 +00:00
|
|
|
~InsetError() { hideDialog(); }
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-09-22 15:09:51 +00:00
|
|
|
int ascent(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-09-22 15:09:51 +00:00
|
|
|
int descent(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-09-22 15:09:51 +00:00
|
|
|
int width(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-06-23 15:02:46 +00:00
|
|
|
void draw(BufferView *, LyXFont const &, int, float &, bool) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void write(Buffer const *, std::ostream &) const {}
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void read(Buffer const *, LyXLex &) {}
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int ascii(Buffer const *, std::ostream &, int) const { return 0; }
|
2000-04-24 20:58:23 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2001-09-04 11:02:09 +00:00
|
|
|
int docbook(Buffer const *, std::ostream &) const { return 0; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
bool autoDelete() const { return true; }
|
1999-09-27 18:44:28 +00:00
|
|
|
/// what appears in the minibuffer when opening
|
2001-06-28 10:25:20 +00:00
|
|
|
string const editMessage() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2002-05-26 17:33:14 +00:00
|
|
|
void edit(BufferView *, int, int, mouse_button::state);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-20 14:18:48 +00:00
|
|
|
void edit(BufferView * bv, bool front = true);
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
EDITABLE editable() const { return IS_EDITABLE; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
Inset * clone(Buffer const &, bool same_id = false) const {
|
|
|
|
return new InsetError(contents, same_id);
|
|
|
|
}
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
Inset::Code lyxCode() const { return Inset::ERROR_CODE; }
|
1999-09-27 18:44:28 +00:00
|
|
|
/// We don't want "begin" and "end inset" in lyx-file
|
2001-06-28 10:25:20 +00:00
|
|
|
bool directWrite() const { return true; };
|
1999-10-19 15:06:30 +00:00
|
|
|
///
|
2000-09-22 15:09:51 +00:00
|
|
|
string const & getContents() const { return contents; }
|
|
|
|
///
|
2002-05-29 16:21:03 +00:00
|
|
|
boost::signal0<void> hideDialog;
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string contents;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|