]> git.lyx.org Git - features.git/blob - src/frontends/qt/GuiToc.h
Guard against possible referencing null.
[features.git] / src / frontends / qt / 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 namespace lyx {
21
22 class Cursor;
23 class DispatchResult;
24 class FuncStatus;
25
26 namespace frontend {
27
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 = {});
40
41         ///
42         bool initialiseParams(std::string const & data) override;
43         void updateView() override;
44         void enableView(bool enable) override;
45         bool wantInitialFocus() const override { return true; }
46         void closeEvent(QCloseEvent * event) override;
47         bool isClosing() const override { return is_closing_; }
48
49 public:
50         /// clean-up on hide.
51         void clearParams() override {}
52         ///
53         void dispatchParams() override;
54         ///
55         bool isBufferDependent() const override { return true; }
56         ///
57         void doDispatch(Cursor & cur, FuncRequest const & fr, DispatchResult & dr);
58         ///
59         bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & fs) const;
60
61 private:
62         ///
63         TocWidget * widget_;
64         ///
65         bool is_closing_;
66 };
67
68 } // namespace frontend
69 } // namespace lyx
70
71 #endif // GUITOC_H