2 * Copyright 2008 Alex Merry <alex.merry@kdemail.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
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 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this program. If not, see <http://www.gnu.org/licenses/>.
27 class QDBusConnectionInterface
;
28 class DBusPlayerFactory
;
30 class DBusWatcher
: public QObject
35 DBusWatcher(QObject
* parent
= 0);
37 QList
<Player::Ptr
> players();
40 * Adds a service to watch for.
42 * @param factory the factory for the player
44 void addFactory(DBusPlayerFactory
* factory
);
48 * A new service appeared on D-Bus
50 void newPlayer(Player::Ptr player
);
52 * A player disappeared from D-Bus
54 * @param player the now-invalid player
56 void playerDisappeared(Player::Ptr player
);
59 void serviceChange(const QString
& name
,
60 const QString
& oldOwner
,
61 const QString
& newOwner
);
64 QList
<DBusPlayerFactory
*> m_factories
;
65 QHash
<QString
,Player::Ptr
> m_players
;
66 QDBusConnectionInterface
* m_bus
;
69 #endif // DBUSWATCHER_H