3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
7 * \author Abdelrazak Younes
8 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS.
18 #include "TocWidget.h"
19 #include "qt_helpers.h"
22 #include "BufferView.h"
23 #include "BufferParams.h"
24 #include "FuncRequest.h"
26 #include "support/debug.h"
27 #include "support/gettext.h"
28 #include "support/lassert.h"
35 GuiToc::GuiToc(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
36 : DockView(parent, "toc", qt_("Outline"), area, flags)
38 widget_ = new TocWidget(parent, this);
49 void GuiToc::updateView()
52 widget_->updateView();
56 widget_->updateView();
57 // Special code for Mac drawer.
58 if (windowFlags() & Qt::Drawer && lyxview().isFullScreen()) {
59 setWindowFlags(Qt::Widget);
60 setFeatures(DockWidgetClosable);
61 // Setting features hides the dialog, see Qt's doc.
63 } else if (!(windowFlags() & Qt::Drawer)) {
64 setWindowFlags(Qt::Drawer);
65 setFeatures(NoDockWidgetFeatures);
66 // Setting features hides the dialog, see Qt's doc.
72 bool GuiToc::initialiseParams(string const & data)
74 widget_->init(toqstr(data));
79 void GuiToc::dispatchParams()
84 void GuiToc::enableView(bool enable)
87 // In the opposite case, updateView() will be called anyway.
88 widget_->updateView();
92 Dialog * createGuiToc(GuiView & lv)
94 GuiView & guiview = static_cast<GuiView &>(lv);
96 // On Mac show as a drawer at the right
97 return new GuiToc(guiview, Qt::RightDockWidgetArea, Qt::Drawer);
99 return new GuiToc(guiview);
104 } // namespace frontend
107 #include "GuiToc_moc.cpp"