]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/TocWidget.h
e1c12479cfd19bbc8f17fd6b93730bcb47d1a756
[lyx.git] / src / frontends / qt4 / TocWidget.h
1 // -*- C++ -*-
2 /**
3  * \file TocWidget.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 Abdelrazak Younes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef TOC_WIDGET_H
14 #define TOC_WIDGET_H
15
16 #include "ui/QTocUi.h"
17
18 #include <QMainWindow>
19 #include <QWidget>
20
21 namespace lyx {
22 namespace frontend {
23
24 class QToc;
25
26 class TocWidget : public QWidget, public Ui::QTocUi {
27         Q_OBJECT
28 public:
29         TocWidget(QToc * form, QMainWindow * parent = 0);
30
31         /// Update the display of the dialog whilst it is still visible.
32         void update();
33
34 protected Q_SLOTS:
35         /// Update Gui of the display.
36         void updateGui();
37         ///
38         void select(QModelIndex const & index);
39         ///
40         void selectionChanged(const QModelIndex & current,
41                 const QModelIndex & previous);
42
43         void on_updatePB_clicked();
44         void on_depthSL_valueChanged(int depth);
45         void on_typeCO_activated(int value);
46         void on_moveUpPB_clicked();
47         void on_moveDownPB_clicked();
48         void on_moveInPB_clicked();
49         void on_moveOutPB_clicked();
50
51 protected:
52         ///
53         void enableButtons(bool enable = true);
54         ///
55         int getIndexDepth(QModelIndex const & index, int depth = -1);
56         ///
57         void setTreeDepth(int depth);
58
59 private:
60         /// Reconnects the selection model change signal when TOC changed.
61         void reconnectSelectionModel();
62
63         QToc * form_;
64
65         /// depth of list shown
66         int depth_;
67 };
68
69 } // namespace frontend
70 } // namespace lyx
71
72 #endif // TOC_WIDGET_H