X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiSelectionManager.h;h=ddb7d2c665dcd85de5e28b4a5d694dc1b7f61733;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=fa176327e76f99810d296a0fde165d9af31890c0;hpb=7c28905b177b8366531915903ac903a0fff716de;p=lyx.git diff --git a/src/frontends/qt4/GuiSelectionManager.h b/src/frontends/qt4/GuiSelectionManager.h index fa176327e7..ddb7d2c665 100644 --- a/src/frontends/qt4/GuiSelectionManager.h +++ b/src/frontends/qt4/GuiSelectionManager.h @@ -12,14 +12,15 @@ #ifndef GUISELECTIONMANAGER_H #define GUISELECTIONMANAGER_H -#include "Dialog.h" - #include -#include -#include -#include -#include -#include + +class QAbstractListModel; +class QModelIndex; +class QListView; +class QPushButton; +class QVariant; +class QAbstractItemView; +template class QMap; namespace lyx { namespace frontend { @@ -34,19 +35,19 @@ namespace frontend { */ class GuiSelectionManager : public QObject { -Q_OBJECT + Q_OBJECT public: /// GuiSelectionManager( - QListView * availableLV, + QAbstractItemView * availableLV, QListView * selectedLV, QPushButton * addPB, 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.) @@ -62,27 +63,29 @@ public: bool selectedFocused() { return selectedHasFocus_; }; Q_SIGNALS: - ///Emitted when the list of selected items has changed. + /// Emitted when the list of selected items has changed. void selectionChanged(); - ///Emitted when something has changed that might lead the containing - ///dialog to want to update---the focused subwidget or selected item. - ///(Specifically, it is emitted by *_PB_clicked() and *_LV_clicked.) - ///NOTE: No automatic update of the button state is done here. If you - ///just want to do that, connect updateHook() to updateView(). Much of the - ///time, though, you will want to do a bit more processing first, so - ///you can connect to some other function that itself calls updateView(). + /// Emitted when something has changed that might lead the containing + /// dialog to want to update---the focused subwidget or selected item. + /// (Specifically, it is emitted by *_PB_clicked() and *_LV_clicked.) + /// NOTE: No automatic update of the button state is done here. If you + /// just want to do that, connect updateHook() to updateView(). Much of the + /// time, though, you will want to do a bit more processing first, so + /// you can connect to some other function that itself calls updateView(). void updateHook(); - ///Emitted on Ctrl-Enter in the availableLV. Intended to be connected - ///to an "OK" event in the parent dialog. + /// Emitted on Ctrl-Enter in the availableLV. Intended to be connected + /// to an "OK" event in the parent dialog. void okHook(); protected: - ///Given a QModelIndex from availableLV, determines whether it has - ///been selected (i.e., is also in selectedLV). + /// Given a QModelIndex from availableLV, determines whether it has + /// been selected (i.e., is also in selectedLV). bool isSelected(const QModelIndex & idx); /// - QListView * availableLV; + bool insertRowToSelected(int i, QMap const & itemData); + /// + QAbstractItemView * availableLV; /// QListView * selectedLV; /// @@ -94,9 +97,9 @@ protected: /// QPushButton * downPB; /// - QStringListModel * availableModel; + QAbstractListModel * availableModel; /// - QStringListModel * selectedModel; + QAbstractListModel * selectedModel; protected Q_SLOTS: /// @@ -104,13 +107,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 &); /// @@ -129,7 +132,7 @@ private: virtual void updateDownPB(); /// virtual void updateUpPB(); - + /// bool selectedHasFocus_; };