]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QTocDialog.h
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[lyx.git] / src / frontends / qt4 / QTocDialog.h
index 2647fb632803c12ce3ad0875f23ce718ad02b80f..dd9d60b90b7b829a29451e76cf0c3bf3c46de1bb 100644 (file)
 #include "controllers/ControlToc.h"
 
 #include <QDialog>
-#include <QCloseEvent>
 
-class QTreeWidget;
-class QTreeWidgetItem;
+class QTreeViewItem;
 
 namespace lyx {
 namespace frontend {
 
 class QToc;
 
-class QTocDialog : public QDialog, public Ui::QTocUi {
+class QTocDialog : public QDialog, public Ui::QTocUi, public Dialog::View  {
        Q_OBJECT
 public:
-       QTocDialog(QToc * form);
+       QTocDialog(Dialog &, QToc * form);
+
        ~QTocDialog();
 
-       /// update the listview
-       void updateToc(bool newdepth=false);
+       virtual void apply();
+
+       /// Hide the dialog from sight
+       void hide();
+
+       /// Redraw the dialog (e.g. if the colors have been remapped).
+       void redraw() {}
+
+       /// Create the dialog if necessary, update it and display it.
+       void show();
+
+       /// Update the display of the dialog whilst it is still visible.
+       void update();
 
-       /// update the float types
-       void updateType();
+       /// Update Gui of the display.
+       void updateGui();
+
+       /// \return true if the dialog is visible.
+       bool isVisible() const;
 
 protected slots:
        ///
-       void on_tocTW_currentItemChanged(QTreeWidgetItem * current,
-               QTreeWidgetItem * previous);
+       void select(QModelIndex const & index);
+       ///
+       void selectionChanged(const QModelIndex & current,
+               const QModelIndex & previous);
 
        void on_closePB_clicked();
        void on_updatePB_clicked();
@@ -54,13 +69,11 @@ protected slots:
        void on_moveOutPB_clicked();
 
 protected:
+       ///
        void enableButtons(bool enable = true);
-       void closeEvent(QCloseEvent * e);
 
 private:
 
-       void populateItem(QTreeWidgetItem * parentItem, toc::Toc::const_iterator& iter);
-
        QToc * form_;
 
        /// depth of list shown