// -*- C++ -*-
/* This file is part of*
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
- * Copyright (C) 1995 Matthias Ettrich
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-2001 The LyX Team.
*
- *======================================================*/
+ * ====================================================== */
-#ifndef _INSET_ERROR_H
-#define _INSET_ERROR_H
+#ifndef INSET_ERROR_H
+#define INSET_ERROR_H
#ifdef __GNUG__
#pragma interface
#endif
-#include FORMS_H_LOCATION
-#include "lyxinset.h"
+#include "inset.h"
#include "LString.h"
-#include "gettext.h"
+#include <sigc++/signal_system.h>
/** Used for error messages from LaTeX runs.
The edit-operation opens a
dialog with the text of the error-message. The inset is displayed as
"Error" in a box, and automatically deleted. */
-class InsetError: public Inset {
+class InsetError : public Inset {
public:
///
- InsetError(LString const & string);
+ explicit
+ InsetError(string const &, bool same_id = false);
///
- InsetError();
+ ~InsetError() { hideDialog(); }
///
- ~InsetError();
+ int ascent(BufferView *, LyXFont const &) const;
///
- int Ascent(LyXFont const &font) const;
+ int descent(BufferView *, LyXFont const &) const;
///
- int Descent(LyXFont const &font) const;
+ int width(BufferView *, LyXFont const &) const;
///
- int Width(LyXFont const &font) const;
+ void draw(BufferView *, LyXFont const &, int, float &, bool) const;
///
- void Draw(LyXFont font, LyXScreen &scr, int baseline, float &x);
+ void write(Buffer const *, std::ostream &) const {}
///
- void Write(FILE *file);
+ void read(Buffer const *, LyXLex &) {}
///
- void Read(LyXLex &lex);
+ int latex(Buffer const *, std::ostream &, bool, bool) const { return 0; }
///
- int Latex(FILE *file, signed char fragile);
+ int ascii(Buffer const *, std::ostream &, int) const { return 0; }
///
- int Latex(LString &file, signed char fragile);
+ int linuxdoc(Buffer const *, std::ostream &) const { return 0; }
///
- int Linuxdoc(LString &file);
+ int docbook(Buffer const *, std::ostream &) const { return 0; }
///
- int DocBook(LString &file);
- ///
- bool AutoDelete() const;
+ bool autoDelete() const { return true; }
/// what appears in the minibuffer when opening
- char const* EditMessage() {return _("Opened error");}
+ string const editMessage() const;
///
- void Edit(int, int);
+ void edit(BufferView *, int, int, unsigned int);
///
- unsigned char Editable() const;
+ void edit(BufferView * bv, bool front = true);
///
- Inset* Clone();
+ EDITABLE editable() const { return IS_EDITABLE; }
///
- Inset::Code LyxCode() const { return Inset::NO_CODE; }
- /// We don't want "begin" and "end inset" in lyx-file
- bool DirectWrite() const { return true; };
-private:
+ Inset * clone(Buffer const &, bool same_id = false) const {
+ return new InsetError(contents, same_id);
+ }
///
- LString contents;
+ Inset::Code lyxCode() const { return Inset::ERROR_CODE; }
+ /// We don't want "begin" and "end inset" in lyx-file
+ bool directWrite() const { return true; };
///
- FL_FORM *form;
+ string const & getContents() const { return contents; }
///
- FL_OBJECT *strobj;
+ SigC::Signal0<void> hideDialog;
+private:
///
- static void CloseErrorCB(FL_OBJECT *, long data);
+ string contents;
};
#endif