# HG changeset patch # User hgs # Date 1278666970 -19800 # Node ID 25fe1fe642e395b0f67edc6998d1018b6a7b1e47 # Parent 224522e33db90202cb7fdb471cf300c6248f7445 201027_02 diff -r 224522e33db9 -r 25fe1fe642e3 inc/unieditorplugininterface.h --- a/inc/unieditorplugininterface.h Tue Jul 06 22:50:16 2010 +0530 +++ b/inc/unieditorplugininterface.h Fri Jul 09 14:46:10 2010 +0530 @@ -34,7 +34,8 @@ */ enum EditorOperation { - Forward = 0, + Forward = 0, + Reply, ReplyAll, Default }; diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgappfw/plugins/msgplugin/src/ccsmsghandler.cpp --- a/messagingapp/msgappfw/plugins/msgplugin/src/ccsmsghandler.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgappfw/plugins/msgplugin/src/ccsmsghandler.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -737,6 +737,18 @@ break; case KSenduiMtmBioUidValue: { + if (aEntry.iMtmData1 == KSenduiMtmBtUidValue) + { + if (aEntry.iBioType == KMsgBioUidVCard.iUid) + { + type = ECsBlueTooth_VCard; + } + else if (aEntry.iBioType == KMsgBioUidVCalendar.iUid) + { + type = ECsBlueTooth_VCal; + } + break; + } type = ECsBioMsg; // based on the biotype uid set message type diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgappfw/plugins/previewplugin/tsrc/group/test_pluginpreview.mmp --- a/messagingapp/msgappfw/plugins/previewplugin/tsrc/group/test_pluginpreview.mmp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgappfw/plugins/previewplugin/tsrc/group/test_pluginpreview.mmp Fri Jul 09 14:46:10 2010 +0530 @@ -65,6 +65,7 @@ USERINCLUDE ..\..\inc USERINCLUDE ..\..\..\..\..\msgutils\unidatautils\unidatamodel\inc USERINCLUDE ..\..\..\..\..\..\messagingappbase\obexmtms\TObexMTM\INC +USERINCLUDE ..\..\..\..\utils\inc APP_LAYER_SYSTEMINCLUDE MW_LAYER_SYSTEMINCLUDE diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp --- a/messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -249,7 +249,7 @@ CCsConversationEntry* conEntry = iConversationEvent->ClientConversation()->GetConversationEntry(); - if (ECsBlueTooth == conEntry->GetType()) + if (ECsBlueTooth == conEntry->GetType()|| ECsBlueTooth_VCard == conEntry->GetType()|| ECsBlueTooth_VCal == conEntry->GetType()) { AddConversationEntryL(conEntry, KBluetoothMsgsConversationId); } @@ -290,7 +290,7 @@ TUint8 CCsConversationCacheHelper::NeedsSpecialProcessing( CCsConversationEntry* aConversationEntry) { - if (ECsBlueTooth == aConversationEntry->GetType()) + if (ECsBlueTooth == aConversationEntry->GetType() || ECsBlueTooth_VCard == aConversationEntry->GetType() || ECsBlueTooth_VCal == aConversationEntry->GetType()) { return 1; } diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgservices/msgserviceapp/src/msgstorehandler.cpp --- a/messagingapp/msgservices/msgserviceapp/src/msgstorehandler.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgservices/msgserviceapp/src/msgstorehandler.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -120,6 +120,21 @@ break; case KSenduiMtmBioUidValue: { + if (entry.iMtmData1 == KSenduiMtmBtUidValue) + { + msgType = ConvergedMessage::BT; + + if (entry.iBioType == KMsgBioUidVCard.iUid) + { + msgSubType = ConvergedMessage::VCard; + } + else if (entry.iBioType == KMsgBioUidVCalendar.iUid) + { + msgSubType = ConvergedMessage::VCal; + } + + break; + } msgType = ConvergedMessage::BioMsg; // based on the biotype uid set message type diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgsettings/settingsview/inc/msgsettingsform.h --- a/messagingapp/msgsettings/settingsview/inc/msgsettingsform.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgsettings/settingsview/inc/msgsettingsform.h Fri Jul 09 14:46:10 2010 +0530 @@ -34,7 +34,6 @@ QGraphicsItem *parent = 0); ~MsgSettingsForm(); void refreshViewForm(); - void expandSMSSettings(); signals: void newSMSCCenterClicked(int); @@ -44,6 +43,7 @@ void addMMSGroupItem(HbDataFormModelItem* parent); void addSmsMCGroupItem(HbDataFormModelItem* parent); void updateSmsMCGroupItem(HbDataFormModelItem* parent); + void expandGroup(HbDataFormModelItem* group,bool expand); private slots: void onPressedServiceMessages(); diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgsettings/settingsview/inc/msgsettingsview.h --- a/messagingapp/msgsettings/settingsview/inc/msgsettingsview.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgsettings/settingsview/inc/msgsettingsview.h Fri Jul 09 14:46:10 2010 +0530 @@ -60,6 +60,10 @@ //Settings Form MsgSettingsForm* mSettingsForm; + //main window. HbMainWindow* mMainWindow; + + //current settings view. + SettingsView mCurrentView; }; #endif // MSGSETTINGSVIEW_H diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgsettings/settingsview/src/msgsettingsform.cpp --- a/messagingapp/msgsettings/settingsview/src/msgsettingsform.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgsettings/settingsview/src/msgsettingsform.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -157,15 +157,10 @@ if (settingsView == MsgSettingsView::MMSView) { //set MMS Settings as expanded - QModelIndex index_mms = settingsModel->indexFromItem(mmsGroup); //TODO: dataform issue on expanding one group item - //this->setExpanded(index_mms, true); +// expandGroup(mmsGroup,true); } - else if(settingsView == MsgSettingsView::SMSView) - { - //expandSMSSettings(); - } - + } void MsgSettingsForm::refreshViewForm() @@ -227,6 +222,7 @@ this, SLOT(onPressedCustomButton())); } + } void MsgSettingsForm::addMMSGroupItem(HbDataFormModelItem* parent) @@ -489,10 +485,13 @@ mSettingEngine->setSMSMessageCenter(index); } -void MsgSettingsForm::expandSMSSettings() +void MsgSettingsForm::expandGroup(HbDataFormModelItem* group,bool expand) { - QModelIndex index_sms = settingsModel->indexFromItem(mSmsMCGroup); + QModelIndex index = settingsModel->indexFromItem(group); - this->setExpanded(index_sms, true); + if(index.isValid()) + { + this->setExpanded(index, expand); + } } //EOF diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp --- a/messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -17,6 +17,7 @@ #include #include #include +#include #include "msgsettingsview.h" #include "msgsettingsform.h" @@ -26,9 +27,11 @@ //LOCALAIZED CONSTANTS #define LOC_MESSAGE_SETTINGS_HEADING hbTrId("txt_messaging_title_messaging_settings") -MsgSettingsView::MsgSettingsView(SettingsView settingsView, - QGraphicsItem *parent) : - MsgBaseView(parent), mSMSCenterView(0), mSettingsForm(0) +MsgSettingsView::MsgSettingsView(SettingsView settingsView,QGraphicsItem *parent): +MsgBaseView(parent), +mSMSCenterView(0), +mSettingsForm(0), +mCurrentView(settingsView) { mMainWindow = this->mainWindow(); @@ -47,11 +50,18 @@ SIGNAL(newSMSCCenterClicked(int)), this, SLOT(onNewSMSCCenterClicked(int))); + mainLayout->addItem(viewHeading); mainLayout->addItem(mSettingsForm); this->setLayout(mainLayout); + + //sms settings need to be created so launch MsgSMSCenterView in edit mode. + if(settingsView == SMSView) + { + onNewSMSCCenterClicked(-1); + } } MsgSettingsView::~MsgSettingsView() @@ -81,9 +91,16 @@ void MsgSettingsView::onSmsCenterEditViewClosed() { + + //sms center view was directly launched, no need to go back to settings view. + if(mCurrentView == SMSView) + { + this->navigationAction()->trigger(); + return; + } //remove the view mMainWindow->removeView(mSMSCenterView); - + //refresh the form mSettingsForm->refreshViewForm(); diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgsettings/settingsview/src/msgsmscentersettingsform.cpp --- a/messagingapp/msgsettings/settingsview/src/msgsmscentersettingsform.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgsettings/settingsview/src/msgsmscentersettingsform.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -32,8 +32,9 @@ //Localized constants #define LOC_SMS_CENTRE_NAME hbTrId("txt_messaging_setlabel_message_centre_name") #define LOC_SMS_CENTRE_NUMBER hbTrId("txt_messaging_setlabel_message_centre_number") -#define LOC_SMS_CENTRE_DELETE hbTrId("txt_messaging_button_delete_message_centre") -#define LOC_MESSAGE_CENTER_SAVED hbTrId("txt_messaging_setlabel_message_centre_saved") +#define LOC_DELETE hbTrId("txt_messaging_button_delete_message_centre") +#define LOC_SMS_CENTRE_DELETE hbTrId("txt_messaging_dialog_delete_message_centre") +#define LOC_MESSAGE_CENTER_SAVED hbTrId("txt_messaging_dpopinfo_message_centre_saved") MsgSMSCenterSettingsForm::MsgSMSCenterSettingsForm(int view, QGraphicsItem *parent) : @@ -114,12 +115,9 @@ QString(""), settingsmodel->invisibleRootItem()); - deleteMessageCentre->setContentWidgetData("text", - LOC_SMS_CENTRE_DELETE); - this->addConnection(deleteMessageCentre, - SIGNAL(clicked()), - this, - SLOT(onPressedCustomButton())); + deleteMessageCentre->setContentWidgetData("text",LOC_DELETE); + this->addConnection(deleteMessageCentre,SIGNAL(clicked()), + this,SLOT(onPressedCustomButton())); } this->setModel(settingsmodel); @@ -153,12 +151,11 @@ } else { - mSettingEngine->editSmsMessageCenter(centerName, - centerNumber, - mView); - - HbNotificationDialog::launchDialog(LOC_MESSAGE_CENTER_SAVED); + mSettingEngine->editSmsMessageCenter(centerName, centerNumber, mView); } + + HbNotificationDialog::launchDialog(LOC_MESSAGE_CENTER_SAVED); + QDEBUG_WRITE("ex MsgSMSCenterSettingsForm::commitChanges"); } diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h --- a/messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h Fri Jul 09 14:46:10 2010 +0530 @@ -147,9 +147,9 @@ /** * Seeker method for getting mms notification estimated msg size - * @return Formatted string of msg size + * @return formatted string for msg size in KB */ - QString NotificationMsgSizeL(); + QString NotificationMsgSize(); /** * Seeker method for getting mms notification class type @@ -168,13 +168,9 @@ /** * Seeker method getting expiry info of a notification msg - * @param [OUT] expiryTime, notification's expiry time - * @param [OUT] expiryTimeQString, formatted string of - * notification's expiry time + * @return formatted string of notification's expiry time */ - void NotificationExpiryDate( - TTime& expiryTime, - QString& expiryTimeStr); + QString NotificationExpiryDate(); /** * Download a specified message @@ -223,6 +219,11 @@ * Checks if the MTM type supported */ TBool IsMtmSupported(long uid); + + /** + * Get max receive size limit (for MMS) from settings + */ + TInt MaxReceiveSizeLimitL(); private: /** diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp --- a/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -15,6 +15,7 @@ * */ +#include #include // from CommonEngine #include #include @@ -46,6 +47,17 @@ _LIT(KUnixEpoch, "19700000:000000.000000"); #define BYTES_TO_KBYTES_FACTOR 1024 +// LOCALIZATION +#define LOC_MESSAGE_SIZE hbTrId("txt_messaging_list_size") +#define LOC_CLASS_ADVERTISEMENT hbTrId("txt_messaging_list_advertisement") +#define LOC_CLASS_INFORMATIONAL hbTrId("txt_messaging_list_informational") +#define LOC_CLASS_PERSONAL hbTrId("txt_messaging_list_personal") +#define LOC_MMS_RETRIEVAL_FAILED hbTrId("txt_messaging_dialog_mms_retrieval_failed") +#define LOC_MMS_NOTIF_EXPIRED hbTrId("Message Expired !") //TODO: localization +#define LOC_MMS_WAITING hbTrId("txt_wireframe_list_multimedia_message_waiting") +#define LOC_MMS_RETRIEVING hbTrId("Retrieving message...") //TODO: localization +#define LOC_MMS_EXPIRY_DATE hbTrId("txt_messaging_list_expiry_date") + // TODO: read global setting of formats on the phone const QString DATE_FORMAT("dd/MM"); const QString TIME_FORMAT("hh:mm"); @@ -674,18 +686,14 @@ // ConversationMsgStoreHandler::NotificationMsgSizeL // @see header //--------------------------------------------------------------- -QString ConversationMsgStoreHandler::NotificationMsgSizeL() +QString ConversationMsgStoreHandler::NotificationMsgSize() { // Size of message. TInt size = iNotificationClient->MessageTransferSize( ); - + // read max receive size limit from settings - CMmsSettings* settings = CMmsSettings::NewL(); - CleanupStack::PushL( settings ); - iNotificationClient->RestoreSettingsL(); - settings->CopyL( iNotificationClient->MmsSettings() ); - TInt maxSize = static_cast(settings->MaximumReceiveSize() ); - CleanupStack::PopAndDestroy( settings ); + TInt maxSize = 0; + TRAP_IGNORE(maxSize = MaxReceiveSizeLimitL()); // apply max size limit rule if( maxSize > 0 ) @@ -696,16 +704,13 @@ } } - // Finally make the UI string - int fileSize = size / BYTES_TO_KBYTES_FACTOR; + TInt fileSize = size / BYTES_TO_KBYTES_FACTOR; if ( size % BYTES_TO_KBYTES_FACTOR ) { fileSize++; } - // TODO: use localized string constants here - QString sizeString = QString("%1").arg(fileSize); - sizeString.append(" Kb"); - return sizeString; + + return LOC_MESSAGE_SIZE.arg(fileSize); } //--------------------------------------------------------------- @@ -714,24 +719,23 @@ //--------------------------------------------------------------- QString ConversationMsgStoreHandler::NotificationClass() { - //TODO: use localized string QString notificationClass; TInt msgClass = iNotificationClient->MessageClass( ); switch( msgClass ) { case EMmsClassPersonal: { - notificationClass = "Personal"; + notificationClass = LOC_CLASS_PERSONAL; break; } case EMmsClassAdvertisement: { - notificationClass = "Advertisement"; + notificationClass = LOC_CLASS_ADVERTISEMENT; break; } case EMmsClassInformational: { - notificationClass = "Informative"; + notificationClass = LOC_CLASS_INFORMATIONAL; break; } default: @@ -750,7 +754,6 @@ int& status, QString& statusStr) { - // TODO : use standard strings provided by Arul // fetch mms notification status from store handler // and map as per our UI requirements TMsvEntry entry = iNotificationClient->Entry().Entry(); @@ -759,23 +762,23 @@ { case ConvergedMessage::NotifFailed: { - statusStr = "Message retrieval failed !"; + statusStr = LOC_MMS_RETRIEVAL_FAILED; break; } case ConvergedMessage::NotifExpired: { - statusStr = "Message Expired !"; + statusStr = LOC_MMS_NOTIF_EXPIRED; break; } case ConvergedMessage::NotifReadyForFetching: { - statusStr = "Multimedia Message waiting..."; + statusStr = LOC_MMS_WAITING; break; } case ConvergedMessage::NotifWaiting: case ConvergedMessage::NotifRetrieving: { - statusStr = "Retrieving message..."; + statusStr = LOC_MMS_RETRIEVING; break; } default: @@ -790,10 +793,11 @@ // ConversationMsgStoreHandler::NotificationExpiryDate // @see header //--------------------------------------------------------------- -void ConversationMsgStoreHandler::NotificationExpiryDate( - TTime& expiryTime, - QString& expiryTimeStr) +QString ConversationMsgStoreHandler::NotificationExpiryDate() { + TTime expiryTime = 0; + QString expiryTimeStr; + // get expiry time from entry expiryTime = iNotificationClient->ExpiryDate( ); TLocale locale; @@ -808,14 +812,7 @@ TTime unixEpoch(KUnixEpoch); TTimeIntervalSeconds seconds; expiryTime.SecondsFrom(unixEpoch, seconds); - QDateTime dateTime; - dateTime.setTime_t(seconds.Int()); - if (dateTime.date() == QDateTime::currentDateTime().date()) { - expiryTimeStr = dateTime.toString(TIME_FORMAT); - } - else { - expiryTimeStr = dateTime.toString(DATE_FORMAT); - } + return LOC_MMS_EXPIRY_DATE.arg(seconds.Int()); } //----------------------------------------------------------------------------- @@ -967,6 +964,22 @@ break; case KSenduiMtmBioUidValue: { + if (entry.iMtmData1 == KSenduiMtmBtUidValue) + { + msgType = ConvergedMessage::BT; + + if (entry.iBioType == KMsgBioUidVCard.iUid) + { + msgSubType = ConvergedMessage::VCard; + } + else if (entry.iBioType == KMsgBioUidVCalendar.iUid) + { + + msgSubType = ConvergedMessage::VCal; + } + + break; + } msgType = ConvergedMessage::BioMsg; // based on the biotype uid set message type @@ -997,6 +1010,10 @@ } } +//---------------------------------------------------------------------------- +// ConversationMsgStoreHandler::getMsgSubType +// @see header +//---------------------------------------------------------------------------- int ConversationMsgStoreHandler::getMsgSubType(int msgId) { int msgType = ConvergedMessage::None; @@ -1010,4 +1027,19 @@ return msgSubType; } +//---------------------------------------------------------------------------- +// ConversationMsgStoreHandler::MaxReceiveSizeLimitL +// @see header +//---------------------------------------------------------------------------- +TInt ConversationMsgStoreHandler::MaxReceiveSizeLimitL() +{ + CMmsSettings* settings = CMmsSettings::NewL(); + CleanupStack::PushL( settings ); + iNotificationClient->RestoreSettingsL(); + settings->CopyL( iNotificationClient->MmsSettings() ); + TInt maxSize = static_cast(settings->MaximumReceiveSize() ); + CleanupStack::PopAndDestroy( settings ); + return maxSize; +} + // End of file diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/appengine/src/conversationsengineutility.cpp --- a/messagingapp/msgui/appengine/src/conversationsengineutility.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/appengine/src/conversationsengineutility.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -51,6 +51,8 @@ mMessageType = ConvergedMessage::BioMsg; break; case ECsBlueTooth: + case ECsBlueTooth_VCard: + case ECsBlueTooth_VCal: mMessageType = ConvergedMessage::BT; break; case ECsMmsNotification: @@ -110,6 +112,12 @@ case ECsBioMsg_VCal: messageSubType = ConvergedMessage::VCal; break; + case ECsBlueTooth_VCard: + messageSubType = ConvergedMessage::VCard; + break; + case ECsBlueTooth_VCal: + messageSubType = ConvergedMessage::VCal; + break; case ECsAudio: messageSubType = ConvergedMessage::Audio; break; diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/appengine/src/conversationsmodel.cpp --- a/messagingapp/msgui/appengine/src/conversationsmodel.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/appengine/src/conversationsmodel.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -663,21 +663,6 @@ } // fetch relevent info to show in CV - // msg size - QString estimatedMsgSizeStr = QString("%1").arg(0); - estimatedMsgSizeStr.append(" Kb"); - TRAP_IGNORE(estimatedMsgSizeStr = - mMsgStoreHandler->NotificationMsgSizeL()); - - // msg class type - QString classInfoStr = mMsgStoreHandler->NotificationClass(); - - // notification expiry date - //TODO: Need to do localization of digits used to show expiry time - TTime expiryTime; - QString expiryTimeStr; - mMsgStoreHandler->NotificationExpiryDate(expiryTime, expiryTimeStr); - // notification state e.g. waiting, retrieving etc QString statusStr; int status; @@ -685,19 +670,15 @@ // create data for bodytext role QString dataText; - dataText.append("Size: "); // TODO: use logical str name - dataText.append(estimatedMsgSizeStr); + dataText.append(mMsgStoreHandler->NotificationMsgSize()); dataText.append(QChar::LineSeparator); - dataText.append("Class: "); // TODO: use logical str name - dataText.append(classInfoStr); + dataText.append(mMsgStoreHandler->NotificationClass()); dataText.append(QChar::LineSeparator); - dataText.append("Expiry date: "); //TODO: use logical str name - dataText.append(expiryTimeStr); + dataText.append(mMsgStoreHandler->NotificationExpiryDate()); if(!statusStr.isEmpty()) { dataText.append(QChar::LineSeparator); dataText.append(statusStr); - dataText.append(QChar::LineSeparator); //Temp fix to be removed } // set fetched data to roles @@ -719,38 +700,49 @@ void ConversationsModel::handleBlueToothMessages(QStandardItem& item, const CCsConversationEntry& entry) { - //TODO, needs to be revisited again, once BT team provides the solution for - //BT received as Biomsg issue. - QString description = XQConversions::s60DescToQString(*(entry.Description())); + int msgSubType = ConversationsEngineUtility::messageSubType(entry.GetType()); + if (msgSubType == ConvergedMessage::VCard) + { + iBioMsgPlugin->setMessageId(entry.EntryId()); + + if (iBioMsgPlugin->attachmentCount() > 0) + { + UniMessageInfoList attList = iBioMsgPlugin->attachmentList(); + QString attachmentPath = attList[0]->path(); - if (description.contains(".vcf") || description.contains(".ics")) // "vCard" - { - //message sub-type - item.setData(ConvergedMessage::VCard, MessageSubType); + //get display-name and set as bodytext + QString displayName = MsgContactHandler::getVCardDisplayName(attachmentPath); + item.setData(displayName, BodyText); + // clear attachement list : its allocated at data model + while (!attList.isEmpty()) + { + delete attList.takeFirst(); + } + + } + } - //parse vcf file to get the details - QString displayName = MsgContactHandler::getVCardDisplayName( - description); - item.setData(displayName, BodyText); - } - else - { - if (description.contains(".vcs")) // "vCalendar" - { - //message sub-type - item.setData(ConvergedMessage::VCal, MessageSubType); - } - else - { - //message sub-type - item.setData(ConvergedMessage::None, MessageSubType); - } - //for BT messages we show filenames for all other (except vcard) messages - //get filename and set as body - QFileInfo fileinfo(description); - QString filename = fileinfo.fileName(); - item.setData(filename, BodyText); - } + else + { + QString description = XQConversions::s60DescToQString(*(entry.Description())); + + if (msgSubType == ConvergedMessage::VCal) // "vCalendar" + { + //message sub-type + item.setData(ConvergedMessage::VCal, MessageSubType); + } + else + { + //message sub-type + item.setData(ConvergedMessage::None, MessageSubType); + } + //for BT messages we show filenames for all other (except vcard) messages + //get filename and set as body + QFileInfo fileinfo(description); + QString filename = fileinfo.fileName(); + item.setData(filename, BodyText); + } + } //--------------------------------------------------------------- diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/appengine/src/conversationssummarymodel.cpp --- a/messagingapp/msgui/appengine/src/conversationssummarymodel.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/appengine/src/conversationssummarymodel.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -305,29 +305,44 @@ void ConversationsSummaryModel::handleBlueToothMessages(QStandardItem& item, const CCsConversationEntry& entry) { - //TODO, needs to be revisited again, once BT team provides the solution for - //BT received as Biomsg issue. - QString description = XQConversions::s60DescToQString(*(entry.Description())); - - if (description.contains(".vcf") || description.contains(".ics")) // "vCard" + int msgSubType = ConversationsEngineUtility::messageSubType(entry.GetType()); + if (msgSubType == ConvergedMessage::VCard) { - //message sub-type - item.setData(ConvergedMessage::VCard, MessageSubType); + UniDataModelLoader* pluginLoader = new UniDataModelLoader; + UniDataModelPluginInterface* bioMsgPlugin = pluginLoader->getDataModelPlugin( + ConvergedMessage::BioMsg); + bioMsgPlugin->setMessageId(entry.EntryId()); + + if (bioMsgPlugin->attachmentCount() > 0) + { + UniMessageInfoList attList = bioMsgPlugin->attachmentList(); + QString attachmentPath = attList[0]->path(); - //parse vcf file to get the details - QString displayName = MsgContactHandler::getVCardDisplayName( - description); - item.setData(displayName, BodyText); + //get display-name and set as bodytext + QString displayName = MsgContactHandler::getVCardDisplayName(attachmentPath); + item.setData(displayName, BodyText); + + // clear attachement list : its allocated at data model + while (!attList.isEmpty()) + { + delete attList.takeFirst(); + } + + } + delete pluginLoader; } + else { - if (description.contains(".vcs")) // "vCalendar" + QString description = XQConversions::s60DescToQString(*(entry.Description())); + + if (msgSubType == ConvergedMessage::VCal) // "vCalendar" { //message sub-type item.setData(ConvergedMessage::VCal, MessageSubType); } - else - { + else + { //message sub-type item.setData(ConvergedMessage::None, MessageSubType); } diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/appengine/tsrc/testconversationengine/testconversationengine.pro --- a/messagingapp/msgui/appengine/tsrc/testconversationengine/testconversationengine.pro Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/testconversationengine.pro Fri Jul 09 14:46:10 2010 +0530 @@ -32,6 +32,7 @@ INCLUDEPATH += ../../../../msgappfw/client/inc INCLUDEPATH += ../../../../smartmessaging/ringbc/inc INCLUDEPATH += ../../../../msgutils/unieditorutils/editorgenutils/inc +INCLUDEPATH += ../../../msguiutils/inc INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE @@ -100,4 +101,6 @@ -lestor \ -lFeatMgr \ -lfbscli \ - -lringbc + -lringbc \ + -lmsguiutils \ + -lcsserverclientapi diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/bwins/appengineu.def --- a/messagingapp/msgui/bwins/appengineu.def Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/bwins/appengineu.def Fri Jul 09 14:46:10 2010 +0530 @@ -1,45 +1,47 @@ EXPORTS ?fetchMoreConversations@ConversationsEngine@@QAEXXZ @ 1 NONAME ; void ConversationsEngine::fetchMoreConversations(void) - ?disableRegisterationForCVEvents@ConversationsEngine@@QAEXXZ @ 2 NONAME ; void ConversationsEngine::disableRegisterationForCVEvents(void) - ?getConversationIdFromAddress@ConversationsEngine@@QAE_JVQString@@@Z @ 3 NONAME ; long long ConversationsEngine::getConversationIdFromAddress(class QString) - ?deleteAllDraftMessages@ConversationsEngine@@QAEXXZ @ 4 NONAME ; void ConversationsEngine::deleteAllDraftMessages(void) - ?metaObject@ConversationsEngine@@UBEPBUQMetaObject@@XZ @ 5 NONAME ; struct QMetaObject const * ConversationsEngine::metaObject(void) const - ??1ConversationsEngine@@UAE@XZ @ 6 NONAME ; ConversationsEngine::~ConversationsEngine(void) - ?markAsReadAndGetType@ConversationsEngine@@QAEXHAAH0@Z @ 7 NONAME ; void ConversationsEngine::markAsReadAndGetType(int, int &, int &) - ?deleteConversations@ConversationsEngine@@QAE_N_J@Z @ 8 NONAME ; bool ConversationsEngine::deleteConversations(long long) - ?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 9 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *) - ?qt_metacast@ConversationsEngine@@UAEPAXPBD@Z @ 10 NONAME ; void * ConversationsEngine::qt_metacast(char const *) - ?emitConversationListModelPopulated@ConversationsEngine@@QAEXXZ @ 11 NONAME ; void ConversationsEngine::emitConversationListModelPopulated(void) - ?getDraftsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 12 NONAME ; class QStandardItemModel * ConversationsEngine::getDraftsModel(void) - ?emitOpenConversationViewIdUpdate@ConversationsEngine@@QAEXH@Z @ 13 NONAME ; void ConversationsEngine::emitOpenConversationViewIdUpdate(int) - ?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *, int) - ?tr@ConversationsEngine@@SA?AVQString@@PBD0H@Z @ 15 NONAME ; class QString ConversationsEngine::tr(char const *, char const *, int) - ?conversationModelUpdated@ConversationsEngine@@IAEXXZ @ 16 NONAME ; void ConversationsEngine::conversationModelUpdated(void) - ?getStaticMetaObject@ConversationsEngine@@SAABUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const & ConversationsEngine::getStaticMetaObject(void) - ?downloadOperationSupported@ConversationsEngine@@QAE_NH@Z @ 18 NONAME ; bool ConversationsEngine::downloadOperationSupported(int) - ?markMessagesRead@ConversationsEngine@@QAE_NAAV?$QList@H@@@Z @ 19 NONAME ; bool ConversationsEngine::markMessagesRead(class QList &) - ?conversationModelPopulated@ConversationsEngine@@IAEXXZ @ 20 NONAME ; void ConversationsEngine::conversationModelPopulated(void) - ?downloadMessage@ConversationsEngine@@QAEHH@Z @ 21 NONAME ; int ConversationsEngine::downloadMessage(int) - ?getConversationsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 22 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsModel(void) - ?markConversationRead@ConversationsEngine@@QAE_N_J@Z @ 23 NONAME ; bool ConversationsEngine::markConversationRead(long long) - ?getCurrentConversationId@ConversationsEngine@@QAE_JXZ @ 24 NONAME ; long long ConversationsEngine::getCurrentConversationId(void) - ??_EConversationsEngine@@UAE@I@Z @ 25 NONAME ; ConversationsEngine::~ConversationsEngine(unsigned int) - ?getConversationsSummaryModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 26 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsSummaryModel(void) - ?conversationListModelPopulated@ConversationsEngine@@IAEXXZ @ 27 NONAME ; void ConversationsEngine::conversationListModelPopulated(void) - ??0ConversationsEngine@@AAE@PAVQObject@@@Z @ 28 NONAME ; ConversationsEngine::ConversationsEngine(class QObject *) - ?getContactDetails@ConversationsEngine@@QAEX_JAAVQString@@1@Z @ 29 NONAME ; void ConversationsEngine::getContactDetails(long long, class QString &, class QString &) - ?instance@ConversationsEngine@@SAPAV1@XZ @ 30 NONAME ; class ConversationsEngine * ConversationsEngine::instance(void) - ?tr@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 31 NONAME ; class QString ConversationsEngine::tr(char const *, char const *) - ?resendMessage@ConversationsEngine@@QAE_NH@Z @ 32 NONAME ; bool ConversationsEngine::resendMessage(int) - ?emitConversationModelUpdated@ConversationsEngine@@QAEXXZ @ 33 NONAME ; void ConversationsEngine::emitConversationModelUpdated(void) - ?getConversations@ConversationsEngine@@QAE_N_J@Z @ 34 NONAME ; bool ConversationsEngine::getConversations(long long) - ?clearConversations@ConversationsEngine@@QAE_NXZ @ 35 NONAME ; bool ConversationsEngine::clearConversations(void) - ?getDBHandle@ConversationsEngine@@QAEAAVRSqlDatabase@@AAH@Z @ 36 NONAME ; class RSqlDatabase & ConversationsEngine::getDBHandle(int &) - ?getMsgSubType@ConversationsEngine@@QAEHH@Z @ 37 NONAME ; int ConversationsEngine::getMsgSubType(int) - ?getConversationIdFromContactId@ConversationsEngine@@QAE_JH@Z @ 38 NONAME ; long long ConversationsEngine::getConversationIdFromContactId(int) - ?staticMetaObject@ConversationsEngine@@2UQMetaObject@@B @ 39 NONAME ; struct QMetaObject const ConversationsEngine::staticMetaObject - ?deleteMessages@ConversationsEngine@@QAEXAAV?$QList@H@@@Z @ 40 NONAME ; void ConversationsEngine::deleteMessages(class QList &) - ?emitConversationModelPopulated@ConversationsEngine@@QAEXXZ @ 41 NONAME ; void ConversationsEngine::emitConversationModelPopulated(void) - ?conversationViewEmpty@ConversationsEngine@@IAEXXZ @ 42 NONAME ; void ConversationsEngine::conversationViewEmpty(void) - ?qt_metacall@ConversationsEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 43 NONAME ; int ConversationsEngine::qt_metacall(enum QMetaObject::Call, int, void * *) + ?emitConversationListModelEntryDeleted@ConversationsEngine@@QAEXH@Z @ 2 NONAME ; void ConversationsEngine::emitConversationListModelEntryDeleted(int) + ?disableRegisterationForCVEvents@ConversationsEngine@@QAEXXZ @ 3 NONAME ; void ConversationsEngine::disableRegisterationForCVEvents(void) + ?getConversationIdFromAddress@ConversationsEngine@@QAE_JVQString@@@Z @ 4 NONAME ; long long ConversationsEngine::getConversationIdFromAddress(class QString) + ?deleteAllDraftMessages@ConversationsEngine@@QAEXXZ @ 5 NONAME ; void ConversationsEngine::deleteAllDraftMessages(void) + ?metaObject@ConversationsEngine@@UBEPBUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const * ConversationsEngine::metaObject(void) const + ??1ConversationsEngine@@UAE@XZ @ 7 NONAME ; ConversationsEngine::~ConversationsEngine(void) + ?markAsReadAndGetType@ConversationsEngine@@QAEXHAAH0@Z @ 8 NONAME ; void ConversationsEngine::markAsReadAndGetType(int, int &, int &) + ?deleteConversations@ConversationsEngine@@QAE_N_J@Z @ 9 NONAME ; bool ConversationsEngine::deleteConversations(long long) + ?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 10 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *) + ?qt_metacast@ConversationsEngine@@UAEPAXPBD@Z @ 11 NONAME ; void * ConversationsEngine::qt_metacast(char const *) + ?emitConversationListModelPopulated@ConversationsEngine@@QAEXXZ @ 12 NONAME ; void ConversationsEngine::emitConversationListModelPopulated(void) + ?getDraftsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 13 NONAME ; class QStandardItemModel * ConversationsEngine::getDraftsModel(void) + ?emitOpenConversationViewIdUpdate@ConversationsEngine@@QAEXH@Z @ 14 NONAME ; void ConversationsEngine::emitOpenConversationViewIdUpdate(int) + ?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0H@Z @ 15 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *, int) + ?tr@ConversationsEngine@@SA?AVQString@@PBD0H@Z @ 16 NONAME ; class QString ConversationsEngine::tr(char const *, char const *, int) + ?conversationModelUpdated@ConversationsEngine@@IAEXXZ @ 17 NONAME ; void ConversationsEngine::conversationModelUpdated(void) + ?getStaticMetaObject@ConversationsEngine@@SAABUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const & ConversationsEngine::getStaticMetaObject(void) + ?downloadOperationSupported@ConversationsEngine@@QAE_NH@Z @ 19 NONAME ; bool ConversationsEngine::downloadOperationSupported(int) + ?markMessagesRead@ConversationsEngine@@QAE_NAAV?$QList@H@@@Z @ 20 NONAME ; bool ConversationsEngine::markMessagesRead(class QList &) + ?conversationModelPopulated@ConversationsEngine@@IAEXXZ @ 21 NONAME ; void ConversationsEngine::conversationModelPopulated(void) + ?downloadMessage@ConversationsEngine@@QAEHH@Z @ 22 NONAME ; int ConversationsEngine::downloadMessage(int) + ?getConversationsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 23 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsModel(void) + ?markConversationRead@ConversationsEngine@@QAE_N_J@Z @ 24 NONAME ; bool ConversationsEngine::markConversationRead(long long) + ?getCurrentConversationId@ConversationsEngine@@QAE_JXZ @ 25 NONAME ; long long ConversationsEngine::getCurrentConversationId(void) + ??_EConversationsEngine@@UAE@I@Z @ 26 NONAME ; ConversationsEngine::~ConversationsEngine(unsigned int) + ?conversationListEntryDeleted@ConversationsEngine@@IAEXH@Z @ 27 NONAME ; void ConversationsEngine::conversationListEntryDeleted(int) + ?getConversationsSummaryModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 28 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsSummaryModel(void) + ?conversationListModelPopulated@ConversationsEngine@@IAEXXZ @ 29 NONAME ; void ConversationsEngine::conversationListModelPopulated(void) + ??0ConversationsEngine@@AAE@PAVQObject@@@Z @ 30 NONAME ; ConversationsEngine::ConversationsEngine(class QObject *) + ?instance@ConversationsEngine@@SAPAV1@XZ @ 31 NONAME ; class ConversationsEngine * ConversationsEngine::instance(void) + ?getContactDetails@ConversationsEngine@@QAEX_JAAVQString@@1@Z @ 32 NONAME ; void ConversationsEngine::getContactDetails(long long, class QString &, class QString &) + ?tr@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 33 NONAME ; class QString ConversationsEngine::tr(char const *, char const *) + ?resendMessage@ConversationsEngine@@QAE_NH@Z @ 34 NONAME ; bool ConversationsEngine::resendMessage(int) + ?emitConversationModelUpdated@ConversationsEngine@@QAEXXZ @ 35 NONAME ; void ConversationsEngine::emitConversationModelUpdated(void) + ?getConversations@ConversationsEngine@@QAE_N_J@Z @ 36 NONAME ; bool ConversationsEngine::getConversations(long long) + ?clearConversations@ConversationsEngine@@QAE_NXZ @ 37 NONAME ; bool ConversationsEngine::clearConversations(void) + ?getDBHandle@ConversationsEngine@@QAEAAVRSqlDatabase@@AAH@Z @ 38 NONAME ; class RSqlDatabase & ConversationsEngine::getDBHandle(int &) + ?getMsgSubType@ConversationsEngine@@QAEHH@Z @ 39 NONAME ; int ConversationsEngine::getMsgSubType(int) + ?getConversationIdFromContactId@ConversationsEngine@@QAE_JH@Z @ 40 NONAME ; long long ConversationsEngine::getConversationIdFromContactId(int) + ?staticMetaObject@ConversationsEngine@@2UQMetaObject@@B @ 41 NONAME ; struct QMetaObject const ConversationsEngine::staticMetaObject + ?deleteMessages@ConversationsEngine@@QAEXAAV?$QList@H@@@Z @ 42 NONAME ; void ConversationsEngine::deleteMessages(class QList &) + ?emitConversationModelPopulated@ConversationsEngine@@QAEXXZ @ 43 NONAME ; void ConversationsEngine::emitConversationModelPopulated(void) + ?conversationViewEmpty@ConversationsEngine@@IAEXXZ @ 44 NONAME ; void ConversationsEngine::conversationViewEmpty(void) + ?qt_metacall@ConversationsEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 45 NONAME ; int ConversationsEngine::qt_metacall(enum QMetaObject::Call, int, void * *) diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/bwins/unifiededitoru.def --- a/messagingapp/msgui/bwins/unifiededitoru.def Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/bwins/unifiededitoru.def Fri Jul 09 14:46:10 2010 +0530 @@ -2,14 +2,14 @@ ?fetchAudio@MsgUnifiedEditorView@@AAEXXZ @ 1 NONAME ; void MsgUnifiedEditorView::fetchAudio(void) ??0CUniImageProcessor@@QAE@PAVMUniImageProcessorCallback@@@Z @ 2 NONAME ; CUniImageProcessor::CUniImageProcessor(class MUniImageProcessorCallback *) ?changePriority@MsgUnifiedEditorView@@AAEXXZ @ 3 NONAME ; void MsgUnifiedEditorView::changePriority(void) - ?forwardMessage@MsgUnifiedEditorView@@AAEXAAVConvergedMessageId@@W4MessageType@ConvergedMessage@@@Z @ 4 NONAME ; void MsgUnifiedEditorView::forwardMessage(class ConvergedMessageId &, enum ConvergedMessage::MessageType) - ?updateOtherRecipientCount@MsgUnifiedEditorView@@AAEX_N@Z @ 5 NONAME ; void MsgUnifiedEditorView::updateOtherRecipientCount(bool) - ?qt_metacall@MsgUnifiedEditorView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 6 NONAME ; int MsgUnifiedEditorView::qt_metacall(enum QMetaObject::Call, int, void * *) - ?fetchImages@MsgUnifiedEditorView@@AAEXXZ @ 7 NONAME ; void MsgUnifiedEditorView::fetchImages(void) - ?packMessage@MsgUnifiedEditorView@@AAEXAAVConvergedMessage@@_N@Z @ 8 NONAME ; void MsgUnifiedEditorView::packMessage(class ConvergedMessage &, bool) - ?handleViewExtnActivated@MsgUnifiedEditorView@@AAEXPAVHbListWidgetItem@@@Z @ 9 NONAME ; void MsgUnifiedEditorView::handleViewExtnActivated(class HbListWidgetItem *) - ?addAttachment@MsgUnifiedEditorView@@AAEHABVQString@@@Z @ 10 NONAME ; int MsgUnifiedEditorView::addAttachment(class QString const &) - ?doDelayedConstruction@MsgUnifiedEditorView@@AAEXXZ @ 11 NONAME ; void MsgUnifiedEditorView::doDelayedConstruction(void) + ?updateOtherRecipientCount@MsgUnifiedEditorView@@AAEX_N@Z @ 4 NONAME ; void MsgUnifiedEditorView::updateOtherRecipientCount(bool) + ?qt_metacall@MsgUnifiedEditorView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 5 NONAME ; int MsgUnifiedEditorView::qt_metacall(enum QMetaObject::Call, int, void * *) + ?fetchImages@MsgUnifiedEditorView@@AAEXXZ @ 6 NONAME ; void MsgUnifiedEditorView::fetchImages(void) + ?packMessage@MsgUnifiedEditorView@@AAEXAAVConvergedMessage@@_N@Z @ 7 NONAME ; void MsgUnifiedEditorView::packMessage(class ConvergedMessage &, bool) + ?handleViewExtnActivated@MsgUnifiedEditorView@@AAEXPAVHbListWidgetItem@@@Z @ 8 NONAME ; void MsgUnifiedEditorView::handleViewExtnActivated(class HbListWidgetItem *) + ?addAttachment@MsgUnifiedEditorView@@AAEHABVQString@@@Z @ 9 NONAME ; int MsgUnifiedEditorView::addAttachment(class QString const &) + ?doDelayedConstruction@MsgUnifiedEditorView@@AAEXXZ @ 10 NONAME ; void MsgUnifiedEditorView::doDelayedConstruction(void) + ?fetchMessageFromStore@MsgUnifiedEditorView@@AAEXAAVConvergedMessageId@@W4MessageType@ConvergedMessage@@H@Z @ 11 NONAME ; void MsgUnifiedEditorView::fetchMessageFromStore(class ConvergedMessageId &, enum ConvergedMessage::MessageType, int) ?onContentChanged@MsgUnifiedEditorView@@AAEXXZ @ 12 NONAME ; void MsgUnifiedEditorView::onContentChanged(void) ?staticMetaObject@MsgUnifiedEditorView@@2UQMetaObject@@B @ 13 NONAME ; struct QMetaObject const MsgUnifiedEditorView::staticMetaObject ?activateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 14 NONAME ; void MsgUnifiedEditorView::activateInputBlocker(void) diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/bwins/unifiedvieweru.def --- a/messagingapp/msgui/bwins/unifiedvieweru.def Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/bwins/unifiedvieweru.def Fri Jul 09 14:46:10 2010 +0530 @@ -1,22 +1,25 @@ EXPORTS ?trUtf8@UnifiedViewer@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString UnifiedViewer::trUtf8(char const *, char const *) ?populateContent@UnifiedViewer@@QAEXH_NH@Z @ 2 NONAME ; void UnifiedViewer::populateContent(int, bool, int) - ?handleDeleteAction@UnifiedViewer@@QAEXXZ @ 3 NONAME ; void UnifiedViewer::handleDeleteAction(void) - ?metaObject@UnifiedViewer@@UBEPBUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const * UnifiedViewer::metaObject(void) const - ?sendMessage@UnifiedViewer@@AAEXABVQString@@0@Z @ 5 NONAME ; void UnifiedViewer::sendMessage(class QString const &, class QString const &) - ?resizeEvent@UnifiedViewer@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 6 NONAME ; void UnifiedViewer::resizeEvent(class QGraphicsSceneResizeEvent *) - ?handleFwdAction@UnifiedViewer@@QAEXXZ @ 7 NONAME ; void UnifiedViewer::handleFwdAction(void) - ?qt_metacast@UnifiedViewer@@UAEPAXPBD@Z @ 8 NONAME ; void * UnifiedViewer::qt_metacast(char const *) - ?createToolBar@UnifiedViewer@@AAEXXZ @ 9 NONAME ; void UnifiedViewer::createToolBar(void) - ??1UnifiedViewer@@UAE@XZ @ 10 NONAME ; UnifiedViewer::~UnifiedViewer(void) - ?onDialogDeleteMsg@UnifiedViewer@@AAEXPAVHbAction@@@Z @ 11 NONAME ; void UnifiedViewer::onDialogDeleteMsg(class HbAction *) - ??_EUnifiedViewer@@UAE@I@Z @ 12 NONAME ; UnifiedViewer::~UnifiedViewer(unsigned int) - ?qt_metacall@UnifiedViewer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13 NONAME ; int UnifiedViewer::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@UnifiedViewer@@SA?AVQString@@PBD0@Z @ 14 NONAME ; class QString UnifiedViewer::tr(char const *, char const *) - ?getStaticMetaObject@UnifiedViewer@@SAABUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const & UnifiedViewer::getStaticMetaObject(void) - ??0UnifiedViewer@@QAE@HHPAVQGraphicsItem@@@Z @ 16 NONAME ; UnifiedViewer::UnifiedViewer(int, int, class QGraphicsItem *) + ?handleReplyAction@UnifiedViewer@@AAEXXZ @ 3 NONAME ; void UnifiedViewer::handleReplyAction(void) + ?handleDeleteAction@UnifiedViewer@@QAEXXZ @ 4 NONAME ; void UnifiedViewer::handleDeleteAction(void) + ?metaObject@UnifiedViewer@@UBEPBUQMetaObject@@XZ @ 5 NONAME ; struct QMetaObject const * UnifiedViewer::metaObject(void) const + ?sendMessage@UnifiedViewer@@AAEXABVQString@@0@Z @ 6 NONAME ; void UnifiedViewer::sendMessage(class QString const &, class QString const &) + ?resizeEvent@UnifiedViewer@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 7 NONAME ; void UnifiedViewer::resizeEvent(class QGraphicsSceneResizeEvent *) + ?handleFwdAction@UnifiedViewer@@QAEXXZ @ 8 NONAME ; void UnifiedViewer::handleFwdAction(void) + ?qt_metacast@UnifiedViewer@@UAEPAXPBD@Z @ 9 NONAME ; void * UnifiedViewer::qt_metacast(char const *) + ?createToolBar@UnifiedViewer@@AAEXXZ @ 10 NONAME ; void UnifiedViewer::createToolBar(void) + ??1UnifiedViewer@@UAE@XZ @ 11 NONAME ; UnifiedViewer::~UnifiedViewer(void) + ?onDialogDeleteMsg@UnifiedViewer@@AAEXPAVHbAction@@@Z @ 12 NONAME ; void UnifiedViewer::onDialogDeleteMsg(class HbAction *) + ??_EUnifiedViewer@@UAE@I@Z @ 13 NONAME ; UnifiedViewer::~UnifiedViewer(unsigned int) + ?qt_metacall@UnifiedViewer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 14 NONAME ; int UnifiedViewer::qt_metacall(enum QMetaObject::Call, int, void * *) + ?tr@UnifiedViewer@@SA?AVQString@@PBD0@Z @ 15 NONAME ; class QString UnifiedViewer::tr(char const *, char const *) + ?getStaticMetaObject@UnifiedViewer@@SAABUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const & UnifiedViewer::getStaticMetaObject(void) ?staticMetaObject@UnifiedViewer@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const UnifiedViewer::staticMetaObject - ?trUtf8@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString UnifiedViewer::trUtf8(char const *, char const *, int) - ?clearContent@UnifiedViewer@@QAEXXZ @ 19 NONAME ; void UnifiedViewer::clearContent(void) - ?tr@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString UnifiedViewer::tr(char const *, char const *, int) + ??0UnifiedViewer@@QAE@HHPAVQGraphicsItem@@@Z @ 18 NONAME ; UnifiedViewer::UnifiedViewer(int, int, class QGraphicsItem *) + ?handleReplyAllAction@UnifiedViewer@@AAEXXZ @ 19 NONAME ; void UnifiedViewer::handleReplyAllAction(void) + ?trUtf8@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString UnifiedViewer::trUtf8(char const *, char const *, int) + ?clearContent@UnifiedViewer@@QAEXXZ @ 21 NONAME ; void UnifiedViewer::clearContent(void) + ?launchEditor@UnifiedViewer@@AAEXW4UniEditorOperation@MsgBaseView@@@Z @ 22 NONAME ; void UnifiedViewer::launchEditor(enum MsgBaseView::UniEditorOperation) + ?tr@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 23 NONAME ; class QString UnifiedViewer::tr(char const *, char const *, int) diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/conversationview/inc/msgconversationview.h --- a/messagingapp/msgui/conversationview/inc/msgconversationview.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/conversationview/inc/msgconversationview.h Fri Jul 09 14:46:10 2010 +0530 @@ -325,6 +325,11 @@ */ void handleSmsCharLimitReached(); + /** + * Hanldes saving of vcard. + */ + void saveVCard(); + signals: /** * Signal emitted to inform close the conversation view. @@ -386,6 +391,16 @@ * @param msgId message id */ void handleProvisoningMsg(int msgId); + + /** + * Handles short tap for vcard. + */ + void handleShortTap(); + + /** + * helper method to show long/short tap context menu. + */ + void showContextMenu(HbAbstractViewItem* viewItem,const QPointF& point, int placement); private: diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/conversationview/inc/msgeditorwidget.h --- a/messagingapp/msgui/conversationview/inc/msgeditorwidget.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/conversationview/inc/msgeditorwidget.h Fri Jul 09 14:46:10 2010 +0530 @@ -165,10 +165,10 @@ */ void init(); - /** - * To update back ground. - */ - void updateButtonBackground(const QString& bg); + /** + * To update back ground. + */ + void updateButtonBackgroundAndColor(const QString& bg,const QString& iconColor); private: diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/conversationview/resources/layouts/msgeditorwidget.css --- a/messagingapp/msgui/conversationview/resources/layouts/msgeditorwidget.css Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgeditorwidget.css Fri Jul 09 14:46:10 2010 +0530 @@ -23,8 +23,15 @@ MsgEditorWidget::charCounter { - size-policy:fixed fixed; - pref-height:-1; - pref-width:-1; - text-height:var(hb-param-text-height-tiny); + text-height:var(hb-param-text-height-tiny); + text-align:centre; + text-line-count-min: 1; + text-line-count-max: 1; } + +MsgEditorWidget::charCounterFrame +{ + size-policy: fixed, fixed ; + pref-height: expr(var(hb-param-text-height-tiny)+2*var(hb-param-margin-gene-middle-vertical)); + pref-width: expr(var(hb-param-text-height-tiny)*3 + 2*var(hb-param-margin-gene-middle-horizontal)); +} diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/conversationview/resources/layouts/msgeditorwidget.widgetml --- a/messagingapp/msgui/conversationview/resources/layouts/msgeditorwidget.widgetml Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgeditorwidget.widgetml Fri Jul 09 14:46:10 2010 +0530 @@ -9,13 +9,11 @@ - - + + - - - - + + \ No newline at end of file diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp --- a/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -144,15 +144,17 @@ QStandardItemModel* msgModel = ConversationsEngine::instance()->getConversationsModel(); const int rowCnt = msgModel->rowCount(); QModelIndex index = msgModel->index(rowCnt-1, 0); - ConvergedMessageAddress* address = new ConvergedMessageAddress( - index.data(ConversationAddress).toString()); + QString addr = index.data(ConversationAddress).toString(); + ConvergedMessageAddress* address = new ConvergedMessageAddress(addr); + // resolve contact QString displayname; - QString addr; - ConversationsEngine::instance()->getContactDetails( - ConversationsEngine::instance()->getCurrentConversationId(), - displayname, - addr); - address->setAlias(displayname); + int count; + int retval = MsgContactHandler::resolveContactDisplayName( + addr, displayname, count); + if(retval != -1) + { + address->setAlias(displayname); + } addresses.append(address); return addresses; } diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/conversationview/src/msgconversationview.cpp --- a/messagingapp/msgui/conversationview/src/msgconversationview.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/conversationview/src/msgconversationview.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -80,8 +80,9 @@ #define LOC_ADD_SUBJECT hbTrId("txt_messaging_opt_add_subject") #define LOC_MSG_SEND_FAILED hbTrId("txt_messaging_dialog_message_sending_failed") -#define LOC_DIALOG_SMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_sms_settings_incomplete") +#define LOC_DIALOG_SMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_sms_message_centre_does_not_e") #define LOC_DIALOG_SAVE_RINGTONE hbTrId("txt_conversations_dialog_save_ringing_tone") +#define LOC_MMS_RETRIEVAL_FAILED hbTrId("txt_messaging_dialog_mms_retrieval_failed") const int INVALID_MSGID = -1; @@ -274,40 +275,15 @@ // MsgConversationView::longPressed // @see header file //--------------------------------------------------------------- -void MsgConversationView::longPressed(HbAbstractViewItem* viewItem, - const QPointF& point) -{ - MsgConversationViewItem* item = qgraphicsitem_cast< - MsgConversationViewItem *> (viewItem); - - // Show the item-specific menu - if (this->isVisible()) - { - //If message is in Sending state or is Scheduled to be sent later, - //do not allow any operations on the message - int sendingState = item->modelIndex().data(SendingState).toInt(); - if(sendingState == ConvergedMessage::Scheduled || - sendingState == ConvergedMessage::Sending || - sendingState == ConvergedMessage::Waiting) - { - return; - } - // Create new menu - HbMenu* contextMenu = new HbMenu(); - contextMenu->setAttribute(Qt::WA_DeleteOnClose); - contextMenu->setPreferredPos(point); - setContextMenu(item, contextMenu, sendingState); - contextMenu->show(); - - } - +void MsgConversationView::longPressed(HbAbstractViewItem* viewItem, const QPointF& point) +{ + showContextMenu(viewItem,point,HbPopup::TopLeftCorner); } //--------------------------------------------------------------- // MsgConversationView::setContextMenu // @see header //--------------------------------------------------------------- - void MsgConversationView::setContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState) { addOpenItemToContextMenu(item , contextMenu,sendingState); @@ -358,10 +334,11 @@ (direction == ConvergedMessage::Incoming)) { HbAction *contextItem = contextMenu->addAction(LOC_SAVE_TO_CONTACTS); - connect(contextItem, SIGNAL(triggered()),this, SLOT(openItem())); + connect(contextItem, SIGNAL(triggered()),this, SLOT(saveVCard())); return; } - if( (sendingState == ConvergedMessage::SentState ) || + if( (sendingState == ConvergedMessage::SentState && + messageSubType != ConvergedMessage::VCard) || (direction == ConvergedMessage::Incoming)) { HbAction *contextItem = contextMenu->addAction(LOC_COMMON_OPEN); @@ -379,8 +356,11 @@ { Q_UNUSED(item) int direction = item->modelIndex().data(Direction).toInt(); + int messageSubType = item->modelIndex().data(MessageSubType).toInt(); - if( (direction == ConvergedMessage::Outgoing)&& + + if( ((direction == ConvergedMessage::Outgoing) && + (messageSubType != ConvergedMessage::VCard))&& ((sendingState == ConvergedMessage::Resend ) || (sendingState == ConvergedMessage::Suspended )|| (sendingState == ConvergedMessage::Failed ))) @@ -722,7 +702,7 @@ qint32 messageId = index.data(ConvergedMsgId).toLongLong(); if(!(ConversationsEngine::instance()->resendMessage(messageId))) { - HbMessageBox::warning(LOC_MSG_SEND_FAILED); + HbMessageBox::warning(LOC_MSG_SEND_FAILED, 0, 0, HbMessageBox::Ok); } } @@ -737,10 +717,10 @@ QModelIndex index = mConversationList->currentIndex(); if(index.isValid()) { - qint32 messageId = index.data(ConvergedMsgId).toLongLong(); + qint32 messageId = index.data(ConvergedMsgId).toLongLong(); if(ConversationsEngine::instance()->downloadMessage(messageId)!=KErrNone) { - HbMessageBox::warning("Message Retrieval Failed!"); //TODO: use logical str name + HbMessageBox::warning(LOC_MMS_RETRIEVAL_FAILED, 0, 0, HbMessageBox::Ok); } } @@ -920,20 +900,7 @@ } else if(ConvergedMessage::VCard == messageSubType) { - QString filepath = index.data(Attachments).toStringList().at(0); - bool result = MsgContactsUtil::launchVCardViewer(filepath); - if(result) - { - - int messageId = index.data(ConvergedMsgId).toInt(); - QList msgIdList; - if(index.data(UnReadStatus).toInt()) - { - msgIdList.clear(); - msgIdList << messageId; - ConversationsEngine::instance()->markMessagesRead(msgIdList); - } - } + handleShortTap(); return; } else if(ConvergedMessage::VCal == messageSubType) @@ -955,7 +922,7 @@ } else if(ConvergedMessage::MmsNotification == messageType) { - qint32 messageId = index.data(ConvergedMsgId).toLongLong(); + qint32 messageId = index.data(ConvergedMsgId).toLongLong(); if(!ConversationsEngine::instance()->downloadOperationSupported(messageId)) { int notificationState = index.data(NotificationStatus).toInt(); @@ -1346,6 +1313,17 @@ if (action == dlg->actions().at(0)) { downloadMessage(); } + + //if message unread, mark as read now + QModelIndex index = mConversationList->currentIndex(); + qint32 messageId = index.data(ConvergedMsgId).toLongLong(); + QList msgIdList; + if(index.data(UnReadStatus).toInt()) + { + msgIdList.clear(); + msgIdList << messageId; + ConversationsEngine::instance()->markMessagesRead(msgIdList); + } } //--------------------------------------------------------------- @@ -1402,4 +1380,70 @@ fetchMoreConversations(); } + +//--------------------------------------------------------------- +// MsgConversationView::handleShortTap +// @see header file +//--------------------------------------------------------------- +void MsgConversationView::handleShortTap() +{ + HbAbstractViewItem* item = mConversationList->currentViewItem(); + QRectF rc = item->rect(); + QPointF p = item->mapToScene(rc.center()); + + showContextMenu(item,p,HbPopup::TopEdgeCenter); +} + +//--------------------------------------------------------------- +// MsgConversationView::handleShortTap +// @see header file +//--------------------------------------------------------------- +void MsgConversationView::showContextMenu(HbAbstractViewItem* viewItem,const QPointF& point, int placement) +{ + MsgConversationViewItem* item = qgraphicsitem_cast(viewItem); + + // Show the item-specific menu + if (this->isVisible()) + { + //If message is in Sending state or is Scheduled to be sent later, + //do not allow any operations on the message + int sendingState = item->modelIndex().data(SendingState).toInt(); + + if(sendingState == ConvergedMessage::Scheduled || + sendingState == ConvergedMessage::Sending || + sendingState == ConvergedMessage::Waiting) + { + return; + } + // Create new menu + HbMenu* contextMenu = new HbMenu(); + contextMenu->setAttribute(Qt::WA_DeleteOnClose); + contextMenu->setPreferredPos(point,HbPopup::Placement(placement)); + setContextMenu(item, contextMenu, sendingState); + contextMenu->show(); + } +} + +//--------------------------------------------------------------- +// MsgConversationView::saveVCard +// @see header file +//--------------------------------------------------------------- +void MsgConversationView::saveVCard() +{ + QModelIndex index = mConversationList->currentIndex(); + + QString filepath = index.data(Attachments).toStringList().at(0); + bool result = MsgContactsUtil::launchVCardViewer(filepath); + if(result) + { + int messageId = index.data(ConvergedMsgId).toInt(); + QList msgIdList; + if(index.data(UnReadStatus).toInt()) + { + msgIdList.clear(); + msgIdList << messageId; + ConversationsEngine::instance()->markMessagesRead(msgIdList); + } + } +} // EOF diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/conversationview/src/msgeditorwidget.cpp --- a/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include "unieditorpluginloader.h" #include "unieditorplugininterface.h" @@ -39,11 +41,16 @@ const QString SEND_ICON("qtg_mono_send"); const QString BACKGROUND("qtg_fr_input_v_bg"); -const QString BACKGROUND_FRAME("qtg_fr_btn_normal"); +const QString BACKGROUND_FRAME("qtg_fr_messaging_char_count"); +const QString CHAR_COUNTER_COLOR("qtc_messaging_char_count"); -const QString SEND_BUTTON_NORMAL("qtg_fr_input_btn_function_normal"); -const QString SEND_BUTTON_PRESSED("qtg_fr_input_btn_function_pressed"); -const QString SEND_BUTTON_DISABLED("qtg_fr_input_btn_function_disabled"); +const QString SEND_BUTTON_NORMAL("qtg_fr_btn_green_normal"); +const QString SEND_BUTTON_PRESSED("qtg_fr_btn_green_pressed"); +const QString SEND_BUTTON_DISABLED("qtg_fr_btn_disabled"); + +const QString SEND_BUTTON_NORMAL_COLOR("qtc_callhandling_answer_normal"); +const QString SEND_BUTTON_PRESSED_COLOR("qtc_callhandling_answer_pressed"); +const QString SEND_BUTTON_DISABLED_COLOR("qtc_button_disabled"); #define LOC_SMS_CHAR_LIMIT_REACHED hbTrId("txt_messaging_dialog_sms_character_count_exceeded") #define LOC_HINT_TEXT hbTrId("txt_messaging_formlabel_enter_message_here") @@ -90,17 +97,20 @@ HbFrameItem* backGround = new HbFrameItem(this); backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); mSendButton->setBackgroundItem(backGround); - updateButtonBackground(SEND_BUTTON_DISABLED); + updateButtonBackgroundAndColor(SEND_BUTTON_DISABLED,SEND_BUTTON_DISABLED_COLOR); mSendButton->setIcon(HbIcon(SEND_ICON)); mCharCounter = new HbTextItem(this); HbStyle::setItemName(mCharCounter, "charCounter"); mCharCounter->setZValue(1.5); + QColor color = HbColorScheme::color(CHAR_COUNTER_COLOR); + mCharCounter->setTextColor(color); + mBackgroundItem = new HbFrameItem(this); HbStyle::setItemName(mBackgroundItem, "charCounterFrame"); - mBackgroundItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); + mBackgroundItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal); mBackgroundItem->frameDrawer().setFillWholeRect(true); mBackgroundItem->frameDrawer().setFrameGraphicsName( @@ -175,7 +185,7 @@ { mSendButton->setFocusProxy(mMsgEditor); mSendButton->setEnabled(true); - updateButtonBackground(SEND_BUTTON_NORMAL); + updateButtonBackgroundAndColor(SEND_BUTTON_NORMAL,SEND_BUTTON_NORMAL_COLOR); } } else @@ -184,7 +194,7 @@ { mSendButton->setFocusProxy(0); mSendButton->setEnabled(false); - updateButtonBackground(SEND_BUTTON_DISABLED); + updateButtonBackgroundAndColor(SEND_BUTTON_DISABLED,SEND_BUTTON_DISABLED_COLOR); } } @@ -279,16 +289,22 @@ } //--------------------------------------------------------------- -// MsgEditor::updateButtonBackground +// MsgEditor::updateButtonBackgroundAndColor // @see header //--------------------------------------------------------------- -void MsgEditorWidget::updateButtonBackground(const QString& bg) +void MsgEditorWidget::updateButtonBackgroundAndColor(const QString& bg,const QString& iconColor) { HbFrameItem* drawer = static_cast(mSendButton->backgroundItem()); if(drawer) { drawer->frameDrawer().setFrameGraphicsName(bg); } + QColor color = HbColorScheme::color(iconColor); + + if(color.isValid()) + { + mSendButton->icon().setColor(color); + } } @@ -298,7 +314,7 @@ //--------------------------------------------------------------- void MsgEditorWidget::onPressed() { - updateButtonBackground(SEND_BUTTON_PRESSED); + updateButtonBackgroundAndColor(SEND_BUTTON_PRESSED,SEND_BUTTON_PRESSED_COLOR); } //--------------------------------------------------------------- @@ -307,7 +323,7 @@ //--------------------------------------------------------------- void MsgEditorWidget::onReleased() { - updateButtonBackground(SEND_BUTTON_NORMAL); + updateButtonBackgroundAndColor(SEND_BUTTON_NORMAL,SEND_BUTTON_NORMAL_COLOR); } //--------------------------------------------------------------- diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/eabi/appengineu.def --- a/messagingapp/msgui/eabi/appengineu.def Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/eabi/appengineu.def Fri Jul 09 14:46:10 2010 +0530 @@ -16,32 +16,32 @@ _ZN19ConversationsEngine19getStaticMetaObjectEv @ 15 NONAME _ZN19ConversationsEngine20markAsReadAndGetTypeEiRiS0_ @ 16 NONAME _ZN19ConversationsEngine20markConversationReadEx @ 17 NONAME - _ZN19ConversationsEngine21getConversationsModelEv @ 18 NONAME - _ZN19ConversationsEngine22deleteAllDraftMessagesEv @ 19 NONAME - _ZN19ConversationsEngine22fetchMoreConversationsEv @ 20 NONAME - _ZN19ConversationsEngine24conversationModelUpdatedEv @ 21 NONAME - _ZN19ConversationsEngine24getCurrentConversationIdEv @ 22 NONAME - _ZN19ConversationsEngine26conversationModelPopulatedEv @ 23 NONAME - _ZN19ConversationsEngine26downloadOperationSupportedEi @ 24 NONAME - _ZN19ConversationsEngine28emitConversationModelUpdatedEv @ 25 NONAME - _ZN19ConversationsEngine28getConversationIdFromAddressE7QString @ 26 NONAME - _ZN19ConversationsEngine28getConversationsSummaryModelEv @ 27 NONAME - _ZN19ConversationsEngine30conversationListModelPopulatedEv @ 28 NONAME - _ZN19ConversationsEngine30emitConversationModelPopulatedEv @ 29 NONAME - _ZN19ConversationsEngine30getConversationIdFromContactIdEi @ 30 NONAME - _ZN19ConversationsEngine34emitConversationListModelPopulatedEv @ 31 NONAME - _ZN19ConversationsEngine8instanceEv @ 32 NONAME - _ZN19ConversationsEngineC1EP7QObject @ 33 NONAME - _ZN19ConversationsEngineC2EP7QObject @ 34 NONAME - _ZN19ConversationsEngineD0Ev @ 35 NONAME - _ZN19ConversationsEngineD1Ev @ 36 NONAME - _ZN19ConversationsEngineD2Ev @ 37 NONAME - _ZNK19ConversationsEngine10metaObjectEv @ 38 NONAME - _ZTI19ConversationsEngine @ 39 NONAME - _ZTV19ConversationsEngine @ 40 NONAME - _ZN19ConversationsEngine28conversationListEntryDeletedEi @ 41 NONAME - _ZN19ConversationsEngine37emitConversationListModelEntryDeletedEi @ 42 NONAME - _ZN19ConversationsEngine21conversationViewEmptyEv @ 43 NONAME - _ZN19ConversationsEngine31disableRegisterationForCVEventsEv @ 44 NONAME - _ZN19ConversationsEngine32emitOpenConversationViewIdUpdateEi @ 45 NONAME + _ZN19ConversationsEngine21conversationViewEmptyEv @ 18 NONAME + _ZN19ConversationsEngine21getConversationsModelEv @ 19 NONAME + _ZN19ConversationsEngine22deleteAllDraftMessagesEv @ 20 NONAME + _ZN19ConversationsEngine22fetchMoreConversationsEv @ 21 NONAME + _ZN19ConversationsEngine24conversationModelUpdatedEv @ 22 NONAME + _ZN19ConversationsEngine24getCurrentConversationIdEv @ 23 NONAME + _ZN19ConversationsEngine26conversationModelPopulatedEv @ 24 NONAME + _ZN19ConversationsEngine26downloadOperationSupportedEi @ 25 NONAME + _ZN19ConversationsEngine28conversationListEntryDeletedEi @ 26 NONAME + _ZN19ConversationsEngine28emitConversationModelUpdatedEv @ 27 NONAME + _ZN19ConversationsEngine28getConversationIdFromAddressE7QString @ 28 NONAME + _ZN19ConversationsEngine28getConversationsSummaryModelEv @ 29 NONAME + _ZN19ConversationsEngine30conversationListModelPopulatedEv @ 30 NONAME + _ZN19ConversationsEngine30emitConversationModelPopulatedEv @ 31 NONAME + _ZN19ConversationsEngine30getConversationIdFromContactIdEi @ 32 NONAME + _ZN19ConversationsEngine31disableRegisterationForCVEventsEv @ 33 NONAME + _ZN19ConversationsEngine32emitOpenConversationViewIdUpdateEi @ 34 NONAME + _ZN19ConversationsEngine34emitConversationListModelPopulatedEv @ 35 NONAME + _ZN19ConversationsEngine37emitConversationListModelEntryDeletedEi @ 36 NONAME + _ZN19ConversationsEngine8instanceEv @ 37 NONAME + _ZN19ConversationsEngineC1EP7QObject @ 38 NONAME + _ZN19ConversationsEngineC2EP7QObject @ 39 NONAME + _ZN19ConversationsEngineD0Ev @ 40 NONAME + _ZN19ConversationsEngineD1Ev @ 41 NONAME + _ZN19ConversationsEngineD2Ev @ 42 NONAME + _ZNK19ConversationsEngine10metaObjectEv @ 43 NONAME + _ZTI19ConversationsEngine @ 44 NONAME + _ZTV19ConversationsEngine @ 45 NONAME diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/eabi/unifiededitoru.def --- a/messagingapp/msgui/eabi/unifiededitoru.def Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/eabi/unifiededitoru.def Fri Jul 09 14:46:10 2010 +0530 @@ -22,25 +22,25 @@ _ZN20MsgUnifiedEditorView13imagesFetchedERK8QVariant @ 21 NONAME _ZN20MsgUnifiedEditorView14addAttachmentsE11QStringList @ 22 NONAME _ZN20MsgUnifiedEditorView14changePriorityEv @ 23 NONAME - _ZN20MsgUnifiedEditorView14forwardMessageER18ConvergedMessageIdN16ConvergedMessage11MessageTypeE @ 24 NONAME - _ZN20MsgUnifiedEditorView15contactsFetchedERK8QVariant @ 25 NONAME - _ZN20MsgUnifiedEditorView15formatAddressesER5QListIP23ConvergedMessageAddressE @ 26 NONAME - _ZN20MsgUnifiedEditorView15populateContentERK5QListI8QVariantE @ 27 NONAME - _ZN20MsgUnifiedEditorView16createTempFolderEv @ 28 NONAME - _ZN20MsgUnifiedEditorView16enableSendButtonEb @ 29 NONAME - _ZN20MsgUnifiedEditorView16generateFileNameER7QString @ 30 NONAME - _ZN20MsgUnifiedEditorView16onContentChangedEv @ 31 NONAME - _ZN20MsgUnifiedEditorView16removeTempFolderEv @ 32 NONAME - _ZN20MsgUnifiedEditorView16staticMetaObjectE @ 33 NONAME DATA 16 - _ZN20MsgUnifiedEditorView17onDialogDeleteMsgEP8HbAction @ 34 NONAME - _ZN20MsgUnifiedEditorView17openDraftsMessageERK5QListI8QVariantE @ 35 NONAME - _ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 36 NONAME - _ZN20MsgUnifiedEditorView19onDialogMmsSettingsEP8HbAction @ 37 NONAME - _ZN20MsgUnifiedEditorView19onDialogSmsSettingsEP8HbAction @ 38 NONAME - _ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 39 NONAME - _ZN20MsgUnifiedEditorView19serviceRequestErrorEiRK7QString @ 40 NONAME - _ZN20MsgUnifiedEditorView20activateInputBlockerEv @ 41 NONAME - _ZN20MsgUnifiedEditorView21doDelayedConstructionEv @ 42 NONAME + _ZN20MsgUnifiedEditorView15contactsFetchedERK8QVariant @ 24 NONAME + _ZN20MsgUnifiedEditorView15formatAddressesER5QListIP23ConvergedMessageAddressE @ 25 NONAME + _ZN20MsgUnifiedEditorView15populateContentERK5QListI8QVariantE @ 26 NONAME + _ZN20MsgUnifiedEditorView16createTempFolderEv @ 27 NONAME + _ZN20MsgUnifiedEditorView16enableSendButtonEb @ 28 NONAME + _ZN20MsgUnifiedEditorView16generateFileNameER7QString @ 29 NONAME + _ZN20MsgUnifiedEditorView16onContentChangedEv @ 30 NONAME + _ZN20MsgUnifiedEditorView16removeTempFolderEv @ 31 NONAME + _ZN20MsgUnifiedEditorView16staticMetaObjectE @ 32 NONAME DATA 16 + _ZN20MsgUnifiedEditorView17onDialogDeleteMsgEP8HbAction @ 33 NONAME + _ZN20MsgUnifiedEditorView17openDraftsMessageERK5QListI8QVariantE @ 34 NONAME + _ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 35 NONAME + _ZN20MsgUnifiedEditorView19onDialogMmsSettingsEP8HbAction @ 36 NONAME + _ZN20MsgUnifiedEditorView19onDialogSmsSettingsEP8HbAction @ 37 NONAME + _ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 38 NONAME + _ZN20MsgUnifiedEditorView19serviceRequestErrorEiRK7QString @ 39 NONAME + _ZN20MsgUnifiedEditorView20activateInputBlockerEv @ 40 NONAME + _ZN20MsgUnifiedEditorView21doDelayedConstructionEv @ 41 NONAME + _ZN20MsgUnifiedEditorView21fetchMessageFromStoreER18ConvergedMessageIdN16ConvergedMessage11MessageTypeEi @ 42 NONAME _ZN20MsgUnifiedEditorView22deactivateInputBlockerEv @ 43 NONAME _ZN20MsgUnifiedEditorView22setAttachOptionEnabledENS_16TBE_AttachOptionEb @ 44 NONAME _ZN20MsgUnifiedEditorView23handleViewExtnActivatedEP16HbListWidgetItem @ 45 NONAME diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/eabi/unifiedvieweru.def --- a/messagingapp/msgui/eabi/unifiedvieweru.def Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/eabi/unifiedvieweru.def Fri Jul 09 14:46:10 2010 +0530 @@ -4,23 +4,26 @@ _ZN13UnifiedViewer11resizeEventEP25QGraphicsSceneResizeEvent @ 3 NONAME _ZN13UnifiedViewer11sendMessageERK7QStringS2_ @ 4 NONAME _ZN13UnifiedViewer12clearContentEv @ 5 NONAME - _ZN13UnifiedViewer13createToolBarEv @ 6 NONAME - _ZN13UnifiedViewer15handleFwdActionEv @ 7 NONAME - _ZN13UnifiedViewer15populateContentEibi @ 8 NONAME - _ZN13UnifiedViewer16staticMetaObjectE @ 9 NONAME DATA 16 - _ZN13UnifiedViewer17onDialogDeleteMsgEP8HbAction @ 10 NONAME - _ZN13UnifiedViewer18handleDeleteActionEv @ 11 NONAME - _ZN13UnifiedViewer19getStaticMetaObjectEv @ 12 NONAME - _ZN13UnifiedViewerC1EiiP13QGraphicsItem @ 13 NONAME - _ZN13UnifiedViewerC2EiiP13QGraphicsItem @ 14 NONAME - _ZN13UnifiedViewerD0Ev @ 15 NONAME - _ZN13UnifiedViewerD1Ev @ 16 NONAME - _ZN13UnifiedViewerD2Ev @ 17 NONAME - _ZNK13UnifiedViewer10metaObjectEv @ 18 NONAME - _ZTI13UnifiedViewer @ 19 NONAME - _ZTV13UnifiedViewer @ 20 NONAME - _ZThn16_N13UnifiedViewerD0Ev @ 21 NONAME - _ZThn16_N13UnifiedViewerD1Ev @ 22 NONAME - _ZThn8_N13UnifiedViewerD0Ev @ 23 NONAME - _ZThn8_N13UnifiedViewerD1Ev @ 24 NONAME + _ZN13UnifiedViewer12launchEditorEN11MsgBaseView18UniEditorOperationE @ 6 NONAME + _ZN13UnifiedViewer13createToolBarEv @ 7 NONAME + _ZN13UnifiedViewer15handleFwdActionEv @ 8 NONAME + _ZN13UnifiedViewer15populateContentEibi @ 9 NONAME + _ZN13UnifiedViewer16staticMetaObjectE @ 10 NONAME DATA 16 + _ZN13UnifiedViewer17handleReplyActionEv @ 11 NONAME + _ZN13UnifiedViewer17onDialogDeleteMsgEP8HbAction @ 12 NONAME + _ZN13UnifiedViewer18handleDeleteActionEv @ 13 NONAME + _ZN13UnifiedViewer19getStaticMetaObjectEv @ 14 NONAME + _ZN13UnifiedViewer20handleReplyAllActionEv @ 15 NONAME + _ZN13UnifiedViewerC1EiiP13QGraphicsItem @ 16 NONAME + _ZN13UnifiedViewerC2EiiP13QGraphicsItem @ 17 NONAME + _ZN13UnifiedViewerD0Ev @ 18 NONAME + _ZN13UnifiedViewerD1Ev @ 19 NONAME + _ZN13UnifiedViewerD2Ev @ 20 NONAME + _ZNK13UnifiedViewer10metaObjectEv @ 21 NONAME + _ZTI13UnifiedViewer @ 22 NONAME + _ZTV13UnifiedViewer @ 23 NONAME + _ZThn16_N13UnifiedViewerD0Ev @ 24 NONAME + _ZThn16_N13UnifiedViewerD1Ev @ 25 NONAME + _ZThn8_N13UnifiedViewerD0Ev @ 26 NONAME + _ZThn8_N13UnifiedViewerD1Ev @ 27 NONAME diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/inc/msgbaseview.h --- a/messagingapp/msgui/inc/msgbaseview.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/inc/msgbaseview.h Fri Jul 09 14:46:10 2010 +0530 @@ -54,14 +54,16 @@ */ enum UniEditorOperation { - ADD_PHOTO = 0x01, - ADD_AUDIO = 0x02, - ADD_VIDEO = 0x04, - ADD_VCARD = 0x08, - ADD_OTHERS = 0x10, - ADD_RECIPIENTS = 0x20, - ADD_SUBJECT = 0x40, - FORWARD_MSG = 0x80 + ADD_PHOTO = 0x001, + ADD_AUDIO = 0x002, + ADD_VIDEO = 0x004, + ADD_VCARD = 0x008, + ADD_OTHERS = 0x010, + ADD_RECIPIENTS = 0x020, + ADD_SUBJECT = 0x040, + FORWARD_MSG = 0x080, + REPLY_MSG = 0x100, + REPLY_ALL_MSG = 0x200 }; signals: diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/msgapp/src/msgviewmanager.cpp --- a/messagingapp/msgui/msgapp/src/msgviewmanager.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/msgapp/src/msgviewmanager.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -779,7 +779,11 @@ mSettingsView = new MsgSettingsView(view); mSettingsView->setNavigationAction(mBackAction); mMainWindow->addView(mSettingsView); - mMainWindow->setCurrentView(mSettingsView); + + if(view != MsgSettingsView::SMSView) + { + mMainWindow->setCurrentView(mSettingsView); + } } if(mPreviousView==MsgBaseView::CV && mConversationView){ mConversationView->setPSCVId(false); diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp --- a/messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -113,6 +113,11 @@ CleanupStack::PopAndDestroy(4); + // TODO: Remove this check once Video support is provided in UniEditor. + if (info->MediaType() == EMsgMediaVideo) + { + return EInsertNotSupported; + } // In "free" mode user can insert images that are larger by dimensions than allowed by conformance if (iCreationMode != EMmsCreationModeRestricted) @@ -267,10 +272,6 @@ // void MmsConformanceCheck::showPopup(const QString& text) { - HbNotificationDialog* dlg = new HbNotificationDialog(); - dlg->setFocusPolicy(Qt::NoFocus); - dlg->setAttribute(Qt::WA_DeleteOnClose, true); - dlg->setText(text); - dlg->show(); + HbMessageBox::information(text, 0, 0, HbMessageBox::Ok); } diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h Fri Jul 09 14:46:10 2010 +0530 @@ -79,6 +79,11 @@ * Disables char counter */ void disableCharCounter(); + + /* + * Enables char counter + */ + void enableCharCounter(); /** * To set focus on editable field. diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiededitor/inc/msgunieditorview.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h Fri Jul 09 14:46:10 2010 +0530 @@ -112,10 +112,15 @@ const ConvergedMessage& messageDetails, bool draftMessage = false); /** - * Populate the editor with the forwarded message's content + * Populate the editor with the message's content + * for various cases like forward, reply, replyAll + * @param messageId, unique id of message in store + * @param messageType, sms or mms + * @param editorOperation, forward or reply or replyAll etc */ - void forwardMessage(ConvergedMessageId& messageId, - ConvergedMessage::MessageType messageType ); + void fetchMessageFromStore(ConvergedMessageId& messageId, + ConvergedMessage::MessageType messageType, + int editorOperation); /** * Create VCards for all the contacts available in the list diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.css --- a/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.css Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.css Fri Jul 09 14:46:10 2010 +0530 @@ -87,10 +87,18 @@ } /*************************** Character Counter ******************************/ + MsgUnifiedEditorBody::charCounter { - size-policy:fixed fixed; - pref-height:-1; - pref-width:-1; - text-height:var(hb-param-text-height-tiny); + text-height:var(hb-param-text-height-tiny); + text-align:centre; + text-line-count-min: 1; + text-line-count-max: 1; } + +MsgUnifiedEditorBody::charCounterFrame +{ + size-policy: fixed, fixed ; + pref-height: expr(var(hb-param-text-height-tiny)+2*var(hb-param-margin-gene-middle-vertical)); + pref-width: expr(var(hb-param-text-height-tiny)*3 + 2*var(hb-param-margin-gene-middle-horizontal)); +} diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml --- a/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml Fri Jul 09 14:46:10 2010 +0530 @@ -14,14 +14,12 @@ - - - + + + - - - - + + @@ -36,13 +34,11 @@ - - + + - - - - + + @@ -61,13 +57,11 @@ - - + + - - - - + + diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -270,7 +270,7 @@ // append line seperator invalidStr.append("
"); invalidStr.append(invalidContacts); - HbMessageBox::information(invalidStr); + HbMessageBox::information(invalidStr, 0, 0, HbMessageBox::Ok); } // addition operation complete, reset flags @@ -307,8 +307,7 @@ --mExceedsMaxMmsRecipientsBy; if(!mExceedsMaxMmsRecipientsBy) { - HbNotificationDialog::launchDialog( - LOC_MMS_RECIPIENT_LIMIT_REACHED); + HbMessageBox::information(LOC_MMS_RECIPIENT_LIMIT_REACHED, 0, 0, HbMessageBox::Ok); } resetToPrevious(); } @@ -318,8 +317,7 @@ emit contentChanged(); if(MsgUnifiedEditorMonitor::msgAddressCount() > MsgUnifiedEditorMonitor::maxMmsRecipients()) { - HbNotificationDialog::launchDialog( - LOC_MMS_RECIPIENT_LIMIT_REACHED); + HbMessageBox::information(LOC_MMS_RECIPIENT_LIMIT_REACHED, 0, 0, HbMessageBox::Ok); resetToPrevious(); // reset monitor data emit contentChanged(); diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -41,6 +41,9 @@ #include #include #include +#include +#include +#include // USER INCLUDES #include "msgunieditorbody.h" #include "UniEditorGenUtils.h" @@ -56,7 +59,8 @@ #include "msgunieditoraudiowidget.h" // Constants -const QString BACKGROUND_FRAME("qtg_fr_btn_normal"); +const QString BACKGROUND_FRAME("qtg_fr_messaging_char_count"); +const QString CHAR_COUNTER_COLOR("qtc_messaging_char_count"); const int KShowCounterLimit = 10; const int BYTES_TO_KBYTES_FACTOR = 1024; @@ -83,12 +87,8 @@ /BYTES_TO_KBYTES_FACTOR; QString displayStr = QString(LOC_UNABLE_TO_ATTACH_ITEM) .arg(availableSize); - HbNotificationDialog* dlg = new HbNotificationDialog(); - dlg->setFocusPolicy(Qt::NoFocus); - dlg->setDismissPolicy(HbPopup::TapAnywhere); - dlg->setAttribute(Qt::WA_DeleteOnClose, true); - dlg->setText(displayStr); - dlg->show(); + + HbMessageBox::information(displayStr, 0, 0, HbMessageBox::Ok); } @@ -119,16 +119,17 @@ mCharCounter = new HbTextItem(this); HbStyle::setItemName(mCharCounter, "charCounter"); mCharCounter->setZValue(1.5); - mCharCounter->setText("160(1)"); - + + QColor color = HbColorScheme::color(CHAR_COUNTER_COLOR); + mCharCounter->setTextColor(color); + mBackgroundItem = new HbFrameItem(this); HbStyle::setItemName(mBackgroundItem, "charCounterFrame"); - mBackgroundItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); + mBackgroundItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal); mBackgroundItem->frameDrawer().setFillWholeRect(true); - mBackgroundItem->frameDrawer().setFrameGraphicsName( - BACKGROUND_FRAME); + mBackgroundItem->frameDrawer().setFrameGraphicsName(BACKGROUND_FRAME); mPluginLoader = new UniEditorPluginLoader(this); @@ -578,7 +579,7 @@ if(futureSize > MsgUnifiedEditorMonitor::maxMmsSize()) { mTextEdit->setPlainText(mPrevBuffer); - HbNotificationDialog::launchDialog(LOC_UNABLE_TO_ADD_CONTENT); + HbMessageBox::information(LOC_UNABLE_TO_ADD_CONTENT, 0, 0, HbMessageBox::Ok); mTextEdit->setCursorPosition(mPrevBuffer.length()); return; } @@ -719,6 +720,45 @@ mBackgroundItem->setVisible(false); } +// --------------------------------------------------------- +// MsgUnifiedEditorBody::enableCharCounter +// --------------------------------------------------------- +// +void MsgUnifiedEditorBody::enableCharCounter() + { + mPluginInterface->setEncodingSettings(EFalse, ESmsEncodingNone, + mCharSupportType); + + TInt numOfRemainingChars; + TInt numOfPDUs; + TBool unicodeMode; + TSmsEncoding alternativeEncodingType; + QString string = mTextEdit->toPlainText(); + mPluginInterface->getNumPDUs(string, + numOfRemainingChars, numOfPDUs, unicodeMode, + alternativeEncodingType); + + //Save the unicode value returned + mUnicode = unicodeMode; + + //Set char counter value + QString display = QString("%1(%2)").arg(numOfRemainingChars).arg( + numOfPDUs); + mCharCounter->setText(display); + + if (numOfPDUs > 1 || numOfRemainingChars <= KShowCounterLimit) + { + mCharCounter->setVisible(true); + mBackgroundItem->setVisible(true); + } + else + { + mCharCounter->setVisible(false); + mBackgroundItem->setVisible(false); + } + + } + //--------------------------------------------------------------- // MsgUnifiedEditorBody :: setFocus // @see header file diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiededitor/src/msgunieditormonitor.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditormonitor.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditormonitor.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -151,6 +151,11 @@ view()->mBody->disableCharCounter(); view()->addSubject(); } + else + { + //Enable char counter + view()->mBody->enableCharCounter(); + } // check if sent by body widget MsgUnifiedEditorBody* body = NULL; diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -19,6 +19,7 @@ #include "debugtraces.h" #include #include +#include // USER INCLUDES #include "msgunieditorsubject.h" @@ -125,7 +126,7 @@ mSubjectEdit->setText(mPrevBuffer); connect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)), this, SLOT(onContentsChanged(const QString&))); - HbNotificationDialog::launchDialog(LOC_UNABLE_TO_ADD_CONTENT); + HbMessageBox::information(LOC_UNABLE_TO_ADD_CONTENT, 0, 0, HbMessageBox::Ok); return; } diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -302,13 +302,14 @@ mCanSaveToDrafts = false; } -void MsgUnifiedEditorView::forwardMessage(ConvergedMessageId& messageId, - ConvergedMessage::MessageType messageType ) +void MsgUnifiedEditorView::fetchMessageFromStore( + ConvergedMessageId& messageId, + ConvergedMessage::MessageType messageType, + int editorOperation) { if(!mPluginLoader) { mPluginLoader = new UniEditorPluginLoader(this); - } UniEditorPluginInterface* pluginInterface = NULL; if( messageType == ConvergedMessage::Mms ) @@ -325,8 +326,7 @@ //Fetch the converged message from the msgId ConvergedMessage* msg; msg = pluginInterface->convertFrom(messageId.getId(), - UniEditorPluginInterface::Forward); - + (UniEditorPluginInterface::EditorOperation)editorOperation); if( msg != NULL ) { //Populate the content inside editor @@ -367,7 +367,23 @@ break; case MsgBaseView::FORWARD_MSG: { - forwardMessage(*messageDetails->id(), messageDetails->messageType()); + fetchMessageFromStore(*messageDetails->id(), + messageDetails->messageType(), + UniEditorPluginInterface::Forward); + } + break; + case MsgBaseView::REPLY_MSG: + { + fetchMessageFromStore(*messageDetails->id(), + messageDetails->messageType(), + UniEditorPluginInterface::Reply); + } + break; + case MsgBaseView::REPLY_ALL_MSG: + { + fetchMessageFromStore(*messageDetails->id(), + messageDetails->messageType(), + UniEditorPluginInterface::ReplyAll); } break; default: diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h --- a/messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h Fri Jul 09 14:46:10 2010 +0530 @@ -75,7 +75,12 @@ * @see HbView */ void createToolBar(); - + + /** + * Launch Editor for forward, reply, replyall actions + * @param operation, Editor operation e.g. forward, reply etc + */ + void launchEditor(MsgBaseView::UniEditorOperation operation); public slots: @@ -91,7 +96,7 @@ * Handle delete */ void handleDeleteAction(); - + private slots: /** * This slot is called when sendMessage signal is emitted for a highlighted @@ -105,6 +110,16 @@ */ void onDialogDeleteMsg(HbAction* action); + /** + * Handle reply + */ + void handleReplyAction(); + + /** + * Handle reply-all + */ + void handleReplyAllAction(); + private: /** diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h Fri Jul 09 14:46:10 2010 +0530 @@ -26,6 +26,7 @@ class UniViewerPixmapWidget; class UniViewerAudioWidget; class HbTextItem; +class HbIconItem; /** * @class UniViewerBodyWidget @@ -118,6 +119,14 @@ */ void clearContent(); +private slots: + + /** + * Sets overlay icon on top of pixmap widget. + * @param iconName Overlay icon name to be set. + */ + void setOverlayIcon(const QString &iconName); + protected: /** @@ -164,6 +173,11 @@ * Media widget for embedded audio content. */ UniViewerAudioWidget *mAudioItem; + + /** + * Overlay icon on top of pixmap widget. + */ + HbIconItem *mOverlayItem; }; #endif //UNIVIEWER_BODY_WIDGET_H diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h Fri Jul 09 14:46:10 2010 +0530 @@ -25,7 +25,6 @@ class UniMessageInfo; class ThumbnailManager; - /** * This widget displays the pixmap content in viewer. */ @@ -65,6 +64,13 @@ */ void longTap(const QPointF &position); + /** + * Signal emitted when the thumbnail returned by Thumbnail manager is set + * to pixmap widget. + * @param iconName Overlay icon name to be set. + */ + void setOverlayIcon(const QString& iconName); + protected: /** @@ -77,12 +83,12 @@ private slots: /** - * + * Handles opening of media. */ void handleOpen(); /** - * + * Handles saving of media. */ void handleSave(); @@ -95,7 +101,7 @@ /** * Slot hit when the thumbnail is ready. */ - void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error); + void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error); private: @@ -115,6 +121,12 @@ */ void handleLongTap(const QPointF &position); + /** + * Calculates the thumbnail size. + * @return Thumbnail size + */ + QSize getThumbnailSize(); + private: /** @@ -127,7 +139,7 @@ * ThumbnailManager * Own. */ - ThumbnailManager *mThumbnailManager; + ThumbnailManager *mThumbnailManager; /** * Mime Type of pixmap. diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.css --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.css Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.css Fri Jul 09 14:46:10 2010 +0530 @@ -63,6 +63,15 @@ right:1un; } +UniViewerBodyWidget::overlayItem +{ + zvalue:1; + size-policy-vertical:fixed; + size-policy-horizontal:fixed; + pref-width:var(hb-param-graphic-size-primary-large); + pref-height:var(hb-param-graphic-size-primary-large); +} + UniViewerBodyWidget[hasText="false"]::pixmap:landscape { top:-var(hb-param-margin-gene-middle-vertical); diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.widgetml --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.widgetml Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.widgetml Fri Jul 09 14:46:10 2010 +0530 @@ -12,6 +12,9 @@ + + + @@ -31,6 +34,9 @@ + + + @@ -46,6 +52,8 @@ + + @@ -81,5 +89,8 @@ + + + \ No newline at end of file diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp --- a/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -114,11 +114,15 @@ } else { - toolbar->addAction(HbIcon(REPLY_ICON), ""); + // do not show reply option for multi recipient outgoing message + if(!(!mViewFeeder->isIncoming() && mViewFeeder->recipientCount()>1)) + { + toolbar->addAction(HbIcon(REPLY_ICON), "", this, SLOT(handleReplyAction())); + } if (mViewFeeder->recipientCount() > 1) { - toolbar->addAction(HbIcon(REPLY_ALL_ICON), ""); + toolbar->addAction(HbIcon(REPLY_ALL_ICON), "", this, SLOT(handleReplyAllAction())); } } @@ -192,32 +196,26 @@ // @see header file //--------------------------------------------------------------- void UnifiedViewer::handleFwdAction() -{ - ConvergedMessage message; - ConvergedMessageId id(mMessageId); - message.setMessageId(id); - if(mViewFeeder->msgType() == KSenduiMtmMmsUidValue) - { - message.setMessageType(ConvergedMessage::Mms); - } - else - { - message.setMessageType(ConvergedMessage::Sms); - } +{ + launchEditor(MsgBaseView::FORWARD_MSG); +} - QByteArray dataArray; - QDataStream messageStream - (&dataArray, QIODevice::WriteOnly | QIODevice::Append); - message.serialize(messageStream); +//--------------------------------------------------------------- +// UnifiedViewer::handleReplyAction +// @see header file +//--------------------------------------------------------------- +void UnifiedViewer::handleReplyAction() +{ + launchEditor(MsgBaseView::REPLY_MSG); +} - QVariantList params; - params << MsgBaseView::UNIEDITOR; // target view - params << MsgBaseView::UNIVIEWER; // source view - - params << dataArray; - params << MsgBaseView::FORWARD_MSG; - - emit switchView(params); +//--------------------------------------------------------------- +// UnifiedViewer::handleReplyAllAction +// @see header file +//--------------------------------------------------------------- +void UnifiedViewer::handleReplyAllAction() +{ + launchEditor(MsgBaseView::REPLY_ALL_MSG); } //--------------------------------------------------------------- @@ -297,4 +295,38 @@ } } +//--------------------------------------------------------------- +// UnifiedViewer::launchEditor +// @see header file +//--------------------------------------------------------------- +void UnifiedViewer::launchEditor( + MsgBaseView::UniEditorOperation operation) +{ + ConvergedMessage message; + ConvergedMessageId id(mMessageId); + message.setMessageId(id); + if(mViewFeeder->msgType() == KSenduiMtmMmsUidValue) + { + message.setMessageType(ConvergedMessage::Mms); + } + else + { + message.setMessageType(ConvergedMessage::Sms); + } + + QByteArray dataArray; + QDataStream messageStream + (&dataArray, QIODevice::WriteOnly | QIODevice::Append); + message.serialize(messageStream); + + QVariantList params; + params << MsgBaseView::UNIEDITOR; // target view + params << MsgBaseView::UNIVIEWER; // source view + + params << dataArray; + params << operation; + + emit switchView(params); +} + // EOF diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -21,6 +21,7 @@ #include #include #include +#include // USER INCLUDES #include "univiewertextitem.h" @@ -39,7 +40,7 @@ //--------------------------------------------------------------- UniViewerBodyWidget::UniViewerBodyWidget(QGraphicsItem *parent) : HbWidget(parent), mHasText(false), mHasPixmap(false), mTextItem(0), mSlideCounter(0), - mPixmapItem(0), mAudioItem(0) + mPixmapItem(0), mAudioItem(0), mOverlayItem(0) { this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); } @@ -97,6 +98,7 @@ if (!mPixmapItem) { mPixmapItem = new UniViewerPixmapWidget(this); HbStyle::setItemName(mPixmapItem, "pixmap"); + connect(mPixmapItem, SIGNAL(setOverlayIcon(QString)), this, SLOT(setOverlayIcon(QString))); } mPixmapItem->hide(); mPixmapItem->populate(info); @@ -122,6 +124,7 @@ text.replace(QChar::ParagraphSeparator, QChar::LineSeparator); text.replace('\r', QChar::LineSeparator); mTextItem->setText(text); + this->repolish(); } @@ -138,6 +141,7 @@ mSlideCounter->hide(); mSlideCounter->setText(slideCounter); + this->repolish(); } @@ -214,7 +218,7 @@ } //--------------------------------------------------------------- -//UniViewerBodyWidget :: clearContent +// UniViewerBodyWidget :: clearContent // @see header file //--------------------------------------------------------------- void UniViewerBodyWidget::clearContent() @@ -238,12 +242,35 @@ mTextItem = NULL; } + if (mOverlayItem) { + mOverlayItem->setParent(NULL); + delete mOverlayItem; + mOverlayItem = NULL; + } + setHasText(false); setHasPixmap(false); repolish(); } //--------------------------------------------------------------- +// UniViewerBodyWidget::setOverlayIcon +// @see header file +//--------------------------------------------------------------- +void UniViewerBodyWidget::setOverlayIcon(const QString &iconName) +{ + if (!mOverlayItem) { + mOverlayItem = new HbIconItem(this); + HbStyle::setItemName(mOverlayItem, "overlayItem"); + } + + mOverlayItem->hide(); + mOverlayItem->setIconName(iconName); + + this->repolish(); +} + +//--------------------------------------------------------------- //UniViewerBodyWidget::sizeHint // @see header file //--------------------------------------------------------------- @@ -360,6 +387,10 @@ mPixmapItem->show(); } + if (mOverlayItem) { + mOverlayItem->show(); + } + // Calculate the size hint to be returned. szHint.setHeight(0); diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -38,6 +38,10 @@ const QString CORRUPTED_PIXMAP_ICON("qtg_large_corrupted"); const QString VIDEO_MIMETYPE("video"); const QString MSG_VIDEO_ICON("qtg_small_video"); +const QString VIDEO_OVERLAY_ICON("qtg_large_video_player"); + +const int WIDTH_RATIO = 4; +const int HEIGHT_RATIO = 3; //--------------------------------------------------------------- // UniViewerPixmapWidget::UniViewerPixmapWidget @@ -51,22 +55,6 @@ } //--------------------------------------------------------------- -// UniViewerPixmapWidget::init -// @see header file -//--------------------------------------------------------------- -void UniViewerPixmapWidget::init() -{ - mThumbnailManager = new ThumbnailManager(this); - mThumbnailManager->setMode(ThumbnailManager::Default); - mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForQuality); - mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge); - - connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)), this, - SLOT(thumbnailReady(QPixmap, void*, int, int))); - -} - -//--------------------------------------------------------------- // UniViewerPixmapWidget::~UniViewerPixmapWidget // @see header file //--------------------------------------------------------------- @@ -168,6 +156,46 @@ { } +//--------------------------------------------------------------- +// UniViewerPixmapWidget::regrabGesture +// @see header file +//--------------------------------------------------------------- +void UniViewerPixmapWidget::regrabGesture() +{ + this->grabGesture(Qt::TapGesture); +} + +//--------------------------------------------------------------- +// UniViewerPixmapWidget::thumbnailReady +// @see header +//--------------------------------------------------------------- +void UniViewerPixmapWidget::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error) +{ + Q_UNUSED(data) + Q_UNUSED(id) + this->grabGesture(Qt::TapGesture); + if (!error) { + this->setIcon(HbIcon(pixmap)); + this->hide(); + emit setOverlayIcon(VIDEO_OVERLAY_ICON); + } +} + +//--------------------------------------------------------------- +// UniViewerPixmapWidget::init +// @see header file +//--------------------------------------------------------------- +void UniViewerPixmapWidget::init() +{ + mThumbnailManager = new ThumbnailManager(this); + mThumbnailManager->setMode(ThumbnailManager::CropToAspectRatio); + mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForQuality); + mThumbnailManager->setThumbnailSize(getThumbnailSize()); + + connect(mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void*, int, int)), this, + SLOT(thumbnailReady(QPixmap, void*, int, int))); +} + //---------------------------------------------------------------------------- // UniViewerPixmapWidget::handleShortTap // @see header file @@ -197,27 +225,23 @@ } //--------------------------------------------------------------- -// UniViewerPixmapWidget::regrabGesture +// UniViewerPixmapWidget::getThumbnailSize // @see header file //--------------------------------------------------------------- -void UniViewerPixmapWidget::regrabGesture() +QSize UniViewerPixmapWidget::getThumbnailSize() { - this->grabGesture(Qt::TapGesture); + QSize thumbnailSize(1, 1); + HbWidget *parent = qobject_cast(this->parentWidget()); + + if (parent) { + qreal thumbnailWidth = 0.0; + qreal thumbnailHeight = 0.0; + parent->style()->parameter("hb-param-screen-short-edge", thumbnailWidth); + thumbnailHeight = (thumbnailWidth * HEIGHT_RATIO) / WIDTH_RATIO; + thumbnailSize.setHeight(qRound(thumbnailHeight)); + thumbnailSize.setWidth(qRound(thumbnailWidth)); + } + return thumbnailSize; } -//--------------------------------------------------------------- -// UniViewerPixmapWidget::thumbnailReady -// @see header -//--------------------------------------------------------------- -void UniViewerPixmapWidget::thumbnailReady(const QPixmap& pixmap, void *data, int id, int error) -{ - Q_UNUSED(data) - Q_UNUSED(id) - this->grabGesture(Qt::TapGesture); - if (!error) { - this->setIcon(HbIcon(pixmap)); - this->hide(); - this->updateGeometry(); - } -} // EOF diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -38,16 +38,17 @@ //consts //regexp -const QString NUMBER_PATTERN("(\\(?(\\+|\\d))((?:\\d)((?:[\\s-/.\\)\\(])*(?:(\\d+|\\))))*(?:\\d?|\\)))|((\\*#)(?:\\d+(\\*|#)(?:\\d+#)?))"); +const QString NUMBER_PATTERN("(\\(?(\\+|\\d))((?:\\d)((?:[\\s-/.\\)\\(])*(?:(\\d+|\\))))*(?:\\d?[^\\D]|\\)))|((\\*#)(?:\\d+(\\*|#)(?:\\d+#)?))"); const QString EMAIL_PATTERN("[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?"); const QString URL_PATTERN("(((ht|f|rt)(tp|sp)(s?)\\:\\/\\/)|(www|wap)(?:\\.))(([-\\w]*[0-9a-zA-Z])+(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\?\\,\'\\/\\\\+&%\\$#_=~]*)(\\.)([-\\w]*[0-9a-zA-Z])+(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\?\\,\'\\/\\\\+&%\\$#_=~]*))+[a-zA-Z0-9/]"); //rules -const QString NUMBER_RULE("NUMBER_RULE"); -const QString EMAIL_RULE("EMAIL_RULE"); -const QString URL_RULE("URL_RULE"); +const QString URL_RULE("0_URL_RULE"); +const QString EMAIL_RULE("1_EMAIL_RULE"); +const QString NUMBER_RULE("2_NUMBER_RULE"); + //localization #define LOC_CONTACT_INFO hbTrId("txt_messaging_menu_contact_info") @@ -123,26 +124,33 @@ while(cursor.hasSelection()) { - // Insert anchor in the document - QTextCharFormat f; - f.setFontUnderline(true); - f.setForeground(palette().link()); - - //prepending rule name to identiy different fragment to which - //catagory it belongs to. - QString txt = cursor.selectedText().prepend(ruleName); + int p = cursor.position(); + QString anchor = this->anchorAt(p-1); + + //not identified yet. + if(anchor.isEmpty()) + { + // Insert anchor in the document + QTextCharFormat f; + f.setFontUnderline(true); + f.setForeground(palette().link()); - if(ruleName == NUMBER_RULE) - { - //removing special char(s) from phone numbers. - QRegExp numberCharExp("[\\s-/.\\(\\)]"); - txt = txt.remove(numberCharExp); + //prepending rule name to identiy different fragment to which + //catagory it belongs to. + QString txt = cursor.selectedText().prepend(ruleName); + + if(ruleName == NUMBER_RULE) + { + //removing special char(s) from phone numbers. + QRegExp numberCharExp("[\\s-/.\\(\\)]"); + txt = txt.remove(numberCharExp); + } + + f.setAnchorHref(txt); + f.setAnchor(true); + cursor.mergeCharFormat(f); } - f.setAnchorHref(txt); - f.setAnchor(true); - cursor.mergeCharFormat(f); - // Find next cursor = this->document()->find(ruleExp, cursor); } diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -75,7 +75,7 @@ //--------------------------------------------------------------- UniBioMessageDataPluginPrivate::UniBioMessageDataPluginPrivate(UniBioMessageDataPlugin* plugin) : q_ptr(plugin), iMSession(NULL), iMtmReg(NULL), iBioClientMtm(NULL), - iMsvEntry(NULL) + iMsvEntry(NULL),iAttachmentCount(0) { iMSession = CMsvSession::OpenSyncL(*this); done = EFalse; @@ -247,7 +247,13 @@ CMsvStore* store1 = iMsvEntry->ReadStoreL(); CleanupStack::PushL(store1); MMsvAttachmentManager& attachMan = store1->AttachmentManagerL(); - RFile file = attachMan.GetAttachmentFileL(0); + RFile file; + + if (iAttachmentCount > 0) + { + file = attachMan.GetAttachmentFileL(0); + } + CleanupStack::PopAndDestroy(store1); return file; } diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/bwins/test_unidatamodel_vcal_pluginu.def --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/bwins/test_unidatamodel_vcal_pluginu.def Tue Jul 06 22:50:16 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -EXPORTS - ?SetForMtmTypeL@TestUniDataModelVCalPlugin@@AAEXAAVTMsvEntry@@W4TBIOMessageType@@@Z @ 1 NONAME ; void TestUniDataModelVCalPlugin::SetForMtmTypeL(class TMsvEntry &, enum TBIOMessageType) - ?SetSessionPath@TestUniDataModelVCalPlugin@@AAEXABVTDesC16@@@Z @ 2 NONAME ; void TestUniDataModelVCalPlugin::SetSessionPath(class TDesC16 const &) - ?CreateBioEntryClientSideL@TestUniDataModelVCalPlugin@@AAEXAAVTMsvEntry@@AAVCRichText@@@Z @ 3 NONAME ; void TestUniDataModelVCalPlugin::CreateBioEntryClientSideL(class TMsvEntry &, class CRichText &) - ?trUtf8@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString TestUniDataModelVCalPlugin::trUtf8(char const *, char const *, int) - ?qt_metacall@TestUniDataModelVCalPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 5 NONAME ; int TestUniDataModelVCalPlugin::qt_metacall(enum QMetaObject::Call, int, void * *) - ?CreateBIOEntryL@TestUniDataModelVCalPlugin@@AAEJAAVTDesC16@@W4TBIOMessageType@@@Z @ 6 NONAME ; long TestUniDataModelVCalPlugin::CreateBIOEntryL(class TDesC16 &, enum TBIOMessageType) - ?initTestCase@TestUniDataModelVCalPlugin@@AAEXXZ @ 7 NONAME ; void TestUniDataModelVCalPlugin::initTestCase(void) - ?CreateBIOEntryFromFileL@TestUniDataModelVCalPlugin@@AAEJABVTDesC16@@W4TBIOMessageType@@@Z @ 8 NONAME ; long TestUniDataModelVCalPlugin::CreateBIOEntryFromFileL(class TDesC16 const &, enum TBIOMessageType) - ?testPluginLoading@TestUniDataModelVCalPlugin@@AAEXXZ @ 9 NONAME ; void TestUniDataModelVCalPlugin::testPluginLoading(void) - ?testGetPluginWithoutLoading@TestUniDataModelVCalPlugin@@AAEXXZ @ 10 NONAME ; void TestUniDataModelVCalPlugin::testGetPluginWithoutLoading(void) - ?testDraftsVCalMessage@TestUniDataModelVCalPlugin@@AAEXXZ @ 11 NONAME ; void TestUniDataModelVCalPlugin::testDraftsVCalMessage(void) - ?tr@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString TestUniDataModelVCalPlugin::tr(char const *, char const *) - ?getStaticMetaObject@TestUniDataModelVCalPlugin@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & TestUniDataModelVCalPlugin::getStaticMetaObject(void) - ?testInBoxVCalMessage@TestUniDataModelVCalPlugin@@AAEXXZ @ 14 NONAME ; void TestUniDataModelVCalPlugin::testInBoxVCalMessage(void) - ?qt_metacast@TestUniDataModelVCalPlugin@@UAEPAXPBD@Z @ 15 NONAME ; void * TestUniDataModelVCalPlugin::qt_metacast(char const *) - ?init@TestUniDataModelVCalPlugin@@AAEXXZ @ 16 NONAME ; void TestUniDataModelVCalPlugin::init(void) - ?metaObject@TestUniDataModelVCalPlugin@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * TestUniDataModelVCalPlugin::metaObject(void) const - ?tr@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString TestUniDataModelVCalPlugin::tr(char const *, char const *, int) - ?ReadFromFileL@TestUniDataModelVCalPlugin@@AAEPAVHBufC16@@ABVTDesC16@@@Z @ 19 NONAME ; class HBufC16 * TestUniDataModelVCalPlugin::ReadFromFileL(class TDesC16 const &) - ?SetBIOServiceIdL@TestUniDataModelVCalPlugin@@AAEJXZ @ 20 NONAME ; long TestUniDataModelVCalPlugin::SetBIOServiceIdL(void) - ?cleanupTestCase@TestUniDataModelVCalPlugin@@AAEXXZ @ 21 NONAME ; void TestUniDataModelVCalPlugin::cleanupTestCase(void) - ?SetMessageType@TestUniDataModelVCalPlugin@@AAE?AW4TBIOMessageType@@ABVTDesC16@@@Z @ 22 NONAME ; enum TBIOMessageType TestUniDataModelVCalPlugin::SetMessageType(class TDesC16 const &) - ?trUtf8@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0@Z @ 23 NONAME ; class QString TestUniDataModelVCalPlugin::trUtf8(char const *, char const *) - ?testUnusedAPIs@TestUniDataModelVCalPlugin@@AAEXXZ @ 24 NONAME ; void TestUniDataModelVCalPlugin::testUnusedAPIs(void) - ?staticMetaObject@TestUniDataModelVCalPlugin@@2UQMetaObject@@B @ 25 NONAME ; struct QMetaObject const TestUniDataModelVCalPlugin::staticMetaObject - ?GenerateMessagesL@TestUniDataModelVCalPlugin@@AAEPAVCMsvEntrySelection@@XZ @ 26 NONAME ; class CMsvEntrySelection * TestUniDataModelVCalPlugin::GenerateMessagesL(void) - ?testPluginLoadingMultipleTimes@TestUniDataModelVCalPlugin@@AAEXXZ @ 27 NONAME ; void TestUniDataModelVCalPlugin::testPluginLoadingMultipleTimes(void) - ?cleanup@TestUniDataModelVCalPlugin@@AAEXXZ @ 28 NONAME ; void TestUniDataModelVCalPlugin::cleanup(void) - diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/group/BioMtm.rsc Binary file messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/group/BioMtm.rsc has changed diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/group/TestUniDataModelVCalPlugin.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/group/TestUniDataModelVCalPlugin.cfg Fri Jul 09 14:46:10 2010 +0530 @@ -0,0 +1,1 @@ +TestUniDataModelVCalPlugin diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/group/TestUniDataModelVCalPlugin.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/group/TestUniDataModelVCalPlugin.pl Fri Jul 09 14:46:10 2010 +0530 @@ -0,0 +1,182 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +#!/usr/bin/perl -w +use warnings; +use strict; + +my $TOTALCASES = 0; +my $TOTALPASSED = 0; +my $TOTALRUN = 0; +my $TOTALFAILED = 0; +my $TOTALSKIPPED = 0; + +sub parse_line +{ + my $line = $_[0]; + my @parts = split (" ", $line); + my $passed = $parts[1]; + my $failed = $parts[3]; + my $skipped = $parts[5]; + + my $total = $passed + $failed + $skipped; + my $passrate = $passed * 100 / $total; + my $passrateround = sprintf("%.0f",$passrate); + my $runrate = ($total - $skipped)*100/$total; + my $runrateround = sprintf("%.0f",$runrate); + + $TOTALCASES += $total; + $TOTALPASSED += $passed; + $TOTALRUN += ($total - $skipped); + $TOTALFAILED += $failed; + $TOTALSKIPPED += $skipped; + + printf MYFILE "\n"; + printf MYFILE "$passed\n"; + printf MYFILE "\n"; + + if($failed > 0) + { + printf MYFILE "\n"; + printf MYFILE "$failed\n"; + printf MYFILE "\n"; + } + else + { + printf MYFILE "\n"; + printf MYFILE "$failed\n"; + printf MYFILE "\n"; + } + + printf MYFILE "\n"; + printf MYFILE "$skipped\n"; + printf MYFILE "\n"; + + printf MYFILE "\n"; + printf MYFILE "$total\n"; + printf MYFILE "\n"; + + printf MYFILE "\n"; + printf MYFILE ("$passrateround %%\n"); + printf MYFILE "\n"; + + printf MYFILE "\n"; + printf MYFILE "$runrateround %%\n"; + printf MYFILE "\n"; + + +} + +sub parse_file + { + my $pattern = "Totals"; + my $file = $_[0]; + open (FILE,$file); + + while (my $line= ) + { + chomp ($line); + if ($line =~ m/$pattern/) + { + parse_line $line; + } + } + close(FILE); + } + + +sub generate_report + { + open (MYFILE, '>/epoc32/winscw/c/logs/messagingtestsuite/report.html'); + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "MsgApp Test Suite Reports"; + printf MYFILE "\n"; + printf MYFILE "

Messaging101 Test Suite Report

\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + + + my @files = ; + foreach my $file (@files) + { + my @splitedpath = split("/",$file); + my $filename = $splitedpath[-1]; + my $length = length($filename); + my $name = substr($filename,11,$length-15); + printf MYFILE "\n"; + printf MYFILE "\n"; + + parse_file $file; + + printf MYFILE "\n"; + } + + printf MYFILE "\n"; + printf MYFILE "\n"; + + + printf MYFILE "\n"; + + printf MYFILE "\n"; + + printf MYFILE "\n"; + + printf MYFILE "\n"; + + my $passrate = $TOTALPASSED*100/$TOTALCASES; + my $passrateround = sprintf("%.0f",$passrate); + printf MYFILE "\n"; + + my $runrate = ($TOTALCASES - $TOTALSKIPPED)*100/$TOTALCASES; + my $runrateround = sprintf("%.0f",$runrate); + printf MYFILE "\n"; + + printf MYFILE "\n"; + + printf MYFILE "
ModulePassedFailedSkippedTotal CasesPass RateRun Rate
\n"; + printf MYFILE "$name\n"; + printf MYFILE "
\n"; + printf MYFILE "Overall\n"; + printf MYFILE "\n"; + printf MYFILE "$TOTALPASSED\n"; + printf MYFILE "\n"; + printf MYFILE "$TOTALFAILED\n"; + printf MYFILE "\n"; + printf MYFILE "$TOTALSKIPPED\n"; + printf MYFILE "\n"; + printf MYFILE "$TOTALCASES\n"; + printf MYFILE "\n"; + printf MYFILE "$passrateround%%\n"; + printf MYFILE "\n"; + printf MYFILE "$runrateround%%\n"; + printf MYFILE "
\n"; + printf MYFILE "\n"; + printf MYFILE "\n"; + + close (MYFILE); + } + + +generate_report; \ No newline at end of file diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/group/testunidatamodelvcalplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/group/testunidatamodelvcalplugin.pro Fri Jul 09 14:46:10 2010 +0530 @@ -0,0 +1,71 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +QT += testlib +QT -= gui + +TEMPLATE = app +TARGET = test-unidatamodel-vcal-plugin + + +INCLUDEPATH += . +INCLUDEPATH += ../../../../../../inc +INCLUDEPATH += ../../../../../../../inc +#INCLUDEPATH += ../../../../../s60qconversions/inc +INCLUDEPATH += ../../../../../../../../../../epoc32/include/platform/mw +INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + +DEFINES += BUILD_TEST_DLL + +SOURCES += \ + ../src/testunidatamodelvcalplugin.cpp + + +# Input +HEADERS += \ + ../inc/testunidatamodelvcalplugin.h + + + +SYMBIAN_PLATFORMS = WINSCW ARMV5 + symbian { + TARGET.CAPABILITY = CAP_GENERAL_DLL + TARGET.EPOCSTACKSIZE = 0x8000 + TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000 + TARGET.EPOCALLOWDLLDATA = 1 + BLD_INF_RULES.prj_exports += "vcal1.txt /epoc32/winscw/c/test/vcal1.txt" + BLD_INF_RULES.prj_exports += "BioMtm.rsc /epoc32/winscw/c/resource/messaging/mtm/BioMtm.rsc" + BLD_INF_RULES.prj_exports += "TestUniDataModelVCalPlugin.cfg c:/TestUniDataModelVCalPlugin.cfg" + BLD_INF_RULES.prj_exports += "TestUniDataModelVCalPlugin.pl c:/TestUniDataModelVCalPlugin.pl" + + } + + LIBS += -leuser \ + -lconvergedmessageutils\ + -lmsgs \ + -lsmcm \ + -lgsmu \ + -letext \ + -lmsgs \ + -lunidatamodelloader\ + -lQtCore \ + -lbioc \ + -lefsrv \ + -lbiodb \ + -lxqutils \ + -lbifu + + diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/group/vcal1.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/group/vcal1.txt Fri Jul 09 14:46:10 2010 +0530 @@ -0,0 +1,15 @@ +BEGIN:VCALENDAR +PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN +VERSION:1.0 +BEGIN:VEVENT +DTSTART:20000322T080000Z +DTEND:20000322T083000Z +LOCATION;ENCODING=QUOTED-PRINTABLE:Somewhere +UID:040000008200E00074C5B7101A82E0080000000090BB8A23ED93BF010000000000000000100 + 00000AB7E96B01EFFD31192E70060084F0B48 +DESCRIPTION;ENCODING=QUOTED-PRINTABLE:=09You will be busy doing something, = +somewhere at some point.=0D=0A +SUMMARY;ENCODING=QUOTED-PRINTABLE:My big appointment +PRIORITY:3 +END:VEVENT +END:VCALENDAR diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/inc/testunidatamodelvcalplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/inc/testunidatamodelvcalplugin.h Fri Jul 09 14:46:10 2010 +0530 @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + */ + +#ifndef TEST_UNI_DATA_MODEL_VCAL_PLUGIN_H +#define TEST_UNI_DATA_MODEL_VCAL_PLUGIN_H + +#ifdef BUILD_TEST_DLL +#define TEST_EXPORT Q_DECL_EXPORT +#else +#define TEST_EXPORT Q_DECL_IMPORT +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include + +const TInt32 KUidBIOVCalenderMsg = {0x10005533}; // VCalender diary + +class UniDataModelPluginInterface; +class UniDataModelLoader; +class MsgObserver; +class S60QConversions; +class ConvergedMessage; +class CBIODatabase; +class ConvergedMessgageAddress; + +typedef enum + { // GENERATE A MESSAGE USING.... + ENoMessage, // .. error cases + EBioIapSettingsMessage, // .. IAP grammar, includes Internet settings + // Email settings, and logon scripts, + EBioEnpMessage, // .. Email Notification grammar. + EBioRingTonesMessage, // .. Ringing Tones binary data + EBioOpLogoMessage, // .. Logo for Operator service + EBioCompBusCardMessage, // .. Compact Business Card data + EBiovCardMessage, // .. virtual business card data + EBiovCalenderMessage, // .. vCalender data + EBioWAPSettingsMessage, // .. wap settings + EBioWPRVSettingsMessage // .. wprv settings + } TBIOMessageType; + + +class TEST_EXPORT TestUniDataModelVCalPlugin : public QObject +{ +Q_OBJECT + +private slots: + //called by frame work. + void initTestCase();//called before the first testfunction is executed. + void init();//called before each testfunction is executed. + + //test cases. + void testInBoxVCalMessage(); + void testDraftsVCalMessage(); + void testUnusedAPIs(); + void cleanup();//called after every testfunction. + void cleanupTestCase();//called after the last testfunction was executed. + +private: + + TMsvId CreateBIOEntryL(TDesC& aText, TBIOMessageType aMessageType); + void CreateBioEntryClientSideL(TMsvEntry& aEntry, CRichText& aBody); + HBufC* ReadFromFileL(const TDesC& aFile); + void SetSessionPath(const TDesC& aSessionPath); + TMsvId CreateBIOEntryFromFileL(const TDesC& aFilename, + TBIOMessageType aMessageType); + TBIOMessageType SetMessageType(const TDesC& aFileName); + CMsvEntrySelection* GenerateMessagesL(); + TMsvId SetBIOServiceIdL(); + void SetForMtmTypeL(TMsvEntry& aEntry, TBIOMessageType aType); + +private: + + UniDataModelPluginInterface* pluginInterface; + MsgObserver* iObserver; + CMsvSession* iMSession; + CClientMtmRegistry* iMtmReg; + TMsvId messageId; + UniDataModelLoader* pluginLoader; + QDateTime retTimeStamp; + RFs iFs; + CDir* iDir; + TInt iFilesProcessed; + CMsvEntry* iMsvEntry; + CBIODatabase* iBioDb; + TMsvId newEntryId; + HBufC* tempNumber; + TBufC currentFile; + TBool inbox; + TBool drafts; +}; + +class MsgObserver : public MMsvSessionObserver +{ +public: + void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, + TAny* aArg3); +}; + +#endif //TEST_UNI_DATA_MODEL_VCAL_PLUGIN_H diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/inc/testunidatamodelvcalplugin.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/inc/testunidatamodelvcalplugin.ini Fri Jul 09 14:46:10 2010 +0530 @@ -0,0 +1,8 @@ +//this file is used to provide predefined set of input data. + +//eg. +const char TEST_MSG_RECIEPIENT[] = "Shweta Singh<77>"; +const char TEST_MSG_FROM1[] = "88"; +const char TEST_MSG_ALIAS1[] = "Shweta Singh"; +const char TEST_MSG_FROM2[] = "999"; +const char TEST_MSG_SUBJECT[] = "Hi"; diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/src/testunidatamodelvcalplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/src/testunidatamodelvcalplugin.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -0,0 +1,682 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "convergedmessageaddress.h" + +#include "testunidatamodelvcalplugin.h" +#include +#include "testunidatamodelvcalplugin.ini" +#include "unidatamodelplugininterface.h" +#include + +const TInt KTelephoneNumberMaxLength = 32; +_LIT(KBIOTxtFilePath, "C:\\test\\"); +_LIT(KBIOvCalenderPrefix, "vcal*"); +// vCalender +_LIT(KUnixEpoch, "19700000:000000.000000"); +#define KBioUidValue 0x10001262 + +const TUid KBioUidValueUid = +{KBioUidValue}; + + + + +//out put directory for test results. +QString OUTPUTDIRECTORY = "c:/logs/TestUniDataModelVCalPlugin"; +//o/p directory for data to be written on temp file. +QString TEMPDIR = "c:/logs/TestUniDataModelVCalPlugin/testdata"; +//test result O/P file name. +QString RESULTFILE = "c:/logs/TestUniDataModelVCalPlugin/result_%1.txt"; +// folder named UID3 of TestUniDataModelVCalPlugin inside private folder. +const QString PRIVATE_DIR("C:/private/Ed034a47"); + +//factory method to create objects. +QObject* getObject(QString className) +{ + if(className == "TestUniDataModelVCalPlugin" ) + { + return new TestUniDataModelVCalPlugin; + } + else + { + return 0; + } +} + +//creating o/p directory. +void createOutPutDirectory() + { + QDir dir; + //o/p dir + dir.mkdir(OUTPUTDIRECTORY); + //tmp dir + dir.mkdir(TEMPDIR); + // dir inside private folder. + dir.mkdir(PRIVATE_DIR); + } + +//main entry point +int main(int argc, char *argv[]) + { + int ret = -1; + QCoreApplication app(argc, argv); + + //creating output directory. + createOutPutDirectory(); + + //the configuration file. + QFile data("c:/TestUniDataModelVCalPlugin.cfg"); + + if (data.open(QFile::ReadOnly)) + { + QTextStream in(&data); + while(!in.atEnd()) + { + QStringList args; + QString appName = argv[0]; + args << appName; + + QString option = "-o"; + args << option; + + QString outFile = RESULTFILE; + QString name = in.readLine(); + outFile = outFile.arg(name); + args << outFile; + + QObject* tc = getObject(name); + + if(tc) + { + + ret = QTest::qExec(tc, args); + delete tc; + } + } + } + data.close(); + return ret; + } + + + + + +//--------------------------------------------------------------- +// TestUniDataModelVCalPlugin::init +//--------------------------------------------------------------- + + +void TestUniDataModelVCalPlugin::initTestCase() +{ + iObserver = new (ELeave) MsgObserver(); + + // Create a new messaging server session.. + iMSession = CMsvSession::OpenSyncL(*iObserver); + + iMsvEntry = iMSession->GetEntryL(KMsvRootIndexEntryId); + newEntryId = 0; + pluginLoader = new UniDataModelLoader(); + + retTimeStamp = QDateTime::currentDateTime(); + int err = iFs.Connect(); + QVERIFY(err == 0); + iBioDb = CBIODatabase::NewL(iFs); + iFs.SetSessionPath(_L("c:\\")); + inbox = EFalse; + drafts = EFalse; +} +void TestUniDataModelVCalPlugin::cleanupTestCase() +{ + delete iMsvEntry; + iMsvEntry = NULL; + delete iObserver; + iObserver = NULL; + delete iMSession; + iMSession = NULL; + delete pluginLoader; +} + +void TestUniDataModelVCalPlugin::init() +{ + +} + +//--------------------------------------------------------------- +// TestUniDataModelVCalPlugin::cleanup +//--------------------------------------------------------------- +void TestUniDataModelVCalPlugin::cleanup() +{ + + +} + +void TestUniDataModelVCalPlugin::testInBoxVCalMessage() +{ + inbox = ETrue; + GenerateMessagesL(); + + pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg); + pluginInterface->setMessageId(newEntryId); + + int count = pluginInterface->attachmentCount(); + QVERIFY(count == 1); + + UniMessageInfoList attachmentlist = pluginInterface->attachmentList(); + QVERIFY(!attachmentlist.isEmpty()); + + UniMessageInfo* att = attachmentlist.at(0); + QString path = att->path(); + + QString recepient(TEST_MSG_FROM1); + QString fromaddress; + pluginInterface->fromAddress(fromaddress); + QVERIFY(recepient == fromaddress); + + QString body; + pluginInterface->body(body); + QVERIFY(!body.isEmpty()); + + // Compare input message , with the read message + RFile origFile; + int op = origFile.Open(iFs, currentFile, EFileRead); + QVERIFY(op == 0); + + TBuf8<1000> readBuf; + HBufC* readBuf16 = HBufC::NewL(2000); + + origFile.Read(readBuf); + readBuf16->Des().Copy(readBuf); + + QString orig = XQConversions::s60DescToQString(*readBuf16); + origFile.Close(); + + HBufC* filepath = XQConversions::qStringToS60Desc(path); + + int size = pluginInterface->messageSize(); + + MsgPriority priority = pluginInterface->messagePriority(); + // Normal priority + qDebug() << "prority" << priority; + QVERIFY(priority == 1); + + QVERIFY(pluginInterface->timeStamp() == retTimeStamp); + + ConvergedMessageAddressList recipientList; + pluginInterface->toRecipientList(recipientList); + QVERIFY(recipientList.count() == 0); + qDebug() << "recipientList.count" << recipientList.count(); + + if (inbox) + { + iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId); + qDebug() << "SetEntry" ; + } + + +} + +void TestUniDataModelVCalPlugin::testDraftsVCalMessage() +{ + drafts = ETrue; + GenerateMessagesL(); + + pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg); + pluginInterface->setMessageId(newEntryId); + + int count = pluginInterface->attachmentCount(); + QVERIFY(count == 1); + + UniMessageInfoList attachmentlist = pluginInterface->attachmentList(); + QVERIFY(!attachmentlist.isEmpty()); + + UniMessageInfo* att = attachmentlist.at(0); + QString path = att->path(); + + QString fromaddress; + pluginInterface->fromAddress(fromaddress); + QVERIFY(!fromaddress.isEmpty()); //added ! shweta + + QString body; + pluginInterface->body(body); + QVERIFY(!body.isEmpty()); + + // Compare input message , with the read message + RFile origFile; + int op = origFile.Open(iFs, currentFile, EFileRead); + QVERIFY(op == 0); + + TBuf8<1000> readBuf; + HBufC* readBuf16 = HBufC::NewL(2000); + + origFile.Read(readBuf); + readBuf16->Des().Copy(readBuf); + + QString orig = XQConversions::s60DescToQString(*readBuf16); + origFile.Close(); + + int size = pluginInterface->messageSize(); + + MsgPriority priority = pluginInterface->messagePriority(); + // Normal priority + qDebug() << "prority" << priority; + QVERIFY(priority == 1); + + QVERIFY(pluginInterface->timeStamp() == retTimeStamp); + + QString recepient(TEST_MSG_FROM1); + ConvergedMessageAddressList recipientList; + ConvergedMessageAddress alias(recepient); + + recipientList.append(&alias); + pluginInterface->toRecipientList(recipientList); + + QVERIFY( recipientList.count() != 0 ); + qDebug() << "recipientList.count()"<address(); + qDebug() << "copy = "<address(); + QVERIFY(recepient == copy); + qDebug() << "Receipient Verified"; + + if (drafts) + { + iMsvEntry->SetEntryL(KMsvDraftEntryId); + qDebug() << "SetEntry" ; + } + } + + + +void TestUniDataModelVCalPlugin::testUnusedAPIs() +{ + pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg); + + QVERIFY(pluginInterface->objectCount() == 0); + + UniMessageInfoList objectlist = pluginInterface->objectList(); + QVERIFY(objectlist.isEmpty()); + + QVERIFY(pluginInterface->slideCount() == 0); + + UniMessageInfoList slidelist = pluginInterface->slideContent(0); + QVERIFY(slidelist.isEmpty()); + + QVERIFY(pluginInterface->hasAttachment() == true ); + + ConvergedMessageAddressList recipientList; + + pluginInterface->ccRecipientList(recipientList); + QVERIFY(recipientList.count() == 0); + + pluginInterface->bccRecipientList(recipientList); + QVERIFY(recipientList.count() == 0); +} + +CMsvEntrySelection* TestUniDataModelVCalPlugin::GenerateMessagesL() +{ + HBufC* aFileDirectory = KBIOTxtFilePath().AllocL(); + TMsvId messageId; + TBIOMessageType currentMsgType; + + CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection(); + CleanupStack::PushL(selection); + + TInt err = iFs.GetDir(aFileDirectory->Des(), + KEntryAttMatchMask, + ESortByName, + iDir); + if (err == KErrPathNotFound) + { + TInt makeDirErr = iFs.MkDirAll(aFileDirectory->Des()); + makeDirErr == KErrNone ? User::Leave(KErrNotFound) + : User::Leave(makeDirErr); + } + else if (err != KErrNone) + { + User::Leave(err); + } + + // Set the session path for the RFs + SetSessionPath(aFileDirectory->Des()); + if (iDir) + { + delete iDir; + iDir = NULL; + } + + User::LeaveIfError(iFs.GetDir(_L("*.txt"), KEntryAttNormal, ESortByName, iDir)); + TInt count = iDir->Count(); + if (count == 0) + { + User::Leave(KErrNotFound); // No files to process + } + + TBuf<60> outputBuf; + + for (TInt loop = 0; loop < count; loop++) + { + TEntry as = (*iDir)[0]; + currentFile = (as.iName); + // Not processed all the messages - so keep the current state + iFilesProcessed++; // Here because need to update the counter promptly + currentMsgType = SetMessageType(currentFile); + if (currentMsgType != ENoMessage) // skip any dodgy filenames + { + messageId = CreateBIOEntryFromFileL(currentFile, currentMsgType); + selection->AppendL(messageId); + TPtrC tempPtr = (currentFile.Des()); + + } + } + CleanupStack::Pop(); // selection + + return selection; +} + +TBIOMessageType TestUniDataModelVCalPlugin::SetMessageType( + const TDesC& aFileName) +{ + + if (aFileName.MatchF(KBIOvCalenderPrefix) == 0) + { + return EBiovCalenderMessage; + } + + return ENoMessage; +} + +TMsvId TestUniDataModelVCalPlugin::CreateBIOEntryFromFileL( + const TDesC& aFilename, + TBIOMessageType aMessageType) +{ + //First use the filename to get the message body, + // then convert '\n' to the paragraph delimiters used in proper SMS + HBufC* tempBuffer; + + tempBuffer = ReadFromFileL(aFilename); + CleanupStack::PushL(tempBuffer); + + newEntryId = CreateBIOEntryL(*tempBuffer, aMessageType); + + // Finished with our local descriptors - free up some memory + CleanupStack::PopAndDestroy(); + + return newEntryId; +} + +void TestUniDataModelVCalPlugin::SetSessionPath(const TDesC& aSessionPath) +{ + iFs.SetSessionPath(aSessionPath); +} + +HBufC* TestUniDataModelVCalPlugin::ReadFromFileL(const TDesC& aFile) +{ + RFile file; + TBuf8<1024> lineBuffer; + TInt err = KErrNone; + + err = file.Open(iFs, aFile, EFileStreamText | EFileRead | EFileShareAny); + + if (err != KErrNone) // Didn't find the file, so leave - should only get valid filenames! + { + User::Leave(KErrNotFound); + } + + HBufC* bioBuf = HBufC::NewLC(65535); // Create a new descriptor on the heap. + HBufC* copyBuffer = HBufC::NewLC(1024); + + do // Read in the text from file, and also check if there is a name field: + { + err = file.Read(lineBuffer);// Read upto 256 chars, '\n' and all... + //err = ReadLineL(file,lineBuffer); + if (err == KErrNone) // Made a valid read, + if (lineBuffer.Length() == 0) // but read 0 chars + err = KErrEof; // so set err value to end processing + + if (err == KErrNone) + { + copyBuffer->Des().Copy(lineBuffer);// Copy, and overwrite existing text + if ( (bioBuf->Length() + copyBuffer->Length()) + > bioBuf->Des().MaxLength()) + { + bioBuf = bioBuf->ReAllocL(bioBuf->Length() + + copyBuffer->Length()); + } + bioBuf->Des().Append(*copyBuffer); + //bioBuf->Des().Append(_L("\n")); + } + }while (err != KErrEof); + + CleanupStack::PopAndDestroy(); // Destroy the copyBuffer. + CleanupStack::Pop();// Remove the bioBuf. + + file.Close(); + return bioBuf; +} + +TMsvId TestUniDataModelVCalPlugin::CreateBIOEntryL(TDesC& aText, + TBIOMessageType aMessageType) +{ + // Ensure that we have a valid service ID to work with: + TMsvId iBioServiceId; + + iBioServiceId = SetBIOServiceIdL(); + + HBufC* localBuffer = aText.AllocL(); + CleanupStack::PushL(localBuffer); + + TPtr messDes = localBuffer->Des(); + + if (aMessageType != EBiovCardMessage && aMessageType + != EBiovCalenderMessage) + { + // convert \r\n to \n since this is what is expected from SMS when not vCard data + for (TInt i = 0; i < messDes.Length(); i++) + { + if (messDes[i] == (TText) '\r' && i < messDes.Length() - 1 + && messDes[i + 1] == (TText) '\n') + messDes.Delete(i, 1); + } + } + + // Create and fill a CRichText object for the jobbie: + CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL(); + CleanupStack::PushL(paraFormatLayer); + CCharFormatLayer* charFormatLayer = CCharFormatLayer::NewL(); + CleanupStack::PushL(charFormatLayer); + CRichText* richText = CRichText::NewL(paraFormatLayer, charFormatLayer); + CleanupStack::PushL(richText); + + TInt pos = richText->DocumentLength(); + richText->InsertL(pos, messDes); + + TMsvEntry newBioEntry; + newBioEntry.SetNew(ETrue); + newBioEntry.SetComplete(EFalse); + newBioEntry.SetUnread(ETrue); + newBioEntry.SetVisible(ETrue); + newBioEntry.SetReadOnly(EFalse); + newBioEntry.SetFailed(EFalse); + newBioEntry.SetOperation(EFalse); + newBioEntry.SetMultipleRecipients(EFalse); + newBioEntry.SetAttachment(EFalse); + newBioEntry.iMtm = KUidBIOMessageTypeMtm; + newBioEntry.iType = KUidMsvMessageEntry; + newBioEntry.iServiceId = iBioServiceId; + TTime now; + now.UniversalTime(); + newBioEntry.iDate = now; + + TTime unixEpoch(KUnixEpoch); + TTimeIntervalSeconds seconds; + TTime timeStamp = newBioEntry.iDate; + timeStamp.SecondsFrom(unixEpoch, seconds); + retTimeStamp.setTime_t(seconds.Int()); + + newBioEntry.iDescription.Set(richText->Read(0, richText->DocumentLength())); + TBufC telNumber; + + QString recepient(TEST_MSG_FROM1); + tempNumber = XQConversions::qStringToS60Desc(recepient); + + telNumber = tempNumber->Des(); + newBioEntry.iDetails.Set(telNumber); + + SetForMtmTypeL(newBioEntry, aMessageType); + + newBioEntry.iSize = richText->DocumentLength();// msgSize; + CreateBioEntryClientSideL(newBioEntry, *richText); + + CleanupStack::PopAndDestroy(4); // richText, charFormatLayer, paraFormatLayer, localBuffer + return newBioEntry.Id(); +} + +void TestUniDataModelVCalPlugin::CreateBioEntryClientSideL(TMsvEntry& aEntry, + CRichText& aBody) +{ + if (inbox) + { + iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId); + } + else if (drafts) + { + iMsvEntry->SetEntryL(KMsvDraftEntryId); + } + // Get the global inbox. + + iMsvEntry->CreateL(aEntry); + iMsvEntry->SetEntryL(aEntry.Id()); + + // Save all the changes + CMsvStore* store = iMsvEntry->EditStoreL(); + CleanupStack::PushL(store); + + if (store->HasBodyTextL()) + { + store->DeleteBodyTextL(); + } + + CPlainText* pText = CPlainText::NewL(); + CleanupStack::PushL(pText); + + if (inbox) + { + CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *pText); + CleanupStack::PushL(smsHeader); + smsHeader->SetFromAddressL(*tempNumber); + smsHeader->StoreL(*store); + + } + else if (drafts) + { + + QString recepient(TEST_MSG_FROM1); + QString recepient2(TEST_MSG_FROM2); + QString alias(TEST_MSG_ALIAS1); + + HBufC* addr = XQConversions::qStringToS60Desc(recepient); + HBufC* addr2 = XQConversions::qStringToS60Desc(recepient2); + HBufC* alias1 = XQConversions::qStringToS60Desc(alias); + + CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *pText); + CleanupStack::PushL(smsHeader); + + CSmsNumber* number1 = CSmsNumber::NewL(); // create the instance + CleanupStack::PushL(number1); + + number1->SetNameL(TPtrC()); + number1->SetAddressL(*addr); + smsHeader->Recipients().AppendL(number1); + CleanupStack::Pop(number1); + + CSmsNumber* number2 = CSmsNumber::NewL(); + CleanupStack::PushL(number2); + + number2->SetNameL(*alias1); + number2->SetAddressL(*addr2); + + smsHeader->Recipients().AppendL(number2); + CleanupStack::Pop(number2); + smsHeader->StoreL(*store); + + } + + store->StoreBodyTextL(aBody); + store->CommitL(); + + CleanupStack::PopAndDestroy(3); //store - close the store + + aEntry.SetComplete(ETrue); + // Update the entry + iMsvEntry->ChangeL(aEntry); + iMsvEntry->SetEntryL(KMsvRootIndexEntryId); +} + +TMsvId TestUniDataModelVCalPlugin::SetBIOServiceIdL() +{ + // Haven't found an entry so create a BIO Message service: + TMsvEntry bioServiceEntry; + bioServiceEntry.iMtm = KUidBIOMessageTypeMtm; + bioServiceEntry.iType = KUidMsvServiceEntry; + bioServiceEntry.SetVisible(EFalse); + bioServiceEntry.iDate.UniversalTime(); + bioServiceEntry.iDescription.Set(_L("BIO Message Service ")); // Is there such a thing? + bioServiceEntry.iDetails.Set(_L("BIO Message Service")); + + TMsvId newBIOServiceId; + + iMsvEntry->SetEntryL(KMsvRootIndexEntryId); + iMsvEntry->CreateL(bioServiceEntry); // Needs to be a child of the root! + newBIOServiceId = bioServiceEntry.Id(); + + return newBIOServiceId; +} + +void TestUniDataModelVCalPlugin::SetForMtmTypeL(TMsvEntry& aEntry, + TBIOMessageType aType) +{ + TInt index; + + aEntry.iBioType = KUidBIOVCalenderMsg; + + // Set other TMsvEntry fields if we have a BIO message type + if (aType != ENoMessage) + { + aEntry.SetMtmData2(0); + aEntry.SetMtmData3(0); + } + + // set description from BIF file + iBioDb->GetBioIndexWithMsgIDL(TUid::Uid(aEntry.iBioType), index); + if (index == KErrNotFound) + User::Leave(KErrNotFound); + aEntry.iDescription.Set(iBioDb->BifReader(index).Description()); +} + +void MsgObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, + TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) +{ +} diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/BioMtm.rsc Binary file messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/BioMtm.rsc has changed diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.cpp --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.cpp Tue Jul 06 22:50:16 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,618 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "serviceinfo.h" -#include "testunidatamodelvcalplugin.h" -#include "unidatamodelloader.h" -#include "testunidatamodelvcalplugin.ini" -#include "unidatamodelplugininterface.h" -#include "convergedmessage.h" - -const TInt KTelephoneNumberMaxLength = 32; -_LIT(KBIOTxtFilePath, "C:\\test\\"); -_LIT(KBIOvCalenderPrefix, "vcal*"); -// vCalender -_LIT(KUnixEpoch, "19700000:000000.000000"); -#define KBioUidValue 0x10001262 - -const TUid KBioUidValueUid = -{KBioUidValue}; - -//--------------------------------------------------------------- -// TestUniDataModelVCalPlugin::init -//--------------------------------------------------------------- - - -void TestUniDataModelVCalPlugin::initTestCase() -{ - -} -void TestUniDataModelVCalPlugin::cleanupTestCase() -{ - -} - -void TestUniDataModelVCalPlugin::init() -{ - iObserver = new (ELeave) MsgObserver(); - - // Create a new messaging server session.. - iMSession = CMsvSession::OpenSyncL(*iObserver); - - iMsvEntry = iMSession->GetEntryL(KMsvRootIndexEntryId); - newEntryId = 0; - pluginLoader = new UniDataModelLoader(); - - retTimeStamp = QDateTime::currentDateTime(); - int err = iFs.Connect(); - QVERIFY(err == 0); - iBioDb = CBIODatabase::NewL(iFs); - iFs.SetSessionPath(_L("c:\\")); - inbox = EFalse; - drafts = EFalse; -} - -//--------------------------------------------------------------- -// TestUniDataModelVCalPlugin::cleanup -//--------------------------------------------------------------- -void TestUniDataModelVCalPlugin::cleanup() -{ - if (newEntryId > 0) - iMsvEntry->DeleteL(newEntryId); - delete iMsvEntry; - iMsvEntry = NULL; - delete iObserver; - iObserver = NULL; - delete iMSession; - iMSession = NULL; - delete pluginLoader; - -} - -void TestUniDataModelVCalPlugin::testInBoxVCalMessage() -{ - inbox = ETrue; - GenerateMessagesL(); - - pluginInterface = pluginLoader->getDataModelPlugin("bio:vcal"); - pluginInterface->setMessageId(newEntryId); - - int count = pluginInterface->attachmentCount(); - QVERIFY(count == 1); - - UniMessageInfoList attachmentlist = pluginInterface->attachmentList(); - QVERIFY(!attachmentlist.isEmpty()); - - UniMessageInfo* att = attachmentlist.at(0); - QString path = att->path(); - - QString recepient(TEST_MSG_FROM1); - QString fromaddress; - pluginInterface->fromAddress(fromaddress); - QVERIFY(recepient == fromaddress); - - QString body; - pluginInterface->body(body); - QVERIFY(!body.isEmpty()); - - // Compare input message , with the read message - RFile origFile; - int op = origFile.Open(iFs, currentFile, EFileRead); - QVERIFY(op == 0); - - TBuf8<1000> readBuf; - HBufC* readBuf16 = HBufC::NewL(2000); - - origFile.Read(readBuf); - readBuf16->Des().Copy(readBuf); - - QString orig = XQConversions::s60DescToQString(*readBuf16); - origFile.Close(); - - HBufC* filepath = XQConversions::qStringToS60Desc(path); - - RFile file; - op = file.Open(iFs, *filepath, EFileRead); - QVERIFY(op == 0); - - file.Read(readBuf); - readBuf16->Des().Copy(readBuf); - QString bod = XQConversions::s60DescToQString(*readBuf16); - - delete readBuf16; - file.Close(); - // compare Input body and output body - QVERIFY(bod == orig ); - - int size = pluginInterface->messageSize(); - - MsgPriority priority = pluginInterface->messagePriority(); - // Normal priority - qDebug() << "prority" << priority; - QVERIFY(priority == 1); - - QVERIFY(pluginInterface->timeStamp() == retTimeStamp); - - ConvergedMessageAddressList recipientList; - pluginInterface->toRecipientList(recipientList); - QVERIFY(recipientList.count() == 0); - iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId); -} - -void TestUniDataModelVCalPlugin::testDraftsVCalMessage() -{ - drafts = ETrue; - GenerateMessagesL(); - - pluginInterface = pluginLoader->getDataModelPlugin("bio:vcal"); - pluginInterface->setMessageId(newEntryId); - - int count = pluginInterface->attachmentCount(); - QVERIFY(count == 1); - - UniMessageInfoList attachmentlist = pluginInterface->attachmentList(); - QVERIFY(!attachmentlist.isEmpty()); - - UniMessageInfo* att = attachmentlist.at(0); - QString path = att->path(); - - QString fromaddress; - pluginInterface->fromAddress(fromaddress); - QVERIFY(fromaddress.isEmpty()); - - QString body; - pluginInterface->body(body); - QVERIFY(!body.isEmpty()); - - // Compare input message , with the read message - RFile origFile; - int op = origFile.Open(iFs, currentFile, EFileRead); - QVERIFY(op == 0); - - TBuf8<1000> readBuf; - HBufC* readBuf16 = HBufC::NewL(2000); - - origFile.Read(readBuf); - readBuf16->Des().Copy(readBuf); - - QString orig = XQConversions::s60DescToQString(*readBuf16); - origFile.Close(); - - HBufC* filepath = XQConversions::qStringToS60Desc(path); - - RFile file; - op = file.Open(iFs, *filepath, EFileRead); - QVERIFY(op == 0); - - file.Read(readBuf); - - readBuf16->Des().Copy(readBuf); - - QString bod = XQConversions::s60DescToQString(*readBuf16); - - delete readBuf16; - file.Close(); - // compare Input body and output body - QVERIFY(bod == orig ); - - int size = pluginInterface->messageSize(); - - MsgPriority priority = pluginInterface->messagePriority(); - // Normal priority - qDebug() << "prority" << priority; - QVERIFY(priority == 1); - - QVERIFY(pluginInterface->timeStamp() == retTimeStamp); - - ConvergedMessageAddressList recipientList; - pluginInterface->toRecipientList(recipientList); - QString recepient(TEST_MSG_FROM1); - QString recepient2(TEST_MSG_FROM2); - QString origalias(TEST_MSG_ALIAS1); - - QVERIFY(recipientList.count() == 2); - - QVERIFY(recepient == recipientList[0]->address()); - - QVERIFY( recipientList[0]->alias().isEmpty()); - - const QString& as = recipientList[1]->address(); - const QString& as1 = recipientList[1]->alias(); - QVERIFY(recepient2 == as); - - QVERIFY(origalias == as1); - iMsvEntry->SetEntryL(KMsvDraftEntryId); -} - - - -void TestUniDataModelVCalPlugin::testUnusedAPIs() -{ - pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg); - - QVERIFY(pluginInterface->objectCount() == 0); - - UniMessageInfoList objectlist = pluginInterface->objectList(); - QVERIFY(objectlist.isEmpty()); - - QVERIFY(pluginInterface->slideCount() == 0); - - UniMessageInfoList slidelist = pluginInterface->slideContent(0); - QVERIFY(slidelist.isEmpty()); - - QVERIFY(pluginInterface->hasAttachment() == true ); - - ConvergedMessageAddressList recipientList; - - pluginInterface->ccRecipientList(recipientList); - QVERIFY(recipientList.count() == 0); - - pluginInterface->bccRecipientList(recipientList); - QVERIFY(recipientList.count() == 0); -} - -CMsvEntrySelection* TestUniDataModelVCalPlugin::GenerateMessagesL() -{ - HBufC* aFileDirectory = KBIOTxtFilePath().AllocL(); - TMsvId messageId; - TBIOMessageType currentMsgType; - - CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection(); - CleanupStack::PushL(selection); - - TInt err = iFs.GetDir(aFileDirectory->Des(), - KEntryAttMatchMask, - ESortByName, - iDir); - if (err == KErrPathNotFound) - { - TInt makeDirErr = iFs.MkDirAll(aFileDirectory->Des()); - makeDirErr == KErrNone ? User::Leave(KErrNotFound) - : User::Leave(makeDirErr); - } - else if (err != KErrNone) - { - User::Leave(err); - } - - // Set the session path for the RFs - SetSessionPath(aFileDirectory->Des()); - if (iDir) - { - delete iDir; - iDir = NULL; - } - - User::LeaveIfError(iFs.GetDir(_L("*.txt"), KEntryAttNormal, ESortByName, iDir)); - TInt count = iDir->Count(); - if (count == 0) - { - User::Leave(KErrNotFound); // No files to process - } - - TBuf<60> outputBuf; - - for (TInt loop = 0; loop < count; loop++) - { - TEntry as = (*iDir)[0]; - currentFile = (as.iName); - // Not processed all the messages - so keep the current state - iFilesProcessed++; // Here because need to update the counter promptly - currentMsgType = SetMessageType(currentFile); - if (currentMsgType != ENoMessage) // skip any dodgy filenames - { - messageId = CreateBIOEntryFromFileL(currentFile, currentMsgType); - selection->AppendL(messageId); - TPtrC tempPtr = (currentFile.Des()); - - } - } - CleanupStack::Pop(); // selection - return selection; -} - -TBIOMessageType TestUniDataModelVCalPlugin::SetMessageType( - const TDesC& aFileName) -{ - - if (aFileName.MatchF(KBIOvCalenderPrefix) == 0) - { - return EBiovCalenderMessage; - } - - return ENoMessage; -} - -TMsvId TestUniDataModelVCalPlugin::CreateBIOEntryFromFileL( - const TDesC& aFilename, - TBIOMessageType aMessageType) -{ - //First use the filename to get the message body, - // then convert '\n' to the paragraph delimiters used in proper SMS - HBufC* tempBuffer; - - tempBuffer = ReadFromFileL(aFilename); - CleanupStack::PushL(tempBuffer); - - newEntryId = CreateBIOEntryL(*tempBuffer, aMessageType); - - // Finished with our local descriptors - free up some memory - CleanupStack::PopAndDestroy(); - return newEntryId; -} - -void TestUniDataModelVCalPlugin::SetSessionPath(const TDesC& aSessionPath) -{ - iFs.SetSessionPath(aSessionPath); -} - -HBufC* TestUniDataModelVCalPlugin::ReadFromFileL(const TDesC& aFile) -{ - RFile file; - TBuf8<1024> lineBuffer; - TInt err = KErrNone; - - err = file.Open(iFs, aFile, EFileStreamText | EFileRead | EFileShareAny); - - if (err != KErrNone) // Didn't find the file, so leave - should only get valid filenames! - { - User::Leave(KErrNotFound); - } - - HBufC* bioBuf = HBufC::NewLC(65535); // Create a new descriptor on the heap. - HBufC* copyBuffer = HBufC::NewLC(1024); - - do // Read in the text from file, and also check if there is a name field: - { - err = file.Read(lineBuffer);// Read upto 256 chars, '\n' and all... - //err = ReadLineL(file,lineBuffer); - if (err == KErrNone) // Made a valid read, - if (lineBuffer.Length() == 0) // but read 0 chars - err = KErrEof; // so set err value to end processing - - if (err == KErrNone) - { - copyBuffer->Des().Copy(lineBuffer);// Copy, and overwrite existing text - if ( (bioBuf->Length() + copyBuffer->Length()) - > bioBuf->Des().MaxLength()) - { - bioBuf = bioBuf->ReAllocL(bioBuf->Length() - + copyBuffer->Length()); - } - bioBuf->Des().Append(*copyBuffer); - //bioBuf->Des().Append(_L("\n")); - } - }while (err != KErrEof); - - CleanupStack::PopAndDestroy(); // Destroy the copyBuffer. - CleanupStack::Pop();// Remove the bioBuf. - - file.Close(); - return bioBuf; -} - -TMsvId TestUniDataModelVCalPlugin::CreateBIOEntryL(TDesC& aText, - TBIOMessageType aMessageType) -{ - // Ensure that we have a valid service ID to work with: - TMsvId iBioServiceId; - - iBioServiceId = SetBIOServiceIdL(); - - HBufC* localBuffer = aText.AllocL(); - CleanupStack::PushL(localBuffer); - - TPtr messDes = localBuffer->Des(); - - if (aMessageType != EBiovCardMessage && aMessageType - != EBiovCalenderMessage) - { - // convert \r\n to \n since this is what is expected from SMS when not vCard data - for (TInt i = 0; i < messDes.Length(); i++) - { - if (messDes[i] == (TText) '\r' && i < messDes.Length() - 1 - && messDes[i + 1] == (TText) '\n') - messDes.Delete(i, 1); - } - } - - // Create and fill a CRichText object for the jobbie: - CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL(); - CleanupStack::PushL(paraFormatLayer); - CCharFormatLayer* charFormatLayer = CCharFormatLayer::NewL(); - CleanupStack::PushL(charFormatLayer); - CRichText* richText = CRichText::NewL(paraFormatLayer, charFormatLayer); - CleanupStack::PushL(richText); - - TInt pos = richText->DocumentLength(); - richText->InsertL(pos, messDes); - - TMsvEntry newBioEntry; - newBioEntry.SetNew(ETrue); - newBioEntry.SetComplete(EFalse); - newBioEntry.SetUnread(ETrue); - newBioEntry.SetVisible(ETrue); - newBioEntry.SetReadOnly(EFalse); - newBioEntry.SetFailed(EFalse); - newBioEntry.SetOperation(EFalse); - newBioEntry.SetMultipleRecipients(EFalse); - newBioEntry.SetAttachment(EFalse); - newBioEntry.iMtm = KUidBIOMessageTypeMtm; - newBioEntry.iType = KUidMsvMessageEntry; - newBioEntry.iServiceId = iBioServiceId; - TTime now; - now.UniversalTime(); - newBioEntry.iDate = now; - - TTime unixEpoch(KUnixEpoch); - TTimeIntervalSeconds seconds; - TTime timeStamp = newBioEntry.iDate; - timeStamp.SecondsFrom(unixEpoch, seconds); - retTimeStamp.setTime_t(seconds.Int()); - - newBioEntry.iDescription.Set(richText->Read(0, richText->DocumentLength())); - TBufC telNumber; - - QString recepient(TEST_MSG_FROM1); - tempNumber = XQConversions::qStringToS60Desc(recepient); - - telNumber = tempNumber->Des(); - newBioEntry.iDetails.Set(telNumber); - - SetForMtmTypeL(newBioEntry, aMessageType); - - newBioEntry.iSize = richText->DocumentLength();// msgSize; - CreateBioEntryClientSideL(newBioEntry, *richText); - - CleanupStack::PopAndDestroy(4); // richText, charFormatLayer, paraFormatLayer, localBuffer - return newBioEntry.Id(); -} - -void TestUniDataModelVCalPlugin::CreateBioEntryClientSideL(TMsvEntry& aEntry, - CRichText& aBody) -{ - if (inbox) - { - iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId); - } - else if (drafts) - { - iMsvEntry->SetEntryL(KMsvDraftEntryId); - } - // Get the global inbox. - - iMsvEntry->CreateL(aEntry); - iMsvEntry->SetEntryL(aEntry.Id()); - - // Save all the changes - CMsvStore* store = iMsvEntry->EditStoreL(); - CleanupStack::PushL(store); - - if (store->HasBodyTextL()) - { - store->DeleteBodyTextL(); - } - - CPlainText* pText = CPlainText::NewL(); - CleanupStack::PushL(pText); - - if (inbox) - { - CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *pText); - CleanupStack::PushL(smsHeader); - smsHeader->SetFromAddressL(*tempNumber); - smsHeader->StoreL(*store); - - } - else if (drafts) - { - - QString recepient(TEST_MSG_FROM1); - QString recepient2(TEST_MSG_FROM2); - QString alias(TEST_MSG_ALIAS1); - - HBufC* addr = XQConversions::qStringToS60Desc(recepient); - HBufC* addr2 = XQConversions::qStringToS60Desc(recepient2); - HBufC* alias1 = XQConversions::qStringToS60Desc(alias); - - CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *pText); - CleanupStack::PushL(smsHeader); - - CSmsNumber* number1 = CSmsNumber::NewL(); // create the instance - CleanupStack::PushL(number1); - - number1->SetNameL(TPtrC()); - number1->SetAddressL(*addr); - smsHeader->Recipients().AppendL(number1); - CleanupStack::Pop(number1); - - CSmsNumber* number2 = CSmsNumber::NewL(); - CleanupStack::PushL(number2); - - number2->SetNameL(*alias1); - number2->SetAddressL(*addr2); - - smsHeader->Recipients().AppendL(number2); - CleanupStack::Pop(number2); - smsHeader->StoreL(*store); - - } - - store->StoreBodyTextL(aBody); - store->CommitL(); - - CleanupStack::PopAndDestroy(3); //store - close the store - - aEntry.SetComplete(ETrue); - // Update the entry - iMsvEntry->ChangeL(aEntry); - iMsvEntry->SetEntryL(KMsvRootIndexEntryId); -} - -TMsvId TestUniDataModelVCalPlugin::SetBIOServiceIdL() -{ - // Haven't found an entry so create a BIO Message service: - TMsvEntry bioServiceEntry; - bioServiceEntry.iMtm = KUidBIOMessageTypeMtm; - bioServiceEntry.iType = KUidMsvServiceEntry; - bioServiceEntry.SetVisible(EFalse); - bioServiceEntry.iDate.UniversalTime(); - bioServiceEntry.iDescription.Set(_L("BIO Message Service ")); // Is there such a thing? - bioServiceEntry.iDetails.Set(_L("BIO Message Service")); - - TMsvId newBIOServiceId; - - iMsvEntry->SetEntryL(KMsvRootIndexEntryId); - iMsvEntry->CreateL(bioServiceEntry); // Needs to be a child of the root! - newBIOServiceId = bioServiceEntry.Id(); - - return newBIOServiceId; -} - -void TestUniDataModelVCalPlugin::SetForMtmTypeL(TMsvEntry& aEntry, - TBIOMessageType aType) -{ - TInt index; - - aEntry.iBioType = KUidBIOVCalenderMsg; - - // Set other TMsvEntry fields if we have a BIO message type - if (aType != ENoMessage) - { - aEntry.SetMtmData2(0); - aEntry.SetMtmData3(0); - } - - // set description from BIF file - iBioDb->GetBioIndexWithMsgIDL(TUid::Uid(aEntry.iBioType), index); - if (index == KErrNotFound) - User::Leave(KErrNotFound); - aEntry.iDescription.Set(iBioDb->BifReader(index).Description()); -} - -void MsgObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, - TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) -{ -} diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.h --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.h Tue Jul 06 22:50:16 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - */ - -#ifndef TEST_UNI_DATA_MODEL_VCAL_PLUGIN_H -#define TEST_UNI_DATA_MODEL_VCAL_PLUGIN_H - -#ifdef BUILD_TEST_DLL -#define TEST_EXPORT Q_DECL_EXPORT -#else -#define TEST_EXPORT Q_DECL_IMPORT -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include - -const TInt32 KUidBIOVCalenderMsg = {0x10005533}; // VCalender diary - -class UniDataModelPluginInterface; -class UniDataModelLoader; -class MsgObserver; - -class ConvergedMessage; -class CBIODatabase; - - -typedef enum - { // GENERATE A MESSAGE USING.... - ENoMessage, // .. error cases - EBioIapSettingsMessage, // .. IAP grammar, includes Internet settings - // Email settings, and logon scripts, - EBioEnpMessage, // .. Email Notification grammar. - EBioRingTonesMessage, // .. Ringing Tones binary data - EBioOpLogoMessage, // .. Logo for Operator service - EBioCompBusCardMessage, // .. Compact Business Card data - EBiovCardMessage, // .. virtual business card data - EBiovCalenderMessage, // .. vCalender data - EBioWAPSettingsMessage, // .. wap settings - EBioWPRVSettingsMessage // .. wprv settings - } TBIOMessageType; - - -class TEST_EXPORT TestUniDataModelVCalPlugin : public QObject -{ -Q_OBJECT - -private slots: - //called by frame work. - void initTestCase();//called before the first testfunction is executed. - void cleanupTestCase();//called after the last testfunction was executed. - void init();//called before each testfunction is executed. - void cleanup();//called after every testfunction. - //test cases. - void testInBoxVCalMessage(); - void testDraftsVCalMessage(); - void testUnusedAPIs(); - -private: - TMsvId CreateBIOEntryL(TDesC& aText, TBIOMessageType aMessageType); - void CreateBioEntryClientSideL(TMsvEntry& aEntry, CRichText& aBody); - HBufC* ReadFromFileL(const TDesC& aFile); - void SetSessionPath(const TDesC& aSessionPath); - TMsvId CreateBIOEntryFromFileL(const TDesC& aFilename, - TBIOMessageType aMessageType); - TBIOMessageType SetMessageType(const TDesC& aFileName); - CMsvEntrySelection* GenerateMessagesL(); - TMsvId SetBIOServiceIdL(); - void SetForMtmTypeL(TMsvEntry& aEntry, TBIOMessageType aType); - -private: - UniDataModelPluginInterface* pluginInterface; - MsgObserver* iObserver; - CMsvSession* iMSession; - CClientMtmRegistry* iMtmReg; - TMsvId messageId; - UniDataModelLoader* pluginLoader; - QDateTime retTimeStamp; - RFs iFs; - CDir* iDir; - TInt iFilesProcessed; - CMsvEntry* iMsvEntry; - CBIODatabase* iBioDb; - TMsvId newEntryId; - HBufC* tempNumber; - TBufC currentFile; - TBool inbox; - TBool drafts; -}; - -class MsgObserver : public MMsvSessionObserver -{ -public: - void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, - TAny* aArg3); -}; - -#endif //TEST_UNI_DATA_MODEL_VCAL_PLUGIN_H diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.ini --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.ini Tue Jul 06 22:50:16 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -//this file is used to provide predefined set of input data. - -//eg. -const char TEST_MSG_BODY[] = "This string is message body test string"; -const char TEST_MSG_RECIEPIENT[] = "Javaid Nabi<9741596546>"; -const char TEST_MSG_FROM1[] = "9741596546"; -const char TEST_MSG_ALIAS1[] = "Javaid Nabi"; -const char TEST_MSG_FROM2[] = "9797979797"; -const char TEST_MSG_ALIAS2[] = "Rajesh Batchu"; -const char TEST_MSG_SUBJECT[] = "Message Subject"; diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.pro --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.pro Tue Jul 06 22:50:16 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -QT += testlib -QT -= gui - -TEMPLATE = lib -TARGET = test-unidatamodel-vcal-plugin - - -INCLUDEPATH += . -INCLUDEPATH += ../../../../../../inc -INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE - -DEFINES += BUILD_TEST_DLL - -SOURCES += \ - testunidatamodelvcalplugin.cpp - - -# Input -HEADERS += \ - testunidatamodelvcalplugin.h - - - -SYMBIAN_PLATFORMS = WINSCW ARMV5 - symbian { - TARGET.CAPABILITY = CAP_GENERAL_DLL - TARGET.EPOCSTACKSIZE = 0x8000 - TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000 - TARGET.EPOCALLOWDLLDATA = 1 - BLD_INF_RULES.prj_exports += "vcal1.txt /epoc32/winscw/c/test/vcal1.txt" - BLD_INF_RULES.prj_exports += "BioMtm.rsc /epoc32/winscw/c/resource/messaging/mtm/BioMtm.rsc" - } - -defBlock = \ - "$${LITERAL_HASH}if defined(EABI)" \ - "DEFFILE ../eabi/test_unidatamodel_vcal_plugin.def" \ - "$${LITERAL_HASH}else" \ - "DEFFILE ../bwins/test_unidatamodel_vcal_plugin.def" \ - "$${LITERAL_HASH}endif" - -MMP_RULES += defBlock - - LIBS += -leuser \ - -lconvergedmessageutils\ - -lmsgs \ - -lsmcm \ - -lgsmu \ - -letext \ - -lmsgs \ - -lunidatamodelloader\ - -lQtCore \ - -lbioc \ - -lefsrv \ - -lbiodb \ - -lbifu \ - -lxqutils - - diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/vcal1.txt --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/vcal1.txt Tue Jul 06 22:50:16 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN -VERSION:1.0 -BEGIN:VEVENT -DTSTART:20000322T080000Z -DTEND:20000322T083000Z -LOCATION;ENCODING=QUOTED-PRINTABLE:Somewhere -UID:040000008200E00074C5B7101A82E0080000000090BB8A23ED93BF010000000000000000100 - 00000AB7E96B01EFFD31192E70060084F0B48 -DESCRIPTION;ENCODING=QUOTED-PRINTABLE:=09You will be busy doing something, = -somewhere at some point.=0D=0A -SUMMARY;ENCODING=QUOTED-PRINTABLE:My big appointment -PRIORITY:3 -END:VEVENT -END:VCALENDAR diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h Fri Jul 09 14:46:10 2010 +0530 @@ -210,6 +210,21 @@ */ void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); + + /** + * Populate sender address (for reply/replyAll case) + */ + void populateSenderL(ConvergedMessage& aMessage); + + /** + * Populates converged message for reply case + */ + void convertFromReplyHandlerL(ConvergedMessage* aMessage); + + /** + * Populates converged message for replyAll case + */ + void convertFromReplyAllHandlerL(ConvergedMessage* aMessage); private: // Data diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -43,6 +43,7 @@ #include "UniSendingSettings.h" #include "unidatamodelloader.h" #include "unidatamodelplugininterface.h" +#include "msgcontacthandler.h" #include #include "debugtraces.h" #include "UniEditorGenUtils.h" @@ -62,6 +63,7 @@ const TUid KSenduiMtmMmsUid = {KSenduiMtmMmsUidValue}; #define LOC_FWD hbTrId("txt_messaging_formlabel_fwd") +#define LOC_RE hbTrId("txt_messaging_formlabel_re") // ----------------------------------------------------------------------------- // Two-phased constructor. @@ -139,6 +141,14 @@ { convertFromForwardHandlerL(*msg); } + else if(aOperation == UniEditorPluginInterface::Reply) + { + convertFromReplyHandlerL(msg); + } + else if(aOperation == UniEditorPluginInterface::ReplyAll) + { + convertFromReplyAllHandlerL(msg); + } CleanupStack::Pop(msg); QDEBUG_WRITE("Exit convertFromL"); return msg; @@ -945,7 +955,7 @@ { } - +// ----------------------------------------------------------------------------- // HandleSessionEventL // @see Header // ----------------------------------------------------------------------------- @@ -957,4 +967,146 @@ // do nothing } +// ----------------------------------------------------------------------------- +// populateSenderL +// @see Header +// ----------------------------------------------------------------------------- +// +void CUniEditorMmsPluginPrivate::populateSenderL( + ConvergedMessage& aMessage) + { + // get sender address + HBufC* fromAddress = (MmsMtmL()->Sender()).AllocLC(); + HBufC* pureAddr = TMmsGenUtils::PureAddress(*fromAddress).AllocLC(); + HBufC* aliasAddr = TMmsGenUtils::Alias(*fromAddress).AllocLC(); + + if(pureAddr->Length() > 0) + { + ConvergedMessageAddress messageAddress( + XQConversions::s60DescToQString(*pureAddr), + XQConversions::s60DescToQString(*aliasAddr)); + aMessage.addToRecipient(messageAddress); + } + CleanupStack::PopAndDestroy(3, fromAddress ); + } + +// ----------------------------------------------------------------------------- +// convertFromReplyHandlerL +// @see Header +// ----------------------------------------------------------------------------- +// +void CUniEditorMmsPluginPrivate::convertFromReplyHandlerL( + ConvergedMessage* aMessage) + { + // for received mms, populate sender address into To-field + // for sent mms, populate recipients into To-field + TMsvEntry entry = MmsMtmL()->Entry().Entry(); + if( entry.Parent() == KMsvGlobalInBoxIndexEntryIdValue ) + { + populateSenderL(*aMessage); + } + else + { + populateRecipientsL(*aMessage); + } + + // resolve contacts + ConvergedMessageAddressList addrList = aMessage->toAddressList(); + int addrCount = addrList.count(); + for(int i=0; ialias().isEmpty()) + { + QString alias; + int count; + int localId = + MsgContactHandler::resolveContactDisplayName( + addr->address(), alias, count); + addr->setAlias(alias); + } + } + } + +// ----------------------------------------------------------------------------- +// convertFromReplyAllHandlerL +// @see Header +// ----------------------------------------------------------------------------- +// +void CUniEditorMmsPluginPrivate::convertFromReplyAllHandlerL( + ConvergedMessage* aMessage) + { + // populate all recipients (and sender for received mms) + TMsvEntry entry = MmsMtmL()->Entry().Entry(); + if( entry.Parent() == KMsvGlobalInBoxIndexEntryIdValue ) + { + populateSenderL(*aMessage); + } + populateRecipientsL(*aMessage); + + // resolve to-field contacts + ConvergedMessageAddressList addrList = aMessage->toAddressList(); + int addrCount = addrList.count(); + for(int i=0; ialias().isEmpty()) + { + QString alias; + int count; + int localId = + MsgContactHandler::resolveContactDisplayName( + addr->address(), alias, count); + addr->setAlias(alias); + } + } + + // resolve cc-field contacts + addrList = aMessage->ccAddressList(); + addrCount = addrList.count(); + for(int i=0; ialias().isEmpty()) + { + QString alias; + int count; + int localId = + MsgContactHandler::resolveContactDisplayName( + addr->address(), alias, count); + addr->setAlias(alias); + } + } + + // resolve bcc-field contacts + addrList = aMessage->bccAddressList(); + addrCount = addrList.count(); + for(int i=0; ialias().isEmpty()) + { + QString alias; + int count; + int localId = + MsgContactHandler::resolveContactDisplayName( + addr->address(), alias, count); + addr->setAlias(alias); + } + } + + // populate the subject field + QString subject = XQConversions::s60DescToQString( + MmsMtmL()->SubjectL()); + if(!subject.startsWith(LOC_RE, Qt::CaseInsensitive)) + { + subject.insert(0, LOC_RE); + } + aMessage->setSubject(subject); + } + // End of File diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/unieditormmsplugin.pro --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/unieditormmsplugin.pro Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/unieditormmsplugin.pro Fri Jul 09 14:46:10 2010 +0530 @@ -44,21 +44,22 @@ src/unieditormmsplugin_p.cpp LIBS += -leuser \ - -lcone \ - -lmsgs \ - -lmmsmessage \ - -lmmsserversettings \ - -lmmsgenutils \ - -lcommdb \ - -lefsrv \ - -lbafl \ - -leditorgenutils \ - -lunidatamodelloader \ - -lconvergedmessageutils \ - -lunidatamodel \ - -lmsgmedia \ - -leikctl \ - -lxqutils + -lcone \ + -lmsgs \ + -lmmsmessage \ + -lmmsserversettings \ + -lmmsgenutils \ + -lcommdb \ + -lefsrv \ + -lbafl \ + -leditorgenutils \ + -lunidatamodelloader \ + -lconvergedmessageutils \ + -lunidatamodel \ + -lmsgmedia \ + -leikctl \ + -lxqutils \ + -lQtContacts # Build.inf rules diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h Fri Jul 09 14:46:10 2010 +0530 @@ -306,7 +306,17 @@ * @see MMsvSessionObserver */ void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, - TAny* aArg3); + TAny* aArg3); + + /** + * Populate recipients for reply case + */ + void populateMessageForReplyL(ConvergedMessage* aMessage); + + /** + * Extract from address from Deliver PDU + */ + void fromAddress(QString& messageAddress); private: // Data diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -62,6 +62,7 @@ #include "UniEditorGenUtils.h" #include "unidatamodelloader.h" #include "unidatamodelplugininterface.h" +#include "msgcontacthandler.h" #include // for translation support #include // resources @@ -334,6 +335,15 @@ //Populate message body populateMessageBodyL(aMessage,msvEntry); } + else if(aOperation == UniEditorPluginInterface::Reply) + { + populateMessageForReplyL(aMessage); + } + else if(aOperation == UniEditorPluginInterface::ReplyAll) + { + // control should never reach here for sms + User::Leave(KErrArgument); + } //This is required as the switch entry doesnot reset sms headers //so if we fwd an inbox msg and then try to save that content to drafts @@ -451,6 +461,7 @@ { emailFields->AddAddressL( *pureAddr ); appendbuf.Set(pureAddr->Des().Left(appendLen)); + iRecipients->AppendL( *addr ); } else { @@ -458,6 +469,8 @@ { SmsMtmL()->AddAddresseeL( *pureAddr, *aliasAddr ); appendbuf.Set(aliasAddr->Des().Left(appendLen)); + iRecipients->AppendL( + *TMmsGenUtils::GenerateAddressL(*pureAddr, *aliasAddr)); } else { @@ -465,11 +478,14 @@ { SmsMtmL()->AddAddresseeL( *pureAddr, *alt_alias ); appendbuf.Set(alt_alias->Des().Left(appendLen)); + iRecipients->AppendL( + *TMmsGenUtils::GenerateAddressL(*pureAddr, *alt_alias)); } else { SmsMtmL()->AddAddresseeL( *pureAddr ); appendbuf.Set(pureAddr->Des().Left(appendLen)); + iRecipients->AppendL( *addr ); } } } @@ -478,7 +494,6 @@ { idetailsBuf.Append( appendbuf ); } - iRecipients->AppendL( *addr ); // cleanup CleanupStack::PopAndDestroy(2, pureAddr ); @@ -1796,7 +1811,6 @@ aMessage->setSubject(XQConversions::s60DescToQString( emailFields.Subject())); } - } // ---------------------------------------------------- @@ -1879,4 +1893,76 @@ // do nothing } +// ----------------------------------------------------------------------------- +// UniEditorSmsPluginPrivate::populateMessageForReplyL +// @see Header +// ----------------------------------------------------------------------------- +// +void UniEditorSmsPluginPrivate::populateMessageForReplyL( + ConvergedMessage* aMessage) + { + // find out if the message is incoming or outgoing + CSmsPDU::TSmsPDUType smsPduType = SmsMtmL()->SmsHeader().Type(); + + // for incoming message, populate sender address in To-field + if(smsPduType == CSmsPDU::ESmsDeliver) + { + QString addr; + fromAddress(addr); + if(!addr.isEmpty()) + { + ConvergedMessageAddress messageAddress(addr); + aMessage->addToRecipient(messageAddress); + } + } + // else, for outgoing message, populate receiver address in To-field + else if(smsPduType == CSmsPDU::ESmsSubmit) + { + populateRecipientsL(aMessage); + } + + // resolve to-field contacts + ConvergedMessageAddressList addrList = aMessage->toAddressList(); + int addrCount = addrList.count(); + for(int i=0; ialias().isEmpty()) + { + QString alias; + int count; + int localId = + MsgContactHandler::resolveContactDisplayName( + addr->address(), alias, count); + addr->setAlias(alias); + } + } + } + +//--------------------------------------------------------------- +// UniEditorSmsPluginPrivate::fromAddress +// @see header +//--------------------------------------------------------------- +void UniEditorSmsPluginPrivate::fromAddress( + QString& messageAddress) +{ + CPlainText* pText = CPlainText::NewL(); + CleanupStack::PushL(pText); + + CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *pText); + CleanupStack::PushL(smsHeader); + + CMsvEntry &cEntry = SmsMtmL()->Entry(); + + CMsvStore* store = cEntry.ReadStoreL(); + CleanupStack::PushL(store); + + smsHeader->RestoreL(*store); + + messageAddress + = XQConversions::s60DescToQString(smsHeader->FromAddress()); + CleanupStack::PopAndDestroy(3, pText); +} + // End of File diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/unieditorsmsplugin.pro --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/unieditorsmsplugin.pro Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/unieditorsmsplugin.pro Fri Jul 09 14:46:10 2010 +0530 @@ -66,7 +66,8 @@ -lFeatMgr \ -lapmime \ -lunidatamodelloader \ - -lxqutils + -lxqutils \ + -lQtContacts # plugin stub deployment plugin.sources = unieditorsmsplugin.dll diff -r 224522e33db9 -r 25fe1fe642e3 messagingapp/smartmessaging/ringbc/src/ringbc_p.cpp --- a/messagingapp/smartmessaging/ringbc/src/ringbc_p.cpp Tue Jul 06 22:50:16 2010 +0530 +++ b/messagingapp/smartmessaging/ringbc/src/ringbc_p.cpp Fri Jul 09 14:46:10 2010 +0530 @@ -90,23 +90,23 @@ if(error == KErrCorrupt) { - HbMessageBox::information("Ringing Tone Corrupted"); + HbMessageBox::information("Ringing Tone Corrupted", 0, 0, HbMessageBox::Ok); QDEBUG_WRITE("RingBcPrivate::saveTone : Ringing tone corrupted") } else if(error == KErrNoMemory || error == KErrDiskFull) { - HbMessageBox::information("No memory to save"); + HbMessageBox::information("No memory to save", 0, 0, HbMessageBox::Ok); QDEBUG_WRITE("RingBcPrivate::saveTone : Low memory") } else { - HbMessageBox::information("Error in Saving"); + HbMessageBox::information("Error in Saving", 0, 0, HbMessageBox::Ok); QDEBUG_WRITE("RingBcPrivate::saveTone : Error in Saving") } } else { - HbMessageBox::information("Saved succesfully"); + HbMessageBox::information("Saved succesfully", 0, 0, HbMessageBox::Ok); QDEBUG_WRITE("RingBcPrivate::saveTone : Ringing tone saved successfully") } diff -r 224522e33db9 -r 25fe1fe642e3 msg_plat/conversation_services_utilities_api/inc/ccsdefs.h --- a/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h Tue Jul 06 22:50:16 2010 +0530 +++ b/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h Fri Jul 09 14:46:10 2010 +0530 @@ -199,7 +199,9 @@ ECsBioMsg_VCard, ECsBioMsg_VCal, ECsBioMgs_NokiaService, -ECsUnknown +ECsUnknown, +ECsBlueTooth_VCard, +ECsBlueTooth_VCal }; /**