diff -r e4ebb16b39ea -r 603d3f8b6302 src/messaging/qmtmengine_symbian.cpp --- a/src/messaging/qmtmengine_symbian.cpp Fri Sep 17 08:34:34 2010 +0300 +++ b/src/messaging/qmtmengine_symbian.cpp Mon Oct 04 01:37:06 2010 +0300 @@ -77,8 +77,6 @@ #include #include // CMtmUiRegistry #include // CBaseMtmUi -#include -#include // SendUi API #include //CMessageData #include #include @@ -93,6 +91,17 @@ #include #include +#ifdef QTHIGHWAYUSED +#include +#include +#include +#include + +#include +#else +#include +#include // SendUi API +#endif QTM_BEGIN_NAMESPACE @@ -781,6 +790,25 @@ return retVal; } +#ifdef QTHIGHWAYUSED +bool CMTMEngine::composeSMSL(const QMessage &message) +{ + bool embedded = false; + XQAiwRequest* request = iAiwMgr.create("com.nokia.symbian.IMessageSend", + "send(QVariantMap, QString)", + embedded); + QMap map; + foreach (QMessageAddress recipient,message.to()) { + map.insert(recipient.addressee(), QString("")); + } + QList data; + data.append(map); + data.append(message.textContent()); + request->setArguments(data); + request->send(); + return true; +} +#else bool CMTMEngine::composeSMSL(const QMessage &message) { CSendUi *sendUi = CSendUi::NewL(); @@ -811,9 +839,39 @@ sendUi->CreateAndSendMessageL(KSenduiMtmSmsUid, messageData, KNullUid, ETrue); CleanupStack::PopAndDestroy(3); //bd, messageData and sendUi + return true; } +#endif +#ifdef QTHIGHWAYUSED + +bool CMTMEngine::composeMMSL(const QMessage &message) +{ + bool embedded = false; + + XQAiwRequest* request = iAiwMgr.create("com.nokia.symbian.IMessageSend", + "send(QVariantMap, QString)", + embedded); + + QMap map; + + foreach (QMessageAddress recipient,message.to()) { + map.insert(recipient.addressee(), QString("")); + } + + QList data; + data.append(map); + data.append(message.textContent()); + request->setArguments(data); + + request->send(); + + return true; +} + +#else + bool CMTMEngine::composeMMSL(const QMessage &message) { CSendUi *sendUi = CSendUi::NewL(); @@ -884,6 +942,51 @@ return true; } +#endif +#ifdef QTHIGHWAYUSED + +bool CMTMEngine::composeEmailL(const QMessage &message) +{ + bool embedded = false; + + XQAiwRequest* request = iAiwMgr.create(XQI_EMAIL_MESSAGE_SEND, + "send(QVariant)",//XQOP_EMAIL_MESSAGE_SEND, + embedded); + + QMap map; + + // Add receivers + QStringList toRecipients; + QStringList ccRecipients; + QStringList bccRecipients; + + foreach(QMessageAddress address, message.to()) + toRecipients.append(address.addressee()); + + foreach(QMessageAddress address, message.cc()) + ccRecipients.append(address.addressee()); + + foreach(QMessageAddress address, message.bcc()) + bccRecipients.append(address.addressee()); + + map.insert(emailSendToKey, toRecipients); + map.insert(emailSendCcKey, ccRecipients); + map.insert(emailSendBccKey, bccRecipients); + map.insert(emailSendSubjectKey, message.subject()); + + map.insert(emailSendBodyTextKey, message.textContent()); + + QList data; + data.append(map); + request->setArguments(data); + + bool res = request->send(); + + return res; +} + +#else + bool CMTMEngine::composeEmailL(const QMessage &message) { CSendUi *sendUi = CSendUi::NewL(); @@ -971,6 +1074,8 @@ return true; } +#endif + bool CMTMEngine::retrieve(QMessageServicePrivate& privateService, const QMessageId &messageId, const QMessageContentContainerId& id) { TRAPD(err, retrieveL(privateService, messageId, id)); @@ -3763,6 +3868,30 @@ ipMmsMtm->LoadMessageL(); message.setFrom(QMessageAddress(QMessageAddress::Phone, QString::fromUtf16(ipMmsMtm->Sender().Ptr(), ipMmsMtm->Sender().Length()))); QMessagePrivate::setSenderName(message, QString::fromUtf16(ipMmsMtm->Sender().Ptr(), ipMmsMtm->Sender().Length())); + + // Read message recipients + const CMsvRecipientList& recipients = ipMmsMtm->AddresseeList(); + QMessageAddressList toList; + QMessageAddressList ccList; + QMessageAddressList bccList; + for (int i=0; i < recipients.Count(); i++) { + switch (recipients.Type(i)) { + case EMsvRecipientCc: + ccList.append(QMessageAddress(QMessageAddress::Phone, QString::fromUtf16(recipients[i].Ptr(), recipients[i].Length()))); + break; + case EMsvRecipientBcc: + bccList.append(QMessageAddress(QMessageAddress::Phone, QString::fromUtf16(recipients[i].Ptr(), recipients[i].Length()))); + break; + case EMsvRecipientTo: + default: + toList.append(QMessageAddress(QMessageAddress::Phone, QString::fromUtf16(recipients[i].Ptr(), recipients[i].Length()))); + break; + } + } + message.setTo(toList); + message.setCc(ccList); + message.setBcc(bccList); + // Read message subject if (receivedEntry.Entry().iDescription.Length() > 0) {