]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiToc.h
* fix spelling in comments to please John.
[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         void closeEvent(QCloseEvent * event);
53         bool isClosing() const { return is_closing_; }
54
55 public:
56         /// clean-up on hide.
57         void clearParams() {}
58         ///
59         void dispatchParams();
60         ///
61         bool isBufferDependent() const { return true; }
62         ///
63         void doDispatch(Cursor & cur, FuncRequest const & fr);
64         ///
65         bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & fs) const;
66
67 private:
68         ///
69         TocWidget * widget_;
70         ///
71         bool is_closing_;
72 };
73
74 } // namespace frontend
75 } // namespace lyx
76
77 #endif // GUITOC_H