2
* Copyright (C) 2011 Canonical, Ltd.
5
* Florian Boucault <florian.boucault@canonical.com>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; version 3.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
24
#include <QAbstractListModel>
28
#include <UnityCore/Filters.h>
29
#include <UnityCore/Filter.h>
34
class Filters : public QAbstractListModel
41
explicit Filters(unity::dash::Filters::Ptr unityFilters, QObject *parent = 0);
48
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
49
int rowCount(const QModelIndex& parent = QModelIndex()) const;
52
unity::dash::Filters::Ptr m_unityFilters;
53
QList<Filter*> m_filters;
55
void onFilterAdded(unity::dash::Filter::Ptr unityFilter);
56
void onFilterChanged(unity::dash::Filter::Ptr unityFilter);
57
void onFilterRemoved(unity::dash::Filter::Ptr unityFilter);
59
void addFilter(unity::dash::Filter::Ptr unityFilter, int index);
60
void removeFilter(int index);
62
int indexForFilter(unity::dash::Filter::Ptr unityFilter);
65
Q_DECLARE_METATYPE(Filters*)