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),
37 widget_(new TocWidget(parent, this)),
41 setFocusProxy(widget_);
45 void GuiToc::updateView()
47 widget_->updateView();
51 bool GuiToc::initialiseParams(string const & data)
53 widget_->init(toqstr(data));
58 void GuiToc::dispatchParams()
63 void GuiToc::enableView(bool enable)
66 // In the opposite case, updateView() will be called anyway.
67 widget_->updateViewNow();
71 void GuiToc::closeEvent(QCloseEvent * /*event*/)
74 static_cast<GuiView *>(parent())->updateToolbars();
79 void GuiToc::doDispatch(Cursor & cur, FuncRequest const & cmd)
81 widget_->doDispatch(cur, cmd);
85 bool GuiToc::getStatus(Cursor & cur, FuncRequest const & cmd,
86 FuncStatus & status) const
88 return widget_->getStatus(cur, cmd, status);
92 Dialog * createGuiToc(GuiView & lv)
94 return new GuiToc(lv);
98 } // namespace frontend
101 #include "moc_GuiToc.cpp"