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

« back to all changes in this revision

Viewing changes to plasma/generic/applets/notifications/ui/notificationwidget.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
 *   notificationwidget.h                                                  *
 
3
 *                                                                         *
 
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>                   *
 
8
 *                                                                         *
 
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.                       *
 
13
 *                                                                         *
 
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.                  *
 
18
 *                                                                         *
 
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
 ***************************************************************************/
 
24
 
 
25
#ifndef NOTIFICATIONWIDGET_H
 
26
#define NOTIFICATIONWIDGET_H
 
27
 
 
28
#include <Plasma/Frame>
 
29
 
 
30
#include "../core/notification.h"
 
31
 
 
32
class NotificationWidgetPrivate;
 
33
 
 
34
/**
 
35
 *  A graphics item, representing notification message.
 
36
 */
 
37
class NotificationWidget : public QGraphicsWidget
 
38
{
 
39
    Q_OBJECT
 
40
    Q_PROPERTY(qreal bodyHeight READ bodyHeight WRITE setBodyHeight)
 
41
 
 
42
public:
 
43
    NotificationWidget(Notification *notification, QGraphicsWidget *parent);
 
44
    ~NotificationWidget();
 
45
 
 
46
    void setCollapsed(bool collapse, bool animate = true);
 
47
    bool isCollapsed() const;
 
48
 
 
49
    void setTitleBarVisible(bool visible);
 
50
    bool isTitleBarVisible() const;
 
51
 
 
52
    qreal bodyHeight() const;
 
53
    void setBodyHeight(const qreal height);
 
54
 
 
55
    Notification *notification() const;
 
56
 
 
57
protected:
 
58
    void resizeEvent(QGraphicsSceneResizeEvent *event);
 
59
 
 
60
Q_SIGNALS:
 
61
    void actionTriggered(Notification *);
 
62
 
 
63
private:
 
64
    friend class NotificationWidgetPrivate;
 
65
    NotificationWidgetPrivate* const d;
 
66
 
 
67
    Q_PRIVATE_SLOT(d, void updateNotification())
 
68
    Q_PRIVATE_SLOT(d, void buttonClicked())
 
69
    Q_PRIVATE_SLOT(d, void hideFinished())
 
70
};
 
71
 
 
72
#endif // NOTIFICATIONWIDGET_H