1
/***************************************************************************
2
* notificationgroup.h *
3
* Copyright (C) 2010 Marco Martin <notmart@gmail.com> *
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. *
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. *
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
***************************************************************************/
21
#ifndef NOTIFICATIONGROUP_H
22
#define NOTIFICATIONGROUP_H
25
#include <Plasma/Extender>
26
#include <Plasma/ExtenderGroup>
29
#include <Plasma/Plasma>
31
class QGraphicsLinearLayout;
39
class NotificationWidget;
44
//FIXME: for some reasons using Plasma::Extender directly doesn't build
45
typedef Plasma::Extender Extender;
47
class NotificationGroup : public Plasma::ExtenderGroup
52
NotificationGroup(Extender *parent, uint groupId = 0);
55
void addNotification(Notification *notification);
57
void filterNotificationsByOwner(const QString &owner);
61
void removeNotification(Notification *notification);
64
void tabSwitched(int index);
65
void extenderItemDestroyed(Plasma::ExtenderItem *object);
71
Plasma::TabBar *m_notificationBar;
73
//housekeeping data structures
74
QList<Notification *>m_notifications;
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;
82
QHash<Notification *, Plasma::ExtenderItem *>m_extenderItemsForNotification;
83
QHash<Plasma::ExtenderItem *, Notification *>m_notificationForExtenderItems;
85
QString m_currentFilter;
86
QGraphicsLinearLayout *m_tabsLayout;