4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Abdelrazak Younes
9 * Full author contact details are available in file CREDITS.
15 #include "qt_helpers.h"
19 #include <QStandardItemModel>
20 #include <QStringList>
32 class TocTypeModel : public QStandardItemModel
36 TocTypeModel(QObject * parent = 0);
42 class TocModel : public QStandardItemModel
46 TocModel(QObject * parent = 0);
48 void reset(Toc const & toc);
52 TocItem const & tocItem(QModelIndex const & index) const;
54 QModelIndex modelIndex(DocIterator const & dit) const;
56 int modelDepth() const;
60 void populate(unsigned int & index, QModelIndex const & parent);
62 QList<QModelIndex> toc_indexes_;
71 class TocModels: public QObject
78 void reset(BufferView const * bv);
80 int depth(QString const & type);
82 QStandardItemModel * model(QString const & type);
84 QStandardItemModel * nameModel() { return names_; }
86 QModelIndex currentIndex(QString const & type) const;
88 void goTo(QString const & type, QModelIndex const & index) const;
90 void init(Buffer const & buffer);
92 void updateBackend() const;
95 /// Signal that the internal toc_models_ has been reset.
99 typedef QHash<QString, TocModel *>::const_iterator const_iterator;
100 typedef QHash<QString, TocModel *>::iterator iterator;
104 BufferView const * bv_;
106 QHash<QString, TocModel *> models_;
108 TocTypeModel * names_;
111 } // namespace frontend