]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiToc.h
Implement the getStatus mechanism for the context menu of the toc.
[lyx.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 #include <QStandardItemModel>
25
26 #include <vector>
27
28 namespace lyx {
29 namespace frontend {
30
31 class TocModel;
32 class TocWidget;
33
34 class GuiToc : public DockView
35 {
36         Q_OBJECT
37
38 public:
39         ///
40         GuiToc(
41                 GuiView & parent, ///< the main window where to dock.
42                 Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
43                 Qt::WindowFlags flags = 0);
44
45         ~GuiToc();
46
47         ///
48         bool initialiseParams(std::string const & data);
49         void updateView();
50         void enableView(bool enable);
51         bool wantInitialFocus() const { return false; }
52
53 public:
54         /// clean-up on hide.
55         void clearParams() {}
56         ///
57         void dispatchParams();
58         ///
59         bool isBufferDependent() const { return true; }
60         ///
61         void doDispatch(Cursor & cur, FuncRequest const & fr);
62         ///
63         bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & fs) const;
64
65 private:
66         ///
67         TocWidget * widget_;
68 };
69
70 } // namespace frontend
71 } // namespace lyx
72
73 #endif // GUITOC_H