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), is_closing_(false)
38 widget_ = new TocWidget(parent, this);
40 setFocusProxy(widget_);
50 void GuiToc::updateView()
52 widget_->updateView();
57 bool GuiToc::initialiseParams(string const & data)
59 widget_->init(toqstr(data));
64 void GuiToc::dispatchParams()
69 void GuiToc::enableView(bool enable)
71 widget_->checkModelChanged();
73 // In the opposite case, updateView() will be called anyway.
74 widget_->updateViewForce();
78 void GuiToc::closeEvent(QCloseEvent * /*event*/)
81 static_cast<GuiView *>(parent())->updateToolbars();
86 void GuiToc::doDispatch(Cursor & cur, FuncRequest const & cmd)
88 widget_->doDispatch(cur, cmd);
92 bool GuiToc::getStatus(Cursor & cur, FuncRequest const & cmd,
93 FuncStatus & status) const
95 return widget_->getStatus(cur, cmd, status);
99 Dialog * createGuiToc(GuiView & lv)
101 return new GuiToc(lv);
105 } // namespace frontend
108 #include "moc_GuiToc.cpp"