My Project
Loading...
Searching...
No Matches
AppDrawerModelInterface.h
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include <lomiri/SymbolExport.h>
20
21#include <QAbstractListModel>
22
23namespace lomiri {
24namespace shell {
25namespace launcher {
26
32class LOMIRI_API AppDrawerModelInterface: public QAbstractListModel
33{
34 Q_OBJECT
35public:
41 enum Roles {
42 RoleAppId,
43 RoleName,
44 RoleIcon,
45 RoleKeywords,
46 RoleUsage
47 };
48 Q_ENUM(Roles)
49
50
51 AppDrawerModelInterface(QObject* parent = nullptr): QAbstractListModel(parent) {}
53
54 virtual ~AppDrawerModelInterface() {}
55
57 QHash<int, QByteArray> roleNames() const override {
58 QHash<int, QByteArray> roles;
59 roles.insert(RoleAppId, "appId");
60 roles.insert(RoleName, "name");
61 roles.insert(RoleIcon, "icon");
62 roles.insert(RoleKeywords, "keywords");
63 roles.insert(RoleUsage, "usage");
64 return roles;
65 }
67};
68
69}
70}
71}
A list of app drawer items to be displayed.
Definition: AppDrawerModelInterface.h:33
Roles
The Roles supported by the model.
Definition: AppDrawerModelInterface.h:41
Top-level namespace for all things Lomiri-related.
Definition: Version.h:38