]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToc.h
Whitespace.
[lyx.git] / src / frontends / qt4 / GuiToc.h
index 60d2cb5a649021b18c7e85510ee8e5be061c3929..5e759895a5168fb90d83e868e8d564c34547d161 100644 (file)
@@ -6,61 +6,72 @@
  *
  * \author John Levon
  * \author Kalle Dalheimer
+ * \author Angus Leeming
  * \author Abdelrazak Younes
  *
  * Full author contact details are available in file CREDITS.
  */
 
-#ifndef QTOC_H
-#define QTOC_H
+#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 ControlToc;
 class TocModel;
+class TocWidget;
 
-class GuiToc : public QObject, public ControlToc
+class GuiToc : public DockView
 {
        Q_OBJECT
+
 public:
+       ///
+       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(Dialog &, QObject * parent = 0);
-       virtual ~GuiToc() {}
+       ~GuiToc();
 
-       /// \c ControlToc inherited method.
-       virtual bool initialiseParams(std::string const & data);
        ///
-       void update();
-       ///
-       bool canOutline(int type) const;
+       bool initialiseParams(std::string const & data);
+       void updateView();
+       void enableView(bool enable);
+       bool wantInitialFocus() const { return false; }
+       void closeEvent(QCloseEvent * event);
+       bool isClosing() const { return is_closing_; }
 
-       QStandardItemModel * tocModel(int type);
+public:
+       /// clean-up on hide.
+       void clearParams() {}
        ///
-       QModelIndex const getCurrentIndex(int type) const;
+       void dispatchParams();
        ///
-       void goTo(int type, QModelIndex const & index);
+       bool isBufferDependent() const { return true; }
        ///
-       int getType();
+       void doDispatch(Cursor & cur, FuncRequest const & fr);
        ///
-       int getTocDepth(int type);
-
-Q_SIGNALS:
-       /// Signal that the internal toc_models_ has been reset.
-       void modelReset();
+       bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & fs) const;
 
 private:
        ///
-       std::vector<TocModel *> toc_models_;
+       TocWidget * widget_;
+       ///
+       bool is_closing_;
 };
 
 } // namespace frontend
 } // namespace lyx
 
-#endif // QTOC_H
+#endif // GUITOC_H