Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / libs / solid / control / backends / fakebluetooth / fakebluetoothremotedevice.h
blob9f49cbcac044c9aefcaf3bb294518ec00bc7c13f
1 /* This file is part of the KDE project
2 Copyright (C) 2007 Daniel Gollub <dgollub@suse.de>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
21 #ifndef FAKE_BLUETOOTH_REMOTEDEVICE_H
22 #define FAKE_BLUETOOTH_REMOTEDEVICE_H
24 #include <QString>
25 #include <QVariant>
27 #include <kdemacros.h>
29 #include <solid/control/ifaces/bluetoothremotedevice.h>
31 using namespace Solid::Control::Ifaces;
33 class KDE_EXPORT FakeBluetoothRemoteDevice : public Solid::Control::Ifaces::BluetoothRemoteDevice
35 Q_OBJECT
36 Q_INTERFACES(Solid::Control::Ifaces::BluetoothRemoteDevice)
37 public:
38 FakeBluetoothRemoteDevice(const QMap<QString, QVariant> & propertyMap,
39 QObject *parent = 0);
40 virtual ~FakeBluetoothRemoteDevice();
41 QString ubi() const
43 return mUbi;
45 QString address() const
47 return mAddress;
49 bool isConnected() const
51 return mConnected;
53 QString version() const
55 return mVersion;
57 QString revision() const
59 return mRevision;
61 QString manufacturer() const
63 return mManufacturer;
65 QString company() const
67 return mCompany;
69 QString majorClass() const
71 return mMajorClass;
73 QString minorClass() const
75 return mMinorClass;
77 QStringList serviceClasses() const
79 return mServiceClass;
81 QString name() const
83 return mName;
85 QString alias() const
87 return mAlias;
89 QString lastSeen() const
91 return mLastSeen;
93 QString lastUsed() const
95 return mLastUsed;
97 bool hasBonding() const
99 return mBonded;
101 int pinCodeLength() const
103 return mPinCodeLength;
105 int encryptionKeySize() const
107 return mEncryptionKeySize;
109 KJob *createBonding();
111 private:
112 QString mUbi;
113 QString mAddress;
114 bool mConnected;
115 QString mVersion;
116 QString mRevision;
117 QString mManufacturer;
118 QString mCompany;
119 QString mMajorClass;
120 QString mMinorClass;
121 QStringList mServiceClass;
122 QString mName;
123 QString mAlias;
124 QString mLastSeen;
125 QString mLastUsed;
126 bool mBonded;
127 int mPinCodeLength;
128 int mEncryptionKeySize;
129 bool servicesFound;
131 public Q_SLOTS:
132 void setAlias(const QString &alias)
134 mAlias = alias;
136 void clearAlias()
138 mAlias = "";
140 void disconnect()
142 mConnected = false;
144 void cancelBondingProcess()
146 void removeBonding()
148 mBonded = false;
150 void serviceHandles(const QString &) const
154 void serviceRecordAsXml(uint ) const
157 Q_SIGNALS:
158 void classChanged(uint devClass);
159 void nameChanged(const QString &name);
160 void nameResolvingFailed();
161 void aliasChanged(const QString &alias);
162 void aliasCleared();
163 void connected();
164 void requestDisconnection();
165 void disconnected();
166 void bondingCreated();
167 void bondingRemoved();
168 void serviceRecordXmlAvailable(const QString &ubi, const QString &record);
169 void serviceHandlesAvailable(const QString &ubi, const QList<uint> &handles);
170 protected:
171 QMap<QString, QVariant> mPropertyMap;
175 #endif