add more spacing
[personal-kdebase.git] / workspace / plasma / applets / systemtray / core / notification.cpp
blob7f782d0e3775d01dc8eb25f35e02974cbb382849
1 /***************************************************************************
2 * notification.cpp *
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 ***************************************************************************/
22 #include "notification.h"
24 #include <QtCore/QTimer>
26 #include <KDebug>
29 namespace SystemTray
33 class Notification::Private
35 public:
36 Private()
37 : timeout(0)
41 QString applicationName;
42 QIcon applicationIcon;
43 QString eventId;
44 QString message;
45 QString summary;
46 int timeout;
48 QHash<QString, QString> actions;
49 QStringList actionOrder;
53 Notification::Notification(QObject *parent)
54 : QObject(parent),
55 d(new Private)
60 Notification::~Notification()
62 emit destroyed(this);
63 delete d;
67 QString Notification::applicationName() const
69 return d->applicationName;
73 void Notification::setApplicationName(const QString &applicationName)
75 d->applicationName = applicationName;
79 QIcon Notification::applicationIcon() const
81 return d->applicationIcon;
85 void Notification::setApplicationIcon(const QIcon &applicationIcon)
87 d->applicationIcon = applicationIcon;
91 QString Notification::eventId() const
93 return d->eventId;
97 void Notification::setEventId(const QString &eventId)
99 d->eventId = eventId;
103 QString Notification::message() const
105 return d->message;
109 void Notification::setMessage(const QString &message)
111 d->message = message;
115 QString Notification::summary() const
117 return d->summary;
121 void Notification::setSummary(const QString &summary)
123 d->summary = summary;
127 int Notification::timeout() const
129 return d->timeout;
133 void Notification::setTimeout(int timeout)
135 d->timeout = timeout;
136 if (timeout) {
137 QTimer::singleShot(timeout, this, SLOT(deleteLater()));
142 QHash<QString, QString> Notification::actions() const
144 return d->actions;
148 void Notification::setActions(const QHash<QString, QString> &actions)
150 d->actions = actions;
154 QStringList Notification::actionOrder() const
156 return d->actionOrder;
160 void Notification::setActionOrder(const QStringList &actionOrder)
162 d->actionOrder = actionOrder;
166 void Notification::triggerAction(const QString &actionId)
168 Q_UNUSED(actionId);
169 kDebug() << "action triggered but no handler implemented";
176 #include "notification.moc"