My Project
ModelInterface.h
1/*
2 * Copyright 2013 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 * Authors:
17 * MichaƂ Sawicz <michal.sawicz@canonical.com>
18 */
19
20
21#ifndef LOMIRI_SHELL_NOTIFICATIONS_MODELINTERFACE_H
22#define LOMIRI_SHELL_NOTIFICATIONS_MODELINTERFACE_H
23
24#include <lomiri/SymbolExport.h>
25
26#include <QtCore/QAbstractListModel>
27
28namespace lomiri
29{
30
31namespace shell
32{
33
34namespace notifications
35{
36
37
47class LOMIRI_API ModelInterface : public QAbstractListModel
48{
49 Q_OBJECT
50
60 Q_PROPERTY(bool confirmationPlaceholder READ confirmationPlaceholder WRITE setConfirmationPlaceholder NOTIFY confirmationPlaceholderChanged)
61
62protected:
64 explicit ModelInterface(QObject* parent = 0) : QAbstractListModel(parent) { }
66
67public:
68 virtual ~ModelInterface() { }
69
71 virtual bool confirmationPlaceholder() const = 0;
72 virtual void setConfirmationPlaceholder(bool confirmationPlaceholder) = 0;
74
80 enum Roles {
81 RoleType = Qt::UserRole + 1,
82 RoleUrgency = Qt::UserRole + 2,
83 RoleId = Qt::UserRole + 3,
84 RoleSummary = Qt::UserRole + 4,
85 RoleBody = Qt::UserRole + 5,
86 RoleValue = Qt::UserRole + 6,
87 RoleIcon = Qt::UserRole + 7,
88 RoleSecondaryIcon = Qt::UserRole + 8,
89 RoleActions = Qt::UserRole + 9,
90 RoleHints = Qt::UserRole + 10,
91 RoleNotification = Qt::UserRole + 11
92 };
93 Q_ENUM(Roles)
94
95Q_SIGNALS:
101 void confirmationPlaceholderChanged(bool confirmationPlaceholder);
102};
103
104} // namespace notifications
105
106} // namespace shell
107
108} // namespace lomiri
109
110#endif // LOMIRI_SHELL_NOTIFICATIONS_MODELINTERFACE_H
A list of notifications to be displayed.
Definition: ModelInterface.h:48
Roles
NotificationModel's data-role enumeration.
Definition: ModelInterface.h:80
void confirmationPlaceholderChanged(bool confirmationPlaceholder)
Top-level namespace for all things Lomiri-related.
Definition: Version.h:38