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_OBEXSESSION_H |
10 | #define BLUEZQT_OBEXSESSION_H |
11 | |
12 | #include <QObject> |
13 | |
14 | #include "bluezqt_export.h" |
15 | #include "types.h" |
16 | |
17 | #include <memory> |
18 | |
19 | class QDBusObjectPath; |
20 | |
21 | namespace BluezQt |
22 | { |
23 | class PendingCall; |
24 | |
25 | /*! |
26 | * \inmodule BluezQt |
27 | * \class BluezQt::ObexSession |
28 | * \inheaderfile BluezQt/ObexSession |
29 | * \brief OBEX session. |
30 | * |
31 | * This class represents an OBEX session. |
32 | */ |
33 | class BLUEZQT_EXPORT ObexSession : public QObject |
34 | { |
35 | Q_OBJECT |
36 | |
37 | /*! \property BluezQt::ObexSession::source */ |
38 | Q_PROPERTY(QString source READ source) |
39 | /*! \property BluezQt::ObexSession::destination */ |
40 | Q_PROPERTY(QString destination READ destination) |
41 | /*! \property BluezQt::ObexSession::channel */ |
42 | Q_PROPERTY(quint8 channel READ channel) |
43 | /*! \property BluezQt::ObexSession::target */ |
44 | Q_PROPERTY(QString target READ target) |
45 | /*! \property BluezQt::ObexSession::root */ |
46 | Q_PROPERTY(QString root READ root) |
47 | |
48 | public: |
49 | ~ObexSession() override; |
50 | |
51 | /*! |
52 | * Returns a shared pointer from this. |
53 | */ |
54 | ObexSessionPtr toSharedPtr() const; |
55 | |
56 | /*! |
57 | * Returns the D-Bus object path of the session. |
58 | */ |
59 | QDBusObjectPath objectPath() const; |
60 | |
61 | /*! |
62 | * Returns the address of the Bluetooth adapter. |
63 | * \sa Manager::adapterForAddress() |
64 | */ |
65 | QString source() const; |
66 | |
67 | /*! |
68 | * Returns the address of the Bluetooth device. |
69 | * \sa Manager::deviceForAddress() |
70 | */ |
71 | QString destination() const; |
72 | |
73 | /*! |
74 | * Returns the Bluetooth channel. |
75 | */ |
76 | quint8 channel() const; |
77 | |
78 | /*! |
79 | * Returns the target UUID. |
80 | */ |
81 | QString target() const; |
82 | |
83 | /*! |
84 | * Returns the root path. |
85 | */ |
86 | QString root() const; |
87 | |
88 | /*! |
89 | * Returns the remote device capabilities. |
90 | * |
91 | * Possible errors: |
92 | * |
93 | * \list |
94 | * \li PendingCall::NotSupported |
95 | * \li PendingCall::Failed |
96 | * \endlist |
97 | * |
98 | * Returns QString pending call. |
99 | */ |
100 | PendingCall *getCapabilities(); |
101 | |
102 | private: |
103 | BLUEZQT_NO_EXPORT explicit ObexSession(const QString &path, const QVariantMap &properties); |
104 | |
105 | std::unique_ptr<class ObexSessionPrivate> const d; |
106 | |
107 | friend class ObexSessionPrivate; |
108 | friend class ObexManagerPrivate; |
109 | }; |
110 | |
111 | } // namespace BluezQt |
112 | |
113 | #endif // BLUEZQT_OBEXSESSION_H |
114 | |