Loading...
Searching...
No Matches
AppDrawerModelInterface.h
/*
* Copyright 2016 Canonical Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <unity/SymbolExport.h>
#include <QAbstractListModel>
namespace unity {
namespace shell {
namespace launcher {
class UNITY_API AppDrawerModelInterface: public QAbstractListModel
{
Q_OBJECT
public:
enum Roles {
RoleAppId,
RoleName,
RoleIcon,
RoleKeywords,
RoleUsage
};
Q_ENUM(Roles)
AppDrawerModelInterface(QObject* parent = nullptr): QAbstractListModel(parent) {}
virtual ~AppDrawerModelInterface() {}
QHash<int, QByteArray> roleNames() const override {
QHash<int, QByteArray> roles;
roles.insert(RoleAppId, "appId");
roles.insert(RoleName, "name");
roles.insert(RoleIcon, "icon");
roles.insert(RoleKeywords, "keywords");
roles.insert(RoleUsage, "usage");
return roles;
}
};
}
}
}
unity::shell::launcher::AppDrawerModelInterface
A list of app drawer items to be displayed.
Definition AppDrawerModelInterface.h:33
unity::shell::launcher::AppDrawerModelInterface::Roles
Roles
The Roles supported by the model.
Definition AppDrawerModelInterface.h:41
unity
Top-level namespace for all things Unity-related.
Definition Version.h:38