]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToc.h
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / GuiToc.h
index 95beb91b43655c5f57c0511f5a61585f346f9fc1..99e0e6dba737e883d5e4cd064fcbf5850e57653c 100644 (file)
 #ifndef GUITOC_H
 #define GUITOC_H
 
-#include "TocBackend.h"
-#include "Dialog.h"
+#include "DockView.h"
+
 #include "insets/InsetCommandParams.h"
 
+#include "TocBackend.h"
+
 #include <QObject>
 #include <QStandardItemModel>
 #include <QStringListModel>
@@ -29,14 +31,20 @@ namespace lyx {
 namespace frontend {
 
 class TocModel;
+class TocWidget;
 
-class GuiToc : public QObject, public Controller
+class GuiToc : public DockView
 {
        Q_OBJECT
 
 public:
        ///
-       GuiToc(Dialog &);
+       GuiToc(
+               GuiView & parent, ///< the main window where to dock.
+               Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
+               Qt::WindowFlags flags = 0);
+
+       ~GuiToc();
 
        ///
        bool initialiseParams(std::string const & data);
@@ -60,10 +68,14 @@ Q_SIGNALS:
        void modelReset();
 
 private:
-       friend class TocWidget;
+       ///
+       TocWidget * widget_;
        ///
        std::vector<TocModel *> toc_models_;
+       ///             
+       void clearTocModels();
 
+public:
        ///
        TocList const & tocs() const;
 
@@ -71,9 +83,6 @@ private:
        std::vector<docstring> const & typeNames() const
        { return type_names_; }
 
-       ///
-       int selectedType() { return selected_type_; }
-
        /// Return the first TocItem before the cursor
        TocIterator currentTocItem(int type) const;
 
@@ -90,21 +99,16 @@ private:
 
        std::vector<std::string> types_;
        std::vector<docstring> type_names_;
-       int selected_type_;
 
        /// Return the guiname from a given cmdName of the TOC param
        docstring guiName(std::string const & type) const;
 
        /// clean-up on hide.
-       void clearParams() { params_.clear(); }
+       void clearParams() {}
        ///
        void dispatchParams();
        ///
        bool isBufferDependent() const { return true; }
-
-private:
-       ///
-       InsetCommandParams params_;
 };
 
 } // namespace frontend