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();
56 bool GuiToc::initialiseParams(string const & data)
58 widget_->init(toqstr(data));
63 void GuiToc::dispatchParams()
68 void GuiToc::enableView(bool enable)
70 widget_->checkModelChanged();
72 // In the opposite case, updateView() will be called anyway.
73 widget_->updateViewNow();
77 void GuiToc::closeEvent(QCloseEvent * /*event*/)
80 static_cast<GuiView *>(parent())->updateToolbars();
85 void GuiToc::doDispatch(Cursor & cur, FuncRequest const & cmd)
87 widget_->doDispatch(cur, cmd);
91 bool GuiToc::getStatus(Cursor & cur, FuncRequest const & cmd,
92 FuncStatus & status) const
94 return widget_->getStatus(cur, cmd, status);
98 Dialog * createGuiToc(GuiView & lv)
100 return new GuiToc(lv);
104 } // namespace frontend
107 #include "moc_GuiToc.cpp"