4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Kalle Dalheimer
9 * \author Angus Leeming
10 * \author Abdelrazak Younes
12 * Full author contact details are available in file CREDITS.
20 #include "insets/InsetCommandParams.h"
22 #include "TocBackend.h"
25 #include <QStandardItemModel>
26 #include <QStringListModel>
36 class GuiToc : public DockView
43 GuiViewBase & parent, ///< the main window where to dock.
44 Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
45 Qt::WindowFlags flags = 0);
50 bool initialiseParams(std::string const & data);
53 /// Test if outlining operation is possible
54 bool canOutline(int type) const;
56 QStandardItemModel * tocModel(int type);
58 QModelIndex currentIndex(int type) const;
60 void goTo(int type, QModelIndex const & index);
64 int getTocDepth(int type);
67 /// Signal that the internal toc_models_ has been reset.
74 std::vector<TocModel *> toc_models_;
78 TocList const & tocs() const;
80 /// Return the list of types available
81 std::vector<docstring> const & typeNames() const
82 { return type_names_; }
85 int selectedType() { return selected_type_; }
87 /// Return the first TocItem before the cursor
88 TocIterator currentTocItem(int type) const;
90 /// Apply the selected outlining operation
101 std::vector<std::string> types_;
102 std::vector<docstring> type_names_;
105 /// Return the guiname from a given cmdName of the TOC param
106 docstring guiName(std::string const & type) const;
108 /// clean-up on hide.
109 void clearParams() { params_.clear(); }
111 void dispatchParams();
113 bool isBufferDependent() const { return true; }
117 InsetCommandParams params_;
120 } // namespace frontend