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.
18 #include "TocBackend.h"
20 #include "insets/InsetCommandParams.h"
23 #include <QStandardItemModel>
24 #include <QStringListModel>
33 class GuiToc : public QObject, public Controller
42 bool initialiseParams(std::string const & data);
45 /// Test if outlining operation is possible
46 bool canOutline(int type) const;
48 QStandardItemModel * tocModel(int type);
50 QModelIndex currentIndex(int type) const;
52 void goTo(int type, QModelIndex const & index);
56 int getTocDepth(int type);
59 /// Signal that the internal toc_models_ has been reset.
63 friend class TocWidget;
65 std::vector<TocModel *> toc_models_;
68 TocList const & tocs() const;
70 /// Return the list of types available
71 std::vector<docstring> const & typeNames() const
72 { return type_names_; }
75 int selectedType() { return selected_type_; }
77 /// Return the first TocItem before the cursor
78 TocIterator currentTocItem(int type) const;
80 /// Apply the selected outlining operation
91 std::vector<std::string> types_;
92 std::vector<docstring> type_names_;
95 /// Return the guiname from a given cmdName of the TOC param
96 docstring guiName(std::string const & type) const;
99 void clearParams() { params_.clear(); }
101 void dispatchParams();
103 bool isBufferDependent() const { return true; }
107 InsetCommandParams params_;
110 } // namespace frontend