X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiToc.h;h=5e759895a5168fb90d83e868e8d564c34547d161;hb=ee7dd4a11ea21851e7e32164c66b37d3bc8ac31d;hp=60d2cb5a649021b18c7e85510ee8e5be061c3929;hpb=a1cec91afaca91968b46e695533c10ad2a3f73d3;p=lyx.git diff --git a/src/frontends/qt4/GuiToc.h b/src/frontends/qt4/GuiToc.h index 60d2cb5a64..5e759895a5 100644 --- a/src/frontends/qt4/GuiToc.h +++ b/src/frontends/qt4/GuiToc.h @@ -6,61 +6,72 @@ * * \author John Levon * \author Kalle Dalheimer + * \author Angus Leeming * \author Abdelrazak Younes * * Full author contact details are available in file CREDITS. */ -#ifndef QTOC_H -#define QTOC_H +#ifndef GUITOC_H +#define GUITOC_H -#include "ControlToc.h" +#include "DockView.h" + +#include "insets/InsetCommandParams.h" + +#include "TocBackend.h" -#include #include -#include + +#include namespace lyx { namespace frontend { -class ControlToc; class TocModel; +class TocWidget; -class GuiToc : public QObject, public ControlToc +class GuiToc : public DockView { Q_OBJECT + public: + /// + GuiToc( + GuiView & parent, ///< the main window where to dock. + Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer) + Qt::WindowFlags flags = 0); - GuiToc(Dialog &, QObject * parent = 0); - virtual ~GuiToc() {} + ~GuiToc(); - /// \c ControlToc inherited method. - virtual bool initialiseParams(std::string const & data); /// - void update(); - /// - bool canOutline(int type) const; + bool initialiseParams(std::string const & data); + void updateView(); + void enableView(bool enable); + bool wantInitialFocus() const { return false; } + void closeEvent(QCloseEvent * event); + bool isClosing() const { return is_closing_; } - QStandardItemModel * tocModel(int type); +public: + /// clean-up on hide. + void clearParams() {} /// - QModelIndex const getCurrentIndex(int type) const; + void dispatchParams(); /// - void goTo(int type, QModelIndex const & index); + bool isBufferDependent() const { return true; } /// - int getType(); + void doDispatch(Cursor & cur, FuncRequest const & fr); /// - int getTocDepth(int type); - -Q_SIGNALS: - /// Signal that the internal toc_models_ has been reset. - void modelReset(); + bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & fs) const; private: /// - std::vector toc_models_; + TocWidget * widget_; + /// + bool is_closing_; }; } // namespace frontend } // namespace lyx -#endif // QTOC_H +#endif // GUITOC_H