1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
11 * \author Angus Leeming <a.leeming@ic.ac.uk>
17 #pragma implementation
20 #include "ControlToc.h"
23 #include "BufferView.h"
25 #include "support/lstrings.h" // tostr
31 ControlToc::ControlToc(LyXView & lv, Dialogs & d)
32 : ControlCommand(lv, d, LFUN_TOC_INSERT)
36 void ControlToc::goTo(toc::TocItem const & item) const
42 vector<string> const ControlToc::getTypes() const
44 return toc::getTypes(lv_.view()->buffer());
48 toc::Toc const ControlToc::getContents(string const & type) const
52 // This shouldn't be possible...
53 if (!lv_.view()->available()) {
57 toc::TocList tmp = toc::getTocList(lv_.view()->buffer());
58 toc::TocList::iterator it = tmp.find(type);
59 if (it == tmp.end()) {