]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSelectionManager.h
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / GuiSelectionManager.h
index ac4671be456db74d4224904b3b1df86b6625ab54..43ceea7b50f703c8c449e245e87472f5f18c62c3 100644 (file)
 #include <QObject>
 #include <QKeyEvent>
 #include <QStringList>
-#include <QStringListModel>
+#include <QAbstractListModel>
 #include <QListView>
 #include <QPushButton>
 
+#include "support/qstring_helpers.h"
+
+#include <vector>
+
 namespace lyx {
 namespace frontend {
 
@@ -45,11 +49,13 @@ public:
                QPushButton * delPB, 
                QPushButton * upPB, 
                QPushButton * downPB,
-               QStringListModel * availableModel,
-               QStringListModel * selectedModel);
+               QAbstractListModel * availableModel,
+               QAbstractListModel * selectedModel);
        /// Sets the state of the various push buttons, depending upon the
        /// state of the widgets. (E.g., "delete" is enabled only if the
        /// selection is non-empty.)
+       /// Note: this is separated out into updateAddPB(), etc, below, 
+       /// for easy over-riding of these functions.
        void update();
        
        /// Not strictly a matter of focus, which may be elsewhere, but
@@ -79,6 +85,24 @@ protected:
        ///Given a QModelIndex from availableLV, determines whether it has
        ///been selected (i.e., is also in selectedLV).
        bool isSelected(const QModelIndex & idx);
+       ///
+       bool insertRowToSelected(int i, QMap<int, QVariant> const & itemData);
+       ///
+       QListView * availableLV;
+       ///
+       QListView * selectedLV;
+       ///
+       QPushButton * addPB;
+       ///
+       QPushButton * deletePB; 
+       ///
+       QPushButton * upPB;
+       ///
+       QPushButton * downPB;
+       ///
+       QAbstractListModel * availableModel;
+       ///
+       QAbstractListModel * selectedModel;
 
 protected Q_SLOTS:
        ///
@@ -86,13 +110,13 @@ protected Q_SLOTS:
        ///
        void selectedChanged(const QModelIndex & idx, const QModelIndex &);
        ///
-       void addPB_clicked();
+       virtual void addPB_clicked();
        ///
-       void deletePB_clicked();
+       virtual void deletePB_clicked();
        ///
-       void upPB_clicked();
+       virtual void upPB_clicked();
        ///
-       void downPB_clicked();
+       virtual void downPB_clicked();
        ///
        void availableLV_clicked(const QModelIndex &);
        ///
@@ -103,16 +127,15 @@ protected Q_SLOTS:
        bool eventFilter(QObject *, QEvent *);
 
 private:
-       QListView * availableLV;
-       QListView * selectedLV;
-       QPushButton * addPB;
-       QPushButton * deletePB; 
-       QPushButton * upPB;
-       QPushButton * downPB;
-       QStringListModel * availableModel;
-       QStringListModel * selectedModel;
-       //Dialog::View * dialog;
-       
+       ///
+       virtual void updateAddPB();
+       ///
+       virtual void updateDelPB();
+       ///
+       virtual void updateDownPB();
+       ///
+       virtual void updateUpPB();
+       ///
        bool selectedHasFocus_;
 };