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 "funcrequest.h"
16 #include "BufferView.h"
17 #include "frontends/LyXView.h"
18 #include "frontends/Dialogs.h"
26 InsetTOC::InsetTOC(InsetCommandParams const & p)
33 InsetCommandMailer mailer("toc", *this);
38 string const InsetTOC::getScreenLabel(Buffer const *) const
40 string const cmdname(getCmdName());
42 if (cmdname == "tableofcontents")
43 return _("Table of Contents");
44 return _("Unknown toc list");
48 Inset::Code InsetTOC::lyxCode() const
50 string const cmdname(getCmdName());
51 if (cmdname == "tableofcontents")
52 return Inset::TOC_CODE;
53 return Inset::NO_CODE;
57 dispatch_result InsetTOC::localDispatch(FuncRequest const & cmd)
61 InsetCommandMailer("toc", *this).showDialog(cmd.view());
64 return InsetCommand::localDispatch(cmd);
69 int InsetTOC::ascii(Buffer const * buffer, ostream & os, int) const
71 os << getScreenLabel(buffer) << "\n\n";
73 toc::asciiTocList(toc::getType(getCmdName()), buffer, os);
80 int InsetTOC::linuxdoc(Buffer const *, ostream & os) const
82 if (getCmdName() == "tableofcontents")
88 int InsetTOC::docbook(Buffer const *, ostream & os, bool) const
90 if (getCmdName() == "tableofcontents")