X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetfloat.h;h=633d0a75330087d20e321948541b1ef4a254adc6;hb=5603df4a5b7e511b31026c9a4f8f55b2b10fde57;hp=81ab93538cc9222b74054a60f325ed46e6b8e84e;hpb=f1c24d100985c6df2eb5ec390017b69c78fe49c7;p=lyx.git diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index 81ab93538c..633d0a7533 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -1,26 +1,39 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== +/** + * \file insetfloat.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor + * \author Jürgen Vigna + * \author Lars Gullik Bjønnes * - * Copyright 1998 The LyX Team. - * - * ====================================================== + * Full author contact details are available in file CREDITS. */ -#ifndef InsetFloat_H -#define InsetFloat_H - -#ifdef __GNUG__ -#pragma interface -#endif +#ifndef INSETFLOAT_H +#define INSETFLOAT_H #include "insetcollapsable.h" +#include "toc.h" + -#include +struct InsetFloatParams { + /// + InsetFloatParams() : wide(false), sideways(false) {} + /// + void write(std::ostream & os) const; + /// + void read(LyXLex & lex); + /// + std::string type; + /// + std::string placement; + /// + bool wide; + /// + bool sideways; +}; -class Painter; /** The float inset @@ -28,50 +41,76 @@ class Painter; class InsetFloat : public InsetCollapsable { public: /// - InsetFloat(BufferParams const &, string const &); - /// - InsetFloat(InsetFloat const &, bool same_id = false); + InsetFloat(BufferParams const &, std::string const &); /// ~InsetFloat(); /// - void write(Buffer const * buf, std::ostream & os) const; + void write(Buffer const & buf, std::ostream & os) const; /// - void read(Buffer const * buf, LyXLex & lex); + void read(Buffer const & buf, LyXLex & lex); /// void validate(LaTeXFeatures & features) const; /// - Inset * clone(Buffer const &, bool same_id = false) const; - /// - Inset::Code lyxCode() const { return Inset::FLOAT_CODE; } + virtual std::auto_ptr clone() const; /// - int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const; + InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; } /// - int docbook(Buffer const *, std::ostream &, bool mixcont) const; + int latex(Buffer const &, std::ostream &, + OutputParams const &) const; /// - string const editMessage() const; + int linuxdoc(Buffer const &, std::ostream &, + OutputParams const &) const; /// - bool insetAllowed(Inset::Code) const; + int docbook(Buffer const &, std::ostream &, + OutputParams const &) const; /// - string const & type() const; + std::string const editMessage() const; /// - void placement(string const & p); + bool insetAllowed(InsetOld::Code) const; + /** returns true if, when outputing LaTeX, font changes should + be closed before generating this inset. This is needed for + insets that may contain several paragraphs */ + bool noFontChange() const { return true; } /// - string const & placement() const; + void wide(bool w, BufferParams const &); /// - void wide(bool w); + void sideways(bool s, BufferParams const &); /// - bool wide() const; + void addToToc(lyx::toc::TocList &, Buffer const &) const; /// bool showInsetDialog(BufferView *) const; /// - boost::signal0 hideDialog; + InsetFloatParams const & params() const { return params_; } +protected: + virtual void priv_dispatch(LCursor & cur, FuncRequest & cmd); private: /// - string floatType_; + InsetFloatParams params_; +}; + + +#include "mailinset.h" + + +class InsetFloatMailer : public MailInset { +public: + /// + InsetFloatMailer(InsetFloat & inset); + /// + virtual InsetBase & inset() const { return inset_; } + /// + virtual std::string const & name() const { return name_; } + /// + virtual std::string const inset2string(Buffer const &) const; + /// + static void string2params(std::string const &, InsetFloatParams &); + /// + static std::string const params2string(InsetFloatParams const &); +private: /// - string floatPlacement_; + static std::string const name_; /// - bool wide_; + InsetFloat & inset_; }; #endif