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/gettext.h"
27 #include "support/lassert.h"
34 GuiToc::GuiToc(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
35 : DockView(parent, "toc", qt_("Outline"), area, flags), is_closing_(false)
37 widget_ = new TocWidget(parent, this);
39 setFocusProxy(widget_);
49 void GuiToc::updateView()
51 widget_->updateView();
56 bool GuiToc::initialiseParams(string const & data)
58 widget_->init(toqstr(data));
63 void GuiToc::dispatchParams()
68 void GuiToc::enableView(bool enable)
71 // In the opposite case, updateView() will be called anyway.
72 widget_->updateView();
76 void GuiToc::closeEvent(QCloseEvent * /*event*/)
79 ((GuiView *)parent())->updateToolbars();
84 void GuiToc::doDispatch(Cursor & cur, FuncRequest const & cmd)
86 widget_->doDispatch(cur, cmd);
90 bool GuiToc::getStatus(Cursor & cur, FuncRequest const & cmd,
91 FuncStatus & status) const
93 return widget_->getStatus(cur, cmd, status);
97 Dialog * createGuiToc(GuiView & lv)
101 // On Mac show at the right and floating
102 toc = new GuiToc(lv, Qt::RightDockWidgetArea);
103 toc->setFloating(true);
105 toc = new GuiToc(lv);
111 } // namespace frontend
114 #include "moc_GuiToc.cpp"