X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFloat.h;h=4a4c7d5bfbded980859a3d7174ebf884695af1dd;hb=bfddee97e191a853f0576f4fab3f095c4e9ce0de;hp=841e1d7fc96f0161108839b82fa06490dcd23ec9;hpb=ed858d73e57ce7aa89e38c1bc4d799362edb0227;p=lyx.git diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index 841e1d7fc9..4a4c7d5bfb 100644 --- a/src/insets/InsetFloat.h +++ b/src/insets/InsetFloat.h @@ -4,26 +4,24 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Jürgen Vigna - * \author Lars Gullik Bjønnes + * \author Jürgen Vigna + * \author Lars Gullik Bjønnes * * Full author contact details are available in file CREDITS. */ -#ifndef INSETFLOAT_H -#define INSETFLOAT_H +#ifndef INSET_FLOAT_H +#define INSET_FLOAT_H #include "InsetCollapsable.h" -#include "MailInset.h" namespace lyx { - class InsetFloatParams { public: /// - InsetFloatParams() : wide(false), sideways(false) {} + InsetFloatParams() : wide(false), sideways(false), subfloat(false) {} /// void write(std::ostream & os) const; /// @@ -32,95 +30,85 @@ public: std::string type; /// std::string placement; - /// + /// span columns bool wide; /// bool sideways; + /// + bool subfloat; }; -/** The float inset -*/ -class InsetFloat : public InsetCollapsable { +///////////////////////////////////////////////////////////////////////// +// +// InsetFloat +// +///////////////////////////////////////////////////////////////////////// + +/// Used for "floating" objects like tables, figures etc. +class InsetFloat : public InsetCollapsable +{ public: /// - InsetFloat(BufferParams const &, std::string const &); - /// - ~InsetFloat(); - /// - docstring name() const { return name_; } - /// - void write(Buffer const & buf, std::ostream & os) const; - /// - void read(Buffer const & buf, Lexer & lex); + InsetFloat(Buffer * buffer, std::string params_str); + /// - void validate(LaTeXFeatures & features) const; + static void string2params(std::string const &, InsetFloatParams &); /// - Inset::Code lyxCode() const { return Inset::FLOAT_CODE; } + static std::string params2string(InsetFloatParams const &); /// - int latex(Buffer const &, odocstream &, - OutputParams const &) const; + void setWide(bool w, bool update_label = true); /// - int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + void setSideways(bool s, bool update_label = true); /// - int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + void setSubfloat(bool s, bool update_label = true); /// - virtual docstring const editMessage() const; + void setNewLabel(); /// - bool insetAllowed(Inset::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; } + InsetFloatParams const & params() const { return params_; } +private: /// - void wide(bool w, BufferParams const &); + docstring layoutName() const; /// - void sideways(bool s, BufferParams const &); + docstring toolTip(BufferView const & bv, int x, int y) const; /// - bool showInsetDialog(BufferView *) const; + void write(std::ostream & os) const; /// - InsetFloatParams const & params() const { return params_; } + void read(Lexer & lex); /// - bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; - // Update the counters of this inset and of its contents - virtual void updateLabels(Buffer const &, ParIterator const &); -protected: - virtual void doDispatch(Cursor & cur, FuncRequest & cmd); -private: + void validate(LaTeXFeatures & features) const; /// - virtual Inset * clone() const; + InsetCode lyxCode() const { return FLOAT_CODE; } /// - InsetFloatParams params_; + void latex(otexstream &, OutputParams const &) const; /// - docstring name_; -}; - - -class InsetFloatMailer : public MailInset { -public: + int plaintext(odocstream &, OutputParams const &) const; /// - InsetFloatMailer(InsetFloat & inset); + int docbook(odocstream &, OutputParams const &) const; /// - virtual Inset & inset() const { return inset_; } + docstring xhtml(XHTMLStream &, OutputParams const &) const; /// - virtual std::string const & name() const { return name_; } + bool insetAllowed(InsetCode) const; + /** returns false if, when outputing LaTeX, font changes should + be closed before generating this inset. This is needed for + insets that may contain several paragraphs */ + bool inheritFont() const { return false; } /// - virtual std::string const inset2string(Buffer const &) const; + bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; + // Update the counters of this inset and of its contents + void updateBuffer(ParIterator const &, UpdateType); /// - static void string2params(std::string const &, InsetFloatParams &); + void doDispatch(Cursor & cur, FuncRequest & cmd); /// - static std::string const params2string(InsetFloatParams const &); -private: + Inset * clone() const { return new InsetFloat(*this); } /// - static std::string const name_; + docstring getCaption(OutputParams const &) const; /// - InsetFloat & inset_; + InsetFloatParams params_; }; } // namespace lyx -#endif +#endif // INSET_FLOAT_H