fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kdeui / util / knotificationmanager_p.h
blob2500abcd384be64277875bdb0df61d101fa0a1f3
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>
25 class KNotification;
26 class QPixmap;
27 class QStringList;
29 /**
30 * @internal
31 * @author Olivier Goffart
33 class KNotificationManager : public QObject
35 Q_OBJECT
36 public:
37 static KNotificationManager* self();
38 ~KNotificationManager();
40 /**
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);
46 /**
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);
54 /**
55 * Insert the notification and its id in the internal map
57 void insert(KNotification *n, int id);
59 /**
60 * update one notification text and pixmap and actions
62 void update(KNotification *n, int id);
64 /**
65 * re-emit the notification, eventually with new contexts
67 void reemit(KNotification *n, int id);
69 private Q_SLOTS:
70 void notificationClosed( int id );
71 void notificationActivated( int id, int action);
73 private:
74 struct Private;
75 Private * const d;
76 KNotificationManager();
79 #endif