]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiToc.cpp
Compil fix.
[lyx.git] / src / frontends / qt4 / GuiToc.cpp
1 /**
2  * \file GuiToc.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  * \author Abdelrazak Younes
8  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #include <config.h>
14
15 #include "GuiToc.h"
16 #include "GuiView.h"
17 #include "DockView.h"
18 #include "TocWidget.h"
19 #include "qt_helpers.h"
20
21 #include "Buffer.h"
22 #include "BufferView.h"
23 #include "BufferParams.h"
24 #include "FuncRequest.h"
25
26 #include "support/debug.h"
27 #include "support/gettext.h"
28 #include "support/lassert.h"
29
30 using namespace std;
31
32 namespace lyx {
33 namespace frontend {
34
35 GuiToc::GuiToc(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
36         : DockView(parent, "toc", qt_("Outline"), area, flags)
37 {
38         widget_ = new TocWidget(parent.tocModels(), &parent);
39         setWidget(widget_);
40 }
41
42
43 GuiToc::~GuiToc()
44 {
45         delete widget_;
46 }
47
48
49 void GuiToc::updateView()
50 {
51         widget_->updateView();
52 }
53
54
55 bool GuiToc::initialiseParams(string const & data)
56 {
57         widget_->init(toqstr(data));
58         return true;
59 }
60
61
62 void GuiToc::dispatchParams()
63 {
64 }
65
66
67 void GuiToc::enableView(bool enable)
68 {
69         widget_->setEnabled(enable);
70 }
71
72
73 Dialog * createGuiToc(GuiView & lv)
74 {
75         GuiView & guiview = static_cast<GuiView &>(lv);
76 #ifdef Q_WS_MACX
77         // On Mac show as a drawer at the right
78         return new GuiToc(guiview, Qt::RightDockWidgetArea, Qt::Drawer);
79 #else
80         return new GuiToc(guiview);
81 #endif
82 }
83
84
85 } // namespace frontend
86 } // namespace lyx
87
88 #include "GuiToc_moc.cpp"