tdebluez
transfer1Proxy.cpp
Go to the documentation of this file.
1 // File autogenerated
2 
3 // declaration include
4 #include "transfer1Proxy.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 <tqdbusobjectpath.h>
14 #include <tqdbusproxy.h>
15 #include <tqdbusvariant.h>
16 
17 
18 namespace org
19 {
20 namespace bluez
21 {
22 namespace obex
23 {
24 
25 Transfer1Proxy::Transfer1Proxy(const TQString& service, const TQString& path, TQObject* parent, const char* name)
26  : TQObject(parent, name),
27  m_baseProxy(new TQT_DBusProxy())
28 {
29  m_baseProxy->setInterface("org.bluez.obex.Transfer1");
30  m_baseProxy->setPath(path);
31  m_baseProxy->setService(service);
32 
33 }
34 
36 {
37  delete m_baseProxy;
38 }
39 
40 void Transfer1Proxy::setConnection(const TQT_DBusConnection& connection)
41 {
42  m_baseProxy->setConnection(connection);
43 }
44 
45 bool Transfer1Proxy::Cancel(TQT_DBusError& error)
46 {
47  TQValueList<TQT_DBusData> parameters;
48 
49 
50  TQT_DBusMessage reply = m_baseProxy->sendWithReply("Cancel", parameters, &error);
51 
52  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
53  return true;
54 }
55 
56 bool Transfer1Proxy::Suspend(TQT_DBusError& error)
57 {
58  TQValueList<TQT_DBusData> parameters;
59 
60 
61  TQT_DBusMessage reply = m_baseProxy->sendWithReply("Suspend", parameters, &error);
62 
63  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
64  return true;
65 }
66 
67 bool Transfer1Proxy::Resume(TQT_DBusError& error)
68 {
69  TQValueList<TQT_DBusData> parameters;
70 
71 
72  TQT_DBusMessage reply = m_baseProxy->sendWithReply("Resume", parameters, &error);
73 
74  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
75  return true;
76 }
77 
78 void Transfer1Proxy::setDBusProperty(const TQString& name, const TQT_DBusVariant& value, TQT_DBusError& error)
79 {
80  TQT_DBusConnection connection = m_baseProxy->connection();
81 
82  TQT_DBusMessage message = TQT_DBusMessage::methodCall(m_baseProxy->service(), m_baseProxy->path(), "org.freedesktop.DBus.Properties", "Set");
83 
84  message << TQT_DBusData::fromString(m_baseProxy->interface());
85  message << TQT_DBusData::fromString(name);
86  message << TQT_DBusData::fromVariant(value);
87 
88  connection.sendWithReply(message, &error);
89 }
90 
91 TQT_DBusVariant Transfer1Proxy::getDBusProperty(const TQString& name, TQT_DBusError& error) const
92 {
93  TQT_DBusConnection connection = m_baseProxy->connection();
94 
95  TQT_DBusMessage message = TQT_DBusMessage::methodCall(m_baseProxy->service(), m_baseProxy->path(), "org.freedesktop.DBus.Properties", "Get");
96 
97  message << TQT_DBusData::fromString(m_baseProxy->interface());
98  message << TQT_DBusData::fromString(name);
99 
100  TQT_DBusMessage reply = connection.sendWithReply(message, &error);
101 
102  if (reply.type() != TQT_DBusMessage::ReplyMessage) return TQT_DBusVariant();
103  if (reply.count() != 1) return TQT_DBusVariant();
104 
105  bool ok = false;
106  TQT_DBusVariant value = reply.front().toVariant(&ok);
107  if (!ok) return TQT_DBusVariant();
108 
109  return value;
110 }
111 
112 TQString Transfer1Proxy::getStatus(TQT_DBusError& error) const
113 {
114  TQT_DBusVariant variant = getDBusProperty("Status", error);
115 
116  if (error.isValid()) return TQString();
117 
118  bool ok = false;
119 
120  TQString result = variant.value.toString(&ok);
121  if (!ok) {}
122 
123  return result;
124 }
125 
126 TQT_DBusObjectPath Transfer1Proxy::getSession(TQT_DBusError& error) const
127 {
128  TQT_DBusVariant variant = getDBusProperty("Session", error);
129 
130  if (error.isValid()) return TQT_DBusObjectPath();
131 
132  bool ok = false;
133 
134  TQT_DBusObjectPath result = variant.value.toObjectPath(&ok);
135  if (!ok) {}
136 
137  return result;
138 }
139 
140 TQString Transfer1Proxy::getName(TQT_DBusError& error) const
141 {
142  TQT_DBusVariant variant = getDBusProperty("Name", error);
143 
144  if (error.isValid()) return TQString();
145 
146  bool ok = false;
147 
148  TQString result = variant.value.toString(&ok);
149  if (!ok) {}
150 
151  return result;
152 }
153 
154 TQString Transfer1Proxy::getType(TQT_DBusError& error) const
155 {
156  TQT_DBusVariant variant = getDBusProperty("Type", error);
157 
158  if (error.isValid()) return TQString();
159 
160  bool ok = false;
161 
162  TQString result = variant.value.toString(&ok);
163  if (!ok) {}
164 
165  return result;
166 }
167 
168 TQ_UINT64 Transfer1Proxy::getTime(TQT_DBusError& error) const
169 {
170  TQT_DBusVariant variant = getDBusProperty("Time", error);
171 
172  if (error.isValid()) return TQ_UINT64();
173 
174  bool ok = false;
175 
176  TQ_UINT64 result = variant.value.toUInt64(&ok);
177  if (!ok) {}
178 
179  return result;
180 }
181 
182 TQ_UINT64 Transfer1Proxy::getSize(TQT_DBusError& error) const
183 {
184  TQT_DBusVariant variant = getDBusProperty("Size", error);
185 
186  if (error.isValid()) return TQ_UINT64();
187 
188  bool ok = false;
189 
190  TQ_UINT64 result = variant.value.toUInt64(&ok);
191  if (!ok) {}
192 
193  return result;
194 }
195 
196 TQ_UINT64 Transfer1Proxy::getTransferred(TQT_DBusError& error) const
197 {
198  TQT_DBusVariant variant = getDBusProperty("Transferred", error);
199 
200  if (error.isValid()) return TQ_UINT64();
201 
202  bool ok = false;
203 
204  TQ_UINT64 result = variant.value.toUInt64(&ok);
205  if (!ok) {}
206 
207  return result;
208 }
209 
210 TQString Transfer1Proxy::getFilename(TQT_DBusError& error) const
211 {
212  TQT_DBusVariant variant = getDBusProperty("Filename", error);
213 
214  if (error.isValid()) return TQString();
215 
216  bool ok = false;
217 
218  TQString result = variant.value.toString(&ok);
219  if (!ok) {}
220 
221  return result;
222 }
223 
224 }; // namespace obex
225 
226 }; // namespace bluez
227 
228 }; // namespace org
229 
230 #include "transfer1Proxy.moc"
231 
232 // End of File
233 
virtual bool Resume(TQT_DBusError &error)
virtual TQ_UINT64 getTransferred(TQT_DBusError &error) const
virtual void setDBusProperty(const TQString &name, const TQT_DBusVariant &variant, TQT_DBusError &error)
virtual TQ_UINT64 getTime(TQT_DBusError &error) const
void setConnection(const TQT_DBusConnection &connection)
virtual bool Cancel(TQT_DBusError &error)
virtual TQString getName(TQT_DBusError &error) const
virtual TQT_DBusObjectPath getSession(TQT_DBusError &error) const
virtual TQT_DBusVariant getDBusProperty(const TQString &name, TQT_DBusError &error) const
virtual TQString getStatus(TQT_DBusError &error) const
Transfer1Proxy(const TQString &service, const TQString &path, TQObject *parent=0, const char *name=0)
virtual TQString getType(TQT_DBusError &error) const
virtual TQ_UINT64 getSize(TQT_DBusError &error) const
virtual bool Suspend(TQT_DBusError &error)
virtual TQString getFilename(TQT_DBusError &error) const