11 #include <tqdbuserror.h>
12 #include <tqdbusmessage.h>
13 #include <tqdbusobjectpath.h>
23 interfaceElement.setAttribute(
"name",
"org.bluez.Agent1");
25 TQDomDocument document = interfaceElement.ownerDocument();
26 TQDomElement methodElement = document.createElement(
"method");
27 methodElement.setAttribute(
"name",
"Release");
29 interfaceElement.appendChild(methodElement);
31 methodElement = document.createElement(
"method");
32 TQDomElement asyncAnnotationElement = document.createElement(
"annotation");
33 asyncAnnotationElement.setAttribute(
"name",
"org.freedesktop.DBus.GLib.Async");
34 asyncAnnotationElement.setAttribute(
"value",
"true");
35 methodElement.appendChild(asyncAnnotationElement);
36 methodElement.setAttribute(
"name",
"RequestPinCode");
38 TQDomElement argumentElement = document.createElement(
"arg");
39 argumentElement.setAttribute(
"name",
"device");
40 argumentElement.setAttribute(
"type",
"o");
41 argumentElement.setAttribute(
"direction",
"in");
42 methodElement.appendChild(argumentElement);
44 argumentElement = document.createElement(
"arg");
45 argumentElement.setAttribute(
"name",
"pincode");
46 argumentElement.setAttribute(
"type",
"s");
47 argumentElement.setAttribute(
"direction",
"out");
48 methodElement.appendChild(argumentElement);
50 interfaceElement.appendChild(methodElement);
52 methodElement = document.createElement(
"method");
53 asyncAnnotationElement = document.createElement(
"annotation");
54 asyncAnnotationElement.setAttribute(
"name",
"org.freedesktop.DBus.GLib.Async");
55 asyncAnnotationElement.setAttribute(
"value",
"true");
56 methodElement.appendChild(asyncAnnotationElement);
57 methodElement.setAttribute(
"name",
"DisplayPinCode");
59 argumentElement = document.createElement(
"arg");
60 argumentElement.setAttribute(
"name",
"device");
61 argumentElement.setAttribute(
"type",
"o");
62 argumentElement.setAttribute(
"direction",
"in");
63 methodElement.appendChild(argumentElement);
65 argumentElement = document.createElement(
"arg");
66 argumentElement.setAttribute(
"name",
"pincode");
67 argumentElement.setAttribute(
"type",
"s");
68 argumentElement.setAttribute(
"direction",
"in");
69 methodElement.appendChild(argumentElement);
71 interfaceElement.appendChild(methodElement);
73 methodElement = document.createElement(
"method");
74 asyncAnnotationElement = document.createElement(
"annotation");
75 asyncAnnotationElement.setAttribute(
"name",
"org.freedesktop.DBus.GLib.Async");
76 asyncAnnotationElement.setAttribute(
"value",
"true");
77 methodElement.appendChild(asyncAnnotationElement);
78 methodElement.setAttribute(
"name",
"RequestPasskey");
80 argumentElement = document.createElement(
"arg");
81 argumentElement.setAttribute(
"name",
"device");
82 argumentElement.setAttribute(
"type",
"o");
83 argumentElement.setAttribute(
"direction",
"in");
84 methodElement.appendChild(argumentElement);
86 argumentElement = document.createElement(
"arg");
87 argumentElement.setAttribute(
"name",
"passkey");
88 argumentElement.setAttribute(
"type",
"u");
89 argumentElement.setAttribute(
"direction",
"out");
90 methodElement.appendChild(argumentElement);
92 interfaceElement.appendChild(methodElement);
94 methodElement = document.createElement(
"method");
95 asyncAnnotationElement = document.createElement(
"annotation");
96 asyncAnnotationElement.setAttribute(
"name",
"org.freedesktop.DBus.GLib.Async");
97 asyncAnnotationElement.setAttribute(
"value",
"true");
98 methodElement.appendChild(asyncAnnotationElement);
99 methodElement.setAttribute(
"name",
"DisplayPasskey");
101 argumentElement = document.createElement(
"arg");
102 argumentElement.setAttribute(
"name",
"device");
103 argumentElement.setAttribute(
"type",
"o");
104 argumentElement.setAttribute(
"direction",
"in");
105 methodElement.appendChild(argumentElement);
107 argumentElement = document.createElement(
"arg");
108 argumentElement.setAttribute(
"name",
"passkey");
109 argumentElement.setAttribute(
"type",
"u");
110 argumentElement.setAttribute(
"direction",
"in");
111 methodElement.appendChild(argumentElement);
113 argumentElement = document.createElement(
"arg");
114 argumentElement.setAttribute(
"name",
"entered");
115 argumentElement.setAttribute(
"type",
"q");
116 argumentElement.setAttribute(
"direction",
"in");
117 methodElement.appendChild(argumentElement);
119 interfaceElement.appendChild(methodElement);
121 methodElement = document.createElement(
"method");
122 asyncAnnotationElement = document.createElement(
"annotation");
123 asyncAnnotationElement.setAttribute(
"name",
"org.freedesktop.DBus.GLib.Async");
124 asyncAnnotationElement.setAttribute(
"value",
"true");
125 methodElement.appendChild(asyncAnnotationElement);
126 methodElement.setAttribute(
"name",
"RequestConfirmation");
128 argumentElement = document.createElement(
"arg");
129 argumentElement.setAttribute(
"name",
"device");
130 argumentElement.setAttribute(
"type",
"o");
131 argumentElement.setAttribute(
"direction",
"in");
132 methodElement.appendChild(argumentElement);
134 argumentElement = document.createElement(
"arg");
135 argumentElement.setAttribute(
"name",
"passkey");
136 argumentElement.setAttribute(
"type",
"u");
137 argumentElement.setAttribute(
"direction",
"in");
138 methodElement.appendChild(argumentElement);
140 interfaceElement.appendChild(methodElement);
142 methodElement = document.createElement(
"method");
143 asyncAnnotationElement = document.createElement(
"annotation");
144 asyncAnnotationElement.setAttribute(
"name",
"org.freedesktop.DBus.GLib.Async");
145 asyncAnnotationElement.setAttribute(
"value",
"true");
146 methodElement.appendChild(asyncAnnotationElement);
147 methodElement.setAttribute(
"name",
"RequestAuthorization");
149 argumentElement = document.createElement(
"arg");
150 argumentElement.setAttribute(
"name",
"device");
151 argumentElement.setAttribute(
"type",
"o");
152 argumentElement.setAttribute(
"direction",
"in");
153 methodElement.appendChild(argumentElement);
155 interfaceElement.appendChild(methodElement);
157 methodElement = document.createElement(
"method");
158 asyncAnnotationElement = document.createElement(
"annotation");
159 asyncAnnotationElement.setAttribute(
"name",
"org.freedesktop.DBus.GLib.Async");
160 asyncAnnotationElement.setAttribute(
"value",
"true");
161 methodElement.appendChild(asyncAnnotationElement);
162 methodElement.setAttribute(
"name",
"AuthorizeService");
164 argumentElement = document.createElement(
"arg");
165 argumentElement.setAttribute(
"name",
"device");
166 argumentElement.setAttribute(
"type",
"o");
167 argumentElement.setAttribute(
"direction",
"in");
168 methodElement.appendChild(argumentElement);
170 argumentElement = document.createElement(
"arg");
171 argumentElement.setAttribute(
"name",
"uuid");
172 argumentElement.setAttribute(
"type",
"s");
173 argumentElement.setAttribute(
"direction",
"in");
174 methodElement.appendChild(argumentElement);
176 interfaceElement.appendChild(methodElement);
178 methodElement = document.createElement(
"method");
179 methodElement.setAttribute(
"name",
"Cancel");
181 interfaceElement.appendChild(methodElement);
190 TQT_DBusMessage call = findIt.data();
193 TQT_DBusMessage reply = TQT_DBusMessage::methodReply(call);
194 reply << TQT_DBusData::fromString(pincode);
204 TQT_DBusMessage call = findIt.data();
207 TQT_DBusMessage reply = TQT_DBusMessage::methodError(call, error);
217 TQT_DBusMessage call = findIt.data();
220 TQT_DBusMessage reply = TQT_DBusMessage::methodReply(call);
230 TQT_DBusMessage call = findIt.data();
233 TQT_DBusMessage reply = TQT_DBusMessage::methodError(call, error);
243 TQT_DBusMessage call = findIt.data();
246 TQT_DBusMessage reply = TQT_DBusMessage::methodReply(call);
247 reply << TQT_DBusData::fromUInt32(passkey);
257 TQT_DBusMessage call = findIt.data();
260 TQT_DBusMessage reply = TQT_DBusMessage::methodError(call, error);
270 TQT_DBusMessage call = findIt.data();
273 TQT_DBusMessage reply = TQT_DBusMessage::methodReply(call);
283 TQT_DBusMessage call = findIt.data();
286 TQT_DBusMessage reply = TQT_DBusMessage::methodError(call, error);
296 TQT_DBusMessage call = findIt.data();
299 TQT_DBusMessage reply = TQT_DBusMessage::methodReply(call);
309 TQT_DBusMessage call = findIt.data();
312 TQT_DBusMessage reply = TQT_DBusMessage::methodError(call, error);
322 TQT_DBusMessage call = findIt.data();
325 TQT_DBusMessage reply = TQT_DBusMessage::methodReply(call);
335 TQT_DBusMessage call = findIt.data();
338 TQT_DBusMessage reply = TQT_DBusMessage::methodError(call, error);
348 TQT_DBusMessage call = findIt.data();
351 TQT_DBusMessage reply = TQT_DBusMessage::methodReply(call);
361 TQT_DBusMessage call = findIt.data();
364 TQT_DBusMessage reply = TQT_DBusMessage::methodError(call, error);
371 TQT_DBusMessage reply;
376 reply = TQT_DBusMessage::methodReply(message);
380 if (!error.isValid())
382 tqWarning(
"Call to implementation of org::bluez::Agent1Interface::Release returned 'false' but error object is not valid!");
384 error = TQT_DBusError::stdFailed(
"org.bluez.Agent1.Release execution failed");
387 reply = TQT_DBusMessage::methodError(message, error);
396 TQT_DBusMessage reply;
401 reply = TQT_DBusMessage::methodReply(message);
405 if (!error.isValid())
407 tqWarning(
"Call to implementation of org::bluez::Agent1Interface::Cancel returned 'false' but error object is not valid!");
409 error = TQT_DBusError::stdFailed(
"org.bluez.Agent1.Cancel execution failed");
412 reply = TQT_DBusMessage::methodError(message, error);
420 TQT_DBusObjectPath _device = message[0].toObjectPath();
422 int _asyncCallId = 0;
436 TQT_DBusObjectPath _device = message[0].toObjectPath();
437 TQString _pincode = message[1].toString();
439 int _asyncCallId = 0;
453 TQT_DBusObjectPath _device = message[0].toObjectPath();
455 int _asyncCallId = 0;
469 TQT_DBusObjectPath _device = message[0].toObjectPath();
470 TQ_UINT32 _passkey = message[1].toUInt32();
471 TQ_UINT16 _entered = message[2].toUInt16();
473 int _asyncCallId = 0;
487 TQT_DBusObjectPath _device = message[0].toObjectPath();
488 TQ_UINT32 _passkey = message[1].toUInt32();
490 int _asyncCallId = 0;
504 TQT_DBusObjectPath _device = message[0].toObjectPath();
506 int _asyncCallId = 0;
520 TQT_DBusObjectPath _device = message[0].toObjectPath();
521 TQString _uuid = message[1].toString();
523 int _asyncCallId = 0;
537 if (message.interface() !=
"org.bluez.Agent1")
return false;
539 if (message.member() ==
"Release")
547 if (message.member() ==
"RequestPinCode")
554 if (message.member() ==
"DisplayPinCode")
561 if (message.member() ==
"RequestPasskey")
568 if (message.member() ==
"DisplayPasskey")
575 if (message.member() ==
"RequestConfirmation")
582 if (message.member() ==
"RequestAuthorization")
589 if (message.member() ==
"AuthorizeService")
596 if (message.member() ==
"Cancel")
virtual void DisplayPinCodeAsyncReply(int asyncCallId)
virtual bool Release(TQT_DBusError &error)=0
virtual void RequestAuthorizationAsync(int asyncCallId, const TQT_DBusObjectPath &device)=0
void callRequestPasskeyAsync(const TQT_DBusMessage &message)
virtual void DisplayPasskeyAsyncError(int asyncCallId, const TQT_DBusError &error)
TQMap< int, TQT_DBusMessage > m_asyncCalls
static void buildIntrospectionData(TQDomElement &interfaceElement)
virtual void DisplayPasskeyAsync(int asyncCallId, const TQT_DBusObjectPath &device, TQ_UINT32 passkey, TQ_UINT16 entered)=0
virtual void AuthorizeServiceAsyncError(int asyncCallId, const TQT_DBusError &error)
virtual void RequestConfirmationAsync(int asyncCallId, const TQT_DBusObjectPath &device, TQ_UINT32 passkey)=0
TQT_DBusMessage callCancel(const TQT_DBusMessage &message)
virtual void RequestPinCodeAsyncError(int asyncCallId, const TQT_DBusError &error)
void callDisplayPinCodeAsync(const TQT_DBusMessage &message)
virtual void AuthorizeServiceAsync(int asyncCallId, const TQT_DBusObjectPath &device, const TQString &uuid)=0
virtual bool handleMethodCall(const TQT_DBusMessage &message)
virtual void RequestPinCodeAsync(int asyncCallId, const TQT_DBusObjectPath &device)=0
virtual void DisplayPinCodeAsync(int asyncCallId, const TQT_DBusObjectPath &device, const TQString &pincode)=0
void callDisplayPasskeyAsync(const TQT_DBusMessage &message)
virtual void RequestAuthorizationAsyncReply(int asyncCallId)
TQT_DBusMessage callRelease(const TQT_DBusMessage &message)
void callAuthorizeServiceAsync(const TQT_DBusMessage &message)
void callRequestConfirmationAsync(const TQT_DBusMessage &message)
virtual void RequestPasskeyAsyncError(int asyncCallId, const TQT_DBusError &error)
virtual void RequestConfirmationAsyncError(int asyncCallId, const TQT_DBusError &error)
virtual void RequestPinCodeAsyncReply(int asyncCallId, const TQString &pincode)
virtual void RequestPasskeyAsync(int asyncCallId, const TQT_DBusObjectPath &device)=0
void callRequestAuthorizationAsync(const TQT_DBusMessage &message)
virtual void DisplayPinCodeAsyncError(int asyncCallId, const TQT_DBusError &error)
virtual bool Cancel(TQT_DBusError &error)=0
virtual void RequestConfirmationAsyncReply(int asyncCallId)
virtual void DisplayPasskeyAsyncReply(int asyncCallId)
virtual void RequestPasskeyAsyncReply(int asyncCallId, TQ_UINT32 passkey)
void callRequestPinCodeAsync(const TQT_DBusMessage &message)
virtual void RequestAuthorizationAsyncError(int asyncCallId, const TQT_DBusError &error)
virtual void AuthorizeServiceAsyncReply(int asyncCallId)
virtual void handleMethodReply(const TQT_DBusMessage &reply)=0