]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlToc.h
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlToc.h
index fc3823b87115778cad3f9ac0e4795d5d565495f9..f71751c2fe4e12e41fa2c0cd37a68e1aa91d2589 100644 (file)
@@ -1,51 +1,46 @@
 // -*- C++ -*-
-/* This file is part of
- * ====================================================== 
- *
- *           LyX, The Document Processor
- *
- *           Copyright 2001 The LyX Team.
+/**
+ * \file ControlToc.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ======================================================
+ * \author Angus Leeming
  *
- * \file ControlToc.h
- * \author Angus Leeming <a.leeming@ic.ac.uk>
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef CONTROLTOC_H
 #define CONTROLTOC_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
 #include "ControlCommand.h"
-#include "buffer.h" // Buffer::SingleList
+#include "toc.h"
+#include <vector>
+
+namespace lyx {
+namespace frontend {
 
 /** A controller for TOC dialogs.
  */
-class ControlToc : public ControlCommand
-{
+class ControlToc : public ControlCommand {
 public:
        ///
-       ControlToc(LyXView &, Dialogs &);
+       ControlToc(Dialog &);
 
        /// Goto this paragraph id
-       void Goto(int const & id) const;
+       void goTo(toc::TocItem const &);
+
+       /// Return the list of types available
+       std::vector<std::string> const getTypes() const;
 
-       /// Returns a vector of list types in the document
-       std::vector<string> const getTypes() const;
+       /// Return the guiname from a given cmdName of the TOC param
+       std::string const getGuiName(std::string const & type) const;
 
        /// Given a type, returns the contents
-       Buffer::SingleList const getContents(string const & type) const;
+       toc::Toc const getContents(std::string const & type) const;
 };
 
-namespace toc 
-{
-    /** Given the cmdName of the TOC param, returns the type used
-       by ControlToc::getContents() */
-       string const getType(string const & cmdName);
-
-} // namespace toc
+} // namespace frontend
+} // namespace lyx
 
 #endif // CONTROLTOC_H