X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetfloat.h;h=7992d44d6cdd7d370d08884672e8e38d3ffd5551;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=b76d4e0241a0905443ce2120885a92a1f79b5df7;hpb=ee16c6dfc0268060144dd4de0d40d43d2b25622c;p=lyx.git diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index b76d4e0241..7992d44d6c 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -1,62 +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 "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: /// - explicit - InsetFloat(); + InsetFloat(BufferParams const &, std::string const &); + /// + ~InsetFloat(); /// - ~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; + InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; } /// - Inset * Clone() const; + int latex(Buffer const &, odocstream &, + OutputParams const &) const; /// - Inset::Code LyxCode() const { return Inset::FLOAT_CODE; } + int docbook(Buffer const &, odocstream &, + OutputParams const &) const; /// - int Latex(Buffer const *, std::ostream &, bool fragile, bool fp) const; + virtual docstring const editMessage() const; /// - const char * EditMessage() const; + 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; } /// - bool InsertInset(BufferView *, Inset * inset); + void wide(bool w, BufferParams const &); /// - bool InsertInsetAllowed(Inset * inset) const; + void sideways(bool s, BufferParams const &); /// - LyXFont GetDrawFont(BufferView *, LyXParagraph * par, int pos) const; + void addToToc(TocList &, Buffer const &) const; /// - void InsetButtonRelease(BufferView * bv, int x, int y, int button); + bool showInsetDialog(BufferView *) const; + /// + InsetFloatParams const & params() const { return params_; } + /// + bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const; +protected: + virtual void doDispatch(LCursor & cur, FuncRequest & cmd); private: + virtual std::auto_ptr doClone() const; + + /// + InsetFloatParams params_; +}; + + +class InsetFloatMailer : public MailInset { +public: + /// + InsetFloatMailer(InsetFloat & inset); /// - string floatType; + virtual InsetBase & inset() const { return inset_; } /// - string floatPlacement; + 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: + /// + static std::string const name_; + /// + InsetFloat & inset_; }; + +} // namespace lyx + #endif