X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFloat.h;h=6cff1089754a15401dff14d5a33d2b169cc815db;hb=e15d3d35cba7266d8a1a22c7e4cd92d12599e103;hp=7ab9ed336a3a0272e43097a9b6ab6c39a4fcb2b6;hpb=39e79d8602920eefe36e898c9f415afb979521b2;p=lyx.git diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index 7ab9ed336a..6cff108975 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,93 +30,88 @@ 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(); + InsetFloat(Buffer * buffer, std::string params_str); + /// - void write(Buffer const & buf, std::ostream & os) const; + static void string2params(std::string const &, InsetFloatParams &); /// - void read(Buffer const & buf, Lexer & lex); + static std::string params2string(InsetFloatParams const &); /// - void validate(LaTeXFeatures & features) const; + void setWide(bool w, bool update_label = true); /// - InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; } + void setSideways(bool s, bool update_label = true); /// - virtual bool wide() const { return false; } + void setSubfloat(bool s, bool update_label = true); /// - int latex(Buffer const &, odocstream &, - OutputParams const &) const; + void setNewLabel(); /// - int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + InsetFloatParams const & params() const { return params_; } /// - int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + bool allowsCaptionVariation(std::string const &) const; +private: /// - virtual docstring const editMessage() const; + docstring layoutName() 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; } + docstring toolTip(BufferView const & bv, int x, int y) const; /// - void wide(bool w, BufferParams const &); - /// - void sideways(bool s, BufferParams const &); + void write(std::ostream & os) const; /// - void addToToc(TocList &, Buffer const &) const; + void read(Lexer & lex); /// - bool showInsetDialog(BufferView *) const; + void validate(LaTeXFeatures & features) const; /// - InsetFloatParams const & params() const { return params_; } + InsetCode lyxCode() const { return FLOAT_CODE; } /// - bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const; -protected: - virtual void doDispatch(LCursor & cur, FuncRequest & cmd); -private: - virtual std::auto_ptr doClone() const; - + void latex(otexstream &, OutputParams const &) const; /// - InsetFloatParams params_; -}; - - -class InsetFloatMailer : public MailInset { -public: + int plaintext(odocstringstream & ods, OutputParams const & op, + size_t max_length = INT_MAX) const; /// - InsetFloatMailer(InsetFloat & inset); + int docbook(odocstream &, OutputParams const &) const; /// - virtual InsetBase & 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