tdebluez
session1Proxy.cpp
Go to the documentation of this file.
1 // File autogenerated
2 
3 // declaration include
4 #include "session1Proxy.h"
5 
6 // TQt includes
7 #include <tqstring.h>
8 
9 // TQt D-Bus includes
10 #include <tqdbusconnection.h>
11 #include <tqdbuserror.h>
12 #include <tqdbusmessage.h>
13 #include <tqdbusproxy.h>
14 #include <tqdbusvariant.h>
15 
16 
17 namespace org
18 {
19 namespace bluez
20 {
21 namespace obex
22 {
23 
24 Session1Proxy::Session1Proxy(const TQString& service, const TQString& path, TQObject* parent, const char* name)
25  : TQObject(parent, name),
26  m_baseProxy(new TQT_DBusProxy())
27 {
28  m_baseProxy->setInterface("org.bluez.obex.Session1");
29  m_baseProxy->setPath(path);
30  m_baseProxy->setService(service);
31 
32 }
33 
35 {
36  delete m_baseProxy;
37 }
38 
39 void Session1Proxy::setConnection(const TQT_DBusConnection& connection)
40 {
41  m_baseProxy->setConnection(connection);
42 }
43 
44 bool Session1Proxy::GetCapabilities(TQString& capabilities, TQT_DBusError& error)
45 {
46  TQValueList<TQT_DBusData> parameters;
47 
48 
49  TQT_DBusMessage reply = m_baseProxy->sendWithReply("GetCapabilities", parameters, &error);
50 
51  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
52 
53  if (reply.count() != 1) return false;
54 
55  bool ok = false;
56 
57  capabilities = reply.front().toString(&ok);
58  if (!ok) return false;
59 
60  return true;
61 }
62 
63 void Session1Proxy::setDBusProperty(const TQString& name, const TQT_DBusVariant& value, TQT_DBusError& error)
64 {
65  TQT_DBusConnection connection = m_baseProxy->connection();
66 
67  TQT_DBusMessage message = TQT_DBusMessage::methodCall(m_baseProxy->service(), m_baseProxy->path(), "org.freedesktop.DBus.Properties", "Set");
68 
69  message << TQT_DBusData::fromString(m_baseProxy->interface());
70  message << TQT_DBusData::fromString(name);
71  message << TQT_DBusData::fromVariant(value);
72 
73  connection.sendWithReply(message, &error);
74 }
75 
76 TQT_DBusVariant Session1Proxy::getDBusProperty(const TQString& name, TQT_DBusError& error) const
77 {
78  TQT_DBusConnection connection = m_baseProxy->connection();
79 
80  TQT_DBusMessage message = TQT_DBusMessage::methodCall(m_baseProxy->service(), m_baseProxy->path(), "org.freedesktop.DBus.Properties", "Get");
81 
82  message << TQT_DBusData::fromString(m_baseProxy->interface());
83  message << TQT_DBusData::fromString(name);
84 
85  TQT_DBusMessage reply = connection.sendWithReply(message, &error);
86 
87  if (reply.type() != TQT_DBusMessage::ReplyMessage) return TQT_DBusVariant();
88  if (reply.count() != 1) return TQT_DBusVariant();
89 
90  bool ok = false;
91  TQT_DBusVariant value = reply.front().toVariant(&ok);
92  if (!ok) return TQT_DBusVariant();
93 
94  return value;
95 }
96 
97 TQString Session1Proxy::getSource(TQT_DBusError& error) const
98 {
99  TQT_DBusVariant variant = getDBusProperty("Source", error);
100 
101  if (error.isValid()) return TQString();
102 
103  bool ok = false;
104 
105  TQString result = variant.value.toString(&ok);
106  if (!ok) {}
107 
108  return result;
109 }
110 
111 TQString Session1Proxy::getDestination(TQT_DBusError& error) const
112 {
113  TQT_DBusVariant variant = getDBusProperty("Destination", error);
114 
115  if (error.isValid()) return TQString();
116 
117  bool ok = false;
118 
119  TQString result = variant.value.toString(&ok);
120  if (!ok) {}
121 
122  return result;
123 }
124 
125 bool Session1Proxy::getChannel(TQT_DBusError& error) const
126 {
127  TQT_DBusVariant variant = getDBusProperty("Channel", error);
128 
129  if (error.isValid()) return bool();
130 
131  bool ok = false;
132 
133  bool result = variant.value.toBool(&ok);
134  if (!ok) {}
135 
136  return result;
137 }
138 
139 TQString Session1Proxy::getTarget(TQT_DBusError& error) const
140 {
141  TQT_DBusVariant variant = getDBusProperty("Target", error);
142 
143  if (error.isValid()) return TQString();
144 
145  bool ok = false;
146 
147  TQString result = variant.value.toString(&ok);
148  if (!ok) {}
149 
150  return result;
151 }
152 
153 TQString Session1Proxy::getRoot(TQT_DBusError& error) const
154 {
155  TQT_DBusVariant variant = getDBusProperty("Root", error);
156 
157  if (error.isValid()) return TQString();
158 
159  bool ok = false;
160 
161  TQString result = variant.value.toString(&ok);
162  if (!ok) {}
163 
164  return result;
165 }
166 
167 }; // namespace obex
168 
169 }; // namespace bluez
170 
171 }; // namespace org
172 
173 #include "session1Proxy.moc"
174 
175 // End of File
176 
virtual void setDBusProperty(const TQString &name, const TQT_DBusVariant &variant, TQT_DBusError &error)
void setConnection(const TQT_DBusConnection &connection)
virtual bool getChannel(TQT_DBusError &error) const
virtual TQString getRoot(TQT_DBusError &error) const
virtual TQString getTarget(TQT_DBusError &error) const
virtual TQString getDestination(TQT_DBusError &error) const
virtual bool GetCapabilities(TQString &capabilities, TQT_DBusError &error)
Session1Proxy(const TQString &service, const TQString &path, TQObject *parent=0, const char *name=0)
virtual TQT_DBusVariant getDBusProperty(const TQString &name, TQT_DBusError &error) const
virtual TQString getSource(TQT_DBusError &error) const