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 NOTIFICATIONMODEL
21
#define NOTIFICATIONMODEL
23
#include <akonadi/private/notificationmessage_p.h>
25
#include <QAbstractItemModel>
28
class NotificationModel : public QAbstractItemModel
32
NotificationModel( QObject *parent );
34
int columnCount(const QModelIndex& parent = QModelIndex()) const;
35
int rowCount(const QModelIndex& parent = QModelIndex()) const;
36
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
37
QModelIndex parent(const QModelIndex& child) const;
38
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
39
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
41
bool isEnabled() const { return m_enabled; }
45
void setEnabled( bool enable ) { m_enabled = enable; }
48
void slotNotify( const Akonadi::NotificationMessage::List &msgs );
51
struct NotificationBlock {
52
NotificationBlock( const Akonadi::NotificationMessage::List &msgs );
53
Akonadi::NotificationMessage::List msgs;
56
QList<NotificationBlock> m_data;