]> git.lyx.org Git - features.git/blob - src/frontends/qt4/QToc.h
Cleanup of the Toc model and controller: The objective is to let the View (TocWidget...
[features.git] / src / frontends / qt4 / QToc.h
1 // -*- C++ -*-
2 /**
3  * \file QToc.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  * \author Kalle Dalheimer
9  * \author Abdelrazak Younes
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef QTOC_H
15 #define QTOC_H
16
17 #include "ControlToc.h"
18
19 #include <QObject>
20 #include <QStandardItemModel>
21 #include <QStringListModel>
22
23 namespace lyx {
24 namespace frontend {
25
26 class ControlToc;
27 class TocModel;
28
29 class QToc : public QObject, public ControlToc
30 {
31         Q_OBJECT
32 public:
33
34         QToc(Dialog &);
35
36         void update();
37         ///
38         void updateToc();
39         ///
40         void updateType();
41
42         bool canOutline(int type) const;
43         
44         QStandardItemModel * tocModel(int type);
45
46         QStringListModel * typeModel()
47         { return &type_model_; }
48
49         ///
50         QModelIndex const getCurrentIndex(int type) const;
51         ///
52         void goTo(int type, QModelIndex const & index);
53         ///
54         int getType();
55         ///
56         int getTocDepth(int type);
57
58 Q_SIGNALS:
59         /// Signal that the internal toc_models_ has been reset.
60         void modelReset();
61
62 private:
63         ///
64         std::vector<TocModel *> toc_models_;
65         ///
66         QStringListModel type_model_;
67         ///
68         int type_;
69 };
70
71 } // namespace frontend
72 } // namespace lyx
73
74 #endif // QTOC_H