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 // Special code for Mac drawer.
57 if (windowFlags() & Qt::Drawer && lyxview().isFullScreen()) {
58 setWindowFlags(Qt::Widget);
59 setFeatures(DockWidgetClosable);
61 } else if (!(windowFlags() & Qt::Drawer)) {
62 setWindowFlags(Qt::Drawer);
63 setFeatures(NoDockWidgetFeatures);
64 // Setting features hides the dialog, see Qt's doc.
67 widget_->updateView();
71 bool GuiToc::initialiseParams(string const & data)
73 widget_->init(toqstr(data));
78 void GuiToc::dispatchParams()
83 void GuiToc::enableView(bool enable)
85 widget_->setEnabled(enable);
89 Dialog * createGuiToc(GuiView & lv)
91 GuiView & guiview = static_cast<GuiView &>(lv);
93 // On Mac show as a drawer at the right
94 return new GuiToc(guiview, Qt::RightDockWidgetArea, Qt::Drawer);
96 return new GuiToc(guiview);
101 } // namespace frontend
104 #include "GuiToc_moc.cpp"