#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>
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);
void modelReset();
private:
- friend class TocWidget;
+ ///
+ TocWidget * widget_;
///
std::vector<TocModel *> toc_models_;
+ ///
+ void clearTocModels();
+public:
///
TocList const & tocs() const;
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;
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