X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiToc.h;h=5e759895a5168fb90d83e868e8d564c34547d161;hb=ee7dd4a11ea21851e7e32164c66b37d3bc8ac31d;hp=ac40c2fdae8c3c3ba755ca426dc8e292d1b0718f;hpb=9e3823945a9b5d02485f1d7c1609930f1869eec2;p=lyx.git diff --git a/src/frontends/qt4/GuiToc.h b/src/frontends/qt4/GuiToc.h index ac40c2fdae..5e759895a5 100644 --- a/src/frontends/qt4/GuiToc.h +++ b/src/frontends/qt4/GuiToc.h @@ -6,6 +6,7 @@ * * \author John Levon * \author Kalle Dalheimer + * \author Angus Leeming * \author Abdelrazak Younes * * Full author contact details are available in file CREDITS. @@ -14,49 +15,60 @@ #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 TocModel; +class TocWidget; -class GuiToc : public QObject, public ControlToc +class GuiToc : public DockView { Q_OBJECT public: /// - GuiToc(Dialog &); + 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(); - /// \c ControlToc inherited method. - virtual bool initialiseParams(std::string const & data); /// + bool initialiseParams(std::string const & data); void updateView(); - /// - bool canOutline(int type) const; + 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