Loading...
Searching...
No Matches
PreviewWidgetModelInterface.h
/*
* Copyright (C) 2014 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UNITY_SHELL_SCOPES_PREVIEWWIDGETMODELINTERFACE_H
#define UNITY_SHELL_SCOPES_PREVIEWWIDGETMODELINTERFACE_H
#include <unity/SymbolExport.h>
#include <QAbstractListModel>
namespace unity
{
namespace shell
{
namespace scopes
{
class UNITY_API PreviewWidgetModelInterface : public QAbstractListModel
{
Q_OBJECT
protected:
explicit PreviewWidgetModelInterface(QObject* parent = 0) : QAbstractListModel(parent) { }
public:
enum Roles {
RoleWidgetId,
RoleType,
RoleProperties
};
Q_ENUM(Roles)
// @cond
QHash<int, QByteArray> roleNames() const override
{
QHash<int, QByteArray> roles;
roles[RoleWidgetId] = "widgetId";
roles[RoleType] = "type";
roles[RoleProperties] = "properties";
return roles;
}
// @endcond
};
}
}
}
Q_DECLARE_METATYPE(unity::shell::scopes::PreviewWidgetModelInterface*)
#endif
unity::shell::scopes::PreviewWidgetModelInterface
A list of widgets in a preview.
Definition PreviewWidgetModelInterface.h:37
unity::shell::scopes::PreviewWidgetModelInterface::Roles
Roles
The roles supported by this model.
Definition PreviewWidgetModelInterface.h:49
unity
Top-level namespace for all things Unity-related.
Definition Version.h:38