473 { |
473 { |
474 HbAction* action = qobject_cast<HbAction*>(sender()); |
474 HbAction* action = qobject_cast<HbAction*>(sender()); |
475 |
475 |
476 if(action) |
476 if(action) |
477 { |
477 { |
478 QList<QVariant> args; |
|
479 QString operation; |
|
480 |
|
481 QString data = action->data().toString(); |
478 QString data = action->data().toString(); |
482 |
479 |
483 int contactId = MsgContactHandler::resolveContactDisplayName( |
480 int contactId = MsgContactHandler::resolveContactDisplayName( |
484 data, |
481 data, |
485 QContactPhoneNumber::DefinitionName, |
482 QContactPhoneNumber::DefinitionName, |
493 data, |
490 data, |
494 QContactEmailAddress::DefinitionName, |
491 QContactEmailAddress::DefinitionName, |
495 QContactEmailAddress::FieldEmailAddress); |
492 QContactEmailAddress::FieldEmailAddress); |
496 } |
493 } |
497 |
494 |
|
495 //service stuff. |
|
496 QString service("phonebookservices"); |
|
497 QString interface; |
|
498 QString operation; |
|
499 QList<QVariant> args; |
|
500 |
498 if(contactId > 0) |
501 if(contactId > 0) |
499 { |
502 { |
500 //open contact card |
503 //open contact card |
501 operation = QString("open(int)"); |
504 interface = QString("com.nokia.symbian.IContactsView"); |
|
505 operation = QString("openContactCard(int)"); |
502 args << contactId; |
506 args << contactId; |
503 } |
507 } |
504 else |
508 else |
505 { |
509 { |
506 //save to contacts with phone number field prefilled. |
510 //save to contacts with phone number field prefilled. |
507 |
511 interface = QString("com.nokia.symbian.IContactsEdit"); |
508 operation = QString("editCreateNew(QString,QString)"); |
512 operation = QString("editCreateNew(QString,QString)"); |
509 QString type = QContactPhoneNumber::DefinitionName; |
513 QString type = QContactPhoneNumber::DefinitionName; |
510 |
|
511 args << type; |
514 args << type; |
512 args << data; |
515 args << data; |
513 } |
516 } |
514 |
|
515 //service stuff. |
|
516 QString serviceName("com.nokia.services.phonebookservices"); |
|
517 |
|
518 XQAiwRequest* request; |
517 XQAiwRequest* request; |
519 XQApplicationManager appManager; |
518 XQApplicationManager appManager; |
520 request = appManager.create(serviceName, "Fetch", operation, true); // embedded |
519 request = appManager.create(service, interface, operation, true); // embedded |
521 if ( request == NULL ) |
520 if ( request == NULL ) |
522 { |
521 { |
523 return; |
522 return; |
524 } |
523 } |
525 |
524 |