X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetfloat.h;h=633d0a75330087d20e321948541b1ef4a254adc6;hb=5603df4a5b7e511b31026c9a4f8f55b2b10fde57;hp=997c99f73a695fdd40bea3649e4b0fcd4d6fe402;hpb=eb7220abe64a6e301c51974fb34bb916ac41d64b;p=lyx.git diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index 997c99f73a..633d0a7533 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -1,62 +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: /// - explicit - InsetFloat(); + InsetFloat(BufferParams const &, std::string const &); + /// + ~InsetFloat(); + /// + void write(Buffer const & buf, std::ostream & os) const; + /// + void read(Buffer const & buf, LyXLex & lex); /// - ~InsetFloat() {} + void validate(LaTeXFeatures & features) const; /// - void Write(Buffer const * buf, std::ostream & os) const; + virtual std::auto_ptr clone() const; /// - void Read(Buffer const * buf, LyXLex & lex); + InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; } /// - void Validate(LaTeXFeatures & features) const; + int latex(Buffer const &, std::ostream &, + OutputParams const &) const; /// - Inset * Clone() const; + int linuxdoc(Buffer const &, std::ostream &, + OutputParams const &) const; /// - Inset::Code LyxCode() const { return Inset::FLOAT_CODE; } + int docbook(Buffer const &, std::ostream &, + OutputParams const &) const; + /// + std::string const editMessage() const; + /// + 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; } + /// + void wide(bool w, BufferParams const &); + /// + void sideways(bool s, BufferParams 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: + /// + InsetFloatParams params_; +}; + + +#include "mailinset.h" + + +class InsetFloatMailer : public MailInset { +public: /// - int Latex(Buffer const *, std::ostream &, bool fragile, bool fp) const; + InsetFloatMailer(InsetFloat & inset); /// - const char * EditMessage() const; + virtual InsetBase & inset() const { return inset_; } /// - bool InsertInset(BufferView *, Inset * inset); + virtual std::string const & name() const { return name_; } /// - bool InsertInsetAllowed(Inset * inset) const; + virtual std::string const inset2string(Buffer const &) const; /// -// LyXFont GetDrawFont(BufferView *, LyXParagraph * par, int pos) const; + static void string2params(std::string const &, InsetFloatParams &); /// - void InsetButtonRelease(BufferView * bv, int x, int y, int button); + static std::string const params2string(InsetFloatParams const &); private: /// - string floatType; + static std::string const name_; /// - string floatPlacement; + InsetFloat & inset_; }; #endif