File indexing completed on 2024-12-01 12:29:51
0001 /* 0002 * BluezQt - Asynchronous BlueZ wrapper library 0003 * 0004 * SPDX-FileCopyrightText: 2014-2015 David Rosca <nowrep@gmail.com> 0005 * 0006 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #ifndef BLUEZQT_OBEXSESSION_H 0010 #define BLUEZQT_OBEXSESSION_H 0011 0012 #include <QObject> 0013 0014 #include "bluezqt_export.h" 0015 #include "types.h" 0016 0017 class QDBusObjectPath; 0018 0019 namespace BluezQt 0020 { 0021 class PendingCall; 0022 0023 /** 0024 * @class BluezQt::ObexSession obexsession.h <BluezQt/ObexSession> 0025 * 0026 * OBEX session. 0027 * 0028 * This class represents an OBEX session. 0029 */ 0030 class BLUEZQT_EXPORT ObexSession : public QObject 0031 { 0032 Q_OBJECT 0033 0034 Q_PROPERTY(QString source READ source) 0035 Q_PROPERTY(QString destination READ destination) 0036 Q_PROPERTY(quint8 channel READ channel) 0037 Q_PROPERTY(QString target READ target) 0038 Q_PROPERTY(QString root READ root) 0039 0040 public: 0041 /** 0042 * Destroys an ObexSession object. 0043 */ 0044 ~ObexSession() override; 0045 0046 /** 0047 * Returns a shared pointer from this. 0048 * 0049 * @return ObexSessionPtr 0050 */ 0051 ObexSessionPtr toSharedPtr() const; 0052 0053 /** 0054 * D-Bus object path of the session. 0055 * 0056 * @return object path of session 0057 */ 0058 QDBusObjectPath objectPath() const; 0059 0060 /** 0061 * Returns address of the Bluetooth adapter. 0062 * 0063 * @see Manager::adapterForAddress() const 0064 * 0065 * @return address of adapter 0066 */ 0067 QString source() const; 0068 0069 /** 0070 * Returns address of the Bluetooth device. 0071 * 0072 * @see Manager::deviceForAddress() const 0073 * 0074 * @return address of device 0075 */ 0076 QString destination() const; 0077 0078 /** 0079 * Returns the Bluetooth channel. 0080 * 0081 * @return channel 0082 */ 0083 quint8 channel() const; 0084 0085 /** 0086 * Returns the target UUID. 0087 * 0088 * @return target UUID 0089 */ 0090 QString target() const; 0091 0092 /** 0093 * Returns the root path. 0094 * 0095 * @return root path 0096 */ 0097 QString root() const; 0098 0099 /** 0100 * Returns the remote device capabilities. 0101 * 0102 * Possible errors: PendingCall::NotSupported, PendingCall::Failed 0103 * 0104 * @return QString pending call 0105 */ 0106 PendingCall *getCapabilities(); 0107 0108 private: 0109 BLUEZQT_NO_EXPORT explicit ObexSession(const QString &path, const QVariantMap &properties); 0110 0111 class ObexSessionPrivate *const d; 0112 0113 friend class ObexSessionPrivate; 0114 friend class ObexManagerPrivate; 0115 }; 0116 0117 } // namespace BluezQt 0118 0119 #endif // BLUEZQT_OBEXSESSION_H