1/****************************************************************************
2**
3** Copyright (C) 2015 The Qt Company Ltd.
4** Contact: http://www.qt.io/licensing/
5**
6** This file is part of the QtContacts module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL21$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see http://www.qt.io/terms-conditions. For further
15** information use the contact form at http://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 or version 3 as published by the Free
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22** following information to ensure the GNU Lesser General Public License
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25**
26** As a special exception, The Qt Company gives you certain additional
27** rights. These rights are described in The Qt Company LGPL Exception
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29**
30** $QT_END_LICENSE$
31**
32****************************************************************************/
33
34#ifndef QCONTACTREQUESTS_P_H
35#define QCONTACTREQUESTS_P_H
36
37//
38// W A R N I N G
39// -------------
40//
41// This file is not part of the Qt API. It exists purely as an
42// implementation detail. This header file may change from version to
43// version without notice, or even be removed.
44//
45// We mean it.
46//
47
48#ifndef QT_NO_DEBUG_STREAM
49#include <QtCore/qdebug.h>
50#endif
51#include <QtCore/qmap.h>
52#include <QtCore/qstringlist.h>
53
54#include <QtContacts/qcontact.h>
55#include <QtContacts/qcontactdetail.h>
56#include <QtContacts/qcontactfetchhint.h>
57#include <QtContacts/qcontactfilter.h>
58#include <QtContacts/qcontactrelationshipfilter.h>
59#include <QtContacts/qcontactsortorder.h>
60#include <QtContacts/private/qcontactabstractrequest_p.h>
61
62QT_BEGIN_NAMESPACE_CONTACTS
63
64class QContactSaveRequestPrivate : public QContactAbstractRequestPrivate
65{
66public:
67 QContactSaveRequestPrivate()
68 : QContactAbstractRequestPrivate(QContactAbstractRequest::ContactSaveRequest)
69 {
70 }
71
72 ~QContactSaveRequestPrivate()
73 {
74 }
75
76#ifndef QT_NO_DEBUG_STREAM
77 QDebug& debugStreamOut(QDebug& dbg) const
78 {
79 dbg.nospace() << "QContactSaveRequest(";
80 dbg.nospace() << "contacts=" << m_contacts << ","
81 << "typeMask=" << m_typeMask << ","
82 << "errorMap=" << m_errors;
83 dbg.nospace() << ")";
84 return dbg.maybeSpace();
85 }
86#endif
87
88 QList<QContact> m_contacts;
89 QMap<int, QContactManager::Error> m_errors;
90 QList<QContactDetail::DetailType> m_typeMask;
91};
92
93class QContactFetchRequestPrivate : public QContactAbstractRequestPrivate
94{
95public:
96 QContactFetchRequestPrivate()
97 : QContactAbstractRequestPrivate(QContactAbstractRequest::ContactFetchRequest)
98 {
99 }
100
101 ~QContactFetchRequestPrivate()
102 {
103 }
104
105#ifndef QT_NO_DEBUG_STREAM
106 QDebug& debugStreamOut(QDebug& dbg) const
107 {
108 dbg.nospace() << "QContactFetchRequest("
109 << "filter=" << m_filter << ","
110 << "sorting=" << m_sorting << ","
111 << "fetchHint=" << m_fetchHint;
112 dbg.nospace() << ")";
113 return dbg.maybeSpace();
114 }
115#endif
116
117 QContactFilter m_filter;
118 QList<QContactSortOrder> m_sorting;
119 QContactFetchHint m_fetchHint;
120
121 QList<QContact> m_contacts;
122};
123
124class QContactFetchByIdRequestPrivate : public QContactAbstractRequestPrivate
125{
126public:
127 QContactFetchByIdRequestPrivate()
128 : QContactAbstractRequestPrivate(QContactAbstractRequest::ContactFetchByIdRequest)
129 {
130 }
131
132 ~QContactFetchByIdRequestPrivate()
133 {
134 }
135
136#ifndef QT_NO_DEBUG_STREAM
137 QDebug& debugStreamOut(QDebug& dbg) const
138 {
139 dbg.nospace() << "QContactFetchByIdRequest(\n"
140 << "* contactIds=" << m_contactIds << ",\n"
141 << "* contacts=" << m_contacts << ",\n"
142 << "* fetchHint=" << m_fetchHint << ",\n"
143 << "* errorMap=" << m_errors;
144 dbg.nospace() << "\n)";
145 return dbg.maybeSpace();
146 }
147#endif
148
149 QList<QContactId> m_contactIds;
150 QContactFetchHint m_fetchHint;
151
152 QList<QContact> m_contacts;
153 QMap<int, QContactManager::Error> m_errors;
154};
155
156class QContactRemoveRequestPrivate : public QContactAbstractRequestPrivate
157{
158public:
159 QContactRemoveRequestPrivate()
160 : QContactAbstractRequestPrivate(QContactAbstractRequest::ContactRemoveRequest)
161 {
162 }
163
164 ~QContactRemoveRequestPrivate()
165 {
166 }
167
168#ifndef QT_NO_DEBUG_STREAM
169 QDebug& debugStreamOut(QDebug& dbg) const
170 {
171 dbg.nospace() << "QContactRemoveRequest("
172 << "contactIds=" << m_contactIds << ","
173 << "errorMap=" << m_errors;
174 dbg.nospace() << ")";
175 return dbg.maybeSpace();
176 }
177#endif
178
179 QList<QContactId> m_contactIds;
180 QMap<int, QContactManager::Error> m_errors;
181};
182
183class QContactIdFetchRequestPrivate : public QContactAbstractRequestPrivate
184{
185public:
186 QContactIdFetchRequestPrivate()
187 : QContactAbstractRequestPrivate(QContactAbstractRequest::ContactIdFetchRequest)
188 {
189 }
190
191 ~QContactIdFetchRequestPrivate()
192 {
193 }
194
195#ifndef QT_NO_DEBUG_STREAM
196 QDebug& debugStreamOut(QDebug& dbg) const
197 {
198 dbg.nospace() << "QContactIdFetchRequest("
199 << "filter=" << m_filter << ","
200 << "sorting=" << m_sorting << ","
201 << "ids=" << m_ids;
202 dbg.nospace() << ")";
203 return dbg.maybeSpace();
204 }
205#endif
206
207 QContactFilter m_filter;
208 QList<QContactSortOrder> m_sorting;
209
210 QList<QContactId> m_ids;
211};
212
213class QContactRelationshipFetchRequestPrivate : public QContactAbstractRequestPrivate
214{
215public:
216 QContactRelationshipFetchRequestPrivate()
217 : QContactAbstractRequestPrivate(QContactAbstractRequest::RelationshipFetchRequest)
218 {
219 }
220
221 ~QContactRelationshipFetchRequestPrivate()
222 {
223 }
224
225#ifndef QT_NO_DEBUG_STREAM
226 QDebug& debugStreamOut(QDebug& dbg) const
227 {
228 dbg.nospace() << "QContactRelationshipFetchRequest("
229 << "first=" << m_first << ","
230 << "second=" << m_second << ","
231 << "relationshipType=" << m_relationshipType << ","
232 << "relationships=" << m_relationships;
233 dbg.nospace() << ")";
234 return dbg.maybeSpace();
235 }
236#endif
237
238 // selection criteria
239 QContactId m_first;
240 QContactId m_second;
241 QString m_relationshipType;
242
243 // results
244 QList<QContactRelationship> m_relationships;
245};
246
247class QContactRelationshipSaveRequestPrivate : public QContactAbstractRequestPrivate
248{
249public:
250 QContactRelationshipSaveRequestPrivate()
251 : QContactAbstractRequestPrivate(QContactAbstractRequest::RelationshipSaveRequest)
252 {
253 }
254
255 ~QContactRelationshipSaveRequestPrivate()
256 {
257 }
258
259#ifndef QT_NO_DEBUG_STREAM
260 QDebug& debugStreamOut(QDebug& dbg) const
261 {
262 dbg.nospace() << "QContactRelationshipSaveRequest("
263 << "relationships=" << m_relationships << ","
264 << "errorMap=" << m_errors;
265 dbg.nospace() << ")";
266 return dbg.maybeSpace();
267 }
268#endif
269
270 QList<QContactRelationship> m_relationships;
271 QMap<int, QContactManager::Error> m_errors;
272};
273
274class QContactRelationshipRemoveRequestPrivate : public QContactAbstractRequestPrivate
275{
276public:
277 QContactRelationshipRemoveRequestPrivate()
278 : QContactAbstractRequestPrivate(QContactAbstractRequest::RelationshipRemoveRequest)
279 {
280 }
281
282 ~QContactRelationshipRemoveRequestPrivate()
283 {
284 }
285
286#ifndef QT_NO_DEBUG_STREAM
287 QDebug& debugStreamOut(QDebug& dbg) const
288 {
289 dbg.nospace() << "QContactRelationshipRemoveRequest("
290 << "relationships=" << m_relationships << ","
291 << "errorMap=" << m_errors;
292 dbg.nospace() << ")";
293 return dbg.maybeSpace();
294 }
295#endif
296
297 QList<QContactRelationship> m_relationships;
298 QMap<int, QContactManager::Error> m_errors;
299};
300
301class QContactCollectionFetchRequestPrivate : public QContactAbstractRequestPrivate
302{
303public:
304 QContactCollectionFetchRequestPrivate()
305 : QContactAbstractRequestPrivate(QContactAbstractRequest::CollectionFetchRequest)
306 {
307 }
308
309 ~QContactCollectionFetchRequestPrivate()
310 {
311 }
312
313#ifndef QT_NO_DEBUG_STREAM
314 QDebug& debugStreamOut(QDebug &dbg) const
315 {
316 dbg.nospace() << "QContactCollectionFetchRequestPrivate(";
317 dbg.nospace() << "collections=";
318 dbg.nospace() << m_collections;
319 dbg.nospace() << ")";
320 return dbg.maybeSpace();
321 }
322#endif
323
324 QList<QContactCollection> m_collections;
325};
326
327class QContactCollectionRemoveRequestPrivate : public QContactAbstractRequestPrivate
328{
329public:
330 QContactCollectionRemoveRequestPrivate()
331 : QContactAbstractRequestPrivate(QContactAbstractRequest::CollectionRemoveRequest)
332 {
333 }
334
335 ~QContactCollectionRemoveRequestPrivate()
336 {
337 }
338
339#ifndef QT_NO_DEBUG_STREAM
340 QDebug& debugStreamOut(QDebug &dbg) const
341 {
342 dbg.nospace() << "QContactCollectionRemoveRequestPrivate(";
343 dbg.nospace() << "collectionIds=";
344 dbg.nospace() << m_collectionIds;
345 dbg.nospace() << ",";
346 dbg.nospace() << "errorMap=";
347 dbg.nospace() << m_errors;
348 dbg.nospace() << ")";
349 return dbg.maybeSpace();
350 }
351#endif
352
353 QList<QContactCollectionId> m_collectionIds;
354 QMap<int, QContactManager::Error> m_errors;
355};
356
357class QContactCollectionSaveRequestPrivate : public QContactAbstractRequestPrivate
358{
359public:
360 QContactCollectionSaveRequestPrivate()
361 : QContactAbstractRequestPrivate(QContactAbstractRequest::CollectionSaveRequest)
362 {
363 }
364
365 ~QContactCollectionSaveRequestPrivate()
366 {
367 }
368
369#ifndef QT_NO_DEBUG_STREAM
370 QDebug& debugStreamOut(QDebug &dbg) const
371 {
372 dbg.nospace() << "QContactCollectionSaveRequestPrivate(";
373 dbg.nospace() << "collections=";
374 dbg.nospace() << m_collections;
375 dbg.nospace() << ",";
376 dbg.nospace() << "errorMap=";
377 dbg.nospace() << m_errors;
378 dbg.nospace() << ")";
379 return dbg.maybeSpace();
380 }
381#endif
382
383 QList<QContactCollection> m_collections;
384 QMap<int, QContactManager::Error> m_errors;
385};
386
387QT_END_NAMESPACE_CONTACTS
388
389#endif // QCONTACTREQUESTS_P_H
390

source code of qtpim/src/contacts/requests/qcontactrequests_p.h