+std::string Floating::docbookFloatType() const
+{
+ // All the work is done in the constructor.
+ return docbook_float_type_;
+}
+
+
+string Floating::docbookAttr() const
+{
+ return docbook_attr_;
+}
+
+
+string Floating::docbookTag(bool hasTitle) const
+{
+ // If there is a preconfigured tag, use it.
+ if (!docbook_tag_.empty())
+ return docbook_tag_;
+
+ // Otherwise, guess it.
+ if (docbookFloatType() == "figure" || docbookFloatType() == "algorithm" || docbookFloatType() == "video") {
+ return hasTitle ? "figure" : "informalfigure";
+ } else if (docbookFloatType() == "example") {
+ return hasTitle ? "example" : "informalexample";
+ } else if (docbookFloatType() == "table") {
+ return hasTitle ? "table" : "informaltable";
+ } else {
+ // If nothing matches, return something that will not be valid.
+ LYXERR(Debug::OUTFILE, "Float type '" + floattype() + "' unknown to DocBook!");
+ return "float";
+ }
+}
+
+
+string const & Floating::docbookTagType() const
+{
+ if (docbook_tag_type_ != "block" && docbook_tag_type_ != "paragraph" && docbook_tag_type_ != "inline")
+ docbook_tag_type_ = "block";
+ return docbook_tag_type_;
+}
+
+
+string const & Floating::docbookCaption() const
+{
+ if (!docbook_caption_.empty())
+ return docbook_caption_;
+
+ if (docbook_float_type_ == "figure" || docbook_float_type_ == "video" ||
+ docbook_float_type_ == "algorithm" || docbook_float_type_ == "example")
+ docbook_caption_ = "title";
+ else if (floattype_ == "table" || floattype_ == "tableau")
+ docbook_caption_ = "caption";
+ return docbook_caption_;
+}
+
+