1
/***************************************************************************
2
* notificationwidget.h *
4
* Copyright (C) 2008 Dmitry Suzdalev <dimsuz@gmail.com> *
5
* Copyright (C) 2008 Rob Scheepmaker <r.scheepmaker@student.utwente.nl> *
6
* Copyright (C) 2008 Jason Stubbs <jasonbstubbs@gmail.com> *
7
* Copyright (C) 2010 Marco Martin <notmart@gmail.com> *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU Library General Public License as *
11
* published by the Free Software Foundation; either version 2 of the *
12
* License, or (at your option) any later version. *
14
* This program is distributed in the hope that it will be useful, *
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17
* GNU Library General Public License for more details. *
19
* You should have received a copy of the GNU Library General Public *
20
* License along with this library; if not, write to the *
21
* Free Software Foundation, Inc., *
22
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
23
***************************************************************************/
25
#ifndef NOTIFICATIONWIDGET_H
26
#define NOTIFICATIONWIDGET_H
28
#include <Plasma/Frame>
30
#include "../core/notification.h"
32
class NotificationWidgetPrivate;
35
* A graphics item, representing notification message.
37
class NotificationWidget : public QGraphicsWidget
40
Q_PROPERTY(qreal bodyHeight READ bodyHeight WRITE setBodyHeight)
43
NotificationWidget(Notification *notification, QGraphicsWidget *parent);
44
~NotificationWidget();
46
void setCollapsed(bool collapse, bool animate = true);
47
bool isCollapsed() const;
49
void setTitleBarVisible(bool visible);
50
bool isTitleBarVisible() const;
52
qreal bodyHeight() const;
53
void setBodyHeight(const qreal height);
55
Notification *notification() const;
58
void resizeEvent(QGraphicsSceneResizeEvent *event);
61
void actionTriggered(Notification *);
64
friend class NotificationWidgetPrivate;
65
NotificationWidgetPrivate* const d;
67
Q_PRIVATE_SLOT(d, void updateNotification())
68
Q_PRIVATE_SLOT(d, void buttonClicked())
69
Q_PRIVATE_SLOT(d, void hideFinished())
72
#endif // NOTIFICATIONWIDGET_H