11#include "pendingcall.h"
16Device::Device(
const QString &path,
const QVariantMap &properties, AdapterPtr adapter)
22Device::~Device() =
default;
26 return d->q.toStrongRef();
31 return d->m_bluezDevice->path();
46 return new PendingCall(d->setDBusProperty(QStringLiteral(
"Alias"), name), PendingCall::ReturnVoid,
this);
51 if (name().isEmpty() || name() == remoteName()) {
54 if (remoteName().isEmpty()) {
57 return QStringLiteral(
"%1 (%2)").
arg(name(), remoteName());
65quint32 Device::deviceClass()
const
67 return d->m_deviceClass;
72 if (deviceClass() == 0) {
73 return appearanceToType(appearance());
76 return classToType(d->m_deviceClass);
79quint16 Device::appearance()
const
81 return d->m_appearance;
88 return QStringLiteral(
"audio-headset");
90 return QStringLiteral(
"audio-headphones");
92 return d->m_icon.isEmpty() ? QStringLiteral(
"preferences-system-bluetooth") : d->m_icon;
96bool Device::isPaired()
const
101bool Device::isTrusted()
const
108 return new PendingCall(d->setDBusProperty(QStringLiteral(
"Trusted"), trusted), PendingCall::ReturnVoid,
this);
111bool Device::isBlocked()
const
118 return new PendingCall(d->setDBusProperty(QStringLiteral(
"Blocked"), blocked), PendingCall::ReturnVoid,
this);
121bool Device::hasLegacyPairing()
const
123 return d->m_legacyPairing;
126qint16 Device::rssi()
const
133 return d->m_manufacturerData;
136bool Device::isServicesResolved()
const
138 return d->m_servicesResolved;
141bool Device::isConnected()
const
143 return d->m_connected;
153 return d->m_modalias;
158 return d->m_serviceData;
173 return d->m_mediaPlayer;
178 return d->m_mediaTransport;
188 return d->m_services;
195 return QStringLiteral(
"phone");
197 return QStringLiteral(
"modem");
198 case Device::Computer:
199 return QStringLiteral(
"computer");
200 case Device::Network:
201 return QStringLiteral(
"network");
202 case Device::Headset:
203 return QStringLiteral(
"headset");
204 case Device::Headphones:
205 return QStringLiteral(
"headphones");
206 case Device::AudioVideo:
207 return QStringLiteral(
"audiovideo");
208 case Device::Keyboard:
209 return QStringLiteral(
"keyboard");
211 return QStringLiteral(
"mouse");
213 return QStringLiteral(
"joypad");
215 return QStringLiteral(
"tablet");
216 case Device::Peripheral:
217 return QStringLiteral(
"peripheral");
219 return QStringLiteral(
"camera");
220 case Device::Printer:
221 return QStringLiteral(
"printer");
222 case Device::Imaging:
223 return QStringLiteral(
"imaging");
224 case Device::Wearable:
225 return QStringLiteral(
"wearable");
227 return QStringLiteral(
"toy");
229 return QStringLiteral(
"health");
231 return QStringLiteral(
"uncategorized");
238 return Device::Phone;
240 return Device::Modem;
242 return Device::Computer;
244 return Device::Network;
246 return Device::Headset;
248 return Device::Headphones;
250 return Device::AudioVideo;
252 return Device::Keyboard;
254 return Device::Mouse;
256 return Device::Joypad;
258 return Device::Tablet;
260 return Device::Peripheral;
262 return Device::Camera;
264 return Device::Printer;
266 return Device::Imaging;
268 return Device::Wearable;
272 return Device::Health;
274 return Device::Uncategorized;
279 return new PendingCall(d->m_bluezDevice->Connect(), PendingCall::ReturnVoid,
this);
284 return new PendingCall(d->m_bluezDevice->Disconnect(), PendingCall::ReturnVoid,
this);
289 return new PendingCall(d->m_bluezDevice->ConnectProfile(uuid), PendingCall::ReturnVoid,
this);
294 return new PendingCall(d->m_bluezDevice->DisconnectProfile(uuid), PendingCall::ReturnVoid,
this);
299 return new PendingCall(d->m_bluezDevice->Pair(), PendingCall::ReturnVoid,
this);
304 return new PendingCall(d->m_bluezDevice->CancelPairing(), PendingCall::ReturnVoid,
this);
309#include "moc_device.cpp"
QString path(const QString &relativePath)
QString arg(Args &&... args) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:46:08 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.