--- /dev/null
+#ifndef DICTMANAGERMODEL_H
+#define DICTMANAGERMODEL_H
+
+#include <QAbstractListModel>
+#include <QHash>
+#include "../../include/GUIInterface.h"
+
+/*!
+ Contains a list of installed dictionaries.
+ Data source for qml list view.
+*/
+class DictManagerModel : public QAbstractListModel
+{
+ Q_OBJECT
+public:
+ enum DictTypeRoles
+ {
+ NameRole = Qt::UserRole + 1,
+ IconPathRole,
+ IsSelectedRole,
+ NumberRole
+ };
+
+ //! Constructor
+ /*!
+ \param dictionaries list of dictionaries
+ \param parent parent of this class.
+ */
+ explicit DictManagerModel(QHash<CommonDictInterface*, bool> dictionaries, QObject *parent = 0);
+
+ int rowCount(const QModelIndex & parent = QModelIndex()) const;
+
+ QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
+ bool setData(const QModelIndex &index, const QVariant &value, int role);
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ void setDictionaries(QHash<CommonDictInterface*, bool> dictionaries);
+
+ void clear();
+
+private:
+ QHash<CommonDictInterface*, bool> _dictionaries;
+ QList<CommonDictInterface*> _dictList;
+
+ void addDictionary(CommonDictInterface* dictionary, bool isActive);
+};
+
+#endif // DICTMANAGERMODEL_H