Loading...
Searching...
No Matches
PreviewModelInterface.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_PREVIEWMODELINTERFACE_H
#define UNITY_SHELL_SCOPES_PREVIEWMODELINTERFACE_H
#include <unity/SymbolExport.h>
#include <QAbstractListModel>
namespace unity
{
namespace shell
{
namespace scopes
{
class UNITY_API PreviewModelInterface : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(int widgetColumnCount READ widgetColumnCount WRITE setWidgetColumnCount NOTIFY widgetColumnCountChanged)
Q_PROPERTY(bool loaded READ loaded NOTIFY loadedChanged)
Q_PROPERTY(bool processingAction READ processingAction NOTIFY processingActionChanged)
protected:
explicit PreviewModelInterface(QObject* parent = 0) : QAbstractListModel(parent) { }
public:
enum Roles {
RoleColumnModel
};
Q_ENUM(Roles)
// @cond
virtual void setWidgetColumnCount(int count) = 0;
virtual int widgetColumnCount() const = 0;
virtual bool loaded() const = 0;
virtual bool processingAction() const = 0;
QHash<int, QByteArray> roleNames() const override
{
QHash<int, QByteArray> roles;
roles[RoleColumnModel] = "columnModel";
return roles;
}
// @endcond
Q_SIGNALS:
// @cond
void widgetColumnCountChanged();
void loadedChanged();
void processingActionChanged();
// @endcond
void triggered(QString const&, QString const&, QVariantMap const&);
};
}
}
}
Q_DECLARE_METATYPE(unity::shell::scopes::PreviewModelInterface*)
#endif
unity::shell::scopes::PreviewModelInterface
A list of PreviewWidgetModelInterface instances.
Definition PreviewModelInterface.h:38
unity::shell::scopes::PreviewModelInterface::loaded
bool loaded
Boolean specifying whether loading this preview finished.
Definition PreviewModelInterface.h:53
unity::shell::scopes::PreviewModelInterface::triggered
void triggered(QString const &, QString const &, QVariantMap const &)
Signal emitted when user triggers an action.
unity::shell::scopes::PreviewModelInterface::processingAction
bool processingAction
Boolean specifying whether an action is currently being performed.
Definition PreviewModelInterface.h:62
unity::shell::scopes::PreviewModelInterface::widgetColumnCount
int widgetColumnCount
Number of column models this preview should expose.
Definition PreviewModelInterface.h:48
unity::shell::scopes::PreviewModelInterface::Roles
Roles
The roles supported by this model.
Definition PreviewModelInterface.h:73
unity
Top-level namespace for all things Unity-related.
Definition Version.h:38