X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiToc.h;h=5e759895a5168fb90d83e868e8d564c34547d161;hb=ee7dd4a11ea21851e7e32164c66b37d3bc8ac31d;hp=95beb91b43655c5f57c0511f5a61585f346f9fc1;hpb=faafd03726ed9d6e435bd1bc94c0a9de3b37416b;p=lyx.git diff --git a/src/frontends/qt4/GuiToc.h b/src/frontends/qt4/GuiToc.h index 95beb91b43..5e759895a5 100644 --- a/src/frontends/qt4/GuiToc.h +++ b/src/frontends/qt4/GuiToc.h @@ -15,13 +15,13 @@ #ifndef GUITOC_H #define GUITOC_H -#include "TocBackend.h" -#include "Dialog.h" +#include "DockView.h" + #include "insets/InsetCommandParams.h" -#include +#include "TocBackend.h" + #include -#include #include @@ -29,82 +29,46 @@ namespace lyx { namespace frontend { class TocModel; +class TocWidget; -class GuiToc : public QObject, public Controller +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(); /// bool initialiseParams(std::string const & data); - /// void updateView(); - /// Test if outlining operation is possible - bool canOutline(int type) const; - - QStandardItemModel * tocModel(int type); - /// - QModelIndex currentIndex(int type) const; - /// - void goTo(int type, QModelIndex const & index); - /// - int getType(); - /// - int getTocDepth(int type); - -Q_SIGNALS: - /// Signal that the internal toc_models_ has been reset. - void modelReset(); - -private: - friend class TocWidget; - /// - std::vector toc_models_; - - /// - TocList const & tocs() const; - - /// Return the list of types available - std::vector const & typeNames() const - { return type_names_; } - - /// - int selectedType() { return selected_type_; } - - /// Return the first TocItem before the cursor - TocIterator currentTocItem(int type) const; - - /// Apply the selected outlining operation - void outlineUp(); - /// - void outlineDown(); - /// - void outlineIn(); - /// - void outlineOut(); - /// - void updateBackend(); - - std::vector types_; - std::vector type_names_; - int selected_type_; - - /// Return the guiname from a given cmdName of the TOC param - docstring guiName(std::string const & type) const; + void enableView(bool enable); + bool wantInitialFocus() const { return false; } + void closeEvent(QCloseEvent * event); + bool isClosing() const { return is_closing_; } +public: /// clean-up on hide. - void clearParams() { params_.clear(); } + void clearParams() {} /// void dispatchParams(); /// bool isBufferDependent() const { return true; } + /// + void doDispatch(Cursor & cur, FuncRequest const & fr); + /// + bool getStatus(Cursor & cur, FuncRequest const & fr, FuncStatus & fs) const; private: /// - InsetCommandParams params_; + TocWidget * widget_; + /// + bool is_closing_; }; } // namespace frontend