#include "InsetLayout.h"
#include "InsetList.h"
#include "Language.h"
-#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
#include "output_xhtml.h"
+#include "OutputParams.h"
#include "paragraph_funcs.h"
#include "ParagraphParameters.h"
#include "sgml.h"
}
+docstring const InsetCollapsable::buttonLabel(BufferView const &) const
+{
+ return labelstring_.empty() ? getLayout().labelstring() : labelstring_;
+}
+
+
void InsetCollapsable::setStatus(Cursor & cur, CollapseStatus status)
{
status_ = status;
}
-int InsetCollapsable::latex(odocstream & os,
- OutputParams const & runparams) const
-{
- // This implements the standard way of handling the LaTeX output of
- // a collapsable inset, either a command or an environment. Standard
- // collapsable insets should not redefine this, non-standard ones may
- // call this.
- if (!getLayout().latexname().empty()) {
- if (getLayout().latextype() == InsetLayout::COMMAND) {
- // FIXME UNICODE
- if (runparams.moving_arg)
- os << "\\protect";
- os << '\\' << from_utf8(getLayout().latexname());
- if (!getLayout().latexparam().empty())
- os << from_utf8(getLayout().latexparam());
- os << '{';
- } else if (getLayout().latextype() == InsetLayout::ENVIRONMENT) {
- os << "%\n\\begin{" << from_utf8(getLayout().latexname()) << "}\n";
- if (!getLayout().latexparam().empty())
- os << from_utf8(getLayout().latexparam());
- }
- }
- OutputParams rp = runparams;
- if (getLayout().isPassThru())
- rp.verbatim = true;
- if (getLayout().isNeedProtect())
- rp.moving_arg = true;
- int i = InsetText::latex(os, rp);
- if (!getLayout().latexname().empty()) {
- if (getLayout().latextype() == InsetLayout::COMMAND) {
- os << "}";
- } else if (getLayout().latextype() == InsetLayout::ENVIRONMENT) {
- os << "\n\\end{" << from_utf8(getLayout().latexname()) << "}\n";
- i += 4;
- }
- }
- return i;
-}
-
-
// FIXME It seems as if it ought to be possible to do this more simply,
// maybe by calling InsetText::docbook() in the middle there.
int InsetCollapsable::docbook(odocstream & os, OutputParams const & runparams) const
}
-void InsetCollapsable::validate(LaTeXFeatures & features) const
-{
- features.useInsetLayout(getLayout());
- InsetText::validate(features);
-}
-
-
bool InsetCollapsable::undefined() const
{
docstring const & n = getLayout().name();