X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetfloat.h;h=7992d44d6cdd7d370d08884672e8e38d3ffd5551;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=4d875f68c0d6ee37bc2ea8d64b5515dac98d33fa;hpb=e952d33e0b702265cdac14de9871ecbfcf34863d;p=lyx.git diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index 4d875f68c0..7992d44d6c 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -1,78 +1,119 @@ // -*- 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 +#include "mailinset.h" + + +namespace lyx { + + +class InsetFloatParams { +public: + /// + 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(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; + InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; } + /// + int latex(Buffer const &, odocstream &, + OutputParams const &) const; + /// + int docbook(Buffer const &, odocstream &, + OutputParams const &) const; + /// + virtual docstring const editMessage() const; /// - Inset::Code lyxCode() const { return Inset::FLOAT_CODE; } + bool insetAllowed(InsetBase::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; } /// - int latex(Buffer const *, std::ostream &, bool fragile, bool fp) const; + void wide(bool w, BufferParams const &); /// - int docBook(Buffer const *, std::ostream &) const; + void sideways(bool s, BufferParams const &); /// - string const editMessage() const; + void addToToc(TocList &, Buffer const &) const; /// - bool insetAllowed(Inset::Code) const; + bool showInsetDialog(BufferView *) const; + /// + InsetFloatParams const & params() const { return params_; } /// - void insetButtonRelease(BufferView * bv, int x, int y, int button); + bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const; +protected: + virtual void doDispatch(LCursor & cur, FuncRequest & cmd); +private: + virtual std::auto_ptr doClone() const; + /// - string const & type() const; + InsetFloatParams params_; +}; + + +class InsetFloatMailer : public MailInset { +public: /// - void placement(string const & p); + InsetFloatMailer(InsetFloat & inset); /// - string const & placement() const; + virtual InsetBase & inset() const { return inset_; } /// - void wide(bool w); + virtual std::string const & name() const { return name_; } /// - bool wide() const; + virtual std::string const inset2string(Buffer const &) const; /// - bool showInsetDialog(BufferView *) const; + static void string2params(std::string const &, InsetFloatParams &); /// - SigC::Signal0 hideDialog; + static std::string const params2string(InsetFloatParams const &); private: /// - string floatType_; - /// - string floatPlacement_; + static std::string const name_; /// - bool wide_; + InsetFloat & inset_; }; + +} // namespace lyx + #endif