1 /*******************************************************************************
3 This file is part of mDictionary.
5 mDictionary is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 mDictionary is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
18 Copyright 2010 Comarch S.A.
20 *******************************************************************************/
22 /*! \file DictTypeModel.h
23 \brief Contains plugins data for qml UI
25 \author Marcin Kaźmierczak <marcin.kazmierczak@comarch.pl>
28 #ifndef DICTTYPEMODEL_H
29 #define DICTTYPEMODEL_H
31 #include <QAbstractListModel>
33 #include "../../include/GUIInterface.h"
36 Contains a list of plugin types.
37 Data source for qml list view.
39 class DictTypeModel : public QAbstractListModel
45 TypeRole = Qt::UserRole + 1,
51 \param plugins list of plugin types
52 \param parent parent of this class.
54 explicit DictTypeModel(QList<CommonDictInterface*> plugins, QObject *parent = 0);
56 int rowCount(const QModelIndex & parent = QModelIndex()) const;
58 QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
61 void setDictTypes(QList<CommonDictInterface*> plugins);
62 QList<CommonDictInterface*> _plugins;
64 void addType(CommonDictInterface* plugin);
67 #endif // DICTTYPEMODEL_H