]> git.lyx.org Git - features.git/blob - src/frontends/qt4/GuiToc.h
1e73832cf41896604110d78522891a18f2bddf07
[features.git] / src / frontends / qt4 / GuiToc.h
1 // -*- C++ -*-
2 /**
3  * \file GuiToc.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 Kalle Dalheimer
9  * \author Angus Leeming
10  * \author Abdelrazak Younes
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef GUITOC_H
16 #define GUITOC_H
17
18 #include "DockView.h"
19
20 #include "insets/InsetCommandParams.h"
21
22 #include "TocBackend.h"
23
24 namespace lyx {
25 namespace frontend {
26
27 class TocModel;
28 class TocWidget;
29
30 class GuiToc : public DockView
31 {
32         Q_OBJECT
33
34 public:
35         ///
36         GuiToc(
37                 GuiView & parent, ///< the main window where to dock.
38                 Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
39                 Qt::WindowFlags flags = 0);
40
41         ~GuiToc();
42
43         ///
44         bool initialiseParams(std::string const & data);
45         void updateView();
46         void enableView(bool enable);
47         bool wantInitialFocus() const { return false; }
48         void closeEvent(QCloseEvent * event);
49         bool isClosing() const { return is_closing_; }
50
51 public:
52         /// clean-up on hide.
53         void clearParams() {}
54         ///
55         void dispatchParams();
56         ///
57         bool isBufferDependent() const { return true; }
58         ///
59         void doDispatch(Cursor & cur, FuncRequest const & fr);
60         ///
61         bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & fs) const;
62
63 private:
64         ///
65         TocWidget * widget_;
66         ///
67         bool is_closing_;
68 };
69
70 } // namespace frontend
71 } // namespace lyx
72
73 #endif // GUITOC_H