on 5b03213 help sign in
unity8/plugins/Unity/categoryresults.h
68 lines 1.7 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * Authors:
5 * Michal Hruby <michal.hruby@canonical.com>
6 *
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.
10 *
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.
15 *
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/>.
18 */
21#ifndef CATEGORY_RESULTS_H
22#define CATEGORY_RESULTS_H
24// dee-qt
25#include "deelistmodel.h"
27class Q_DECL_EXPORT CategoryResults : public DeeListModel
29 Q_OBJECT
31 Q_ENUMS(Roles)
33 Q_PROPERTY(int categoryIndex READ categoryIndex WRITE setCategoryIndex NOTIFY categoryIndexChanged)
35public:
36 explicit CategoryResults(QObject* parent = 0);
38 enum Roles {
39 RoleUri,
40 RoleIconHint,
41 RoleCategory,
42 RoleMimetype,
43 RoleTitle,
44 RoleComment,
45 RoleDndUri,
46 RoleMetadata,
47 RoleRendererHints
48 };
50 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
52 QHash<int, QByteArray> roleNames() const;
54 /* getters */
55 int categoryIndex() const;
57 /* setters */
58 void setCategoryIndex(int index);
60Q_SIGNALS:
61 void categoryIndexChanged(int index);
63private:
64 QHash<int, QByteArray> m_roles;
65 int m_categoryIndex;
66};
68#endif // CATEGORY_RESULTS_H