#include "Buffer.h"
#include "DispatchResult.h"
#include "FuncRequest.h"
-#include "gettext.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
#include "TocBackend.h"
-#include "support/std_ostream.h"
+#include "support/gettext.h"
+#include <ostream>
-namespace lyx {
+using namespace std;
-using std::string;
-using std::ostream;
+namespace lyx {
InsetTOC::InsetTOC(InsetCommandParams const & p)
{}
-std::auto_ptr<InsetBase> InsetTOC::doClone() const
+ParamInfo const & InsetTOC::findInfo(string const & /* cmdName */)
{
- return std::auto_ptr<InsetBase>(new InsetTOC(*this));
+ static ParamInfo param_info_;
+ if (param_info_.empty()) {
+ param_info_.add("type", ParamInfo::LATEX_REQUIRED);
+ }
+ return param_info_;
}
-docstring const InsetTOC::getScreenLabel(Buffer const &) const
+docstring InsetTOC::screenLabel() const
{
if (getCmdName() == "tableofcontents")
- return _("Table of Contents");
- return _("Unknown toc list");
+ return buffer().B_("Table of Contents");
+ return _("Unknown TOC type");
}
-InsetBase::Code InsetTOC::lyxCode() const
+int InsetTOC::plaintext(odocstream & os, OutputParams const &) const
{
- if (getCmdName() == "tableofcontents")
- return InsetBase::TOC_CODE;
- return InsetBase::NO_CODE;
-}
-
-
-int InsetTOC::plaintext(Buffer const & buffer, odocstream & os,
- OutputParams const &) const
-{
- os << getScreenLabel(buffer) << "\n\n";
-
- buffer.tocBackend().writePlaintextTocList(getCmdName(), os);
-
+ os << screenLabel() << "\n\n";
+ buffer().tocBackend().writePlaintextTocList(getCmdName(), os);
return PLAINTEXT_NEWLINE;
}
-int InsetTOC::docbook(Buffer const &, odocstream & os,
- OutputParams const &) const
+int InsetTOC::docbook(odocstream & os, OutputParams const &) const
{
if (getCmdName() == "tableofcontents")
os << "<toc></toc>";