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 | * @class BluezQt::ObexSession obexsession.h <BluezQt/ObexSession> |
27 | * |
28 | * OBEX session. |
29 | * |
30 | * This class represents an OBEX session. |
31 | */ |
32 | class BLUEZQT_EXPORT ObexSession : public QObject |
33 | { |
34 | Q_OBJECT |
35 | |
36 | Q_PROPERTY(QString source READ source) |
37 | Q_PROPERTY(QString destination READ destination) |
38 | Q_PROPERTY(quint8 channel READ channel) |
39 | Q_PROPERTY(QString target READ target) |
40 | Q_PROPERTY(QString root READ root) |
41 | |
42 | public: |
43 | /** |
44 | * Destroys an ObexSession object. |
45 | */ |
46 | ~ObexSession() override; |
47 | |
48 | /** |
49 | * Returns a shared pointer from this. |
50 | * |
51 | * @return ObexSessionPtr |
52 | */ |
53 | ObexSessionPtr toSharedPtr() const; |
54 | |
55 | /** |
56 | * D-Bus object path of the session. |
57 | * |
58 | * @return object path of session |
59 | */ |
60 | QDBusObjectPath objectPath() const; |
61 | |
62 | /** |
63 | * Returns address of the Bluetooth adapter. |
64 | * |
65 | * @see Manager::adapterForAddress() const |
66 | * |
67 | * @return address of adapter |
68 | */ |
69 | QString source() const; |
70 | |
71 | /** |
72 | * Returns address of the Bluetooth device. |
73 | * |
74 | * @see Manager::deviceForAddress() const |
75 | * |
76 | * @return address of device |
77 | */ |
78 | QString destination() const; |
79 | |
80 | /** |
81 | * Returns the Bluetooth channel. |
82 | * |
83 | * @return channel |
84 | */ |
85 | quint8 channel() const; |
86 | |
87 | /** |
88 | * Returns the target UUID. |
89 | * |
90 | * @return target UUID |
91 | */ |
92 | QString target() const; |
93 | |
94 | /** |
95 | * Returns the root path. |
96 | * |
97 | * @return root path |
98 | */ |
99 | QString root() const; |
100 | |
101 | /** |
102 | * Returns the remote device capabilities. |
103 | * |
104 | * Possible errors: PendingCall::NotSupported, PendingCall::Failed |
105 | * |
106 | * @return QString pending call |
107 | */ |
108 | PendingCall *getCapabilities(); |
109 | |
110 | private: |
111 | BLUEZQT_NO_EXPORT explicit ObexSession(const QString &path, const QVariantMap &properties); |
112 | |
113 | std::unique_ptr<class ObexSessionPrivate> const d; |
114 | |
115 | friend class ObexSessionPrivate; |
116 | friend class ObexManagerPrivate; |
117 | }; |
118 | |
119 | } // namespace BluezQt |
120 | |
121 | #endif // BLUEZQT_OBEXSESSION_H |
122 | |