X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetfloat.h;h=633d0a75330087d20e321948541b1ef4a254adc6;hb=5603df4a5b7e511b31026c9a4f8f55b2b10fde57;hp=021a27b2fe47bce4c5968f036efa16a7fb0a0916;hpb=74b224fcba406f4ea4d1f1fa91a63aea39ca2712;p=lyx.git diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index 021a27b2fe..633d0a7533 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -1,63 +1,116 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor +/** + * \file insetfloat.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * Copyright 1998 The LyX Team. + * \author Jürgen Vigna + * \author Lars Gullik Bjønnes * - * ====================================================== + * 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" + + +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 - + */ class InsetFloat : public InsetCollapsable { public: /// - InsetFloat(string const &); + 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; /// - void Validate(LaTeXFeatures & features) const; + virtual std::auto_ptr clone() const; /// - Inset * Clone(Buffer const &) const; + InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; } /// - Inset::Code LyxCode() const { return Inset::FLOAT_CODE; } + int latex(Buffer const &, std::ostream &, + OutputParams const &) const; /// - int Latex(Buffer const *, std::ostream &, bool fragile, bool fp) const; + int linuxdoc(Buffer const &, std::ostream &, + OutputParams const &) const; /// - string const EditMessage() const; + int docbook(Buffer const &, std::ostream &, + OutputParams const &) const; /// - bool InsertInsetAllowed(Inset * inset) const; + std::string const editMessage() const; /// - void InsetButtonRelease(BufferView * bv, int x, int y, int button); + 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 & type() 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; + /// + 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