/* * Copyright 2007-2012 Alex Merry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License version 2 as * published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MPRIS2ENGINE_H #define MPRIS2ENGINE_H #include #include class QDBusPendingCallWatcher; class PlayerContainer; class Multiplexer; /** * The MPRIS2 data engine. */ class Mpris2Engine : public Plasma::DataEngine { Q_OBJECT public: Mpris2Engine(QObject* parent, const QVariantList& args); Plasma::Service* serviceForSource(const QString& source); virtual QStringList sources() const; protected: virtual bool sourceRequestEvent(const QString& source); virtual bool updateSourceEvent(const QString& source); private slots: void serviceOwnerChanged( const QString& serviceName, const QString& oldOwner, const QString& newOwner); void initialFetchFinished(PlayerContainer* container); void initialFetchFailed(PlayerContainer* container); void serviceNameFetchFinished(QDBusPendingCallWatcher* watcher); private: void addMediaPlayer(const QString& serviceName, const QString& sourceName); void createMultiplexer(); QWeakPointer m_multiplexer; }; K_EXPORT_PLASMA_DATAENGINE(mpris2, Mpris2Engine) #endif // MPRIS2ENGINE_H