• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libsolidcontrol

bluetoothremotedevice.cpp

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2006 Will Stephenson <wstephenson@kde.org>
00003     Copyright (C) 2007 Daniel Gollub <dgollub@suse.de>
00004     Copyright (C) 2008 Tom Patzig <tpatzig@suse.de>
00005 
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License version 2 as published by the Free Software Foundation.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 
00021 */
00022 
00023 #include <QMap>
00024 #include <QStringList>
00025 
00026 #include "ifaces/bluetoothremotedevice.h"
00027 
00028 #include "frontendobject_p.h"
00029 
00030 #include "soliddefs_p.h"
00031 #include "bluetoothmanager.h"
00032 #include "bluetoothinterface.h"
00033 
00034 namespace Solid
00035 {
00036 namespace Control
00037 {
00038     class BluetoothRemoteDevicePrivate : public FrontendObjectPrivate
00039     {
00040     public:
00041         BluetoothRemoteDevicePrivate(QObject *parent)
00042             : FrontendObjectPrivate(parent) { }
00043 
00044         void setBackendObject(QObject *object);
00045     };
00046 }
00047 }
00048 
00049 Solid::Control::BluetoothRemoteDevice::BluetoothRemoteDevice(QObject *backendObject)
00050     : QObject(), d_ptr(new BluetoothRemoteDevicePrivate(this))
00051 {
00052     Q_D(BluetoothRemoteDevice);
00053     d->setBackendObject(backendObject);
00054 }
00055 
00056 Solid::Control::BluetoothRemoteDevice::BluetoothRemoteDevice(const BluetoothRemoteDevice &device)
00057     : QObject(), d_ptr(new BluetoothRemoteDevicePrivate(this))
00058 {
00059     Q_D(BluetoothRemoteDevice);
00060     d->setBackendObject(device.d_ptr->backendObject());
00061 }
00062 
00063 Solid::Control::BluetoothRemoteDevice::~BluetoothRemoteDevice()
00064 {}
00065 
00066 Solid::Control::BluetoothRemoteDevice &Solid::Control::BluetoothRemoteDevice::operator=(const Solid::Control::BluetoothRemoteDevice  & dev)
00067 {
00068     Q_D(BluetoothRemoteDevice);
00069     d->setBackendObject(dev.d_ptr->backendObject());
00070 
00071     return *this;
00072 }
00073 
00074 bool Solid::Control::BluetoothRemoteDevice::operator==(const BluetoothRemoteDevice  & other) const
00075 {
00076     return ubi() == other.ubi();
00077 }
00078 
00079 QString Solid::Control::BluetoothRemoteDevice::ubi() const
00080 {
00081     Q_D(const BluetoothRemoteDevice);
00082     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), ubi());
00083 }
00084 
00085 QMap<QString,QVariant> Solid::Control::BluetoothRemoteDevice::getProperties()
00086 {
00087     Q_D(const BluetoothRemoteDevice);
00088     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), (QMap< QString,QVariant >()), getProperties());
00089 }
00090 
00091 QVariant Solid::Control::BluetoothRemoteDevice::getProperty(const QString &key)
00092 {
00093     QMap<QString, QVariant> props = getProperties();
00094     if (props.contains(key))
00095         return props[key];
00096     else
00097         return QVariant();
00098 }
00099 
00100 QStringList Solid::Control::BluetoothRemoteDevice::listNodes()
00101 {
00102     Q_D(const BluetoothRemoteDevice);
00103     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QStringList(), listNodes());
00104 }
00105 
00106 void Solid::Control::BluetoothRemoteDevice::setProperty(const QString &name, const QVariant &value)
00107 {
00108     Q_D(const BluetoothRemoteDevice);
00109     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), setProperty(name,value));
00110 }
00111 
00112 void Solid::Control::BluetoothRemoteDevice::cancelDiscovery()
00113 {
00114     Q_D(const BluetoothRemoteDevice);
00115     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), cancelDiscovery());
00116 }
00117 
00118 void Solid::Control::BluetoothRemoteDevice::disconnect()
00119 {
00120     Q_D(const BluetoothRemoteDevice);
00121     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), disconnect());
00122 }
00123 
00124 
00125 QString Solid::Control::BluetoothRemoteDevice::address()
00126 {
00127     QVariant var = getProperty("Address");
00128 
00129     if (var.isValid())
00130         return var.value<QString>();
00131     else
00132         return QString();
00133 
00134 //    Q_D(const BluetoothRemoteDevice);
00135 //    return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), address());
00136 }
00137 
00138 bool Solid::Control::BluetoothRemoteDevice::isTrusted()
00139 {
00140      QVariant var = getProperty("Trusted");
00141 
00142     if (var.isValid())
00143         return var.value<bool>();
00144     else
00145         return false;
00146 }
00147 
00148 void Solid::Control::BluetoothRemoteDevice::setTrusted(bool trust)
00149 {
00150     setProperty("Trusted",QVariant(trust));
00151 }
00152 
00153 QString Solid::Control::BluetoothRemoteDevice::icon()
00154 {
00155      QVariant var = getProperty("Icon");
00156 
00157     if (var.isValid())
00158         return var.value<QString>();
00159     else
00160         return "";
00161 }
00162 
00163 QStringList Solid::Control::BluetoothRemoteDevice::uuids()
00164 {
00165      QVariant var = getProperty("UUIDs");
00166 
00167     if (var.isValid())
00168         return var.value<QStringList>();
00169     else
00170         return QStringList();
00171 }
00172 
00173 bool Solid::Control::BluetoothRemoteDevice::isConnected()
00174 {
00175      QVariant var = getProperty("Connected");
00176 
00177     if (var.isValid())
00178         return var.value<bool>();
00179     else
00180         return false;
00181 }
00182 
00183 /*
00184 bool Solid::Control::BluetoothRemoteDevice::isConnected() const
00185 {
00186     Q_D(const BluetoothRemoteDevice);
00187     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), false, isConnected());
00188 }
00189 
00190 QString Solid::Control::BluetoothRemoteDevice::version() const
00191 {
00192     Q_D(const BluetoothRemoteDevice);
00193     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), version());
00194 }
00195 
00196 QString Solid::Control::BluetoothRemoteDevice::revision() const
00197 {
00198     Q_D(const BluetoothRemoteDevice);
00199     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), revision());
00200 }
00201 
00202 QString Solid::Control::BluetoothRemoteDevice::manufacturer() const
00203 {
00204     Q_D(const BluetoothRemoteDevice);
00205     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), manufacturer());
00206 }
00207 
00208 QString Solid::Control::BluetoothRemoteDevice::company() const
00209 {
00210     Q_D(const BluetoothRemoteDevice);
00211     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), company());
00212 }
00213 
00214 QString Solid::Control::BluetoothRemoteDevice::majorClass() const
00215 {
00216     Q_D(const BluetoothRemoteDevice);
00217     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), majorClass());
00218 }
00219 
00220 QString Solid::Control::BluetoothRemoteDevice::minorClass() const
00221 {
00222     Q_D(const BluetoothRemoteDevice);
00223     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), minorClass());
00224 }
00225 
00226 QStringList Solid::Control::BluetoothRemoteDevice::serviceClasses() const
00227 {
00228     Q_D(const BluetoothRemoteDevice);
00229     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QStringList(), serviceClasses());
00230 }
00231 */
00232 
00233 QString Solid::Control::BluetoothRemoteDevice::name()
00234 {
00235     QVariant var = getProperty("Name");
00236 
00237     if (var.isValid())
00238         return var.value<QString>();
00239     else
00240         return QString();
00241 
00242 //    return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), name());
00243 }
00244 
00245 /*
00246 QString Solid::Control::BluetoothRemoteDevice::alias() const
00247 {
00248     Q_D(const BluetoothRemoteDevice);
00249     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), alias());
00250 }
00251 
00252 QString Solid::Control::BluetoothRemoteDevice::lastSeen() const
00253 {
00254     Q_D(const BluetoothRemoteDevice);
00255     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), lastSeen());
00256 }
00257 
00258 QString Solid::Control::BluetoothRemoteDevice::lastUsed() const
00259 {
00260     Q_D(const BluetoothRemoteDevice);
00261     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), QString(), lastUsed());
00262 }
00263 
00264 bool Solid::Control::BluetoothRemoteDevice::hasBonding() const
00265 {
00266     Q_D(const BluetoothRemoteDevice);
00267     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), false, hasBonding());
00268 }
00269 
00270 int Solid::Control::BluetoothRemoteDevice::pinCodeLength() const
00271 {
00272     Q_D(const BluetoothRemoteDevice);
00273     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), 0, pinCodeLength());
00274 }
00275 
00276 int Solid::Control::BluetoothRemoteDevice::encryptionKeySize() const
00277 {
00278     Q_D(const BluetoothRemoteDevice);
00279     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), 0, encryptionKeySize());
00280 }
00281 
00282 KJob *Solid::Control::BluetoothRemoteDevice::createBonding()
00283 {
00284     Q_D(BluetoothRemoteDevice);
00285     return_SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), 0, createBonding());
00286 }
00287 
00288 void Solid::Control::BluetoothRemoteDevice::setAlias(const QString &alias)
00289 {
00290     Q_D(BluetoothRemoteDevice);
00291     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), setAlias(alias));
00292 }
00293 
00294 void Solid::Control::BluetoothRemoteDevice::clearAlias()
00295 {
00296     Q_D(BluetoothRemoteDevice);
00297     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), clearAlias());
00298 }
00299 
00300 void Solid::Control::BluetoothRemoteDevice::disconnect()
00301 {
00302     Q_D(BluetoothRemoteDevice);
00303     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), disconnect());
00304 }
00305 
00306 void Solid::Control::BluetoothRemoteDevice::cancelBondingProcess()
00307 {
00308     Q_D(BluetoothRemoteDevice);
00309     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), cancelBondingProcess());
00310 }
00311 
00312 void Solid::Control::BluetoothRemoteDevice::removeBonding()
00313 {
00314     Q_D(const BluetoothRemoteDevice);
00315     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), removeBonding());
00316 }
00317 void Solid::Control::BluetoothRemoteDevice::serviceHandles(const QString &filter) const
00318 {
00319     Q_D(const BluetoothRemoteDevice);
00320     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), serviceHandles(filter));
00321 }
00322 
00323 void Solid::Control::BluetoothRemoteDevice::serviceRecordAsXml(uint handle) const
00324 {
00325     Q_D(const BluetoothRemoteDevice);
00326     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), serviceRecordAsXml(handle));
00327 }
00328 */
00329 
00330 void Solid::Control::BluetoothRemoteDevice::discoverServices(const QString &filter)
00331 {
00332     Q_D(const BluetoothRemoteDevice);
00333     SOLID_CALL(Ifaces::BluetoothRemoteDevice *, d->backendObject(), discoverServices(filter));
00334 }
00335 
00336 void Solid::Control::BluetoothRemoteDevicePrivate::setBackendObject(QObject *object)
00337 {
00338     FrontendObjectPrivate::setBackendObject(object);
00339 
00340     if (object) {
00341         /*
00342         QObject::connect(object, SIGNAL(classChanged(uint)),
00343                          parent(), SIGNAL(classChanged(uint)));
00344         QObject::connect(object, SIGNAL(nameChanged(const QString &)),
00345                          parent(), SIGNAL(nameChanged(const QString &)));
00346         QObject::connect(object, SIGNAL(nameResolvingFailed()),
00347                          parent(), SIGNAL(nameResolvingFailed()));
00348         QObject::connect(object, SIGNAL(aliasChanged(const QString &)),
00349                          parent(), SIGNAL(aliasChanged(const QString &)));
00350         QObject::connect(object, SIGNAL(aliasCleared()),
00351                          parent(), SIGNAL(aliasCleared()));
00352         QObject::connect(object, SIGNAL(connected()),
00353                          parent(), SIGNAL(connected()));
00354         QObject::connect(object, SIGNAL(requestDisconnection()),
00355                          parent(), SIGNAL(requestDisconnection()));
00356         QObject::connect(object, SIGNAL(disconnected()),
00357                          parent(), SIGNAL(disconnected()));
00358         QObject::connect(object, SIGNAL(bondingCreated()),
00359                          parent(), SIGNAL(bondingCreated()));
00360         QObject::connect(object, SIGNAL(bondingRemoved()),
00361                          parent(), SIGNAL(bondingRemoved()));
00362     QObject::connect(object, SIGNAL(serviceHandlesAvailable(const QString &, const QList<uint> &)),
00363              parent(), SIGNAL(serviceHandlesAvailable(const QString &, const QList<uint> &)));
00364     QObject::connect(object, SIGNAL(serviceRecordXmlAvailable(const QString &, const QString &)),
00365              parent(), SIGNAL(serviceRecordXmlAvailable(const QString &, const QString &)));
00366         */
00367 
00368         QObject::connect(object, SIGNAL(serviceDiscoverAvailable(const QString &, const QMap< uint,QString> &)),
00369                          parent(), SIGNAL(serviceDiscoverAvailable(const QString &, const QMap< uint,QString > &)));
00370         QObject::connect(object, SIGNAL(propertyChanged(const QString &, const QVariant &)),
00371                          parent(), SIGNAL(propertyChanged(const QString &, const QVariant &)));
00372         QObject::connect(object, SIGNAL(disconnectRequested()),
00373                          parent(), SIGNAL(disconnectRequested()));
00374         QObject::connect(object, SIGNAL(nodeCreated(const QString &)),
00375                          parent(), SIGNAL(nodeCreated(const QString &)));
00376         QObject::connect(object, SIGNAL(nodeRemoved(const QString &)),
00377                          parent(), SIGNAL(nodeRemoved(const QString &)));
00378 
00379 
00380     
00381     }
00382 }
00383 
00384 #include "bluetoothremotedevice.moc"

libsolidcontrol

Skip menu "libsolidcontrol"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal