X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finseterror.h;h=06525a0356c996589b2ece020c9e10e1037f98de;hb=62be565337f08855dbbbeea9d90db2ce497d4c10;hp=caa539d4dedf960286dd9767b8c7bd75b08ecd58;hpb=27de1486ca34aaad446adb798d71a77d6f6304da;p=lyx.git diff --git a/src/insets/inseterror.h b/src/insets/inseterror.h index caa539d4de..06525a0356 100644 --- a/src/insets/inseterror.h +++ b/src/insets/inseterror.h @@ -1,80 +1,68 @@ // -*- C++ -*- -/* This file is part of* - * ====================================================== +/** + * \file inseterror.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor - * - * Copyright (C) 1995 Matthias Ettrich + * \author Lars Gullik Bjønnes * - *======================================================*/ + * Full author contact details are available in file CREDITS + */ -#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" /** 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 + + 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); - /// - InsetError(); + explicit + InsetError(string const &, bool same_id = false); /// ~InsetError(); /// - int Ascent(LyXFont const &font) const; - /// - int Descent(LyXFont const &font) const; + virtual dispatch_result localDispatch(FuncRequest const & cmd); /// - int Width(LyXFont const &font) const; + void dimension(BufferView *, LyXFont const &, Dimension &) const; /// - void Draw(LyXFont font, LyXScreen &scr, int baseline, float &x); + void draw(BufferView *, LyXFont const &, int, float &) const; /// - void Write(FILE *file); + void write(Buffer const *, std::ostream &) const {} /// - void Read(LyXLex &lex); + void read(Buffer const *, LyXLex &) {} /// - int Latex(FILE *file, signed char fragile); + int latex(Buffer const *, std::ostream &, bool, bool) const { return 0; } /// - int Latex(LString &file, signed char fragile); + int ascii(Buffer const *, std::ostream &, int) const { return 0; } /// - int Linuxdoc(LString &file); + int linuxdoc(Buffer const *, std::ostream &) const { return 0; } /// - int DocBook(LString &file); + int docbook(Buffer const *, std::ostream &, bool) const { return 0; } /// - 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); + EDITABLE editable() const { return IS_EDITABLE; } /// - unsigned char Editable() const; + Inset * clone(Buffer const &, bool same_id = false) const { + return new InsetError(contents, same_id); + } /// - Inset* Clone(); - /// - Inset::Code LyxCode() const { return Inset::NO_CODE; } + Inset::Code lyxCode() const { return Inset::ERROR_CODE; } /// We don't want "begin" and "end inset" in lyx-file - bool DirectWrite() const { return true; }; -private: - /// - LString contents; + bool directWrite() const { return true; }; /// - FL_FORM *form; - /// - FL_OBJECT *strobj; + string const & getContents() const { return contents; } +private: /// - static void CloseErrorCB(FL_OBJECT *, long data); + string contents; }; #endif