#include "InsetIndex.h"
+#include "Buffer.h"
#include "DispatchResult.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "support/gettext.h"
#include "LaTeXFeatures.h"
#include "MetricsInfo.h"
#include "sgml.h"
+#include "TocBackend.h"
+
+#include "support/gettext.h"
#include <ostream>
+using namespace std;
namespace lyx {
-using std::string;
-using std::ostream;
-
InsetIndex::InsetIndex(BufferParams const & bp)
: InsetCollapsable(bp)
}
-void InsetIndex::write(Buffer const & buf, std::ostream & os) const
+void InsetIndex::write(Buffer const & buf, ostream & os) const
{
os << to_utf8(name()) << "\n";
InsetCollapsable::write(buf, os);
}
+void InsetIndex::addToToc(Buffer const & buf,
+ ParConstIterator const & cpit) const
+{
+ ParConstIterator pit = cpit;
+ pit.push_back(*this);
+
+ Toc & toc = buf.tocBackend().toc("index");
+ docstring str;
+ str = getNewLabel(str);
+ toc.push_back(TocItem(pit, 0, str));
+}
+
+
InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
: InsetCommand(p, string())
{}
-CommandInfo const * InsetPrintIndex::findInfo(std::string const & /* cmdName */)
+CommandInfo const * InsetPrintIndex::findInfo(string const & /* cmdName */)
{
static const char * const paramnames[] = {"name", ""};
static const bool isoptional[] = {false};
return INDEX_PRINT_CODE;
}
-
} // namespace lyx