| 1 | /* |
| 2 | * BluezQt - Asynchronous Bluez wrapper library |
| 3 | * |
| 4 | * SPDX-FileCopyrightText: 2014-2015 David Rosca <nowrep@gmail.com> |
| 5 | * |
| 6 | * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 7 | */ |
| 8 | |
| 9 | #ifndef BLUEZQT_OBEXMANAGER_P_H |
| 10 | #define BLUEZQT_OBEXMANAGER_P_H |
| 11 | |
| 12 | #include <QObject> |
| 13 | #include <QTimer> |
| 14 | |
| 15 | #include "dbusobjectmanager.h" |
| 16 | #include "obexagentmanager1.h" |
| 17 | #include "obexclient1.h" |
| 18 | #include "types.h" |
| 19 | |
| 20 | namespace BluezQt |
| 21 | { |
| 22 | typedef org::bluez::obex::Client1 ObexClient; |
| 23 | typedef org::bluez::obex::AgentManager1 ObexAgentManager; |
| 24 | typedef org::freedesktop::DBus::ObjectManager DBusObjectManager; |
| 25 | |
| 26 | class ObexManager; |
| 27 | |
| 28 | class ObexManagerPrivate : public QObject |
| 29 | { |
| 30 | Q_OBJECT |
| 31 | |
| 32 | public: |
| 33 | explicit ObexManagerPrivate(ObexManager *qq); |
| 34 | |
| 35 | void init(); |
| 36 | void nameHasOwnerFinished(QDBusPendingCallWatcher *watcher); |
| 37 | void load(); |
| 38 | void getManagedObjectsFinished(QDBusPendingCallWatcher *watcher); |
| 39 | void clear(); |
| 40 | |
| 41 | void serviceRegistered(); |
| 42 | void serviceUnregistered(); |
| 43 | void interfacesAdded(const QDBusObjectPath &objectPath, const QVariantMapMap &interfaces); |
| 44 | void interfacesRemoved(const QDBusObjectPath &objectPath, const QStringList &interfaces); |
| 45 | |
| 46 | void addSession(const QString &sessionPath, const QVariantMap &properties); |
| 47 | void removeSession(const QString &sessionPath); |
| 48 | |
| 49 | ObexManager *q; |
| 50 | ObexClient *m_obexClient; |
| 51 | ObexAgentManager *m_obexAgentManager; |
| 52 | DBusObjectManager *m_dbusObjectManager; |
| 53 | |
| 54 | QTimer m_timer; |
| 55 | QHash<QString, ObexSessionPtr> m_sessions; |
| 56 | |
| 57 | bool m_initialized; |
| 58 | bool m_obexRunning; |
| 59 | bool m_loaded; |
| 60 | |
| 61 | Q_SIGNALS: |
| 62 | void initError(const QString &errorText); |
| 63 | void initFinished(); |
| 64 | |
| 65 | private Q_SLOTS: |
| 66 | void dummy(); |
| 67 | }; |
| 68 | |
| 69 | } // namespace BluezQt |
| 70 | |
| 71 | #endif // BLUEZQT_OBEXMANAGER_P_H |
| 72 | |