*
* \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 <QObject>
-#include <QStandardItemModel>
-#include <QStringListModel>
+#include "DockView.h"
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);
- /// \c ControlToc inherited method.
- virtual bool initialiseParams(std::string const & data);
///
+ bool initialiseParams(std::string const & data);
void updateView();
- ///
- bool canOutline(int type) const;
+ 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