1 /***************************************************************************
4 * Copyright (C) 2008 Jason Stubbs <jasonbstubbs@gmail.com> *
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. *
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. *
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>
33 class Notification::Private
41 QString applicationName
;
42 QIcon applicationIcon
;
48 QHash
<QString
, QString
> actions
;
49 QStringList actionOrder
;
53 Notification::Notification(QObject
*parent
)
60 Notification::~Notification()
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
97 void Notification::setEventId(const QString
&eventId
)
103 QString
Notification::message() const
109 void Notification::setMessage(const QString
&message
)
111 d
->message
= message
;
115 QString
Notification::summary() const
121 void Notification::setSummary(const QString
&summary
)
123 d
->summary
= summary
;
127 int Notification::timeout() const
133 void Notification::setTimeout(int timeout
)
135 d
->timeout
= timeout
;
137 QTimer::singleShot(timeout
, this, SLOT(deleteLater()));
142 QHash
<QString
, QString
> Notification::actions() const
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
)
169 kDebug() << "action triggered but no handler implemented";
176 #include "notification.moc"