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
13 #include "ControlToc.h"
14 #include "support/lstrings.h" // tostr
21 ControlToc::ControlToc(Dialog & d)
22 : ControlCommand(d, "toc")
26 void ControlToc::goTo(lyx::toc::TocItem const & item)
28 item.goTo(kernel().lyxview());
32 vector<string> const ControlToc::getTypes() const
34 return lyx::toc::getTypes(kernel().buffer());
38 lyx::toc::Toc const ControlToc::getContents(string const & type) const
40 lyx::toc::Toc empty_list;
42 // This shouldn't be possible...
43 if (!kernel().isBufferAvailable()) {
47 lyx::toc::TocList tmp = lyx::toc::getTocList(kernel().buffer());
48 lyx::toc::TocList::iterator it = tmp.find(type);
49 if (it == tmp.end()) {