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

« back to all changes in this revision

Viewing changes to plasma/generic/applets/notifications/core/notification.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
 *   notification.h                                                        *
 
3
 *                                                                         *
 
4
 *   Copyright (C) 2008 Jason Stubbs <jasonbstubbs@gmail.com>              *
 
5
 *                                                                         *
 
6
 *   This program is free software; you can redistribute it and/or modify  *
 
7
 *   it under the terms of the GNU General Public License as published by  *
 
8
 *   the Free Software Foundation; either version 2 of the License, or     *
 
9
 *   (at your option) any later version.                                   *
 
10
 *                                                                         *
 
11
 *   This program is distributed in the hope that it will be useful,       *
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
14
 *   GNU General Public License for more details.                          *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU General Public License     *
 
17
 *   along with this program; if not, write to the                         *
 
18
 *   Free Software Foundation, Inc.,                                       *
 
19
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
 
20
 ***************************************************************************/
 
21
 
 
22
#ifndef NOTIFICATION_H
 
23
#define NOTIFICATION_H
 
24
 
 
25
#include <QImage>
 
26
#include <QtCore/QHash>
 
27
#include <QtCore/QObject>
 
28
 
 
29
#include <QtGui/QIcon>
 
30
 
 
31
 
 
32
 
 
33
class Notification : public QObject
 
34
{
 
35
    Q_OBJECT
 
36
 
 
37
public:
 
38
    Notification(QObject *parent = 0);
 
39
    virtual ~Notification();
 
40
 
 
41
    QString applicationName() const;
 
42
    QIcon applicationIcon() const;
 
43
    QString message() const;
 
44
    QString summary() const;
 
45
    int timeout() const;
 
46
    QImage image() const;
 
47
 
 
48
    void setUrgency(int urgency);
 
49
    int urgency() const;
 
50
 
 
51
    QHash<QString, QString> actions() const;
 
52
    QStringList actionOrder() const;
 
53
 
 
54
    bool isExpired() const;
 
55
 
 
56
    void setRead(const bool read);
 
57
    bool isRead() const;
 
58
 
 
59
    void setDeleteTimeout(const int time);
 
60
    int deleteTimeOut() const;
 
61
 
 
62
public slots:
 
63
    virtual void triggerAction(const QString &actionId);
 
64
    virtual void remove();
 
65
    virtual void linkActivated(const QString &link);
 
66
    void startDeletionCountdown();
 
67
    void hide();
 
68
    void destroy();
 
69
 
 
70
signals:
 
71
    void changed(Notification *notification = 0);
 
72
 
 
73
    /**
 
74
     * Emitted when the notification is about to be destroyed
 
75
     **/
 
76
    void notificationDestroyed(Notification *notification = 0);
 
77
 
 
78
    /**
 
79
     * emitted when the notification wants to hide itself
 
80
     */
 
81
    void expired(Notification *notification = 0);
 
82
 
 
83
protected:
 
84
    void setApplicationName(const QString &applicationName);
 
85
    void setApplicationIcon(const QIcon &applicationIcon);
 
86
    void setMessage(const QString &message);
 
87
    void setSummary(const QString &summary);
 
88
    void setImage(QImage image);
 
89
    void setTimeout(int timeout);
 
90
    void setActions(const QHash<QString, QString> &actions);
 
91
    void setActionOrder(const QStringList &actionOrder);
 
92
 
 
93
private:
 
94
    class Private;
 
95
    Private* const d;
 
96
};
 
97
 
 
98
 
 
99
 
 
100
#endif