1
/***************************************************************************
2
* Copyright 2009 by Marco Martin <notmart@gmail.com> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This program 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 *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18
***************************************************************************/
20
#ifndef STATUSNOTIFIERWATCHER_H
21
#define STATUSNOTIFIERWATCHER_H
23
#include <kdedmodule.h>
25
#include <QDBusContext>
27
#include <QStringList>
30
class QDBusServiceWatcher;
32
class StatusNotifierWatcher : public KDEDModule, protected QDBusContext
35
Q_PROPERTY(QStringList RegisteredStatusNotifierItems READ RegisteredStatusNotifierItems)
36
Q_PROPERTY(bool IsStatusNotifierHostRegistered READ IsStatusNotifierHostRegistered)
37
Q_PROPERTY(int ProtocolVersion READ ProtocolVersion)
40
StatusNotifierWatcher(QObject *parent, const QList<QVariant>&);
41
~StatusNotifierWatcher();
43
QStringList RegisteredStatusNotifierItems() const;
45
bool IsStatusNotifierHostRegistered() const;
47
int ProtocolVersion() const;
50
void RegisterStatusNotifierItem(const QString &service);
52
void RegisterStatusNotifierHost(const QString &service);
55
void serviceUnregistered(const QString& name);
58
void StatusNotifierItemRegistered(const QString &service);
59
//TODO: decide if this makes sense, the systray itself could notice the vanishing of items, but looks complete putting it here
60
void StatusNotifierItemUnregistered(const QString &service);
61
void StatusNotifierHostRegistered();
62
void StatusNotifierHostUnregistered();
65
QDBusServiceWatcher *m_serviceWatcher;
66
QStringList m_registeredServices;
67
QSet<QString> m_statusNotifierHostServices;