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
13 #pragma implementation
18 #include "BufferView.h"
19 #include "frontends/LyXView.h"
20 #include "frontends/Dialogs.h"
28 string const InsetTOC::getScreenLabel(Buffer const *) const
30 string const cmdname(getCmdName());
32 if (cmdname == "tableofcontents")
33 return _("Table of Contents");
34 return _("Unknown toc list");
38 Inset::Code InsetTOC::lyxCode() const
40 string const cmdname(getCmdName());
41 if (cmdname == "tableofcontents")
42 return Inset::TOC_CODE;
43 return Inset::NO_CODE;
47 void InsetTOC::edit(BufferView * bv, int, int, mouse_button::state)
49 bv->owner()->getDialogs().showTOC(this);
53 void InsetTOC::edit(BufferView * bv, bool)
55 edit(bv, 0, 0, mouse_button::none);
59 int InsetTOC::ascii(Buffer const * buffer, ostream & os, int) const
61 os << getScreenLabel(buffer) << "\n\n";
63 toc::asciiTocList(toc::getType(getCmdName()), buffer, os);
70 int InsetTOC::linuxdoc(Buffer const *, ostream & os) const
72 if (getCmdName() == "tableofcontents")
78 int InsetTOC::docbook(Buffer const *, ostream & os, bool) const
80 if (getCmdName() == "tableofcontents")