Loading...
Searching...
No Matches
ModelInterface.h
/*
* Copyright 2013 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/>.
*
* Authors:
* Michał Sawicz <michal.sawicz@canonical.com>
*/
#ifndef LOMIRI_SHELL_NOTIFICATIONS_MODELINTERFACE_H
#define LOMIRI_SHELL_NOTIFICATIONS_MODELINTERFACE_H
#include <lomiri/SymbolExport.h>
#include <QtCore/QAbstractListModel>
namespace lomiri
{
namespace shell
{
namespace notifications
{
class LOMIRI_API ModelInterface : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(bool confirmationPlaceholder READ confirmationPlaceholder WRITE setConfirmationPlaceholder NOTIFY confirmationPlaceholderChanged)
protected:
explicit ModelInterface(QObject* parent = 0) : QAbstractListModel(parent) { }
public:
virtual ~ModelInterface() { }
virtual bool confirmationPlaceholder() const = 0;
virtual void setConfirmationPlaceholder(bool confirmationPlaceholder) = 0;
enum Roles {
RoleType = Qt::UserRole + 1,
RoleUrgency = Qt::UserRole + 2,
RoleId = Qt::UserRole + 3,
RoleSummary = Qt::UserRole + 4,
RoleBody = Qt::UserRole + 5,
RoleValue = Qt::UserRole + 6,
RoleIcon = Qt::UserRole + 7,
RoleSecondaryIcon = Qt::UserRole + 8,
RoleActions = Qt::UserRole + 9,
RoleHints = Qt::UserRole + 10,
RoleNotification = Qt::UserRole + 11
};
Q_ENUM(Roles)
Q_SIGNALS:
void confirmationPlaceholderChanged(bool confirmationPlaceholder);
};
} // namespace notifications
} // namespace shell
} // namespace lomiri
#endif // LOMIRI_SHELL_NOTIFICATIONS_MODELINTERFACE_H
lomiri::shell::notifications::ModelInterface
A list of notifications to be displayed.
Definition ModelInterface.h:48
lomiri::shell::notifications::ModelInterface::Roles
Roles
NotificationModel's data-role enumeration.
Definition ModelInterface.h:80
lomiri::shell::notifications::ModelInterface::RoleActions
@ RoleActions
Definition ModelInterface.h:89
lomiri::shell::notifications::ModelInterface::RoleValue
@ RoleValue
Definition ModelInterface.h:86
lomiri::shell::notifications::ModelInterface::RoleBody
@ RoleBody
Definition ModelInterface.h:85
lomiri::shell::notifications::ModelInterface::RoleSecondaryIcon
@ RoleSecondaryIcon
Definition ModelInterface.h:88
lomiri::shell::notifications::ModelInterface::RoleHints
@ RoleHints
Definition ModelInterface.h:90
lomiri::shell::notifications::ModelInterface::RoleUrgency
@ RoleUrgency
Definition ModelInterface.h:82
lomiri::shell::notifications::ModelInterface::RoleSummary
@ RoleSummary
Definition ModelInterface.h:84
lomiri::shell::notifications::ModelInterface::RoleId
@ RoleId
Definition ModelInterface.h:83
lomiri::shell::notifications::ModelInterface::RoleIcon
@ RoleIcon
Definition ModelInterface.h:87
lomiri::shell::notifications::ModelInterface::RoleNotification
@ RoleNotification
Definition ModelInterface.h:91
lomiri::shell::notifications::ModelInterface::confirmationPlaceholder
bool confirmationPlaceholder
Whether a placeholder for confirmation should be kept at the beginning.
Definition ModelInterface.h:60
lomiri::shell::notifications::ModelInterface::confirmationPlaceholderChanged
void confirmationPlaceholderChanged(bool confirmationPlaceholder)
lomiri
Top-level namespace for all things Lomiri-related.
Definition Version.h:38