3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS
15 #include "BufferView.h"
16 #include "frontends/LyXView.h"
17 #include "frontends/Dialogs.h"
25 string const InsetTOC::getScreenLabel(Buffer const *) const
27 string const cmdname(getCmdName());
29 if (cmdname == "tableofcontents")
30 return _("Table of Contents");
31 return _("Unknown toc list");
35 Inset::Code InsetTOC::lyxCode() const
37 string const cmdname(getCmdName());
38 if (cmdname == "tableofcontents")
39 return Inset::TOC_CODE;
40 return Inset::NO_CODE;
44 void InsetTOC::edit(BufferView * bv, int, int, mouse_button::state)
46 bv->owner()->getDialogs().showTOC(this);
50 void InsetTOC::edit(BufferView * bv, bool)
52 edit(bv, 0, 0, mouse_button::none);
56 int InsetTOC::ascii(Buffer const * buffer, ostream & os, int) const
58 os << getScreenLabel(buffer) << "\n\n";
60 toc::asciiTocList(toc::getType(getCmdName()), buffer, os);
67 int InsetTOC::linuxdoc(Buffer const *, ostream & os) const
69 if (getCmdName() == "tableofcontents")
75 int InsetTOC::docbook(Buffer const *, ostream & os, bool) const
77 if (getCmdName() == "tableofcontents")