*
* \author Angus Leeming
* \author Martin Vermeer
- * \author Jürgen Spitzmüller
+ * \author Jürgen Spitzmüller
*
* Full author contact details are available in file CREDITS.
*/
#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
+#include "output_xhtml.h"
#include "TextClass.h"
#include "support/debug.h"
+#include "support/docstream.h"
#include "support/gettext.h"
#include "support/lstrings.h"
#include "support/Translator.h"
//
/////////////////////////////////////////////////////////////////////////
-InsetBox::InsetBox(Buffer const & buffer, string const & label)
+InsetBox::InsetBox(Buffer * buffer, string const & label)
: InsetCollapsable(buffer), params_(label)
-{
- if (forcePlainLayout())
- paragraphs().back().setLayout(buffer.params().documentClass().plainLayout());
-}
+{}
InsetBox::~InsetBox()
}
-docstring InsetBox::editMessage() const
-{
- return _("Opened Box Inset");
-}
-
-
docstring InsetBox::name() const
{
// FIXME: UNICODE
params_.type = cmd.getArg(1);
else
string2params(to_utf8(cmd.argument()), params_);
- setLayout(cur.buffer().params());
break;
}
os << "\\framebox";
if (!params_.inner_box) {
os << "{\\makebox";
- // Special widths, see usrguide §3.5
+ // Special widths, see usrguide §3.5
// FIXME UNICODE
if (params_.special != "none") {
os << "[" << params_.width.value()
}
+docstring InsetBox::xhtml(XHTMLStream & xs, OutputParams const & runparams) const
+{
+ // construct attributes
+ string attrs = "class='" + params_.type + "'";
+ string style;
+ if (!params_.width.empty())
+ style += ("width: " + params_.width.asHTMLString() + "; ");
+ // The special heights don't really mean anything for us.
+ if (!params_.height.empty() && params_.height_special == "none")
+ style += ("height: " + params_.height.asHTMLString() + "; ");
+ if (!style.empty())
+ attrs += " style='" + style + "'";
+
+ xs << StartTag("div", attrs);
+ XHTMLOptions const opts = InsetText::WriteLabel | InsetText::WriteInnerTag;
+ docstring defer = InsetText::insetAsXHTML(xs, runparams, opts);
+ xs << EndTag("div");
+ xs << defer;
+ return docstring();
+}
+
+
void InsetBox::validate(LaTeXFeatures & features) const
{
BoxType btype = boxtranslator().find(params_.type);
features.require("framed");
break;
}
- InsetText::validate(features);
+ InsetCollapsable::validate(features);
}