+docstring InsetInfo::xhtml(XMLStream & xs, OutputParams const & rp) const
+{
+ // TODO: away from a release, merge some of this code with InsetInfo::build and InsetInfoParams::getArguments.
+ switch (params_.type) {
+ case InsetInfoParams::DATE_INFO:
+ case InsetInfoParams::MODDATE_INFO:
+ case InsetInfoParams::FIXDATE_INFO: {
+ std::string cssClass;
+ switch (params_.type) {
+ case InsetInfoParams::DATE_INFO:
+ cssClass = "current-date";
+ break;
+ case InsetInfoParams::MODDATE_INFO:
+ cssClass = "last-modification-date";
+ break;
+ case InsetInfoParams::FIXDATE_INFO:
+ cssClass = "fix-date";
+ break;
+ default:
+ lyxerr << "Assertion failed! InsetInfoParams::info_type: " << params().type;
+ break;
+ }
+
+ QDate date;
+ std::string date_format;
+ std::tie(date, date_format) = parseDate(buffer(), params_);
+
+ xml::openTag(xs, "span", std::string("class=\"infodate-") + cssClass + "\"", "inline");
+ xs << params_.getDate(date_format, date);
+ xml::closeTag(xs, "span", "inline");
+ break;
+ }
+
+ case InsetInfoParams::TIME_INFO:
+ case InsetInfoParams::MODTIME_INFO:
+ case InsetInfoParams::FIXTIME_INFO: {
+ std::string cssClass;
+ switch (params_.type) {
+ case InsetInfoParams::TIME_INFO:
+ cssClass = "current-time";
+ break;
+ case InsetInfoParams::MODTIME_INFO:
+ cssClass = "last-modification-time";
+ break;
+ case InsetInfoParams::FIXTIME_INFO:
+ cssClass = "fix-time";
+ break;
+ default:
+ lyxerr << "Assertion failed! InsetInfoParams::info_type: " << params().type;
+ break;
+ }
+
+ QTime time;
+ std::string time_format;
+ std::tie(time, time_format) = parseTime(buffer(), params_);
+
+ xml::openTag(xs, "span", std::string("class=\"infotime-") + cssClass + "\"", "inline");
+ xs << params_.getTime(time_format, time);
+ xml::closeTag(xs, "span", "inline");
+ break;
+ }
+
+ case InsetInfoParams::BUFFER_INFO:
+ xml::openTag(xs, "span", "class=\"buffer-info " + params_.name + "\"", "inline");
+ xs << getBufferInfo(buffer(), params_);
+ xml::closeTag(xs, "span", "inline");
+ break;
+ case InsetInfoParams::VCS_INFO:
+ xml::openTag(xs, "span", "class=\"vcs-info " + params_.name + "\"", "inline");
+ xs << getVCSInfo(buffer(), params_);
+ xml::closeTag(xs, "span", "inline");
+ break;
+ case InsetInfoParams::PACKAGE_INFO:
+ xml::openTag(xs, "span", "class=\"package-availability " + params_.name + "\"", "inline");
+ xs << getPackageInfo(params_);
+ xml::closeTag(xs, "span", "inline");
+ break;
+ case InsetInfoParams::TEXTCLASS_INFO:
+ xml::openTag(xs, "span", "class=\"textclass-availability " + params_.name + "\"", "inline");
+ xs << getTextClassInfo(params_);
+ xml::closeTag(xs, "span", "inline");
+ break;
+
+ case InsetInfoParams::SHORTCUTS_INFO:
+ case InsetInfoParams::SHORTCUT_INFO:
+ xhtmlShortcutInfo(xs, params_);
+ break;
+
+ case InsetInfoParams::LYXRC_INFO:
+ xml::openTag(xs, "span", "class=\"lyxrc-entry " + params_.name + "\"", "inline");
+ xs << getLyxRCInfo(params_);
+ xml::closeTag(xs, "span", "inline");
+ break;
+
+ case InsetInfoParams::MENU_INFO:
+ xhtmlMenuInfo(xs, buffer(), params_);
+ break;
+ case InsetInfoParams::ICON_INFO:
+ xhtmlIconInfo(xs, rp, buffer_, params_);
+ break;
+ case InsetInfoParams::LYX_INFO:
+ xml::openTag(xs, "span", "class=\"lyx-info " + params_.name + "\"", "inline");
+ xs << getLyXInfo(params_);
+ xml::closeTag(xs, "span", "inline");
+ break;
+
+ case InsetInfoParams::L7N_INFO:
+ xml::openTag(xs, "span", R"(class="localized" translate="no")", "inline");
+ xs << getNormalizedL7N(params_);
+ xml::closeTag(xs, "span", "inline");
+ break;
+
+ case InsetInfoParams::UNKNOWN_INFO:
+ xml::openTag(xs, "span", R"(class="unknown")", "inline");
+ xs << from_ascii("Unknown Info!");
+ xml::closeTag(xs, "span", "inline");
+ break;
+ default:
+ lyxerr << "Unrecognised InsetInfoParams::info_type: " << params().type;
+
+ xml::openTag(xs, "span", R"(class="unrecognized")", "inline");
+ xs << from_ascii("Unrecognized Info!");
+ xml::closeTag(xs, "span", "inline");
+ break;
+ }
+
+ return from_ascii("");
+}
+
+