X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetFloat.h;h=b1500f9a0ed99d9d17ea3e0ecdf57bdd59ce2a4d;hb=d6f1915684328c6e3fe61c6eef8846b5cabec334;hp=fc95581e3b64cbb40b4116daf78adbf1430db658;hpb=51fbea02a8f7dc1e360a61bdc95d5ac9200cb5f6;p=lyx.git diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index fc95581e3b..b1500f9a0e 100644 --- a/src/insets/InsetFloat.h +++ b/src/insets/InsetFloat.h @@ -10,20 +10,18 @@ * 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,97 +30,93 @@ 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(Buffer const &, std::string const &); /// ~InsetFloat(); + /// - docstring getInsetName() const { return name_; } - /// - void write(Buffer const & buf, std::ostream & os) const; - /// - void read(Buffer const & buf, Lexer & lex); + static void string2params(std::string const &, InsetFloatParams &); /// - void validate(LaTeXFeatures & features) const; + static std::string params2string(InsetFloatParams const &); /// - InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; } + void setWide(bool w, BufferParams const &, bool update_label = true); /// - virtual bool wide() const { return false; } + void setSideways(bool s, BufferParams const &, bool update_label = true); /// - int latex(Buffer const &, odocstream &, - OutputParams const &) const; + void setSubfloat(bool s, BufferParams const &, bool update_label = true); /// - int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + void setNewLabel(BufferParams const &); /// - int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + InsetFloatParams const & params() const { return params_; } +private: /// - virtual docstring const editMessage() const; + docstring name() const { return name_; } /// - 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 write(std::ostream & os) const; /// - void sideways(bool s, BufferParams const &); + void read(Lexer & lex); /// - void addToToc(TocList &, Buffer const &) const; + void validate(LaTeXFeatures & features) const; /// - bool showInsetDialog(BufferView *) const; + InsetCode lyxCode() const { return FLOAT_CODE; } /// - InsetFloatParams const & params() const { return params_; } + int latex(odocstream &, OutputParams const &) const; /// - bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; -protected: - virtual void doDispatch(Cursor & cur, FuncRequest & cmd); -private: + int plaintext(odocstream &, OutputParams const &) const; /// - virtual std::auto_ptr doClone() const; + int docbook(odocstream &, OutputParams const &) const; /// - InsetFloatParams params_; + docstring editMessage() const; /// - docstring name_; -}; - - -class InsetFloatMailer : public MailInset { -public: + bool insetAllowed(InsetCode) 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; } /// - InsetFloatMailer(InsetFloat & inset); + bool showInsetDialog(BufferView *) const; /// - virtual InsetBase & inset() const { return inset_; } + bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; + // Update the counters of this inset and of its contents + void updateLabels(ParIterator const &); /// - virtual std::string const & name() const { return name_; } + void doDispatch(Cursor & cur, FuncRequest & cmd); /// - virtual std::string const inset2string(Buffer const &) const; + Inset * clone() const { return new InsetFloat(*this); } /// - static void string2params(std::string const &, InsetFloatParams &); + docstring getCaption(OutputParams const &) const; /// - static std::string const params2string(InsetFloatParams const &); -private: + docstring getCaptionText(OutputParams const &) const; /// - static std::string const name_; + InsetFloatParams params_; /// - InsetFloat & inset_; + docstring name_; }; } // namespace lyx -#endif +#endif // INSET_FLOAT_H