]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/TocWidget.h
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[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 "GuiToc.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 = 0);
31
32         /// Update the display of the dialog whilst it is still visible.
33         void updateView();
34
35         /// Update Gui of the display.
36         void updateGui(int selected_type);
37
38 protected Q_SLOTS:
39         ///
40         void setTocModel(size_t type);
41         ///
42         void select(QModelIndex const & index);
43         ///
44         void selectionChanged(const QModelIndex & current,
45                 const QModelIndex & previous);
46
47         void on_updateTB_clicked();
48         void on_depthSL_valueChanged(int depth);
49         void on_typeCO_currentIndexChanged(int value);
50         void on_moveUpTB_clicked();
51         void on_moveDownTB_clicked();
52         void on_moveInTB_clicked();
53         void on_moveOutTB_clicked();
54         void setTreeDepth() { setTreeDepth(depth_); }
55
56 protected:
57         ///
58         void enableControls(bool enable = true);
59         ///
60         int getIndexDepth(QModelIndex const & index, int depth = -1);
61         ///
62         void setTreeDepth(int depth);
63
64 private:
65         /// Reconnects the selection model change signal when TOC changed.
66         void reconnectSelectionModel();
67         /// Disconnects the selection model.
68         //This is a workaround for a problem of signals blocking.
69         void disconnectSelectionModel();
70
71         /// depth of list shown
72         int depth_;
73         ///
74         GuiToc & form_;
75 };
76
77 } // namespace frontend
78 } // namespace lyx
79
80 #endif // TOC_WIDGET_H