3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS.
15 #include "ControlToc.h"
16 #include "funcrequest.h"
29 ControlToc::ControlToc(Dialog & d)
30 : ControlCommand(d, "toc")
34 void ControlToc::goTo(toc::TocItem const & item)
36 item.goTo(kernel().lyxview());
40 bool ControlToc::canOutline(string const & type)
46 void ControlToc::outline(toc::OutlineOp op)
49 o << op << std::flush;
50 kernel().dispatch(FuncRequest(LFUN_OUTLINE, o.str()));
54 vector<string> const ControlToc::getTypes() const
56 return toc::getTypes(kernel().buffer());
60 string const ControlToc::getGuiName(string const & type) const
63 return _("Table of Contents");
65 return _(toc::getGuiName(type, kernel().buffer()));
69 toc::Toc const ControlToc::getContents(string const & type) const
73 // This shouldn't be possible...
74 if (!kernel().isBufferAvailable()) {
78 toc::TocList tmp = toc::getTocList(kernel().buffer());
79 toc::TocList::iterator it = tmp.find(type);
80 if (it == tmp.end()) {
87 } // namespace frontend