tdebluez
phonebookaccess1Proxy.cpp
Go to the documentation of this file.
1 // File autogenerated
2 
3 // declaration include
5 
6 // TQt includes
7 #include <tqmap.h>
8 #include <tqstring.h>
9 #include <tqstringlist.h>
10 
11 // TQt D-Bus includes
12 #include <tqdbusconnection.h>
13 #include <tqdbusdata.h>
14 #include <tqdbusdatalist.h>
15 #include <tqdbusdatamap.h>
16 #include <tqdbuserror.h>
17 #include <tqdbusmessage.h>
18 #include <tqdbusobjectpath.h>
19 #include <tqdbusproxy.h>
20 #include <tqdbusvariant.h>
21 
22 
23 namespace org
24 {
25 namespace bluez
26 {
27 namespace obex
28 {
29 
30 PhonebookAccess1Proxy::PhonebookAccess1Proxy(const TQString& service, const TQString& path, TQObject* parent, const char* name)
31  : TQObject(parent, name),
32  m_baseProxy(new TQT_DBusProxy())
33 {
34  m_baseProxy->setInterface("org.bluez.obex.PhonebookAccess1");
35  m_baseProxy->setPath(path);
36  m_baseProxy->setService(service);
37 
38 }
39 
41 {
42  delete m_baseProxy;
43 }
44 
45 void PhonebookAccess1Proxy::setConnection(const TQT_DBusConnection& connection)
46 {
47  m_baseProxy->setConnection(connection);
48 }
49 
50 bool PhonebookAccess1Proxy::Select(const TQString& location, const TQString& phonebook, TQT_DBusError& error)
51 {
52  TQValueList<TQT_DBusData> parameters;
53 
54  parameters << TQT_DBusData::fromString(location);
55  parameters << TQT_DBusData::fromString(phonebook);
56 
57  TQT_DBusMessage reply = m_baseProxy->sendWithReply("Select", parameters, &error);
58 
59  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
60  return true;
61 }
62 
63 bool PhonebookAccess1Proxy::PullAll(const TQString& targetfile, const TQMap< TQString, TQT_DBusVariant >& filters, TQT_DBusObjectPath& transfer, TQMap< TQString, TQT_DBusVariant >& properties, TQT_DBusError& error)
64 {
65  TQValueList<TQT_DBusData> parameters;
66 
67  parameters << TQT_DBusData::fromString(targetfile);
68  parameters << TQT_DBusData::fromStringKeyMap(TQT_DBusDataMap< TQString >(filters));
69 
70  TQT_DBusMessage reply = m_baseProxy->sendWithReply("PullAll", parameters, &error);
71 
72  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
73 
74  if (reply.count() != 2) return false;
75 
76  bool ok = false;
77 
78  transfer = reply.front().toObjectPath(&ok);
79  if (!ok) return false;
80 
81  reply.pop_front();
82 
83  bool subOK = false;
84 
85  properties = reply.front().toStringKeyMap(&ok).toVariantMap(&subOK);
86  if (!subOK) return false;
87  if (!ok) return false;
88 
89  return true;
90 }
91 
92 bool PhonebookAccess1Proxy::List(const TQMap< TQString, TQT_DBusVariant >& filters, TQT_DBusDataList& vcard_listing, TQT_DBusError& error)
93 {
94  TQValueList<TQT_DBusData> parameters;
95 
96  parameters << TQT_DBusData::fromStringKeyMap(TQT_DBusDataMap< TQString >(filters));
97 
98  TQT_DBusMessage reply = m_baseProxy->sendWithReply("List", parameters, &error);
99 
100  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
101 
102  if (reply.count() != 1) return false;
103 
104  bool ok = false;
105 
106  vcard_listing = reply.front().toList(&ok);
107  if (!ok) return false;
108 
109  return true;
110 }
111 
112 bool PhonebookAccess1Proxy::Pull(const TQString& vcard, const TQString& targetfile, const TQMap< TQString, TQT_DBusVariant >& filters, TQT_DBusObjectPath& transfer, TQMap< TQString, TQT_DBusVariant >& properties, TQT_DBusError& error)
113 {
114  TQValueList<TQT_DBusData> parameters;
115 
116  parameters << TQT_DBusData::fromString(vcard);
117  parameters << TQT_DBusData::fromString(targetfile);
118  parameters << TQT_DBusData::fromStringKeyMap(TQT_DBusDataMap< TQString >(filters));
119 
120  TQT_DBusMessage reply = m_baseProxy->sendWithReply("Pull", parameters, &error);
121 
122  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
123 
124  if (reply.count() != 2) return false;
125 
126  bool ok = false;
127 
128  transfer = reply.front().toObjectPath(&ok);
129  if (!ok) return false;
130 
131  reply.pop_front();
132 
133  bool subOK = false;
134 
135  properties = reply.front().toStringKeyMap(&ok).toVariantMap(&subOK);
136  if (!subOK) return false;
137  if (!ok) return false;
138 
139  return true;
140 }
141 
142 bool PhonebookAccess1Proxy::Search(const TQString& field, const TQString& value, const TQMap< TQString, TQT_DBusVariant >& filters, TQT_DBusDataList& vcard_listing, TQT_DBusError& error)
143 {
144  TQValueList<TQT_DBusData> parameters;
145 
146  parameters << TQT_DBusData::fromString(field);
147  parameters << TQT_DBusData::fromString(value);
148  parameters << TQT_DBusData::fromStringKeyMap(TQT_DBusDataMap< TQString >(filters));
149 
150  TQT_DBusMessage reply = m_baseProxy->sendWithReply("Search", parameters, &error);
151 
152  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
153 
154  if (reply.count() != 1) return false;
155 
156  bool ok = false;
157 
158  vcard_listing = reply.front().toList(&ok);
159  if (!ok) return false;
160 
161  return true;
162 }
163 
164 bool PhonebookAccess1Proxy::GetSize(TQ_UINT16& size, TQT_DBusError& error)
165 {
166  TQValueList<TQT_DBusData> parameters;
167 
168 
169  TQT_DBusMessage reply = m_baseProxy->sendWithReply("GetSize", parameters, &error);
170 
171  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
172 
173  if (reply.count() != 1) return false;
174 
175  bool ok = false;
176 
177  size = reply.front().toUInt16(&ok);
178  if (!ok) return false;
179 
180  return true;
181 }
182 
183 bool PhonebookAccess1Proxy::UpdateVersion(TQT_DBusError& error)
184 {
185  TQValueList<TQT_DBusData> parameters;
186 
187 
188  TQT_DBusMessage reply = m_baseProxy->sendWithReply("UpdateVersion", parameters, &error);
189 
190  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
191  return true;
192 }
193 
194 bool PhonebookAccess1Proxy::ListFilterFields(TQStringList& fields, TQT_DBusError& error)
195 {
196  TQValueList<TQT_DBusData> parameters;
197 
198 
199  TQT_DBusMessage reply = m_baseProxy->sendWithReply("ListFilterFields", parameters, &error);
200 
201  if (reply.type() != TQT_DBusMessage::ReplyMessage) return false;
202 
203  if (reply.count() != 1) return false;
204 
205  bool ok = false;
206 
207  bool subOK = false;
208 
209  fields = reply.front().toList(&ok).toTQStringList(&subOK);
210  if (!subOK) return false;
211  if (!ok) return false;
212 
213  return true;
214 }
215 
216 void PhonebookAccess1Proxy::setDBusProperty(const TQString& name, const TQT_DBusVariant& value, TQT_DBusError& error)
217 {
218  TQT_DBusConnection connection = m_baseProxy->connection();
219 
220  TQT_DBusMessage message = TQT_DBusMessage::methodCall(m_baseProxy->service(), m_baseProxy->path(), "org.freedesktop.DBus.Properties", "Set");
221 
222  message << TQT_DBusData::fromString(m_baseProxy->interface());
223  message << TQT_DBusData::fromString(name);
224  message << TQT_DBusData::fromVariant(value);
225 
226  connection.sendWithReply(message, &error);
227 }
228 
229 TQT_DBusVariant PhonebookAccess1Proxy::getDBusProperty(const TQString& name, TQT_DBusError& error) const
230 {
231  TQT_DBusConnection connection = m_baseProxy->connection();
232 
233  TQT_DBusMessage message = TQT_DBusMessage::methodCall(m_baseProxy->service(), m_baseProxy->path(), "org.freedesktop.DBus.Properties", "Get");
234 
235  message << TQT_DBusData::fromString(m_baseProxy->interface());
236  message << TQT_DBusData::fromString(name);
237 
238  TQT_DBusMessage reply = connection.sendWithReply(message, &error);
239 
240  if (reply.type() != TQT_DBusMessage::ReplyMessage) return TQT_DBusVariant();
241  if (reply.count() != 1) return TQT_DBusVariant();
242 
243  bool ok = false;
244  TQT_DBusVariant value = reply.front().toVariant(&ok);
245  if (!ok) return TQT_DBusVariant();
246 
247  return value;
248 }
249 
250 TQString PhonebookAccess1Proxy::getFolder(TQT_DBusError& error) const
251 {
252  TQT_DBusVariant variant = getDBusProperty("Folder", error);
253 
254  if (error.isValid()) return TQString();
255 
256  bool ok = false;
257 
258  TQString result = variant.value.toString(&ok);
259  if (!ok) {}
260 
261  return result;
262 }
263 
264 TQString PhonebookAccess1Proxy::getDatabaseIdentifier(TQT_DBusError& error) const
265 {
266  TQT_DBusVariant variant = getDBusProperty("DatabaseIdentifier", error);
267 
268  if (error.isValid()) return TQString();
269 
270  bool ok = false;
271 
272  TQString result = variant.value.toString(&ok);
273  if (!ok) {}
274 
275  return result;
276 }
277 
278 TQString PhonebookAccess1Proxy::getPrimaryCounter(TQT_DBusError& error) const
279 {
280  TQT_DBusVariant variant = getDBusProperty("PrimaryCounter", error);
281 
282  if (error.isValid()) return TQString();
283 
284  bool ok = false;
285 
286  TQString result = variant.value.toString(&ok);
287  if (!ok) {}
288 
289  return result;
290 }
291 
292 TQString PhonebookAccess1Proxy::getSecondaryCounter(TQT_DBusError& error) const
293 {
294  TQT_DBusVariant variant = getDBusProperty("SecondaryCounter", error);
295 
296  if (error.isValid()) return TQString();
297 
298  bool ok = false;
299 
300  TQString result = variant.value.toString(&ok);
301  if (!ok) {}
302 
303  return result;
304 }
305 
306 bool PhonebookAccess1Proxy::getFixedImageSize(TQT_DBusError& error) const
307 {
308  TQT_DBusVariant variant = getDBusProperty("FixedImageSize", error);
309 
310  if (error.isValid()) return bool();
311 
312  bool ok = false;
313 
314  bool result = variant.value.toBool(&ok);
315  if (!ok) {}
316 
317  return result;
318 }
319 
320 }; // namespace obex
321 
322 }; // namespace bluez
323 
324 }; // namespace org
325 
326 #include "phonebookaccess1Proxy.moc"
327 
328 // End of File
329 
virtual TQT_DBusVariant getDBusProperty(const TQString &name, TQT_DBusError &error) const
virtual TQString getFolder(TQT_DBusError &error) const
virtual bool Search(const TQString &field, const TQString &value, const TQMap< TQString, TQT_DBusVariant > &filters, TQT_DBusDataList &vcard_listing, TQT_DBusError &error)
virtual void setDBusProperty(const TQString &name, const TQT_DBusVariant &variant, TQT_DBusError &error)
virtual bool UpdateVersion(TQT_DBusError &error)
virtual TQString getDatabaseIdentifier(TQT_DBusError &error) const
virtual TQString getPrimaryCounter(TQT_DBusError &error) const
virtual bool PullAll(const TQString &targetfile, const TQMap< TQString, TQT_DBusVariant > &filters, TQT_DBusObjectPath &transfer, TQMap< TQString, TQT_DBusVariant > &properties, TQT_DBusError &error)
virtual bool GetSize(TQ_UINT16 &size, TQT_DBusError &error)
virtual bool Pull(const TQString &vcard, const TQString &targetfile, const TQMap< TQString, TQT_DBusVariant > &filters, TQT_DBusObjectPath &transfer, TQMap< TQString, TQT_DBusVariant > &properties, TQT_DBusError &error)
virtual bool ListFilterFields(TQStringList &fields, TQT_DBusError &error)
PhonebookAccess1Proxy(const TQString &service, const TQString &path, TQObject *parent=0, const char *name=0)
virtual TQString getSecondaryCounter(TQT_DBusError &error) const
void setConnection(const TQT_DBusConnection &connection)
virtual bool List(const TQMap< TQString, TQT_DBusVariant > &filters, TQT_DBusDataList &vcard_listing, TQT_DBusError &error)
virtual bool Select(const TQString &location, const TQString &phonebook, TQT_DBusError &error)
virtual bool getFixedImageSize(TQT_DBusError &error) const