]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToc.h
Enable OK/Apply buttons when resetting to class defaults.
[lyx.git] / src / frontends / qt4 / GuiToc.h
index f73291f48f439433d0525cb16a31a2a34bccaedc..d403bc94f9b38a0d58541c494d71eb3295b4c05f 100644 (file)
 
 #include "DockView.h"
 
-#include "insets/InsetCommandParams.h"
-
-#include "TocBackend.h"
-
-#include <QObject>
-#include <QStandardItemModel>
-#include <QStringListModel>
-
-#include <vector>
-
 namespace lyx {
 namespace frontend {
 
@@ -44,79 +34,31 @@ public:
                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:
-       ///
-       TocWidget * widget_;
-       ///
-       std::vector<TocModel *> toc_models_;
-       ///             
-       void clearTocModels();
+       void enableView(bool enable);
+       bool wantInitialFocus() const { return false; }
+       void closeEvent(QCloseEvent * event);
+       bool isClosing() const { return is_closing_; }
 
 public:
-       ///
-       TocList const & tocs() const;
-
-       /// Return the list of types available
-       std::vector<docstring> 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<std::string> types_;
-       std::vector<docstring> type_names_;
-       int selected_type_;
-
-       /// Return the guiname from a given cmdName of the TOC param
-       docstring guiName(std::string const & type) const;
-
        /// 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