My Project
Loading...
Searching...
No Matches
FiltersInterface.h
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef UNITY_SHELL_SCOPES_FILTERSINTERFACE_H
18#define UNITY_SHELL_SCOPES_FILTERSINTERFACE_H
19
20#include <unity/SymbolExport.h>
21
22#include <QAbstractListModel>
23
24namespace unity
25{
26namespace shell
27{
28namespace scopes
29{
30
31class UNITY_API FiltersInterface : public QAbstractListModel
32{
33 Q_OBJECT
34
35public:
36 enum Roles {
37 RoleFilterId = Qt::UserRole + 1,
38 RoleFilterType,
39 RoleFilter
40 };
41 Q_ENUM(Roles)
42
43 enum FilterType {
44 Invalid,
45 OptionSelectorFilter,
46 RangeInputFilter,
47 ValueSliderFilter,
48 ExpandableFilterWidget
49 // TODO add remaining filters
50 };
51 Q_ENUM(FilterType)
52
53 QHash<int, QByteArray> roleNames() const override
54 {
55 QHash<int, QByteArray> roles;
56 roles[RoleFilterId] = "id";
57 roles[RoleFilterType] = "type";
58 roles[RoleFilter] = "filter";
59 return roles;
60 }
61
62protected:
64 explicit FiltersInterface(QObject* parent = 0) : QAbstractListModel(parent) {}
66};
67
68}
69
70}
71}
72
74
75#endif
Definition: FiltersInterface.h:32
Top-level namespace for all things Unity-related.
Definition: Version.h:38