Merge branch 'master' of ssh://drop.maemo.org/git/mdictionary into qml
[mdictionary] / src / mdictionary / gui / HistoryListModel.h
1 #ifndef HISTORYLISTMODEL_H
2 #define HISTORYLISTMODEL_H
3
4 #include <QAbstractListModel>
5 #include <QHash>
6 #include "../../include/GUIInterface.h"
7
8
9 class HistoryListModel : public QAbstractListModel
10 {
11     Q_OBJECT
12 public:
13     enum histotyTypeRoles
14     {
15         WordRole = Qt::UserRole + 1,
16         NumberRole
17     };
18     explicit HistoryListModel(QStringList words, QObject *parent = 0);
19
20     int rowCount(const QModelIndex & parent = QModelIndex()) const;
21
22     QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
23
24 private:
25     void setHistoryTypes(QStringList words);
26     void addType(QString word);
27
28     QStringList  _words;
29 };
30
31 #endif // HISTORYLISTMODEL_H