1
/***************************************************************************
2
* notificationscroller.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 NOTIFICATIONSTACK_H
22
#define NOTIFICATIONSTACK_H
24
#include <QGraphicsWidget>
26
class QGraphicsLinearLayout;
29
class NotificationWidget;
33
class NotificationStack : public QGraphicsWidget
38
NotificationStack(QGraphicsItem *parent = 0);
41
void addNotification(Notification *notification);
44
void setCurrentNotification(Notification *notification);
46
NotificationWidget *currentNotificationWidget() const;
49
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
50
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
51
void mousePressEvent(QGraphicsSceneMouseEvent *event);
52
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
53
bool eventFilter(QObject *watched, QEvent *event);
56
void removeNotification(Notification *notification);
57
void delayedRemoveNotification(Notification *notification);
60
void popNotification();
61
void notificationChanged(Notification *notification);
65
void updateRequested();
70
QList<Notification *> m_notifications;
71
QList<Notification *> m_notificationsToRemove;
72
QHash<Notification *, NotificationWidget *> m_notificationWidgets;
73
QGraphicsLinearLayout *m_mainLayout;
76
QWeakPointer<NotificationWidget> m_currentNotificationWidget;
77
QTimer *m_delayedRemoveTimer;
78
QTimer *m_canDismissTimer;