~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to plasma/generic/applets/notifications/ui/notificationgroup.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   notificationgroup.h                                                *
 
3
 *   Copyright (C) 2010 Marco Martin <notmart@gmail.com>                   *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 *   This program is distributed in the hope that it will be useful,       *
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
13
 *   GNU General Public License for more details.                          *
 
14
 *                                                                         *
 
15
 *   You should have received a copy of the GNU General Public License     *
 
16
 *   along with this program; if not, write to the                         *
 
17
 *   Free Software Foundation, Inc.,                                       *
 
18
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
 
19
 ***************************************************************************/
 
20
 
 
21
#ifndef NOTIFICATIONGROUP_H
 
22
#define NOTIFICATIONGROUP_H
 
23
 
 
24
 
 
25
#include <Plasma/Extender>
 
26
#include <Plasma/ExtenderGroup>
 
27
 
 
28
 
 
29
#include <Plasma/Plasma>
 
30
 
 
31
class QGraphicsLinearLayout;
 
32
 
 
33
namespace Plasma
 
34
{
 
35
    class ExtenderItem;
 
36
    class TabBar;
 
37
}
 
38
 
 
39
class NotificationWidget;
 
40
 
 
41
 
 
42
class Notification;
 
43
 
 
44
//FIXME: for some reasons using Plasma::Extender directly doesn't build
 
45
typedef Plasma::Extender Extender;
 
46
 
 
47
class NotificationGroup : public Plasma::ExtenderGroup
 
48
{
 
49
    Q_OBJECT
 
50
 
 
51
public:
 
52
    NotificationGroup(Extender *parent, uint groupId = 0);
 
53
    ~NotificationGroup();
 
54
 
 
55
    void addNotification(Notification *notification);
 
56
 
 
57
    void filterNotificationsByOwner(const QString &owner);
 
58
 
 
59
 
 
60
public Q_SLOTS:
 
61
    void removeNotification(Notification *notification);
 
62
 
 
63
protected Q_SLOTS:
 
64
    void tabSwitched(int index);
 
65
    void extenderItemDestroyed(Plasma::ExtenderItem *object);
 
66
 
 
67
Q_SIGNALS:
 
68
    void scrollerEmpty();
 
69
 
 
70
private:
 
71
    Plasma::TabBar *m_notificationBar;
 
72
 
 
73
    //housekeeping data structures
 
74
    QList<Notification *>m_notifications;
 
75
 
 
76
    //Those two are kept on both ways since we are not sure the thing
 
77
    //contained in the hash is still valid so we couldn't obtain the
 
78
    //info to remove the proper key, unless both ways are stored
 
79
    QHash<QString, QSet<Notification *> > m_notificationsForApp;
 
80
    QHash<Notification *, QString> m_appForNotification;
 
81
 
 
82
    QHash<Notification *, Plasma::ExtenderItem *>m_extenderItemsForNotification;
 
83
    QHash<Plasma::ExtenderItem *, Notification *>m_notificationForExtenderItems;
 
84
 
 
85
    QString m_currentFilter;
 
86
    QGraphicsLinearLayout *m_tabsLayout;
 
87
};
 
88
 
 
89
 
 
90
#endif