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