10 #include <tqdbuserror.h>
11 #include <tqdbusmessage.h>
12 #include <tqdbusobjectpath.h>
13 #include <tqdbusproxy.h>
22 : TQObject(parent, name),
23 m_baseProxy(new TQT_DBusProxy())
29 TQObject::connect(
m_baseProxy, TQ_SIGNAL(asyncReply(
int,
const TQT_DBusMessage&)),
45 TQValueList<TQT_DBusData> parameters;
48 TQT_DBusMessage reply =
m_baseProxy->sendWithReply(
"Release", parameters, &error);
50 if (reply.type() != TQT_DBusMessage::ReplyMessage)
return false;
56 TQValueList<TQT_DBusData> parameters;
59 TQT_DBusMessage reply =
m_baseProxy->sendWithReply(
"Cancel", parameters, &error);
61 if (reply.type() != TQT_DBusMessage::ReplyMessage)
return false;
67 TQValueList<TQT_DBusData> parameters;
69 parameters << TQT_DBusData::fromObjectPath(device);
71 asyncCallId =
m_baseProxy->sendWithAsyncReply(
"RequestPinCode", parameters);
73 if (asyncCallId != 0)
m_asyncCalls[asyncCallId] =
"RequestPinCode";
75 error = TQT_DBusError();
76 return (asyncCallId != 0);
81 TQValueList<TQT_DBusData> parameters;
83 parameters << TQT_DBusData::fromObjectPath(device);
84 parameters << TQT_DBusData::fromString(pincode);
86 asyncCallId =
m_baseProxy->sendWithAsyncReply(
"DisplayPinCode", parameters);
88 if (asyncCallId != 0)
m_asyncCalls[asyncCallId] =
"DisplayPinCode";
90 error = TQT_DBusError();
91 return (asyncCallId != 0);
96 TQValueList<TQT_DBusData> parameters;
98 parameters << TQT_DBusData::fromObjectPath(device);
100 asyncCallId =
m_baseProxy->sendWithAsyncReply(
"RequestPasskey", parameters);
102 if (asyncCallId != 0)
m_asyncCalls[asyncCallId] =
"RequestPasskey";
104 error = TQT_DBusError();
105 return (asyncCallId != 0);
110 TQValueList<TQT_DBusData> parameters;
112 parameters << TQT_DBusData::fromObjectPath(device);
113 parameters << TQT_DBusData::fromUInt32(passkey);
114 parameters << TQT_DBusData::fromUInt16(entered);
116 asyncCallId =
m_baseProxy->sendWithAsyncReply(
"DisplayPasskey", parameters);
118 if (asyncCallId != 0)
m_asyncCalls[asyncCallId] =
"DisplayPasskey";
120 error = TQT_DBusError();
121 return (asyncCallId != 0);
126 TQValueList<TQT_DBusData> parameters;
128 parameters << TQT_DBusData::fromObjectPath(device);
129 parameters << TQT_DBusData::fromUInt32(passkey);
131 asyncCallId =
m_baseProxy->sendWithAsyncReply(
"RequestConfirmation", parameters);
133 if (asyncCallId != 0)
m_asyncCalls[asyncCallId] =
"RequestConfirmation";
135 error = TQT_DBusError();
136 return (asyncCallId != 0);
141 TQValueList<TQT_DBusData> parameters;
143 parameters << TQT_DBusData::fromObjectPath(device);
145 asyncCallId =
m_baseProxy->sendWithAsyncReply(
"RequestAuthorization", parameters);
147 if (asyncCallId != 0)
m_asyncCalls[asyncCallId] =
"RequestAuthorization";
149 error = TQT_DBusError();
150 return (asyncCallId != 0);
155 TQValueList<TQT_DBusData> parameters;
157 parameters << TQT_DBusData::fromObjectPath(device);
158 parameters << TQT_DBusData::fromString(uuid);
160 asyncCallId =
m_baseProxy->sendWithAsyncReply(
"AuthorizeService", parameters);
162 if (asyncCallId != 0)
m_asyncCalls[asyncCallId] =
"AuthorizeService";
164 error = TQT_DBusError();
165 return (asyncCallId != 0);
173 const TQString signalName = findIt.data();
176 if (signalName ==
"RequestPinCode")
178 int _asyncCallId = asyncCallId;
180 if (message.type() == TQT_DBusMessage::ErrorMessage) {
184 TQString _pincode = message[0].toString();
188 else if (signalName ==
"DisplayPinCode")
190 int _asyncCallId = asyncCallId;
192 if (message.type() == TQT_DBusMessage::ErrorMessage) {
199 else if (signalName ==
"RequestPasskey")
201 int _asyncCallId = asyncCallId;
203 if (message.type() == TQT_DBusMessage::ErrorMessage) {
207 TQ_UINT32 _passkey = message[0].toUInt32();
211 else if (signalName ==
"DisplayPasskey")
213 int _asyncCallId = asyncCallId;
215 if (message.type() == TQT_DBusMessage::ErrorMessage) {
222 else if (signalName ==
"RequestConfirmation")
224 int _asyncCallId = asyncCallId;
226 if (message.type() == TQT_DBusMessage::ErrorMessage) {
233 else if (signalName ==
"RequestAuthorization")
235 int _asyncCallId = asyncCallId;
237 if (message.type() == TQT_DBusMessage::ErrorMessage) {
244 else if (signalName ==
"AuthorizeService")
246 int _asyncCallId = asyncCallId;
248 if (message.type() == TQT_DBusMessage::ErrorMessage) {
261 #include "agent1Proxy.moc"
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)
TQT_DBusProxy * m_baseProxy
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)
TQMap< int, TQString > m_asyncCalls
void RequestPinCodeAsyncReply(int asyncCallId, const TQString &pincode)
virtual bool Cancel(TQT_DBusError &error)