]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/TocWidget.h
809d4600f3fa3318654335c6e49d3ba3abb579fb
[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 "Cursor.h"
19
20 #include <QWidget>
21
22 class QModelIndex;
23 class QString;
24
25 namespace lyx {
26 namespace frontend {
27
28 class GuiView;
29
30 class TocWidget : public QWidget, public Ui::TocUi
31 {
32         Q_OBJECT
33 public:
34         ///
35         TocWidget(GuiView & gui_view, QWidget * parent = 0);
36
37         /// Initialise GUI.
38         void init(QString const & str);
39
40         void doDispatch(Cursor & cur, FuncRequest const & fr);
41
42 public Q_SLOTS:
43         /// Update the display of the dialog whilst it is still visible.
44         void updateView();
45
46 protected Q_SLOTS:
47         ///
48         void select(QModelIndex const & index);
49         ///
50         void goTo(QModelIndex const &);
51
52         void on_tocTV_activated(QModelIndex const &);
53         void on_tocTV_pressed(QModelIndex const &);
54         void on_updateTB_clicked();
55         void on_sortCB_stateChanged(int state);
56         void on_persistentCB_stateChanged(int state);
57         void on_depthSL_valueChanged(int depth);
58         void on_typeCO_currentIndexChanged(int value);
59         void on_moveUpTB_clicked();
60         void on_moveDownTB_clicked();
61         void on_moveInTB_clicked();
62         void on_moveOutTB_clicked();
63
64         void showContextMenu(const QPoint & pos);
65
66 private:
67         ///
68         void enableControls(bool enable = true);
69         ///
70         void setTreeDepth(int depth);
71         ///
72         void outline(int func_code);
73         ///
74         QString current_type_;
75
76         /// depth of list shown
77         int depth_;
78         /// persistence of uncollapsed nodes in toc view
79         bool persistent_;
80         ///
81         GuiView & gui_view_;
82 };
83
84 } // namespace frontend
85 } // namespace lyx
86
87 #endif // TOC_WIDGET_H