85 d->m_app = 0; |
85 d->m_app = 0; |
86 } else { |
86 } else { |
87 if(SUCCEEDED(d->m_app->GetDefaultFolder(olFolderContacts, &d->m_folder))) { |
87 if(SUCCEEDED(d->m_app->GetDefaultFolder(olFolderContacts, &d->m_folder))) { |
88 if(SUCCEEDED(d->m_folder->get_Items(&d->m_collection))) { |
88 if(SUCCEEDED(d->m_folder->get_Items(&d->m_collection))) { |
89 // Register/retrieve our custom ids |
89 // Register/retrieve our custom ids |
90 LPCWSTR customIds[4] = { L"QTCONTACTS_PHONE_META", L"QTCONTACTS_EMAIL_META", L"QTCONTACTS_AVATAR_META", L"QTCONTACTS_AVATAR_TYPE_META" }; |
90 LPCWSTR customIds[4] = { L"QTCONTACTS_PHONE_META", L"QTCONTACTS_EMAIL_META", L"QTCONTACTS_AVATAR_IMAGE_META", L"QTCONTACTS_AVATAR_VIDEO_META" }; |
91 CEPROPID outIds[4]; |
91 CEPROPID outIds[4]; |
92 |
92 |
93 if (SUCCEEDED(d->m_app->GetIDsFromNames(4, customIds, PIM_CREATE | CEVT_LPWSTR, outIds))) { |
93 if (SUCCEEDED(d->m_app->GetIDsFromNames(4, customIds, PIM_CREATE | CEVT_LPWSTR, outIds))) { |
94 d->m_phonemeta = outIds[0]; |
94 d->m_phonemeta = outIds[0]; |
95 d->m_emailmeta = outIds[1]; |
95 d->m_emailmeta = outIds[1]; |
96 d->m_avatarmeta = outIds[2]; |
96 d->m_avatarImageMeta = outIds[2]; |
97 d->m_avatartypemeta = outIds[3]; |
97 d->m_avatarVideoMeta = outIds[3]; |
98 } |
98 } |
99 |
99 |
100 // get an IPOLItems2 pointer for the collection, too |
100 // get an IPOLItems2 pointer for the collection, too |
101 if (SUCCEEDED(d->m_collection->QueryInterface<IPOlItems2>(&d->m_items2))) { |
101 if (SUCCEEDED(d->m_collection->QueryInterface<IPOlItems2>(&d->m_items2))) { |
102 d->m_ids = convertP2QIdList(d->m_collection); |
102 d->m_ids = convertP2QIdList(d->m_collection); |
333 defns[contactType][QContactUrl::DefinitionName].setFields(fields); |
333 defns[contactType][QContactUrl::DefinitionName].setFields(fields); |
334 |
334 |
335 // No contexts for these details |
335 // No contexts for these details |
336 fields = defns[contactType][QContactAvatar::DefinitionName].fields(); |
336 fields = defns[contactType][QContactAvatar::DefinitionName].fields(); |
337 fields.remove(QContactDetail::FieldContext); |
337 fields.remove(QContactDetail::FieldContext); |
338 fields.remove(QContactDetail::FieldContext); |
|
339 fields.remove(QContactDetail::FieldContext); |
|
340 fields.remove(QContactDetail::FieldContext); |
|
341 fields.remove(QContactDetail::FieldContext); |
|
342 fields.remove(QContactDetail::FieldContext); |
|
343 fields.remove(QContactDetail::FieldContext); |
|
344 defns[contactType][QContactAvatar::DefinitionName].setFields(fields); |
338 defns[contactType][QContactAvatar::DefinitionName].setFields(fields); |
345 |
339 |
346 // Simple phone number types (non multiple) |
340 // Simple phone number types (non multiple) |
347 // defns[QContactPhoneNumber::DefinitionName].fields()[QContactPhoneNumber::FieldSubTypes].dataType = QVariant::String; // XXX doesn't work |
341 // defns[QContactPhoneNumber::DefinitionName].fields()[QContactPhoneNumber::FieldSubTypes].dataType = QVariant::String; // XXX doesn't work |
348 fields = defns[contactType][QContactPhoneNumber::DefinitionName].fields(); |
342 fields = defns[contactType][QContactPhoneNumber::DefinitionName].fields(); |
431 } |
425 } |
432 } |
426 } |
433 |
427 |
434 |
428 |
435 |
429 |
436 PROPID QContactWinCEEngine::metaAvatar() const |
430 PROPID QContactWinCEEngine::metaAvatarImage() const |
437 { |
431 { |
438 return d->m_avatarmeta; |
432 return d->m_avatarImageMeta; |
439 } |
433 } |
440 |
434 |
441 PROPID QContactWinCEEngine::metaAvatarType() const |
435 PROPID QContactWinCEEngine::metaAvatarVideo() const |
442 { |
436 { |
443 return d->m_avatartypemeta; |
437 return d->m_avatarVideoMeta; |
444 } |
438 } |
445 |
439 |
446 PROPID QContactWinCEEngine::metaEmail() const |
440 PROPID QContactWinCEEngine::metaEmail() const |
447 { |
441 { |
448 return d->m_emailmeta; |
442 return d->m_emailmeta; |
494 } |
482 } |
495 return cs; |
483 return cs; |
496 } |
484 } |
497 |
485 |
498 /*! \reimp */ |
486 /*! \reimp */ |
499 bool QContactWinCEEngine::saveRelationship(QContactRelationship* relationship, QContactManager::Error* error) |
|
500 { |
|
501 Q_UNUSED(relationship); |
|
502 *error = QContactManager::NotSupportedError; |
|
503 return false; |
|
504 } |
|
505 |
|
506 /*! \reimp */ |
|
507 bool QContactWinCEEngine::removeRelationship(const QContactRelationship& relationship, QContactManager::Error* error) |
|
508 { |
|
509 Q_UNUSED(relationship); |
|
510 *error = QContactManager::NotSupportedError; |
|
511 return false; |
|
512 } |
|
513 |
|
514 /*! \reimp */ |
|
515 bool QContactWinCEEngine::saveContacts(QList<QContact>* contacts, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error* error) |
487 bool QContactWinCEEngine::saveContacts(QList<QContact>* contacts, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error* error) |
516 { |
488 { |
517 bool ret = true; |
489 bool ret = true; |
518 |
490 |
519 for (int j = 0; j < contacts->size(); j++) { |
491 for (int j = 0; j < contacts->size(); j++) { |
540 if (*error != QContactManager::NoError) { |
512 if (*error != QContactManager::NoError) { |
541 errorMap->insert(j, *error); |
513 errorMap->insert(j, *error); |
542 } |
514 } |
543 } |
515 } |
544 return ret; |
516 return ret; |
545 } |
|
546 |
|
547 /*! \reimp */ |
|
548 bool QContactWinCEEngine::setSelfContactId(const QContactLocalId& contactId, QContactManager::Error* error) |
|
549 { |
|
550 Q_UNUSED(contactId); |
|
551 *error = QContactManager::NotSupportedError; |
|
552 return false; |
|
553 } |
|
554 |
|
555 /*! \reimp */ |
|
556 QContactLocalId QContactWinCEEngine::selfContactId(QContactManager::Error* error) const |
|
557 { |
|
558 *error = QContactManager::NotSupportedError; |
|
559 return QContactLocalId(); |
|
560 } |
|
561 |
|
562 /*! \reimp */ |
|
563 QList<QContactRelationship> QContactWinCEEngine::relationships(const QString& relationshipType, const QContactId& participantId, QContactRelationship::Role role, QContactManager::Error* error) const |
|
564 { |
|
565 Q_UNUSED(relationshipType); |
|
566 Q_UNUSED(participantId); |
|
567 Q_UNUSED(role); |
|
568 *error = QContactManager::NotSupportedError; |
|
569 return QList<QContactRelationship>(); |
|
570 } |
|
571 |
|
572 /*! \reimp */ |
|
573 bool QContactWinCEEngine::saveRelationships(QList<QContactRelationship>* relationships, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error* error) |
|
574 { |
|
575 Q_UNUSED(relationships); |
|
576 Q_UNUSED(errorMap); |
|
577 *error = QContactManager::NotSupportedError; |
|
578 return false; |
|
579 } |
|
580 |
|
581 /*! \reimp */ |
|
582 bool QContactWinCEEngine::removeRelationships(const QList<QContactRelationship>& relationships, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error* error) |
|
583 { |
|
584 Q_UNUSED(relationships); |
|
585 Q_UNUSED(errorMap); |
|
586 *error = QContactManager::NotSupportedError; |
|
587 return false; |
|
588 } |
|
589 |
|
590 /*! \reimp */ |
|
591 bool QContactWinCEEngine::saveDetailDefinition(const QContactDetailDefinition& def, const QString& contactType, QContactManager::Error* error) |
|
592 { |
|
593 Q_UNUSED(def); |
|
594 Q_UNUSED(contactType); |
|
595 *error = QContactManager::NotSupportedError; |
|
596 return false; |
|
597 } |
|
598 |
|
599 /*! \reimp */ |
|
600 bool QContactWinCEEngine::removeDetailDefinition(const QString& definitionId, const QString& contactType, QContactManager::Error* error) |
|
601 { |
|
602 Q_UNUSED(definitionId); |
|
603 Q_UNUSED(contactType); |
|
604 *error = QContactManager::NotSupportedError; |
|
605 return false; |
|
606 } |
517 } |
607 |
518 |
608 /*! |
519 /*! |
609 * Returns the list of data types supported by the WinCE engine |
520 * Returns the list of data types supported by the WinCE engine |
610 */ |
521 */ |