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