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 InsetTOC::InsetTOC(InsetCommandParams const & p, bool same_id)
26 : InsetCommand(p, same_id)
32 InsetCommandMailer mailer("toc", *this);
37 string const InsetTOC::getScreenLabel(Buffer const *) const
39 string const cmdname(getCmdName());
41 if (cmdname == "tableofcontents")
42 return _("Table of Contents");
43 return _("Unknown toc list");
47 Inset::Code InsetTOC::lyxCode() const
49 string const cmdname(getCmdName());
50 if (cmdname == "tableofcontents")
51 return Inset::TOC_CODE;
52 return Inset::NO_CODE;
56 void InsetTOC::edit(BufferView *, int, int, mouse_button::state)
58 InsetCommandMailer mailer("toc", *this);
63 void InsetTOC::edit(BufferView * bv, bool)
65 edit(bv, 0, 0, mouse_button::none);
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")