9 #include "BufferView.h"
10 #include "frontends/LyXView.h"
11 #include "frontends/Dialogs.h"
19 string const InsetTOC::getScreenLabel(Buffer const *) const
21 string const cmdname(getCmdName());
23 if (cmdname == "tableofcontents")
24 return _("Table of Contents");
25 return _("Unknown toc list");
29 Inset::Code InsetTOC::lyxCode() const
31 string const cmdname(getCmdName());
32 if (cmdname == "tableofcontents")
33 return Inset::TOC_CODE;
34 return Inset::NO_CODE;
38 void InsetTOC::edit(BufferView * bv, int, int, mouse_button::state)
40 bv->owner()->getDialogs()->showTOC(this);
44 void InsetTOC::edit(BufferView * bv, bool)
46 edit(bv, 0, 0, mouse_button::none);
50 int InsetTOC::ascii(Buffer const * buffer, ostream & os, int) const
52 os << getScreenLabel(buffer) << "\n\n";
54 toc::asciiTocList(toc::getType(getCmdName()), buffer, os);
61 int InsetTOC::linuxdoc(Buffer const *, ostream & os) const
63 if (getCmdName() == "tableofcontents")
69 int InsetTOC::docbook(Buffer const *, ostream & os, bool) const
71 if (getCmdName() == "tableofcontents")