1 /* This file is part of the KDE libraries
2 Copyright (C) 2005 Olivier Goffart <ogoffart at kde.org>
3 Copyright (C) 2006 Thiago Macieira <thiago@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef KNOTIFICATIONMANAGER_H
21 #define KNOTIFICATIONMANAGER_H
23 #include <knotification.h>
31 * @author Olivier Goffart
33 class KNotificationManager
: public QObject
37 static KNotificationManager
* self();
38 ~KNotificationManager();
41 * send the dbus call to the knotify server
43 bool notify(KNotification
*n
, const QPixmap
& pix
, const QStringList
&action
,
44 const KNotification::ContextList
& contexts
, const QString
&appname
);
47 * send the close dcop call to the knotify server for the notification with the identifier @p id .
48 * And remove the notification from the internal map
49 * @param id the id of the notification
50 * @param force if false, only close registered notification
52 void close(int id
, bool force
= false);
55 * Insert the notification and its id in the internal map
57 void insert(KNotification
*n
, int id
);
60 * update one notification text and pixmap and actions
62 void update(KNotification
*n
, int id
);
65 * re-emit the notification, eventually with new contexts
67 void reemit(KNotification
*n
, int id
);
70 void notificationClosed( int id
);
71 void notificationActivated( int id
, int action
);
76 KNotificationManager();