tdebluez
adapter1Proxy.cpp
Go to the documentation of this file.
1// File autogenerated
2
3// declaration include
4#include "adapter1Proxy.h"
5
6// TQt includes
7#include <tqmap.h>
8#include <tqstring.h>
9#include <tqstringlist.h>
10
11// TQt D-Bus includes
12#include <tqdbusconnection.h>
13#include <tqdbusdata.h>
14#include <tqdbusdatalist.h>
15#include <tqdbusdatamap.h>
16#include <tqdbuserror.h>
17#include <tqdbusmessage.h>
18#include <tqdbusobjectpath.h>
19#include <tqdbusproxy.h>
20#include <tqdbusvariant.h>
21
22
23namespace org
24{
25namespace bluez
26{
27
28Adapter1Proxy::Adapter1Proxy(const TQString& service, const TQString& path, TQObject* parent, const char* name)
29 : TQObject(parent, name),
30 m_baseProxy(new TQT_DBusProxy())
31{
32 m_baseProxy->setInterface("org.bluez.Adapter1");
33 m_baseProxy->setPath(path);
34 m_baseProxy->setService(service);
35
36}
37
39{
40 delete m_baseProxy;
41}
42
43void Adapter1Proxy::setConnection(const TQT_DBusConnection& connection)
44{
45 m_baseProxy->setConnection(connection);
46}
47
48bool Adapter1Proxy::StartDiscovery(TQT_DBusError& error)
49{
50 TQValueList<TQT_DBusData> parameters;
51
52
53 TQT_DBusMessage reply = m_baseProxy->sendWithReply("StartDiscovery", parameters, &error);
54
55 if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
56 return true;
57}
58
59bool Adapter1Proxy::SetDiscoveryFilter(const TQMap< TQString, TQT_DBusVariant >& properties, TQT_DBusError& error)
60{
61 TQValueList<TQT_DBusData> parameters;
62
63 parameters << TQT_DBusData::fromStringKeyMap(TQT_DBusDataMap< TQString >(properties));
64
65 TQT_DBusMessage reply = m_baseProxy->sendWithReply("SetDiscoveryFilter", parameters, &error);
66
67 if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
68 return true;
69}
70
71bool Adapter1Proxy::StopDiscovery(TQT_DBusError& error)
72{
73 TQValueList<TQT_DBusData> parameters;
74
75
76 TQT_DBusMessage reply = m_baseProxy->sendWithReply("StopDiscovery", parameters, &error);
77
78 if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
79 return true;
80}
81
82bool Adapter1Proxy::RemoveDevice(const TQT_DBusObjectPath& device, TQT_DBusError& error)
83{
84 TQValueList<TQT_DBusData> parameters;
85
86 parameters << TQT_DBusData::fromObjectPath(device);
87
88 TQT_DBusMessage reply = m_baseProxy->sendWithReply("RemoveDevice", parameters, &error);
89
90 if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
91 return true;
92}
93
94void Adapter1Proxy::setDBusProperty(const TQString& name, const TQT_DBusVariant& value, TQT_DBusError& error)
95{
96 TQT_DBusConnection connection = m_baseProxy->connection();
97
98 TQT_DBusMessage message = TQT_DBusMessage::methodCall(m_baseProxy->service(), m_baseProxy->path(), "org.freedesktop.DBus.Properties", "Set");
99
100 message << TQT_DBusData::fromString(m_baseProxy->interface());
101 message << TQT_DBusData::fromString(name);
102 message << TQT_DBusData::fromVariant(value);
103
104 connection.sendWithReply(message, &error);
105}
106
107TQT_DBusVariant Adapter1Proxy::getDBusProperty(const TQString& name, TQT_DBusError& error) const
108{
109 TQT_DBusConnection connection = m_baseProxy->connection();
110
111 TQT_DBusMessage message = TQT_DBusMessage::methodCall(m_baseProxy->service(), m_baseProxy->path(), "org.freedesktop.DBus.Properties", "Get");
112
113 message << TQT_DBusData::fromString(m_baseProxy->interface());
114 message << TQT_DBusData::fromString(name);
115
116 TQT_DBusMessage reply = connection.sendWithReply(message, &error);
117
118 if (reply.type() != TQT_DBusMessage::ReplyMessage) return TQT_DBusVariant();
119 if (reply.count() != 1) return TQT_DBusVariant();
120
121 bool ok = false;
122 TQT_DBusVariant value = reply.front().toVariant(&ok);
123 if (!ok) return TQT_DBusVariant();
124
125 return value;
126}
127
128TQString Adapter1Proxy::getAddress(TQT_DBusError& error) const
129{
130 TQT_DBusVariant variant = getDBusProperty("Address", error);
131
132 if (error.isValid()) return TQString();
133
134 bool ok = false;
135
136 TQString result = variant.value.toString(&ok);
137 if (!ok) {}
138
139 return result;
140}
141
142TQString Adapter1Proxy::getName(TQT_DBusError& error) const
143{
144 TQT_DBusVariant variant = getDBusProperty("Name", error);
145
146 if (error.isValid()) return TQString();
147
148 bool ok = false;
149
150 TQString result = variant.value.toString(&ok);
151 if (!ok) {}
152
153 return result;
154}
155
156void Adapter1Proxy::setAlias(const TQString& value, TQT_DBusError& error)
157{
158 TQT_DBusVariant variant;
159 variant.value = TQT_DBusData::fromString(value);
160 variant.signature = "s";
161
162 setDBusProperty("Alias", variant, error);
163}
164
165TQString Adapter1Proxy::getAlias(TQT_DBusError& error) const
166{
167 TQT_DBusVariant variant = getDBusProperty("Alias", error);
168
169 if (error.isValid()) return TQString();
170
171 bool ok = false;
172
173 TQString result = variant.value.toString(&ok);
174 if (!ok) {}
175
176 return result;
177}
178
179TQ_UINT32 Adapter1Proxy::getClass(TQT_DBusError& error) const
180{
181 TQT_DBusVariant variant = getDBusProperty("Class", error);
182
183 if (error.isValid()) return TQ_UINT32();
184
185 bool ok = false;
186
187 TQ_UINT32 result = variant.value.toUInt32(&ok);
188 if (!ok) {}
189
190 return result;
191}
192
193void Adapter1Proxy::setPowered(bool value, TQT_DBusError& error)
194{
195 TQT_DBusVariant variant;
196 variant.value = TQT_DBusData::fromBool(value);
197 variant.signature = "b";
198
199 setDBusProperty("Powered", variant, error);
200}
201
202bool Adapter1Proxy::getPowered(TQT_DBusError& error) const
203{
204 TQT_DBusVariant variant = getDBusProperty("Powered", error);
205
206 if (error.isValid()) return bool();
207
208 bool ok = false;
209
210 bool result = variant.value.toBool(&ok);
211 if (!ok) {}
212
213 return result;
214}
215
216void Adapter1Proxy::setDiscoverable(bool value, TQT_DBusError& error)
217{
218 TQT_DBusVariant variant;
219 variant.value = TQT_DBusData::fromBool(value);
220 variant.signature = "b";
221
222 setDBusProperty("Discoverable", variant, error);
223}
224
225bool Adapter1Proxy::getDiscoverable(TQT_DBusError& error) const
226{
227 TQT_DBusVariant variant = getDBusProperty("Discoverable", error);
228
229 if (error.isValid()) return bool();
230
231 bool ok = false;
232
233 bool result = variant.value.toBool(&ok);
234 if (!ok) {}
235
236 return result;
237}
238
239void Adapter1Proxy::setDiscoverableTimeout(TQ_UINT32 value, TQT_DBusError& error)
240{
241 TQT_DBusVariant variant;
242 variant.value = TQT_DBusData::fromUInt32(value);
243 variant.signature = "u";
244
245 setDBusProperty("DiscoverableTimeout", variant, error);
246}
247
248TQ_UINT32 Adapter1Proxy::getDiscoverableTimeout(TQT_DBusError& error) const
249{
250 TQT_DBusVariant variant = getDBusProperty("DiscoverableTimeout", error);
251
252 if (error.isValid()) return TQ_UINT32();
253
254 bool ok = false;
255
256 TQ_UINT32 result = variant.value.toUInt32(&ok);
257 if (!ok) {}
258
259 return result;
260}
261
262void Adapter1Proxy::setPairable(bool value, TQT_DBusError& error)
263{
264 TQT_DBusVariant variant;
265 variant.value = TQT_DBusData::fromBool(value);
266 variant.signature = "b";
267
268 setDBusProperty("Pairable", variant, error);
269}
270
271bool Adapter1Proxy::getPairable(TQT_DBusError& error) const
272{
273 TQT_DBusVariant variant = getDBusProperty("Pairable", error);
274
275 if (error.isValid()) return bool();
276
277 bool ok = false;
278
279 bool result = variant.value.toBool(&ok);
280 if (!ok) {}
281
282 return result;
283}
284
285void Adapter1Proxy::setPairableTimeout(TQ_UINT32 value, TQT_DBusError& error)
286{
287 TQT_DBusVariant variant;
288 variant.value = TQT_DBusData::fromUInt32(value);
289 variant.signature = "u";
290
291 setDBusProperty("PairableTimeout", variant, error);
292}
293
294TQ_UINT32 Adapter1Proxy::getPairableTimeout(TQT_DBusError& error) const
295{
296 TQT_DBusVariant variant = getDBusProperty("PairableTimeout", error);
297
298 if (error.isValid()) return TQ_UINT32();
299
300 bool ok = false;
301
302 TQ_UINT32 result = variant.value.toUInt32(&ok);
303 if (!ok) {}
304
305 return result;
306}
307
308bool Adapter1Proxy::getDiscovering(TQT_DBusError& error) const
309{
310 TQT_DBusVariant variant = getDBusProperty("Discovering", error);
311
312 if (error.isValid()) return bool();
313
314 bool ok = false;
315
316 bool result = variant.value.toBool(&ok);
317 if (!ok) {}
318
319 return result;
320}
321
322TQStringList Adapter1Proxy::getUUIDs(TQT_DBusError& error) const
323{
324 TQT_DBusVariant variant = getDBusProperty("UUIDs", error);
325
326 if (error.isValid()) return TQStringList();
327
328 bool ok = false;
329
330 bool subOK = false;
331
332 TQStringList result = variant.value.toList(&ok).toTQStringList(&subOK);
333 if (!subOK) {}
334 if (!ok) {}
335
336 return result;
337}
338
339TQString Adapter1Proxy::getModalias(TQT_DBusError& error) const
340{
341 TQT_DBusVariant variant = getDBusProperty("Modalias", error);
342
343 if (error.isValid()) return TQString();
344
345 bool ok = false;
346
347 TQString result = variant.value.toString(&ok);
348 if (!ok) {}
349
350 return result;
351}
352
353}; // namespace bluez
354
355}; // namespace org
356
357#include "adapter1Proxy.moc"
358
359// End of File
360
virtual void setPowered(bool value, TQT_DBusError &error)
virtual bool getPairable(TQT_DBusError &error) const
virtual TQ_UINT32 getPairableTimeout(TQT_DBusError &error) const
virtual void setPairableTimeout(TQ_UINT32 value, TQT_DBusError &error)
virtual bool getDiscovering(TQT_DBusError &error) const
virtual bool getDiscoverable(TQT_DBusError &error) const
virtual void setDBusProperty(const TQString &name, const TQT_DBusVariant &variant, TQT_DBusError &error)
virtual TQT_DBusVariant getDBusProperty(const TQString &name, TQT_DBusError &error) const
TQT_DBusProxy * m_baseProxy
Definition: adapter1Proxy.h:83
virtual void setAlias(const TQString &value, TQT_DBusError &error)
virtual bool SetDiscoveryFilter(const TQMap< TQString, TQT_DBusVariant > &properties, TQT_DBusError &error)
virtual TQString getAddress(TQT_DBusError &error) const
virtual void setDiscoverable(bool value, TQT_DBusError &error)
void setConnection(const TQT_DBusConnection &connection)
virtual void setDiscoverableTimeout(TQ_UINT32 value, TQT_DBusError &error)
virtual TQString getAlias(TQT_DBusError &error) const
virtual bool getPowered(TQT_DBusError &error) const
virtual TQString getName(TQT_DBusError &error) const
virtual TQ_UINT32 getDiscoverableTimeout(TQT_DBusError &error) const
virtual bool StartDiscovery(TQT_DBusError &error)
virtual TQStringList getUUIDs(TQT_DBusError &error) const
virtual TQString getModalias(TQT_DBusError &error) const
virtual TQ_UINT32 getClass(TQT_DBusError &error) const
virtual void setPairable(bool value, TQT_DBusError &error)
virtual bool RemoveDevice(const TQT_DBusObjectPath &device, TQT_DBusError &error)
virtual bool StopDiscovery(TQT_DBusError &error)
Adapter1Proxy(const TQString &service, const TQString &path, TQObject *parent=0, const char *name=0)