]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/TocWidget.h
c426534de0effc513a8cd581f1d24c02d8b84168
[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 "GuiDialog.h"
17 #include "ControlToc.h"
18 #include "ui_TocUi.h"
19
20
21 namespace lyx {
22 namespace frontend {
23
24 class GuiToc;
25
26 class TocWidget : public QWidget, public Ui::TocUi
27 {
28         Q_OBJECT
29 public:
30         TocWidget(GuiToc * form, QWidget * parent);
31
32         /// Update the display of the dialog whilst it is still visible.
33         void update();
34
35 protected Q_SLOTS:
36         /// Update Gui of the display.
37         void updateGui();
38         ///
39         void setTocModel(size_t type);
40         ///
41         void select(QModelIndex const & index);
42         ///
43         void selectionChanged(const QModelIndex & current,
44                 const QModelIndex & previous);
45
46         void on_updateTB_clicked();
47         void on_depthSL_valueChanged(int depth);
48         void on_typeCO_currentIndexChanged(int value);
49         void on_moveUpTB_clicked();
50         void on_moveDownTB_clicked();
51         void on_moveInTB_clicked();
52         void on_moveOutTB_clicked();
53
54 protected:
55         ///
56         void enableControls(bool enable = true);
57         ///
58         int getIndexDepth(QModelIndex const & index, int depth = -1);
59         ///
60         void setTreeDepth(int depth);
61
62 private:
63         /// Reconnects the selection model change signal when TOC changed.
64         void reconnectSelectionModel();
65         /// Disconnects the selection model.
66         //This is a workaround for a problem of signals blocking.
67         void disconnectSelectionModel();
68
69         /// depth of list shown
70         int depth_;
71         ///
72         GuiToc * form_;
73 };
74
75 } // namespace frontend
76 } // namespace lyx
77
78 #endif // TOC_WIDGET_H