2 Copyright (c) 2009 Volker Krause <vkrause@kde.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20 #ifndef AKONADICONSOLE_NOTIFICATIONMODEL_H
21 #define AKONADICONSOLE_NOTIFICATIONMODEL_H
23 #include <akonadi/private/notificationmessagev3_p.h>
25 #include <QtCore/QAbstractItemModel>
26 #include <QtCore/QDateTime>
28 #include "notificationsourceinterface.h"
29 #include "notificationmanagerinterface.h"
31 class NotificationModel
: public QAbstractItemModel
35 explicit NotificationModel(QObject
*parent
);
38 int columnCount(const QModelIndex
&parent
= QModelIndex()) const Q_DECL_OVERRIDE
;
39 int rowCount(const QModelIndex
&parent
= QModelIndex()) const Q_DECL_OVERRIDE
;
40 QModelIndex
index(int row
, int column
, const QModelIndex
&parent
= QModelIndex()) const Q_DECL_OVERRIDE
;
41 QModelIndex
parent(const QModelIndex
&child
) const Q_DECL_OVERRIDE
;
42 QVariant
data(const QModelIndex
&index
, int role
= Qt::DisplayRole
) const Q_DECL_OVERRIDE
;
43 QVariant
headerData(int section
, Qt::Orientation orientation
, int role
= Qt::DisplayRole
) const Q_DECL_OVERRIDE
;
45 bool isEnabled() const
47 return m_source
!= Q_NULLPTR
;
52 void setEnabled(bool enable
);
55 void slotNotify(const Akonadi::NotificationMessageV3::List
&msgs
);
59 class NotificationBlock
;
60 class NotificationNode
;
61 class NotificationEntity
;
63 QList
<NotificationBlock
*> m_data
;
65 org::freedesktop::Akonadi::NotificationManager
*m_manager
;
66 org::freedesktop::Akonadi::NotificationSource
*m_source
;