]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QTocDialog.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / QTocDialog.h
index cffca6679ad9621d3f2ed88e6d732e22bd796edc..df86647ebfd933388a257df00124c01aed2ac2e0 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 Q_SLOTS:
+       ///
+       void select(QModelIndex const & index);
+       ///
+       void selectionChanged(const QModelIndex & current,
+               const QModelIndex & previous);
+
+       void on_closePB_clicked();
+       void on_updatePB_clicked();
+       void on_depthSL_valueChanged(int depth);
+       void on_typeCO_activated(int value);
+       void on_moveUpPB_clicked();
+       void on_moveDownPB_clicked();
+       void on_moveInPB_clicked();
+       void on_moveOutPB_clicked();
 
-public slots:
-       void activate_adaptor(int);
-       void depth_adaptor(int);
-       void select_adaptor(QTreeWidgetItem *);
-       void update_adaptor();
 protected:
-       void closeEvent(QCloseEvent * e);
+       ///
+       void enableButtons(bool enable = true);
+
 private:
-       
-       void populateItem(QTreeWidgetItem * parentItem, toc::Toc::const_iterator& iter);
 
        QToc * form_;