tdebluez
libtdebluez/interfaces/agent1Proxy.cpp
Go to the documentation of this file.
1// File autogenerated
2
3// declaration include
4#include "agent1Proxy.h"
5
6// TQt includes
7#include <tqstring.h>
8
9// TQt D-Bus includes
10#include <tqdbuserror.h>
11#include <tqdbusmessage.h>
12#include <tqdbusobjectpath.h>
13#include <tqdbusproxy.h>
14
15
16namespace org
17{
18namespace bluez
19{
20
21Agent1Proxy::Agent1Proxy(const TQString& service, const TQString& path, TQObject* parent, const char* name)
22 : TQObject(parent, name),
23 m_baseProxy(new TQT_DBusProxy())
24{
25 m_baseProxy->setInterface("org.bluez.Agent1");
26 m_baseProxy->setPath(path);
27 m_baseProxy->setService(service);
28
29 TQObject::connect(m_baseProxy, TQ_SIGNAL(asyncReply(int, const TQT_DBusMessage&)),
30 this, TQ_SLOT(slotHandleAsyncReply(int, const TQT_DBusMessage&)));
31}
32
37
38void Agent1Proxy::setConnection(const TQT_DBusConnection& connection)
39{
40 m_baseProxy->setConnection(connection);
41}
42
43bool Agent1Proxy::Release(TQT_DBusError& error)
44{
45 TQValueList<TQT_DBusData> parameters;
46
47
48 TQT_DBusMessage reply = m_baseProxy->sendWithReply("Release", parameters, &error);
49
50 if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
51 return true;
52}
53
54bool Agent1Proxy::Cancel(TQT_DBusError& error)
55{
56 TQValueList<TQT_DBusData> parameters;
57
58
59 TQT_DBusMessage reply = m_baseProxy->sendWithReply("Cancel", parameters, &error);
60
61 if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
62 return true;
63}
64
65bool Agent1Proxy::RequestPinCodeAsync(int& asyncCallId, const TQT_DBusObjectPath& device, TQT_DBusError& error)
66{
67 TQValueList<TQT_DBusData> parameters;
68
69 parameters << TQT_DBusData::fromObjectPath(device);
70
71 asyncCallId = m_baseProxy->sendWithAsyncReply("RequestPinCode", parameters);
72
73 if (asyncCallId != 0) m_asyncCalls[asyncCallId] = "RequestPinCode";
74
75 error = TQT_DBusError();
76 return (asyncCallId != 0);
77}
78
79bool Agent1Proxy::DisplayPinCodeAsync(int& asyncCallId, const TQT_DBusObjectPath& device, const TQString& pincode, TQT_DBusError& error)
80{
81 TQValueList<TQT_DBusData> parameters;
82
83 parameters << TQT_DBusData::fromObjectPath(device);
84 parameters << TQT_DBusData::fromString(pincode);
85
86 asyncCallId = m_baseProxy->sendWithAsyncReply("DisplayPinCode", parameters);
87
88 if (asyncCallId != 0) m_asyncCalls[asyncCallId] = "DisplayPinCode";
89
90 error = TQT_DBusError();
91 return (asyncCallId != 0);
92}
93
94bool Agent1Proxy::RequestPasskeyAsync(int& asyncCallId, const TQT_DBusObjectPath& device, TQT_DBusError& error)
95{
96 TQValueList<TQT_DBusData> parameters;
97
98 parameters << TQT_DBusData::fromObjectPath(device);
99
100 asyncCallId = m_baseProxy->sendWithAsyncReply("RequestPasskey", parameters);
101
102 if (asyncCallId != 0) m_asyncCalls[asyncCallId] = "RequestPasskey";
103
104 error = TQT_DBusError();
105 return (asyncCallId != 0);
106}
107
108bool Agent1Proxy::DisplayPasskeyAsync(int& asyncCallId, const TQT_DBusObjectPath& device, TQ_UINT32 passkey, TQ_UINT16 entered, TQT_DBusError& error)
109{
110 TQValueList<TQT_DBusData> parameters;
111
112 parameters << TQT_DBusData::fromObjectPath(device);
113 parameters << TQT_DBusData::fromUInt32(passkey);
114 parameters << TQT_DBusData::fromUInt16(entered);
115
116 asyncCallId = m_baseProxy->sendWithAsyncReply("DisplayPasskey", parameters);
117
118 if (asyncCallId != 0) m_asyncCalls[asyncCallId] = "DisplayPasskey";
119
120 error = TQT_DBusError();
121 return (asyncCallId != 0);
122}
123
124bool Agent1Proxy::RequestConfirmationAsync(int& asyncCallId, const TQT_DBusObjectPath& device, TQ_UINT32 passkey, TQT_DBusError& error)
125{
126 TQValueList<TQT_DBusData> parameters;
127
128 parameters << TQT_DBusData::fromObjectPath(device);
129 parameters << TQT_DBusData::fromUInt32(passkey);
130
131 asyncCallId = m_baseProxy->sendWithAsyncReply("RequestConfirmation", parameters);
132
133 if (asyncCallId != 0) m_asyncCalls[asyncCallId] = "RequestConfirmation";
134
135 error = TQT_DBusError();
136 return (asyncCallId != 0);
137}
138
139bool Agent1Proxy::RequestAuthorizationAsync(int& asyncCallId, const TQT_DBusObjectPath& device, TQT_DBusError& error)
140{
141 TQValueList<TQT_DBusData> parameters;
142
143 parameters << TQT_DBusData::fromObjectPath(device);
144
145 asyncCallId = m_baseProxy->sendWithAsyncReply("RequestAuthorization", parameters);
146
147 if (asyncCallId != 0) m_asyncCalls[asyncCallId] = "RequestAuthorization";
148
149 error = TQT_DBusError();
150 return (asyncCallId != 0);
151}
152
153bool Agent1Proxy::AuthorizeServiceAsync(int& asyncCallId, const TQT_DBusObjectPath& device, const TQString& uuid, TQT_DBusError& error)
154{
155 TQValueList<TQT_DBusData> parameters;
156
157 parameters << TQT_DBusData::fromObjectPath(device);
158 parameters << TQT_DBusData::fromString(uuid);
159
160 asyncCallId = m_baseProxy->sendWithAsyncReply("AuthorizeService", parameters);
161
162 if (asyncCallId != 0) m_asyncCalls[asyncCallId] = "AuthorizeService";
163
164 error = TQT_DBusError();
165 return (asyncCallId != 0);
166}
167
168void Agent1Proxy::slotHandleAsyncReply(int asyncCallId, const TQT_DBusMessage& message)
169{
170 TQMap<int, TQString>::iterator findIt = m_asyncCalls.find(asyncCallId);
171 if (findIt == m_asyncCalls.end()) return;
172
173 const TQString signalName = findIt.data();
174 m_asyncCalls.erase(findIt);
175
176 if (signalName == "RequestPinCode")
177 {
178 int _asyncCallId = asyncCallId;
179
180 if (message.type() == TQT_DBusMessage::ErrorMessage) {
181 emit AsyncErrorResponseDetected(_asyncCallId, message.error());
182 }
183
184 TQString _pincode = message[0].toString();
185
186 emit RequestPinCodeAsyncReply(_asyncCallId, _pincode);
187 }
188 else if (signalName == "DisplayPinCode")
189 {
190 int _asyncCallId = asyncCallId;
191
192 if (message.type() == TQT_DBusMessage::ErrorMessage) {
193 emit AsyncErrorResponseDetected(_asyncCallId, message.error());
194 }
195
196
197 emit DisplayPinCodeAsyncReply(_asyncCallId);
198 }
199 else if (signalName == "RequestPasskey")
200 {
201 int _asyncCallId = asyncCallId;
202
203 if (message.type() == TQT_DBusMessage::ErrorMessage) {
204 emit AsyncErrorResponseDetected(_asyncCallId, message.error());
205 }
206
207 TQ_UINT32 _passkey = message[0].toUInt32();
208
209 emit RequestPasskeyAsyncReply(_asyncCallId, _passkey);
210 }
211 else if (signalName == "DisplayPasskey")
212 {
213 int _asyncCallId = asyncCallId;
214
215 if (message.type() == TQT_DBusMessage::ErrorMessage) {
216 emit AsyncErrorResponseDetected(_asyncCallId, message.error());
217 }
218
219
220 emit DisplayPasskeyAsyncReply(_asyncCallId);
221 }
222 else if (signalName == "RequestConfirmation")
223 {
224 int _asyncCallId = asyncCallId;
225
226 if (message.type() == TQT_DBusMessage::ErrorMessage) {
227 emit AsyncErrorResponseDetected(_asyncCallId, message.error());
228 }
229
230
231 emit RequestConfirmationAsyncReply(_asyncCallId);
232 }
233 else if (signalName == "RequestAuthorization")
234 {
235 int _asyncCallId = asyncCallId;
236
237 if (message.type() == TQT_DBusMessage::ErrorMessage) {
238 emit AsyncErrorResponseDetected(_asyncCallId, message.error());
239 }
240
241
242 emit RequestAuthorizationAsyncReply(_asyncCallId);
243 }
244 else if (signalName == "AuthorizeService")
245 {
246 int _asyncCallId = asyncCallId;
247
248 if (message.type() == TQT_DBusMessage::ErrorMessage) {
249 emit AsyncErrorResponseDetected(_asyncCallId, message.error());
250 }
251
252
253 emit AuthorizeServiceAsyncReply(_asyncCallId);
254 }
255}
256
257}; // namespace bluez
258
259}; // namespace org
260
261#include "agent1Proxy.moc"
262
263// End of File
264
virtual void slotHandleAsyncReply(int id, const TQT_DBusMessage &message)
virtual bool RequestConfirmationAsync(int &asyncCallId, const TQT_DBusObjectPath &device, TQ_UINT32 passkey, TQT_DBusError &error)
virtual bool RequestPasskeyAsync(int &asyncCallId, const TQT_DBusObjectPath &device, TQT_DBusError &error)
void setConnection(const TQT_DBusConnection &connection)
virtual bool DisplayPasskeyAsync(int &asyncCallId, const TQT_DBusObjectPath &device, TQ_UINT32 passkey, TQ_UINT16 entered, TQT_DBusError &error)
void RequestAuthorizationAsyncReply(int asyncCallId)
void DisplayPasskeyAsyncReply(int asyncCallId)
virtual bool RequestPinCodeAsync(int &asyncCallId, const TQT_DBusObjectPath &device, TQT_DBusError &error)
void DisplayPinCodeAsyncReply(int asyncCallId)
virtual bool DisplayPinCodeAsync(int &asyncCallId, const TQT_DBusObjectPath &device, const TQString &pincode, TQT_DBusError &error)
virtual bool Release(TQT_DBusError &error)
virtual bool AuthorizeServiceAsync(int &asyncCallId, const TQT_DBusObjectPath &device, const TQString &uuid, TQT_DBusError &error)
virtual bool RequestAuthorizationAsync(int &asyncCallId, const TQT_DBusObjectPath &device, TQT_DBusError &error)
void AuthorizeServiceAsyncReply(int asyncCallId)
void AsyncErrorResponseDetected(int asyncCallId, const TQT_DBusError error)
Agent1Proxy(const TQString &service, const TQString &path, TQObject *parent=0, const char *name=0)
void RequestConfirmationAsyncReply(int asyncCallId)
void RequestPasskeyAsyncReply(int asyncCallId, TQ_UINT32 passkey)
void RequestPinCodeAsyncReply(int asyncCallId, const TQString &pincode)
virtual bool Cancel(TQT_DBusError &error)