Fix bug with app crash on exit. Add keyboard support in wordList, DictTypeSelectDialo...
[mdictionary] / src / mdictionary / gui / WordListModel.h
index abb128d..67ec197 100644 (file)
@@ -20,6 +20,7 @@ public:
     explicit WordListModel(QObject *parent = 0);
 
     int rowCount(const QModelIndex & parent = QModelIndex()) const;
+    void setBookmarkModeActive(bool mode);
 
     QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
     bool setData(const QModelIndex &index, const QVariant &value, int role);
@@ -34,6 +35,8 @@ public:
     //! Clear model data and refresh UI
     void clear();
 
+    QString wordOnPosition(int index);
+
     void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
 
 signals:
@@ -52,6 +55,13 @@ public slots:
       */
     void setModelProperty(int index, const QVariant value, QString role);
 
+    //! Reverse value at role in index row of data.
+    /*!
+      \param index word position in data list
+      \param role role name
+      */
+    void setModelPropertyByIndex(int index, QString role);
+
 private:
     int setDataPriv(int index, const QVariant &value, int role);
     void addWord(QString word, QList<Translation*> translations, bool isBookmarked);
@@ -60,6 +70,8 @@ private:
     QHash<QString, bool > _wordInBookmarks;
     QList<QString> _wordList;
 
+    bool _isBookmarkModeActive;
+
 };
 
 #endif // WORDLISTMODEL_H