#ifndef INSET_FLOAT_H
#define INSET_FLOAT_H
-#include "InsetCollapsable.h"
+#include "InsetCaptionable.h"
namespace lyx {
-class InsetFloatParams {
+struct TexString;
+
+
+class InsetFloatParams
+{
public:
///
- InsetFloatParams() : wide(false), sideways(false), subfloat(false) {}
+ InsetFloatParams() : type("senseless"), placement("document"), alignment("document"),
+ wide(false), sideways(false), subfloat(false) {}
///
void write(std::ostream & os) const;
///
std::string type;
///
std::string placement;
+ ///
+ std::string alignment;
/// span columns
bool wide;
///
/////////////////////////////////////////////////////////////////////////
/// Used for "floating" objects like tables, figures etc.
-class InsetFloat : public InsetCollapsable
+class InsetFloat : public InsetCaptionable
{
public:
- ///
- InsetFloat(Buffer * buffer, std::string params_str);
-
+ InsetFloat(Buffer * buffer, std::string const & params_str);
///
static void string2params(std::string const &, InsetFloatParams &);
///
///
InsetFloatParams const & params() const { return params_; }
///
- bool allowsCaptionVariation() const { return !params_.subfloat; }
+ bool allowsCaptionVariation(std::string const &) const;
+ ///
+ LyXAlignment contentAlignment() const;
+ ///
+ bool forceParDirectionSwitch() const { return true; }
private:
+ ///
+ void setCaptionType(std::string const & type);
///
docstring layoutName() const;
///
///
void latex(otexstream &, OutputParams const &) const;
///
- int plaintext(odocstream &, OutputParams const &) const;
+ int plaintext(odocstringstream & ods, OutputParams const & op,
+ size_t max_length = INT_MAX) const;
///
- int docbook(odocstream &, OutputParams const &) const;
+ void docbook(XMLStream &, OutputParams const &) const;
///
- docstring xhtml(XHTMLStream &, OutputParams const &) const;
+ docstring xhtml(XMLStream &, OutputParams const &) const;
///
bool insetAllowed(InsetCode) const;
- /** returns false if, when outputing LaTeX, font changes should
+ /** returns false if, when outputting 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; }
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
- // Update the counters of this inset and of its contents
- void updateBuffer(ParIterator const &, UpdateType);
+ ///
+ bool hasSubCaptions(ParIterator const & it) const;
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
Inset * clone() const { return new InsetFloat(*this); }
+ /// Is the content of this inset part of the immediate (visible) text sequence?
+ bool isPartOfTextSequence() const { return false; }
+ ///
+ TexString getCaption(OutputParams const &) const;
///
- docstring getCaption(OutputParams const &) const;
+ std::string getAlignment() const;
///
+ OutputParams::CtObject CtObject(OutputParams const &) const { return OutputParams::CT_OMITOBJECT; }
+
InsetFloatParams params_;
};