50
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "cntservices.h"
|
|
19 |
#include "cntglobal.h"
|
|
20 |
#include "cntdebug.h"
|
|
21 |
#include <cntabstractviewmanager.h>
|
53
|
22 |
#include "cntserviceviewmanager.h"
|
50
|
23 |
#include "cntimageutility.h"
|
|
24 |
#include "cntserviceviewparams.h"
|
53
|
25 |
#include <cntservicescontact.h>
|
50
|
26 |
|
|
27 |
#include <hbview.h>
|
|
28 |
#include <hblistview.h>
|
|
29 |
#include <qversitreader.h>
|
|
30 |
#include <qversitcontactimporter.h>
|
|
31 |
#include <qversitdocument.h>
|
|
32 |
#include <xqserviceprovider.h>
|
61
|
33 |
#include <cntabstractengine.h>
|
50
|
34 |
|
|
35 |
#include <QApplication>
|
|
36 |
#include <QPixmap>
|
|
37 |
#include <QFile>
|
|
38 |
#include <QUrl>
|
|
39 |
|
|
40 |
CntServices::CntServices() :
|
|
41 |
mViewManager(NULL),
|
72
|
42 |
mCurrentProvider(NULL)
|
50
|
43 |
{
|
|
44 |
CNT_ENTRY
|
|
45 |
|
|
46 |
// Definition names supported in symbian back-end
|
|
47 |
m_definitionNames << QContactName::DefinitionName;
|
|
48 |
m_definitionNames << QContactNickname::DefinitionName;
|
|
49 |
m_definitionNames << QContactPhoneNumber::DefinitionName;
|
|
50 |
m_definitionNames << QContactEmailAddress::DefinitionName;
|
|
51 |
m_definitionNames << QContactAddress::DefinitionName;
|
|
52 |
m_definitionNames << QContactUrl::DefinitionName;
|
|
53 |
m_definitionNames << QContactBirthday::DefinitionName;
|
|
54 |
m_definitionNames << QContactOrganization::DefinitionName;
|
|
55 |
m_definitionNames << QContactSyncTarget::DefinitionName;
|
|
56 |
m_definitionNames << QContactNote::DefinitionName;
|
|
57 |
m_definitionNames << QContactFamily::DefinitionName;
|
|
58 |
m_definitionNames << QContactAvatar::DefinitionName;
|
|
59 |
m_definitionNames << QContactAnniversary::DefinitionName;
|
|
60 |
m_definitionNames << QContactGeoLocation::DefinitionName;
|
|
61 |
m_definitionNames << QContactGender::DefinitionName;
|
|
62 |
m_definitionNames << QContactOnlineAccount::DefinitionName;
|
|
63 |
|
|
64 |
CNT_EXIT
|
|
65 |
}
|
|
66 |
|
|
67 |
|
|
68 |
CntServices::~CntServices()
|
|
69 |
{
|
|
70 |
CNT_LOG
|
|
71 |
}
|
|
72 |
|
|
73 |
|
61
|
74 |
void CntServices::setEngine( CntAbstractEngine& aEngine )
|
|
75 |
{
|
|
76 |
CNT_LOG
|
|
77 |
mEngine = &aEngine;
|
|
78 |
mViewManager = &mEngine->viewManager();
|
|
79 |
CntServiceViewManager* srvMng = static_cast<CntServiceViewManager*>(mViewManager);
|
|
80 |
connect(srvMng, SIGNAL(applicationClosed()), this, SLOT(terminateService()));
|
|
81 |
}
|
50
|
82 |
|
|
83 |
void CntServices::singleFetch(
|
|
84 |
const QString &title, const QString &action,
|
|
85 |
CntAbstractServiceProvider& aServiceProvider )
|
|
86 |
{
|
|
87 |
CNT_ENTRY
|
|
88 |
mCurrentProvider = &aServiceProvider;
|
|
89 |
|
|
90 |
CntViewParameters params;
|
|
91 |
params.insert(EViewId, serviceContactFetchView);
|
|
92 |
params.insert(ESelectedAction, action);
|
|
93 |
params.insert(KCntServiceViewParamTitle, title);
|
|
94 |
// SINGLE fetch
|
|
95 |
params.insert(ESelectionMode, HbAbstractItemView::SingleSelection);
|
|
96 |
|
|
97 |
mViewManager->changeView(params);
|
|
98 |
CNT_EXIT
|
|
99 |
}
|
|
100 |
|
|
101 |
|
|
102 |
void CntServices::multiFetch(
|
|
103 |
const QString &title, const QString &action,
|
|
104 |
CntAbstractServiceProvider& aServiceProvider )
|
|
105 |
{
|
|
106 |
CNT_ENTRY
|
|
107 |
mCurrentProvider = &aServiceProvider;
|
|
108 |
|
|
109 |
CntViewParameters params;
|
|
110 |
params.insert(EViewId, serviceContactFetchView);
|
|
111 |
params.insert(ESelectedAction, action);
|
|
112 |
params.insert(KCntServiceViewParamTitle, title);
|
|
113 |
// MULTI fetch
|
|
114 |
params.insert(ESelectionMode, HbAbstractItemView::MultiSelection);
|
|
115 |
mViewManager->changeView(params);
|
|
116 |
CNT_EXIT
|
|
117 |
}
|
|
118 |
|
53
|
119 |
void CntServices::editCreateNew(const QString &definitionName, const QString &value,
|
|
120 |
CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp )
|
|
121 |
{
|
|
122 |
CNT_ENTRY
|
|
123 |
editCreateNew( definitionName, value, QString(), aServiceProvider, defaultForOnlineAccountIsImpp);
|
|
124 |
CNT_EXIT
|
|
125 |
}
|
50
|
126 |
|
53
|
127 |
void CntServices::editCreateNew(const QString &definitionName, const QString &value, const QString& subType,
|
|
128 |
CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp )
|
50
|
129 |
{
|
|
130 |
CNT_ENTRY
|
|
131 |
mCurrentProvider = &aServiceProvider;
|
|
132 |
|
|
133 |
QContact contact;
|
|
134 |
|
|
135 |
if (definitionName == QContactPhoneNumber::DefinitionName)
|
53
|
136 |
{
|
50
|
137 |
QContactPhoneNumber phoneNumber;
|
|
138 |
phoneNumber.setNumber(value);
|
53
|
139 |
if (!subType.isEmpty())
|
|
140 |
{
|
|
141 |
phoneNumber.setSubTypes(subType);
|
50
|
142 |
}
|
53
|
143 |
else
|
|
144 |
{
|
|
145 |
phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile); // Mobile is the default if subtype is not given.
|
|
146 |
}
|
|
147 |
contact.saveDetail(&phoneNumber);
|
|
148 |
}
|
50
|
149 |
else if (definitionName == QContactEmailAddress::DefinitionName)
|
53
|
150 |
{
|
50
|
151 |
QContactEmailAddress email;
|
|
152 |
email.setEmailAddress(value);
|
53
|
153 |
// Email addresses can't have subtypes.
|
50
|
154 |
contact.saveDetail(&email);
|
53
|
155 |
}
|
50
|
156 |
else if (definitionName == QContactOnlineAccount::DefinitionName)
|
53
|
157 |
{
|
50
|
158 |
QContactOnlineAccount account;
|
53
|
159 |
fillOnlineAccount( account, value, subType, defaultForOnlineAccountIsImpp);
|
50
|
160 |
contact.saveDetail(&account);
|
53
|
161 |
}
|
50
|
162 |
|
|
163 |
// Launch editor now
|
|
164 |
CntViewParameters params;
|
|
165 |
params.insert(EViewId, serviceEditView);
|
|
166 |
QVariant var;
|
|
167 |
var.setValue(contact);
|
|
168 |
params.insert(ESelectedContact, var);
|
|
169 |
mViewManager->changeView(params);
|
|
170 |
CNT_EXIT
|
|
171 |
}
|
|
172 |
|
|
173 |
|
61
|
174 |
void CntServices::editCreateNewFromVCard(const QString &fileName,
|
50
|
175 |
CntAbstractServiceProvider& aServiceProvider )
|
|
176 |
{
|
|
177 |
CNT_ENTRY
|
|
178 |
mCurrentProvider = &aServiceProvider;
|
|
179 |
|
|
180 |
CntImageUtility imageUtility;
|
|
181 |
QContact contact;
|
|
182 |
QVersitReader reader;
|
61
|
183 |
QFile vCardFile(fileName);
|
|
184 |
if (!vCardFile.open(QIODevice::ReadOnly))
|
|
185 |
return;
|
|
186 |
reader.setDevice(&vCardFile);
|
50
|
187 |
reader.startReading();
|
|
188 |
reader.waitForFinished();
|
|
189 |
// Use the resulting document(s)...
|
|
190 |
QVersitContactImporter importer;
|
|
191 |
QList<QVersitDocument> versitDocuments = reader.results();
|
|
192 |
if(versitDocuments.count() > 0
|
|
193 |
&& importer.importDocuments(versitDocuments))
|
|
194 |
{
|
|
195 |
QList<QContact> contacts = importer.contacts();
|
|
196 |
if(contacts.count() > 0)
|
|
197 |
contact = contacts.first();
|
|
198 |
}
|
61
|
199 |
vCardFile.close();
|
50
|
200 |
|
|
201 |
// Save thumbnail images
|
|
202 |
QList<QContactThumbnail> details = contact.details<QContactThumbnail>();
|
|
203 |
for (int i = 0;i < details.count();i++)
|
|
204 |
{
|
|
205 |
if (!details.at(i).thumbnail().isNull())
|
|
206 |
{
|
|
207 |
QString imagepath;
|
|
208 |
QPixmap pixmap = QPixmap::fromImage(details.at(i).thumbnail());
|
|
209 |
if(imageUtility.createImage(pixmap,imagepath))
|
|
210 |
{
|
|
211 |
// Update contact detail
|
|
212 |
QContactAvatar detail=details.at(i);
|
|
213 |
detail.setImageUrl(imagepath);
|
|
214 |
contact.saveDetail(&detail);
|
|
215 |
}
|
|
216 |
}
|
|
217 |
}
|
|
218 |
|
|
219 |
removeNotSupportedDetails(contact);
|
|
220 |
removeNotSupportedFields(contact);
|
|
221 |
|
|
222 |
// Launch editor now
|
|
223 |
CntViewParameters params;
|
|
224 |
params.insert(EViewId, serviceEditView);
|
|
225 |
QVariant var;
|
|
226 |
var.setValue(contact);
|
|
227 |
params.insert(ESelectedContact, var);
|
|
228 |
mViewManager->changeView(params);
|
|
229 |
CNT_EXIT
|
|
230 |
}
|
|
231 |
|
53
|
232 |
void CntServices::editUpdateExisting(const QString &definitionName, const QString &value,
|
|
233 |
CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp )
|
|
234 |
{
|
|
235 |
CNT_ENTRY
|
|
236 |
editUpdateExisting( definitionName, value, QString(), aServiceProvider, defaultForOnlineAccountIsImpp );
|
|
237 |
CNT_EXIT
|
|
238 |
}
|
50
|
239 |
|
53
|
240 |
void CntServices::editUpdateExisting(const QString &definitionName, const QString &value, const QString& subType,
|
|
241 |
CntAbstractServiceProvider& aServiceProvider, bool defaultForOnlineAccountIsImpp )
|
50
|
242 |
{
|
|
243 |
CNT_ENTRY
|
|
244 |
mCurrentProvider = &aServiceProvider;
|
|
245 |
|
|
246 |
QContactDetail detail;
|
|
247 |
|
|
248 |
if (definitionName == QContactPhoneNumber::DefinitionName)
|
|
249 |
{
|
|
250 |
QContactPhoneNumber phoneNumber;
|
|
251 |
phoneNumber.setNumber(value);
|
53
|
252 |
if (!subType.isEmpty())
|
|
253 |
{
|
|
254 |
phoneNumber.setSubTypes(subType);
|
|
255 |
}
|
|
256 |
else
|
|
257 |
{
|
|
258 |
phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile);
|
|
259 |
}
|
50
|
260 |
detail = phoneNumber;
|
|
261 |
}
|
|
262 |
else if (definitionName == QContactEmailAddress::DefinitionName)
|
|
263 |
{
|
|
264 |
QContactEmailAddress email;
|
|
265 |
email.setEmailAddress(value);
|
53
|
266 |
// Email addresses can't have subtypes.
|
50
|
267 |
detail = email;
|
|
268 |
}
|
|
269 |
else if (definitionName == QContactOnlineAccount::DefinitionName)
|
|
270 |
{
|
|
271 |
QContactOnlineAccount account;
|
53
|
272 |
fillOnlineAccount( account, value, subType, defaultForOnlineAccountIsImpp);
|
50
|
273 |
detail = account;
|
|
274 |
}
|
|
275 |
|
|
276 |
CntViewParameters params;
|
|
277 |
params.insert(EViewId, serviceContactSelectionView);
|
|
278 |
QVariant var;
|
|
279 |
var.setValue(detail);
|
|
280 |
params.insert(ESelectedDetail, var);
|
|
281 |
mViewManager->changeView(params);
|
|
282 |
CNT_EXIT
|
|
283 |
}
|
|
284 |
|
|
285 |
void CntServices::editExisting(int contactId,
|
|
286 |
CntAbstractServiceProvider& aServiceProvider)
|
|
287 |
{
|
|
288 |
CNT_ENTRY
|
|
289 |
mCurrentProvider = &aServiceProvider;
|
|
290 |
|
|
291 |
// Give parameters for launching editor.
|
|
292 |
CntViewParameters params;
|
|
293 |
params.insert(EViewId, serviceEditView);
|
|
294 |
|
54
|
295 |
QContact contact = contactManager()->contact(contactId);
|
50
|
296 |
QVariant varContact;
|
|
297 |
varContact.setValue(contact);
|
|
298 |
params.insert(ESelectedContact, varContact);
|
|
299 |
mViewManager->changeView(params);
|
|
300 |
CNT_EXIT
|
|
301 |
}
|
|
302 |
|
|
303 |
|
|
304 |
void CntServices::launchContactCard(int aContactId,
|
|
305 |
CntAbstractServiceProvider& aServiceProvider )
|
|
306 |
{
|
|
307 |
CNT_ENTRY
|
|
308 |
mCurrentProvider = &aServiceProvider;
|
|
309 |
|
54
|
310 |
QContact contact = contactManager()->contact(aContactId);
|
50
|
311 |
|
|
312 |
// Launch Contact Card view
|
|
313 |
CntViewParameters params;
|
|
314 |
params.insert(EViewId, serviceContactCardView);
|
|
315 |
QVariant var;
|
|
316 |
var.setValue(contact);
|
|
317 |
params.insert(ESelectedContact, var);
|
|
318 |
mViewManager->changeView( params );
|
|
319 |
CNT_EXIT
|
|
320 |
}
|
|
321 |
|
|
322 |
|
|
323 |
void CntServices::launchTemporaryContactCard(const QString &definitionName, const QString &value,
|
|
324 |
CntAbstractServiceProvider& aServiceProvider )
|
|
325 |
{
|
|
326 |
CNT_ENTRY
|
|
327 |
mCurrentProvider = &aServiceProvider;
|
|
328 |
|
|
329 |
QContact contact;
|
|
330 |
QContactDetail detail;
|
|
331 |
|
53
|
332 |
QContactName name;
|
|
333 |
name.setFirstName(hbTrId("txt_phob_list_unknown"));
|
|
334 |
contact.saveDetail(&name);
|
|
335 |
|
50
|
336 |
if (definitionName == QContactPhoneNumber::DefinitionName)
|
|
337 |
{
|
|
338 |
QContactPhoneNumber phoneNumber;
|
|
339 |
phoneNumber.setNumber(value);
|
|
340 |
phoneNumber.setSubTypes(QContactPhoneNumber::SubTypeMobile);
|
|
341 |
contact.saveDetail(&phoneNumber);
|
|
342 |
detail = phoneNumber;
|
|
343 |
}
|
|
344 |
else if (definitionName == QContactEmailAddress::DefinitionName)
|
|
345 |
{
|
|
346 |
QContactEmailAddress email;
|
|
347 |
email.setEmailAddress(value);
|
|
348 |
contact.saveDetail(&email);
|
|
349 |
detail = email;
|
|
350 |
}
|
|
351 |
else if (definitionName == QContactOnlineAccount::DefinitionName)
|
|
352 |
{
|
|
353 |
QContactOnlineAccount account;
|
|
354 |
account.setAccountUri(value);
|
|
355 |
account.setSubTypes(QContactOnlineAccount::SubTypeSipVoip);
|
|
356 |
contact.saveDetail(&account);
|
|
357 |
detail = account;
|
|
358 |
}
|
|
359 |
|
|
360 |
// Launch the view
|
|
361 |
CntViewParameters params;
|
|
362 |
params.insert(EViewId, serviceAssignContactCardView);
|
|
363 |
QVariant var;
|
|
364 |
var.setValue(contact);
|
|
365 |
params.insert(ESelectedContact, var);
|
|
366 |
QVariant varDetail;
|
|
367 |
varDetail.setValue(detail);
|
|
368 |
params.insert(ESelectedDetail, varDetail);
|
|
369 |
mViewManager->changeView(params);
|
|
370 |
CNT_EXIT
|
|
371 |
}
|
|
372 |
|
54
|
373 |
void CntServices::launchGroupMemberView(int aContactId,
|
|
374 |
CntAbstractServiceProvider& aServiceProvider )
|
|
375 |
{
|
|
376 |
CNT_ENTRY
|
|
377 |
mCurrentProvider = &aServiceProvider;
|
|
378 |
|
|
379 |
QContact contact = contactManager()->contact(aContactId);
|
|
380 |
|
|
381 |
// Launch Group member view
|
|
382 |
CntViewParameters params;
|
|
383 |
params.insert(EViewId, serviceGroupMemberView);
|
|
384 |
QVariant var;
|
|
385 |
var.setValue(contact);
|
|
386 |
params.insert(ESelectedGroupContact, var);
|
|
387 |
mViewManager->changeView( params );
|
|
388 |
CNT_EXIT
|
|
389 |
}
|
50
|
390 |
|
53
|
391 |
void CntServices::quitApp()
|
|
392 |
{
|
72
|
393 |
CNT_ENTRY
|
|
394 |
|
|
395 |
qApp->quit();
|
|
396 |
|
53
|
397 |
CNT_EXIT
|
|
398 |
}
|
|
399 |
|
50
|
400 |
void CntServices::removeNotSupportedDetails(QContact& contact)
|
|
401 |
{
|
|
402 |
CNT_ENTRY
|
|
403 |
// Check definition map, remove details not supported
|
|
404 |
for (int i=0; i < contact.details().count(); i++)
|
|
405 |
{
|
|
406 |
if (!m_definitionNames.contains(contact.details().at(i).definitionName()))
|
|
407 |
{
|
|
408 |
QContactDetail detail= contact.details().at(i);
|
|
409 |
contact.removeDetail(&detail);
|
|
410 |
}
|
|
411 |
}
|
|
412 |
CNT_EXIT
|
|
413 |
}
|
|
414 |
|
|
415 |
void CntServices::removeNotSupportedFields(QContact& contact)
|
|
416 |
{
|
|
417 |
CNT_ENTRY
|
|
418 |
QList<QContactDetail> removeList;
|
|
419 |
|
|
420 |
// Not all fields are supported in symbian back-end
|
|
421 |
// Remove not supported fields
|
|
422 |
for (int i=0; i < contact.details().count(); i++)
|
|
423 |
{
|
|
424 |
QContactDetail detail = contact.details().at(i);
|
|
425 |
if(detail.definitionName() == QContactAddress::DefinitionName)
|
|
426 |
{
|
|
427 |
QContactAddress addrDetail = static_cast<QContactAddress>(detail);
|
|
428 |
|
|
429 |
// Sub-types not supported
|
|
430 |
if(detail.removeValue(QContactAddress::FieldSubTypes))
|
|
431 |
contact.saveDetail(&detail);
|
|
432 |
}
|
|
433 |
else if(detail.definitionName() == QContactAnniversary::DefinitionName)
|
|
434 |
{
|
|
435 |
QContactAnniversary annivDetail = static_cast<QContactAnniversary>(detail);
|
|
436 |
|
|
437 |
// Sub-types not supported
|
|
438 |
if(detail.removeValue(QContactAnniversary::FieldSubType))
|
|
439 |
contact.saveDetail(&detail);
|
|
440 |
|
|
441 |
// Context not supported
|
|
442 |
if(detail.removeValue(QContactDetail::FieldContext))
|
|
443 |
contact.saveDetail(&detail);
|
|
444 |
}
|
|
445 |
else if(detail.definitionName() == QContactPhoneNumber::DefinitionName)
|
|
446 |
{
|
|
447 |
QContactPhoneNumber phoneDetail = static_cast<QContactPhoneNumber>(detail);
|
|
448 |
|
|
449 |
if(phoneDetail.subTypes().size() > 0 )
|
|
450 |
{
|
|
451 |
// Sub-types not supported
|
|
452 |
if(phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeVoice)
|
|
453 |
|| phoneDetail.subTypes().contains(QContactPhoneNumber::SubTypeMessagingCapable))
|
|
454 |
{
|
54
|
455 |
// Default to subtype mobile
|
|
456 |
QStringList l;
|
|
457 |
l << QLatin1String(QContactPhoneNumber::SubTypeMobile);
|
|
458 |
detail.setValue(QContactPhoneNumber::FieldSubTypes, l);
|
50
|
459 |
contact.saveDetail(&detail);
|
|
460 |
}
|
|
461 |
}
|
|
462 |
}
|
|
463 |
else if(detail.definitionName() == QContactUrl::DefinitionName)
|
|
464 |
{
|
|
465 |
QContactUrl urlDetail = static_cast<QContactUrl>(detail);
|
|
466 |
|
|
467 |
QString stype=QContactUrl::SubTypeHomePage;
|
|
468 |
if(urlDetail.subType().compare(stype) != 0)
|
|
469 |
{
|
|
470 |
detail.removeValue(QContactUrl::FieldSubType);
|
|
471 |
contact.saveDetail(&detail);
|
|
472 |
}
|
|
473 |
}
|
|
474 |
}
|
|
475 |
CNT_EXIT
|
|
476 |
}
|
|
477 |
|
53
|
478 |
void CntServices::fillOnlineAccount( QContactOnlineAccount& account, const QString& value,
|
|
479 |
const QString& subType, bool defaultForOnlineAccountIsImpp )
|
81
|
480 |
{
|
|
481 |
// The value should normally consist of two parts:
|
|
482 |
// <service provider>:<user ID>
|
|
483 |
// for eg. "serviceprovider:jack@serviceprovider.com"
|
|
484 |
QStringList accountDetails = value.split(":");
|
|
485 |
if (accountDetails.count() == 1)
|
53
|
486 |
{
|
81
|
487 |
// For some reason it only had one part, so we're assuming it's the user ID.
|
|
488 |
account.setAccountUri(accountDetails.at(0));
|
|
489 |
}
|
|
490 |
else if (accountDetails.count() >= 2)
|
|
491 |
{
|
|
492 |
account.setServiceProvider(accountDetails.at(0));
|
|
493 |
account.setAccountUri(accountDetails.at(1)); // the user ID
|
|
494 |
}
|
|
495 |
|
|
496 |
if (!subType.isEmpty())
|
|
497 |
{
|
|
498 |
account.setSubTypes(subType);
|
|
499 |
}
|
|
500 |
else
|
|
501 |
{
|
|
502 |
if (defaultForOnlineAccountIsImpp)
|
53
|
503 |
{
|
81
|
504 |
account.setSubTypes( QContactOnlineAccount::SubTypeImpp );
|
53
|
505 |
}
|
|
506 |
else
|
|
507 |
{
|
81
|
508 |
account.setSubTypes( QContactOnlineAccount::SubTypeSipVoip );
|
53
|
509 |
}
|
|
510 |
}
|
81
|
511 |
}
|
53
|
512 |
|
50
|
513 |
// This method is inherited from CntAbstractServiceProvider
|
|
514 |
void CntServices::CompleteServiceAndCloseApp(const QVariant& retValue)
|
|
515 |
{
|
|
516 |
CNT_ENTRY
|
|
517 |
if ( mCurrentProvider )
|
54
|
518 |
{
|
50
|
519 |
mCurrentProvider->CompleteServiceAndCloseApp( retValue );
|
54
|
520 |
}
|
50
|
521 |
CNT_EXIT
|
|
522 |
}
|
|
523 |
|
61
|
524 |
// This method is inherited from CntAbstractServiceProvider
|
|
525 |
void CntServices::overrideReturnValue(const QVariant& retValue)
|
|
526 |
{
|
|
527 |
CNT_ENTRY
|
|
528 |
if ( mCurrentProvider )
|
|
529 |
{
|
|
530 |
mCurrentProvider->overrideReturnValue( retValue );
|
|
531 |
}
|
|
532 |
CNT_EXIT
|
|
533 |
}
|
|
534 |
|
|
535 |
// This method is inherited from CntAbstractServiceProvider
|
|
536 |
bool CntServices::allowSubViewsExit()
|
|
537 |
{
|
|
538 |
bool allow = true;
|
|
539 |
if ( mCurrentProvider )
|
|
540 |
{
|
|
541 |
allow = mCurrentProvider->allowSubViewsExit();
|
|
542 |
}
|
|
543 |
|
|
544 |
return allow;
|
|
545 |
}
|
|
546 |
|
53
|
547 |
void CntServices::terminateService()
|
50
|
548 |
{
|
|
549 |
CNT_ENTRY
|
53
|
550 |
if ( mCurrentProvider )
|
54
|
551 |
{
|
53
|
552 |
// Complete the service with KCntServicesTerminated return value
|
|
553 |
QVariant var(KCntServicesTerminated);
|
|
554 |
mCurrentProvider->CompleteServiceAndCloseApp( var );
|
54
|
555 |
}
|
50
|
556 |
CNT_EXIT
|
|
557 |
}
|
|
558 |
|
54
|
559 |
QContactManager* CntServices::contactManager()
|
|
560 |
{
|
61
|
561 |
if ( mEngine )
|
|
562 |
return &mEngine->contactManager(SYMBIAN_BACKEND);
|
54
|
563 |
return NULL;
|
|
564 |
}
|
|
565 |
|
50
|
566 |
Q_IMPLEMENT_USER_METATYPE(CntServicesContact)
|
|
567 |
Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList)
|
53
|
568 |
|