Merge "qml: QML wouldn't load if there isn't DBUS support builtin"
[apps/mediaplayer.git] / app / dbus.h
index d533143..2dd6e34 100644 (file)
@@ -25,6 +25,7 @@
 #include <QtDBus/QDBusPendingCall>
 #include <QtDBus/QDBusPendingReply>
 #include <QtDBus/QDBusInterface>
+#include <QtDBus/QDBusReply>
 #include <QtDBus/QDBusConnection>
 
 #include "lightmediascanner.h"
@@ -33,14 +34,36 @@ class DbusService : public QObject {
     Q_OBJECT
 public:
     explicit DbusService(QObject *parent = 0);
+
     bool enableLMS();
+    bool enableBluetooth();
+    Q_INVOKABLE void processQMLEvent(const QString&);
+    Q_INVOKABLE long getCurrentPosition();
+
+private:
+    void setBluezPath(const QString& path);
+    QString getBluezPath() const;
+    bool checkIfPlayer(const QString& path) const;
+    bool deviceConnected(const QDBusConnection& system_bus);
+    void initialBluetoothData(const QDBusConnection& system_bus);
+    QString bluezPath;
 
 signals:
     void processPlaylistUpdate(const QVariantList& mediaFiles);
     void processPlaylistHide();
+    void processPlaylistShow();
+
+    void displayBluetoothMetadata(const QString& avrcp_artist, const QString& avrcp_title, const int avrcp_duration);
+    void stopPlayback();
+    void updatePosition(const int current_position);
+    void updatePlayerStatus(const QString status);
 
 private slots:
     void lmsUpdate(const QString&, const QVariantMap&, const QStringList&);
+    void mediaRemoved(const QDBusObjectPath&);
+    void newBluetoothDevice(const QDBusObjectPath&, const QVariantMap&);
+    void removeBluetoothDevice(const QDBusObjectPath&, const QStringList&);
+    void processBluetoothEvent(const QString&, const QVariantMap&, const QStringList&);
 };
 
 #endif