tdebluez
client1Proxy.cpp
Go to the documentation of this file.
1 // File autogenerated
2 
3 // declaration include
4 #include "client1Proxy.h"
5 
6 // TQt includes
7 #include <tqmap.h>
8 #include <tqstring.h>
9 
10 // TQt D-Bus includes
11 #include <tqdbusdata.h>
12 #include <tqdbusdatamap.h>
13 #include <tqdbuserror.h>
14 #include <tqdbusmessage.h>
15 #include <tqdbusobjectpath.h>
16 #include <tqdbusproxy.h>
17 #include <tqdbusvariant.h>
18 
19 
20 namespace org
21 {
22 namespace bluez
23 {
24 namespace obex
25 {
26 
27 Client1Proxy::Client1Proxy(const TQString& service, const TQString& path, TQObject* parent, const char* name)
28  : TQObject(parent, name),
29  m_baseProxy(new TQT_DBusProxy())
30 {
31  m_baseProxy->setInterface("org.bluez.obex.Client1");
32  m_baseProxy->setPath(path);
33  m_baseProxy->setService(service);
34 
35 }
36 
38 {
39  delete m_baseProxy;
40 }
41 
42 void Client1Proxy::setConnection(const TQT_DBusConnection& connection)
43 {
44  m_baseProxy->setConnection(connection);
45 }
46 
47 bool Client1Proxy::CreateSession(const TQString& destination, const TQMap< TQString, TQT_DBusVariant >& args, TQT_DBusObjectPath& session, TQT_DBusError& error)
48 {
49  TQValueList<TQT_DBusData> parameters;
50 
51  parameters << TQT_DBusData::fromString(destination);
52  parameters << TQT_DBusData::fromStringKeyMap(TQT_DBusDataMap< TQString >(args));
53 
54  TQT_DBusMessage reply = m_baseProxy->sendWithReply("CreateSession", parameters, &error);
55 
56  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
57 
58  if (reply.count() != 1) return false;
59 
60  bool ok = false;
61 
62  session = reply.front().toObjectPath(&ok);
63  if (!ok) return false;
64 
65  return true;
66 }
67 
68 bool Client1Proxy::RemoveSession(const TQT_DBusObjectPath& session, TQT_DBusError& error)
69 {
70  TQValueList<TQT_DBusData> parameters;
71 
72  parameters << TQT_DBusData::fromObjectPath(session);
73 
74  TQT_DBusMessage reply = m_baseProxy->sendWithReply("RemoveSession", parameters, &error);
75 
76  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
77  return true;
78 }
79 
80 }; // namespace obex
81 
82 }; // namespace bluez
83 
84 }; // namespace org
85 
86 #include "client1Proxy.moc"
87 
88 // End of File
89 
void setConnection(const TQT_DBusConnection &connection)
virtual bool RemoveSession(const TQT_DBusObjectPath &session, TQT_DBusError &error)
virtual bool CreateSession(const TQString &destination, const TQMap< TQString, TQT_DBusVariant > &args, TQT_DBusObjectPath &session, TQT_DBusError &error)
Client1Proxy(const TQString &service, const TQString &path, TQObject *parent=0, const char *name=0)