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)
31 // InsetTOC::InsetTOC(InsetCommandParams const & p, bool same_id)
32 // : InsetCommand(p, same_id)
38 InsetCommandMailer mailer("toc", *this);
43 string const InsetTOC::getScreenLabel(Buffer const *) const
45 string const cmdname(getCmdName());
47 if (cmdname == "tableofcontents")
48 return _("Table of Contents");
49 return _("Unknown toc list");
53 Inset::Code InsetTOC::lyxCode() const
55 string const cmdname(getCmdName());
56 if (cmdname == "tableofcontents")
57 return Inset::TOC_CODE;
58 return Inset::NO_CODE;
62 dispatch_result InsetTOC::localDispatch(FuncRequest const & cmd)
66 InsetCommandMailer("toc", *this).showDialog(cmd.view());
74 int InsetTOC::ascii(Buffer const * buffer, ostream & os, int) const
76 os << getScreenLabel(buffer) << "\n\n";
78 toc::asciiTocList(toc::getType(getCmdName()), buffer, os);
85 int InsetTOC::linuxdoc(Buffer const *, ostream & os) const
87 if (getCmdName() == "tableofcontents")
93 int InsetTOC::docbook(Buffer const *, ostream & os, bool) const
95 if (getCmdName() == "tableofcontents")