]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QTocDialog.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / QTocDialog.h
1 // -*- C++ -*-
2 /**
3  * \file QTocDialog.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 QTOCDIALOG_H
14 #define QTOCDIALOG_H
15
16 #include "ui/QTocUi.h"
17 #include "controllers/ControlToc.h"
18
19 #include <QDialog>
20
21 class QTreeViewItem;
22
23 namespace lyx {
24 namespace frontend {
25
26 class QToc;
27
28 class QTocDialog : public QDialog, public Ui::QTocUi, public Dialog::View  {
29         Q_OBJECT
30 public:
31         QTocDialog(Dialog &, QToc * form);
32
33         ~QTocDialog();
34
35         virtual void apply();
36
37         /// Hide the dialog from sight
38         void hide();
39
40         /// Redraw the dialog (e.g. if the colors have been remapped).
41         void redraw() {}
42
43         /// Create the dialog if necessary, update it and display it.
44         void show();
45
46         /// Update the display of the dialog whilst it is still visible.
47         void update();
48
49         /// Update Gui of the display.
50         void updateGui();
51
52         /// \return true if the dialog is visible.
53         bool isVisible() const;
54
55 protected Q_SLOTS:
56         ///
57         void select(QModelIndex const & index);
58         ///
59         void selectionChanged(const QModelIndex & current,
60                 const QModelIndex & previous);
61
62         void on_closePB_clicked();
63         void on_updatePB_clicked();
64         void on_depthSL_valueChanged(int depth);
65         void on_typeCO_activated(int value);
66         void on_moveUpPB_clicked();
67         void on_moveDownPB_clicked();
68         void on_moveInPB_clicked();
69         void on_moveOutPB_clicked();
70
71 protected:
72         ///
73         void enableButtons(bool enable = true);
74
75 private:
76
77         QToc * form_;
78
79         /// depth of list shown
80         int depth_;
81 };
82
83 } // namespace frontend
84 } // namespace lyx
85
86 #endif // QTOCDIALOG_H