~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to akonadi/akonadiconsole/notificationmodel.h

  • Committer: Bazaar Package Importer
  • Author(s): Christian Mangold
  • Date: 2009-07-10 06:34:50 UTC
  • mfrom: (1.1.40 upstream)
  • Revision ID: james.westby@ubuntu.com-20090710063450-neojgew2fh0n3y0u
Tags: 4:4.2.96-0ubuntu1
* New upstream release
* Bump kde build-deps to 4.2.96

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    Copyright (c) 2009 Volker Krause <vkrause@kde.org>
3
 
 
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.
8
 
 
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.
13
 
 
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,
17
 
    USA.
18
 
*/
19
 
 
20
 
#ifndef NOTIFICATIONMODEL
21
 
#define NOTIFICATIONMODEL
22
 
 
23
 
#include <akonadi/private/notificationmessage_p.h>
24
 
 
25
 
#include <QAbstractItemModel>
26
 
#include <QDateTime>
27
 
 
28
 
class NotificationModel : public QAbstractItemModel
29
 
{
30
 
  Q_OBJECT
31
 
  public:
32
 
    NotificationModel( QObject *parent );
33
 
 
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;
40
 
 
41
 
    bool isEnabled() const { return m_enabled; }
42
 
 
43
 
  public slots:
44
 
    void clear();
45
 
    void setEnabled( bool enable ) { m_enabled = enable; }
46
 
 
47
 
  private slots:
48
 
    void slotNotify( const Akonadi::NotificationMessage::List &msgs );
49
 
 
50
 
  private:
51
 
    struct NotificationBlock {
52
 
      NotificationBlock( const Akonadi::NotificationMessage::List &msgs );
53
 
      Akonadi::NotificationMessage::List msgs;
54
 
      QDateTime timestamp;
55
 
    };
56
 
    QList<NotificationBlock> m_data;
57
 
    bool m_enabled;
58
 
};
59
 
 
60
 
#endif