]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToc.h
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / GuiToc.h
index ac40c2fdae8c3c3ba755ca426dc8e292d1b0718f..9621f3e8207efc8afd7663ef1e439f4ce9c2b6be 100644 (file)
@@ -6,6 +6,7 @@
  *
  * \author John Levon
  * \author Kalle Dalheimer
+ * \author Angus Leeming
  * \author Abdelrazak Younes
  *
  * Full author contact details are available in file CREDITS.
 #ifndef GUITOC_H
 #define GUITOC_H
 
-#include "ControlToc.h"
+#include "DockView.h"
+
+#include "insets/InsetCommandParams.h"
+
+#include "TocBackend.h"
 
-#include <QObject>
 #include <QStandardItemModel>
-#include <QStringListModel>
+
+#include <vector>
 
 namespace lyx {
 namespace frontend {
 
 class TocModel;
+class TocWidget;
 
-class GuiToc : public QObject, public ControlToc
+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();
 
-       /// \c ControlToc inherited method.
-       virtual bool initialiseParams(std::string const & data);
        ///
-       void updateView();
+       bool initialiseParams(std::string const & data);
        ///
+       void updateView();
+       /// Test if outlining operation is possible
        bool canOutline(int type) const;
 
        QStandardItemModel * tocModel(int type);
        ///
-       QModelIndex const getCurrentIndex(int type) const;
+       QModelIndex currentIndex(int type) const;
        ///
        void goTo(int type, QModelIndex const & index);
        ///
@@ -55,8 +66,48 @@ Q_SIGNALS:
        void modelReset();
 
 private:
+       ///
+       TocWidget * widget_;
        ///
        std::vector<TocModel *> toc_models_;
+       ///             
+       void clearTocModels();
+
+public:
+       ///
+       TocList const & tocs() const;
+
+       /// Return the list of types available
+       QStringList const & typeNames() const { return type_names_; }
+
+       /// Return the first TocItem before the cursor
+       TocIterator currentTocItem(int type) const;
+
+       /// Apply the selected outlining operation
+       void outlineUp();
+       ///
+       void outlineDown();
+       ///
+       void outlineIn();
+       ///
+       void outlineOut();
+       ///
+       void updateBackend();
+
+       /// Return the guiname from a given cmdName of the TOC param
+       docstring guiName(std::string const & type) const;
+
+       /// clean-up on hide.
+       void clearParams() {}
+       ///
+       void dispatchParams();
+       ///
+       bool isBufferDependent() const { return true; }
+
+       ///
+       QStringList types_;
+       ///
+       QStringList type_names_;
 };
 
 } // namespace frontend