# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1276252548 -10800 # Node ID 84197e66a4bdaa5c87209542c8357f2bde8b3b42 # Parent ebfee66fde939f4eaed528c9d867f9b945d5543f Revision: 201021 Kit: 2010123 diff -r ebfee66fde93 -r 84197e66a4bd email/imap4mtm/imapprotocolcontroller/src/cimapopfetchbody.cpp --- a/email/imap4mtm/imapprotocolcontroller/src/cimapopfetchbody.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/email/imap4mtm/imapprotocolcontroller/src/cimapopfetchbody.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -167,7 +167,12 @@ void CImapOpFetchBody::FetchBodyL(TRequestStatus& aRequestStatus, const TMsvId aPart, const TImImap4GetPartialMailInfo& aGetPartialMailInfo) { __LOG_TEXT(iSession->LogId(), "CImapOpFetchBody::FetchBodyL(): fetching message"); - + + if(IsActive()) + { + Cancel(); + } + iRequestedPart=aPart; iGetPartialMailInfo=aGetPartialMailInfo; Queue(aRequestStatus); @@ -1408,6 +1413,7 @@ { // Set vCard flag in message aMessage.SetVCard(ETrue); + aMessage.iType=KUidMsvEmailTextEntry; } // text/x-vcalendar else if (aMime.ContentSubType().CompareF(KMIME_VCALENDAR)==0) @@ -1415,6 +1421,7 @@ // Set vCalendar flag in message aMessage.SetVCalendar(ETrue); iIsVCalendar = ETrue; + aMessage.iType=KUidMsvEmailTextEntry; } // text/calendar else if (aMime.ContentSubType().CompareF(KMIME_ICALENDAR)==0) @@ -1422,6 +1429,7 @@ // Set iCalendar flag in message aMessage.SetICalendar(ETrue); iIsICalendar = ETrue; + aMessage.iType=KUidMsvEmailTextEntry; } else aMessage.iType=KUidMsvEmailTextEntry; @@ -1502,6 +1510,7 @@ TPtrC8 dispositionName = aBodyStructure->ExtDispositionName(); if (dispositionName.Size() != 0) { + aMime.SetContentDispositionL(dispositionName); __LOG_FORMAT((iSession->LogId(), " adding disp name: %S", &dispositionName)); aMime.ContentDispositionParams().AppendL(dispositionName); aMime.ContentDispositionParams().AppendL(KNullDesC8); diff -r ebfee66fde93 -r 84197e66a4bd email/imap4mtm/imapsession/inc/cimapfetchbody.h --- a/email/imap4mtm/imapsession/inc/cimapfetchbody.h Fri Jun 04 10:25:39 2010 +0100 +++ b/email/imap4mtm/imapsession/inc/cimapfetchbody.h Fri Jun 11 13:35:48 2010 +0300 @@ -182,6 +182,7 @@ TBool iSendFetch; // When server responses with no body length, iUnexpectedFormat is set to ETrue. TBool iUnexpectedFormat; + TBool iCancelled; }; #endif // __CIMAPFETCHBODY_H__ diff -r ebfee66fde93 -r 84197e66a4bd email/imap4mtm/imapsession/src/cimapfetchbody.cpp --- a/email/imap4mtm/imapsession/src/cimapfetchbody.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/email/imap4mtm/imapsession/src/cimapfetchbody.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -66,7 +66,8 @@ iImapMailStore(aImapMailStore), iParent(aParent), iFetchBodyResponse(aFetchBodyResponse), - iSendFetch(ETrue) + iSendFetch(ETrue), + iCancelled(EFalse) { } @@ -86,7 +87,7 @@ void CImapFetchBody::Cancel() { __LOG_TEXT(iLogId, "CImapFetchBody::Cancel()"); // Overrides CImapCommand::Cancel() - + iCancelled = ETrue; iImapMailStore.CancelRequest(*this); CImapCommand::Cancel(); } @@ -226,6 +227,10 @@ { iOutStream=&aStream; + if(iCancelled) + { + return; + } #if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT) // check for BINARY capability const CImapCapabilityInfo& capabilityInfo = iParent.CapabilityInfo(); diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/group/IMCM.mmp --- a/email/pop3andsmtpmtm/clientmtms/group/IMCM.mmp Fri Jun 04 10:25:39 2010 +0100 +++ b/email/pop3andsmtpmtm/clientmtms/group/IMCM.mmp Fri Jun 11 13:35:48 2010 +0300 @@ -19,6 +19,7 @@ /** @file */ +#include TARGET imcm.dll TARGETPATH /system/libs @@ -47,10 +48,10 @@ LIBRARY centralrepository.lib tzclient.lib numberconversion.lib SOURCEPATH . -START RESOURCE IMCM.rss -TARGETPATH resource/messaging +START RESOURCE imcm.rss LANG SC HEADER +TARGETPATH resource/messaging END #include "../../../../../../mw/messagingmw/messagingfw/msgtests/group/msgopt.mph" @@ -70,7 +71,7 @@ #endif - +OS_LAYER_SYSTEMINCLUDE diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/group/IMCM.rss --- a/email/pop3andsmtpmtm/clientmtms/group/IMCM.rss Fri Jun 04 10:25:39 2010 +0100 +++ b/email/pop3andsmtpmtm/clientmtms/group/IMCM.rss Fri Jun 11 13:35:48 2010 +0300 @@ -16,6 +16,8 @@ // #include "imcm.rls" +#include +#include #define PARABREAK 8233 #define TABCHAR 9 @@ -37,12 +39,12 @@ RESOURCE LBUF forward_formatting_string { - buffer=STRING_forward_formatting_string1; + buffer=qtn_mail_fwd"%S"; } RESOURCE LBUF reply_formatting_string { - buffer=STRING_reply_formatting_string1; + buffer=qtn_mail_re"%S"; } RESOURCE LBUF receipt_formatting_string @@ -52,17 +54,17 @@ RESOURCE LBUF email_address_formatting_string { - buffer=STRING_email_address_formatting_string1; + buffer="%S <%S>";//STRING_email_address_formatting_string1; } // Headers used in Body for Forwarded/Replyed message RESOURCE LBUF forward_body_header { - buffer=STRING_forward_body_header1 - STRING_forward_body_header2 - STRING_forward_body_header3 - STRING_forward_body_header4; + buffer=qtn_mail_forward_separator + qtn_mail_copy_subject" %S" + qtn_mail_copy_sender" %S" + qtn_mail_copy_date" %S"; } RESOURCE LBUF forward_body_header_toonly @@ -95,10 +97,10 @@ RESOURCE LBUF reply_body_header { - buffer=STRING_reply_body_header1 - STRING_reply_body_header2 - STRING_reply_body_header3 - STRING_reply_body_header4; + buffer=qtn_mail_reply_separator + qtn_mail_copy_subject" %S" + qtn_mail_copy_sender" %S" + qtn_mail_copy_date" %S"; } RESOURCE LBUF reply_body_header_toonly @@ -174,28 +176,29 @@ } // List of available character sets in Charconv.h +// at some point flags should be removed and only qtn_default_charset be used for all builds. RESOURCE L8BUF default_system_charset - { - buffer=STRING_default_system_charset; - } + { + buffer = qtn_default_email_charset; + } // If this value is set to 1, 8 bit body text data and character set information will be stored // when downloaded via IMPS and POPS. The body text will be decoded to the correct character set // when opened. If this value is set to 0, the body text is decoded and stored when downloading. RESOURCE INT8 store_8bit_body_text { - value = 0; + value = 1; } // Used for localised date time formatting for email forward and reply body headers RESOURCE LBUF body_header_datetime_format { - buffer=STRING_body_header_datetime_format; + buffer="%D%M%Y%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:3%+B"; //STRING_body_header_datetime_format; } RESOURCE LBUF partial_download_footer_message { - buffer=STRING_partial_download_footer_message; + buffer=qtn_mail_rest_of_mail_not_fetched; } // If this value is set to 1,body text data will be stored when downloaded via IMPS and POPS using chunk storage option. @@ -203,5 +206,5 @@ RESOURCE INT8 store_plain_body_text { - value = 1; + value = 0; } diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/group/bld.inf --- a/email/pop3andsmtpmtm/clientmtms/group/bld.inf Fri Jun 04 10:25:39 2010 +0100 +++ b/email/pop3andsmtpmtm/clientmtms/group/bld.inf Fri Jun 11 13:35:48 2010 +0300 @@ -14,6 +14,7 @@ // bld.inf // +#include PRJ_EXPORTS ../inc/MIUTHDR.H SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(miuthdr.h) @@ -64,6 +65,13 @@ #endif +//IBY exports +../rom/gtemailmtmResources.iby LANGUAGE_OS_LAYER_IBY_EXPORT_PATH(gtemailmtmResources.iby) +../rom/gtemailmtm.hby CORE_OS_LAYER_IBY_EXPORT_PATH(gtemailmtm.hby) + +// export localised loc file +../loc/imcm.loc OS_LAYER_LOC_EXPORT_PATH(imcm.loc) +../loc/imcm_default_charset.loc OS_LAYER_LOC_EXPORT_PATH(imcm_default_charset.loc) PRJ_MMPFILES IMCM.mmp diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/inc/MIUTRSLV.H --- a/email/pop3andsmtpmtm/clientmtms/inc/MIUTRSLV.H Fri Jun 04 10:25:39 2010 +0100 +++ b/email/pop3andsmtpmtm/clientmtms/inc/MIUTRSLV.H Fri Jun 11 13:35:48 2010 +0300 @@ -130,6 +130,7 @@ private: void DoRunL(); void DoComplete(TInt& ); + void DoCancel(); void CheckCurrentEntryL(); inline TBool CheckContentDetailsL(const TDesC& aContentLocation, const TDesC& aContentId); @@ -210,6 +211,7 @@ void DoRunL(); void DoComplete(TInt& ); + void DoCancel(); inline void SetStartParameterL(); private: CMsvEntry& iCurrentEntry; diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/inc/cimfinder.h --- a/email/pop3andsmtpmtm/clientmtms/inc/cimfinder.h Fri Jun 04 10:25:39 2010 +0100 +++ b/email/pop3andsmtpmtm/clientmtms/inc/cimfinder.h Fri Jun 11 13:35:48 2010 +0300 @@ -57,7 +57,7 @@ private: void DoRunL(); - + void DoCancel(); virtual void AddChildEntriesL() = 0; virtual TBool IsRequiredEntryType(TUid aEntryType) const = 0; diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/loc/imcm.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email/pop3andsmtpmtm/clientmtms/loc/imcm.loc Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2002 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: +* This is a localisation file for imcm.dll +* A .loc file is the one and only place where the logical strings +* to be localised are defined. +* >>> +* The text between >>> and <<< is just to document the syntax and +* you can remove it if you like. +* +*/ + + + + +// LOCALISATION STRINGS + +// d: Added in the beginning of the subject line when replying +// l: mce_header_field_pane_t1 +#define qtn_mail_re "RE: " + +// d: Added in the beginning of the subject line when forwarding +// l: mce_header_field_pane_t1 +#define qtn_mail_fwd "FWD: " + +// d: Text to be inserted into a message when replying +// d: Inerted in the beginning of the original message +// l: msg_header_pane_t2 +#define qtn_mail_reply_separator "--- original message ---" + +// d: Text to be inserted into a message when forwarding +// d: Inserted in the beginning of the original message +// l: msg_header_pane_t2 +#define qtn_mail_forward_separator "--- original message ---" + +// d: Text to be inserted into a message when forwarding or replying +// d: Inserted in the beginning of the original message +// l: msg_header_pane_t2 +#define qtn_mail_copy_subject "Subject:" + +// d: Text to be inserted into a message when forwarding or replying +// d: Inserted in the beginning of the original message +// l: msg_header_pane_t2 +#define qtn_mail_copy_sender "Sender:" + +// d: Text to be inserted into a message when forwarding or replying +// d: Inserted in the beginning of the original message +// l: msg_header_pane_t2 +#define qtn_mail_copy_date "Date:" + +// d: Text to be inserted into a message body if part of message body is filtered out +// l:none +#define qtn_mail_rest_of_mail_not_fetched "- - - Retrieve total mail selecting Retrieve from Options list. - - -" + +// End of File diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/loc/imcm_default_charset.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email/pop3andsmtpmtm/clientmtms/loc/imcm_default_charset.loc Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2002 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: +* !!!!!!!LOCALISATION INSTRUCTIONS, IMPORTANT!!!!!!! +* These default charsets are used to define correct default charsets for different builds. +* +*/ + + + +// d: This is not visible to the user! +// l: None +#define qtn_default_email_charset "ISO-8859-1" + +// End of File diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/rom/gtemailmtm.hby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email/pop3andsmtpmtm/clientmtms/rom/gtemailmtm.hby Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,9 @@ +#ifndef __GTEMAILMTM_HBY__ +#define __GTEMAILMTM_HBY__ + +// +// Moved to gtemailmtmResources.iby +// +//data=MULTI_LINGUIFY(RSC DATAZ_\resource\messaging\imcm resource\messaging\imcm) + +#endif diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/rom/gtemailmtmResources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email/pop3andsmtpmtm/clientmtms/rom/gtemailmtmResources.iby Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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: gtemailmtmResources.iby* +*/ + +#ifndef __GTEMAILMTM_RESOURCES_IBY__ +#define __GTEMAILMTM_RESOURCES_IBY__ + +// Refer to gtemailmtm.hby +data=DATAZ_\resource\messaging\imcm.rsc resource\messaging\imcm.rsc + +#endif \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/src/CACHEMAN.CPP --- a/email/pop3andsmtpmtm/clientmtms/src/CACHEMAN.CPP Fri Jun 04 10:25:39 2010 +0100 +++ b/email/pop3andsmtpmtm/clientmtms/src/CACHEMAN.CPP Fri Jun 11 13:35:48 2010 +0300 @@ -122,6 +122,12 @@ } } +void CImFinder::DoCancel() + { + CMsgActive::DoCancel(); + } + + CImFinder::CImFinder(CMsvEntry& aEntry) : CMsgActive(EPriorityStandard), iCurrentEntry(aEntry) { } diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/src/CIMPLAINBODYTEXT.cpp --- a/email/pop3andsmtpmtm/clientmtms/src/CIMPLAINBODYTEXT.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/email/pop3andsmtpmtm/clientmtms/src/CIMPLAINBODYTEXT.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -468,4 +468,5 @@ void CImPlainBodyText::DoCancel() { iPlainTextArray[iIndex]->Cancel(); + CMsgActive::DoCancel(); } diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/clientmtms/src/MIUTRSLV.CPP --- a/email/pop3andsmtpmtm/clientmtms/src/MIUTRSLV.CPP Fri Jun 04 10:25:39 2010 +0100 +++ b/email/pop3andsmtpmtm/clientmtms/src/MIUTRSLV.CPP Fri Jun 11 13:35:48 2010 +0300 @@ -462,6 +462,12 @@ } } } + + +void CImMhtmlChildEntrySearcher::DoCancel() + { + CMsgActive::DoCancel(); + } void CImMhtmlChildEntrySearcher::DoComplete(TInt& ) { @@ -1043,7 +1049,10 @@ } } - +void CImMhtmlFirstPageFinder::DoCancel() + { + CMsgActive::DoCancel(); + } // The following class implements a class for parsing and combining URI's. diff -r ebfee66fde93 -r 84197e66a4bd email/pop3andsmtpmtm/servermtmutils/src/IMCVCODC.CPP --- a/email/pop3andsmtpmtm/servermtmutils/src/IMCVCODC.CPP Fri Jun 04 10:25:39 2010 +0100 +++ b/email/pop3andsmtpmtm/servermtmutils/src/IMCVCODC.CPP Fri Jun 11 13:35:48 2010 +0300 @@ -1469,14 +1469,14 @@ // Intermediate buffer for decoding, prior to converting - HBufC8* decodeBuf8 = HBufC8::NewLC(aBufOut.MaxLength()); + HBufC8* decodeBuf8 = HBufC8::NewLC(aBufOut.MaxLength()); decodeBuf8->Des().Copy( aBufIn.Mid(i+1, j -i-1)); // Depending on type of encoding Q or B, decode. TPtr8 dataPtr8(dataBuf8->Des()); - + TPtr8 decodePtr8(decodeBuf8->Des()); switch (iEncodingInfo.EncodingType()) { case TImHeaderEncodingInfo::EBase64 : @@ -1484,14 +1484,13 @@ break; case TImHeaderEncodingInfo::EQP : // Replace all underscores in text with SPACE. - iQPCodec.Decode( *decodeBuf8, dataPtr8 ); - - i=dataPtr8.Length(); + i=decodePtr8.Length(); while (i--) { - if (dataPtr8[i] == KImcvUnderScore) - dataPtr8[i] = KImcvSpaceChar; + if (decodePtr8[i] == KImcvUnderScore) + decodePtr8[i] = KImcvSpaceChar; } + iQPCodec.Decode( *decodeBuf8, dataPtr8 ); break; default: dataBuf8->Des().Copy(*decodeBuf8); diff -r ebfee66fde93 -r 84197e66a4bd inc/convergedmessage.h --- a/inc/convergedmessage.h Fri Jun 04 10:25:39 2010 +0100 +++ b/inc/convergedmessage.h Fri Jun 11 13:35:48 2010 +0300 @@ -64,7 +64,8 @@ Provisioning = 0x01, VCard = 0x02, VCal = 0x03, - Audio = 0x04 + Audio = 0x04, + NokiaService = 0x08 }; /** diff -r ebfee66fde93 -r 84197e66a4bd inc/msgbiouids.h --- a/inc/msgbiouids.h Fri Jun 04 10:25:39 2010 +0100 +++ b/inc/msgbiouids.h Fri Jun 11 13:35:48 2010 +0300 @@ -63,6 +63,10 @@ /// UID for the Provisioning Message type for BIO database const TUid KMsgBioProvisioningMessage = {0x101F84D1}; +const TUid KMsgBioNokiaServiceMessage = {0x102832EA}; + +const TUid KMsgBioNokiaServiceSentMessage = {0x20022FE6}; + //// PoC const TUid KMsgBioUidPoC = {0x101FD869}; diff -r ebfee66fde93 -r 84197e66a4bd inc/msgcontacthandler.h --- a/inc/msgcontacthandler.h Fri Jun 04 10:25:39 2010 +0100 +++ b/inc/msgcontacthandler.h Fri Jun 11 13:35:48 2010 +0300 @@ -52,9 +52,9 @@ QString& displayName, int& countPhoneNumber) { - QContactManager * phonebookManager; + QContactManager phonebookManager; QContactDetailFilter phoneFilter; - phonebookManager = new QContactManager("symbian"); + phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, QContactPhoneNumber::FieldNumber); @@ -63,7 +63,7 @@ phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith); QList matchingContacts = - phonebookManager->contacts(phoneFilter); + phonebookManager.contacts(phoneFilter); if (matchingContacts.count() > 0) { @@ -161,17 +161,20 @@ if (versitDocuments.count() > 0) { QVersitContactImporter importer; - QList contacts = - importer.importContacts(versitDocuments); - // get display-name - if (contacts.count() > 0) + bool import_docs = importer.importDocuments(versitDocuments); + if(import_docs) { - //resolveSynthesizedDisplayLabel - QContactManager* contactManager = + QList contacts = importer.contacts(); + // get display-name + if (contacts.count() > 0) + { + //resolveSynthesizedDisplayLabel + QContactManager* contactManager = new QContactManager("symbian"); - displayName + displayName = contactManager->synthesizedDisplayLabel(contacts[0]); - delete contactManager; + delete contactManager; + } } } } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/client/src/ccsrequesthandler.cpp --- a/messagingapp/msgappfw/client/src/ccsrequesthandler.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/client/src/ccsrequesthandler.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -59,13 +59,13 @@ // CCSRequestHandler::NewLC() // Two-phased constructor. // ----------------------------------------------------------------------------- -EXPORT_C CCSRequestHandler* CCSRequestHandler::NewLC(/*CVPbkContactManager* aVPbkContactManager*/) +EXPORT_C CCSRequestHandler* CCSRequestHandler::NewLC() { PRINT ( _L("Enter CCSRequestHandler::NewLC") ); CCSRequestHandler* self = new ( ELeave ) CCSRequestHandler(); CleanupStack::PushL( self ); - self->ConstructL(/*aVPbkContactManager*/); + self->ConstructL(); PRINT ( _L("End CCSRequestHandler::NewLC") ); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/msghistory/src/msghistoryprivate.cpp --- a/messagingapp/msgappfw/msghistory/src/msghistoryprivate.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/msghistory/src/msghistoryprivate.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -101,6 +101,9 @@ conversationId = handler->GetConversationIdL(aContactId)); CCsClientConversation* clientConversation = CCsClientConversation::NewL(); clientConversation->SetConversationEntryId(conversationId); + // set the contact id, which will be used in case when the + // conversation entry id is -1. + clientConversation->SetContactId(aContactId); //set dummy entry CCsConversationEntry *entry = CCsConversationEntry::NewL(); clientConversation->SetConversationEntryL(entry); @@ -125,6 +128,9 @@ conversationId = handler->GetConversationIdL(aContactId)); CCsClientConversation* clientConversation = CCsClientConversation::NewL(); clientConversation->SetConversationEntryId(conversationId); + // set the contact id, which will be used in case when the + // conversation entry id is -1. + clientConversation->SetContactId(aContactId); //set dummy entry CCsConversationEntry *entry = CCsConversationEntry::NewL(); clientConversation->SetConversationEntryL(entry); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/msgplugin/src/ccsmsghandler.cpp --- a/messagingapp/msgappfw/plugins/msgplugin/src/ccsmsghandler.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/plugins/msgplugin/src/ccsmsghandler.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -823,14 +823,17 @@ else if (aEntry.iBioType == KMsgBioUidVCalendar.iUid) { type = ECsBioMsg_VCal; - } - } - break; - default: - type = ECsUnknown; - break; + } + else if (aEntry.iBioType == KMsgBioNokiaServiceMessage.iUid) { + type = ECsBioMgs_NokiaService; } - return (type); } + break; + default: + type = ECsUnknown; + break; + } + return (type); +} // End of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/msgplugin/src/ccsmsgpluginutility.cpp --- a/messagingapp/msgappfw/plugins/msgplugin/src/ccsmsgpluginutility.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/plugins/msgplugin/src/ccsmsgpluginutility.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -72,7 +72,8 @@ CleanupStack::PushL(conversationEntry); //set the values - conversationEntry->SetContactL( *aContact ); + if(aContact) + conversationEntry->SetContactL( *aContact ); conversationEntry->SetEntryId( aEnryId ); conversationEntry->SetTimeStampL( aTimeStamp ); conversationEntry->SetDescriptionL( *aDescription ); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/msgplugin/tsrc/conf/test_plugin.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/tsrc/conf/test_plugin.cfg Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,72 @@ +/* +* ============================================================================== +* Name : test_plugin.cfg +* Part of : plugin / test_plugin +* Description : plugin related test cases +* Version: : % version:1 % +* +* 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. +* +* ============================================================================ +*/ + +[Test] +title 1. CreateCcsPluginL +create test_plugin testplugin +testplugin CreateCcsPluginL +delete testplugin +[Endtest] + + +[Test] +title 2. CreateCCsMsgL +create test_plugin testplugin +testplugin CreateCCsMsgL +delete testplugin +[Endtest] + + +[Test] +title 3. CacheFromCcsPluginL +create test_plugin testplugin +testplugin CacheFromCcsPluginL +delete testplugin +[Endtest] + +[Test] +title 4. SmsMsgPluginValidationL +create test_plugin testplugin +testplugin SmsMsgPluginValidationL +delete testplugin +[Endtest] + + +[Test] +title 5. SendCcsMessageL +create test_plugin testplugin +testplugin SendCcsMessageL +delete testplugin +[Endtest] + + +[Test] +title 6. MmsMsgPluginValidationL +create test_plugin testplugin +testplugin MmsMsgPluginValidationL +delete testplugin +[Endtest] + +[Test] +title 7. BioMsgPluginValidationL +create test_plugin testplugin +testplugin BioMsgPluginValidationL +delete testplugin +[Endtest] diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/msgplugin/tsrc/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/tsrc/group/bld.inf Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,36 @@ +/* +* 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: ?Description +* +*/ + +#define BLD_INF_GROUP_0496D339 + + +prj_platforms + +WINSCW GCCE ARMV5 ARMV6 + +prj_testmmpfiles + +test_plugin.mmp + +prj_extensions + + +#if defined(WINSCW) +#else +#endif + + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/msgplugin/tsrc/group/test_plugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/tsrc/group/test_plugin.mmp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,98 @@ +/*TYPE TESTCLASS*//* +* 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: ?Description +* +*/ + + +// To get the OSEXT_LAYER_SYSTEMINCLUDE-definition +#include +#include + + +TARGET test_plugin.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E4 + +CAPABILITY ALL -TCB + +//TARGETPATH ?target_path +DEFFILE test_plugin.def + +#ifdef SBSV2 + USERINCLUDE ../inc + + #if defined(__S60_) + + #else // __S60_ not defined + SYSTEMINCLUDE /epoc32/include + SYSTEMINCLUDE /epoc32/include/internal + #endif // __S60_ + + SOURCEPATH ../src +#else // SBSV2 not defined + USERINCLUDE ..\inc + + #if defined(__S60_) + OSEXT_LAYER_SYSTEMINCLUDE + #else // __S60_ not defined + SYSTEMINCLUDE \epoc32\include + SYSTEMINCLUDE \epoc32\include\internal + #endif // __S60_ + + SOURCEPATH ..\src +#endif // SBSV2 + +SOURCEPATH ../src +SOURCE test_plugin.cpp +SOURCE test_pluginblocks.cpp +SOURCE ..\..\src\proxy.cpp +SOURCE ..\..\src\ccsmsg.cpp +SOURCE ..\..\src\ccsmsgpluginutility.cpp +SOURCE ..\..\src\ccsmsghandler.cpp + +USERINCLUDE ..\inc +USERINCLUDE ..\..\inc +USERINCLUDE ..\..\..\..\..\conversationserver\csserver\inc +USERINCLUDE ..\..\..\..\..\conversationserver\csutils\inc +USERINCLUDE ..\..\..\..\..\..\..\os\buildtools\devlib\devlibhelp\examples\SysLibs\CentRepExample +USERINCLUDE ..\..\..\..\..\messagingappbase\obexmtms\TObexMTM\INC +USERINCLUDE ..\..\..\..\..\..\inc +USERINCLUDE ..\..\..\..\utils\inc +USERINCLUDE ..\..\..\..\..\..\..\..\mw\messagingmw\messagingfw\msgtest\testutils\sms\inc + + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY efsrv.lib + + +LIBRARY eCom.lib +DEBUGLIBRARY flogger.lib + +LIBRARY csutils.lib +// Msg Server +LIBRARY Smcm.lib +LIBRARY gsmu.lib +LIBRARY etext.lib +LIBRARY msgs.lib +LIBRARY sendas2.lib + +LANG SC + + +// End of File diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/msgplugin/tsrc/group/test_plugin.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/tsrc/group/test_plugin.pkg Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,41 @@ +; +; 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: +; +;Header +#{"TestPlugin"}, (0x101FB3E3), 1, 2, 3, TYPE=SP + +;Language - standard language definitions +&EN + +;Vendor ID +:"Nokia Corporation" + +;Localised vendor +%{"Vendor-EN"} + +;Supports Series 60 v 0.9 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +;rom will not allow to update it if name is testframework, after install need to rename it to testframework.ini + +;INI FILE +"..\init\test_plugin.ini" -"c:\Testframework\testframework.ini" + +;CFG FILES +"..\conf\test_plugin.cfg" -"c:\Testframework\test_plugin.cfg" + + +"\EPOC32\RELEASE\ARMV5\UREL\test_plugin.dll" -"!:\sys\bin\test_plugin.dll" + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/msgplugin/tsrc/inc/test_plugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/tsrc/inc/test_plugin.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,244 @@ +/* +# +# 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: Main test class header for CS Message Plugin +#*/ + +#ifndef TEST_PLUGIN_H_ +#define TEST_PLUGIN_H_ + +// INCLUDES +#include +#include +#include +#include + +// USER INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// Logging path +_LIT( KTestPluginLogPath, "\\logs\\testframework\\test_plugin\\" ); +// Log file +_LIT( KTestPluginTestLogFile, "test_plugin.txt" ); +_LIT( KTestPluginTestLogFileWithTitle, "test_plugin_[%S].txt" ); + +// FORWARD DECLARATIONS +class CCsMsg; +class CCsMsgHandler; +class CCsMsgPluginUtility; +class MCsMsgObserver; +class CCsConversationEntry; +class CCsMsgPluginUtility; +class CMsvSession; +class CClientMtmRegistry; +class CSmsClientMtm; +class CMmsClientMtm; +class CMsvMimeHeaders; +class CAsyncWaiter; +class CMmsSettings; + +/** + * Message plugin class + **/ + +NONSHARABLE_CLASS(Ctest_plugin) : public CScriptBase,public MCsPluginEventObserver,public MMsvSessionObserver + { + private: + + /** + * C++ default constructor. + */ + Ctest_plugin(CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + // Prohibit copy constructor if not deriving from CBase. + // ?classname( const ?classname& ); + // Prohibit assigment operator if not deriving from CBase. + // ?classname& operator=( const ?classname& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Example test method. + * @since ?Series60_version + * @param aItem Script line containing parameters. + * @return Symbian OS error code. + */ + virtual TInt ExampleL( CStifItemParser& aItem ); + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static Ctest_plugin* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + * */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + /** + * Destructor. + */ + virtual ~Ctest_plugin(); + + private: // Data + + CCsMsg* iPlugin; + + /** + * MsvServer session object + */ + CMsvSession* iSession; + + /** + * Mtm registry object + */ + CClientMtmRegistry* iMtmRegistry; + + /** + * Sms Client mtm object + */ + CSmsClientMtm* iSmsClientMtm; + + /** + * MMS Client mtm object + */ + CMmsClientMtm* iMmsClientMtm; + + /** + * List contains the CCsConversationEntry objects that needs to be + * verified with the list obtained from sms plugin + */ + RPointerArray iTestConversationEntryList; + + /** + * List obtained from sms plugin + */ + RPointerArray iResultConversationEntryList; + + + public://Mcsplugineventobserver + /** + * AddConversations. + * Handle Conversation event from Plugins + * @param aConversationEntryLists List of conversation entries. + */ + void AddConversations(const RPointerArray& aConversationEntryLists); + + /** + * ModifyConversations. + * Update Conversation event from Plugins + * @param aConversationEntryLists List of conversation entries. + */ + void ModifyConversations(const RPointerArray& aConversationEntryLists); + + /** + * DeleteConversations. + * Delete Conversation event from Plugins + * @param aConversationEntryLists List of conversation entries. + */ + void DeleteConversations(const RPointerArray& aConversationEntryLists); + /** + * CachingCompleted. + * Caching complete event from Plugins + */ + void CachingCompleted(); + + /** + * CachingError. + * Caching error event from Plugins + * @param aError Caching Error infomation. + */ + void CachingError(const TInt aError) ; + + /** + * RefreshConversations + * Refresh all data from this plugin. + */ + void RefreshConversations(); + + public://from MmsvSessionObserver + /** + * Handles the MsvServer updates. Implemented for MMsvSessionObserver + */ + void HandleSessionEventL(TMsvSessionEvent aEvent, TAny *aArg1, TAny *aArg2, TAny *aArg3); + + public: + + virtual TInt CreateCCsMsgL( CStifItemParser& aItem ); + virtual TInt SendCcsMessageL( CStifItemParser& /*aItem*/ ); + virtual TInt CacheFromCcsPluginL( CStifItemParser& /*aItem*/ ); + virtual TInt CreateCcsPluginL( CStifItemParser& /*aItem*/ ); + virtual TInt SmsMsgPluginValidationL( CStifItemParser& aItem ); + virtual TInt MmsMsgPluginValidationL( CStifItemParser& aItem ); + virtual TInt BioMsgPluginValidationL( CStifItemParser& aItem ); + + TInt Compare(CCsConversationEntry *aResult, CCsConversationEntry *aTest); + /** + * Cleans messages from all foldes + */ + void CleanAllFoldersL(); + + /** + * Populates the messages in different folders which are used + * to verify the caching logic of ccs plugin + */ + void CreateInitialCacheL(); + + /** + * Cleans messages from the specified folder + * @param aBoxId , folder from where messages has to be deleted + * @param aDeleteOne , if set only one message is deleted + */ + void CleanMessagesInFolderL(TMsvId aBoxId ,TBool aDeleteOne = EFalse); + + /** + * Creates messages in the different folders and populates + * the iTestConversationEntryList + * @param aFolderId , the folder in which message is to be created + * @param aUnReadFlag , Used while creating message in inbox folder + */ + void CreateMessageL(const TMsvId aFolderId,TBool aUnReadFlag = EFalse); + void CreateMmsMessageL(const TMsvId aFolderId,TBool aUnReadFlag = EFalse); + void HandleAttachementL(CMsvStore* store,TFileName& sourceFileName ); + void CreateSmartMessageL(const TMsvId aFolderId,TBool aUnReadFlag = EFalse); + }; + +#endif /* TEST_PLUGIN_H_ */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/msgplugin/tsrc/init/TestFramework.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/tsrc/init/TestFramework.ini Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,44 @@ +# +# This is STIFTestFramework initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\LOGS\TestFramework\ +TestReportFileName= TestReport + +TestReportFormat= TXT # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start + +[New_Module] +ModuleName= testscripter +TestCaseFile= C:\testframework\test_plugin.cfg +[End_Module] + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +[Logger_Defaults] + +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/msgplugin/tsrc/src/test_plugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/tsrc/src/test_plugin.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,149 @@ +/* +# +# 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: Test class for CS Message Plugin +# +*/ + + +// INCLUDE FILES +#include +#include "test_plugin.h" +#include + +// ----------------------------------------------------------------------------- +// Ctest_plugin::Ctest_plugin +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- + +Ctest_plugin::Ctest_plugin( CTestModuleIf& aTestModuleIf ) : CScriptBase( aTestModuleIf ) + { + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// + +void Ctest_plugin::ConstructL() + { + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + TInt ret = settingServer.Connect(); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + if(ret != KErrNone) + { + User::Leave(ret); + } + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if(loggerSettings.iAddTestCaseTitle) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KTestPluginTestLogFileWithTitle, &title); + } + else + { + logFileName.Copy(KTestPluginTestLogFile); + } + + iLog = CStifLogger::NewL( KTestPluginLogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + iSession = CMsvSession::OpenSyncL( *this); + iMtmRegistry = CClientMtmRegistry::NewL( *iSession ); + iSmsClientMtm = STATIC_CAST( CSmsClientMtm*, iMtmRegistry->NewMtmL( KUidMsgTypeSMS )); + + iMmsClientMtm = STATIC_CAST( CMmsClientMtm*, iMtmRegistry->NewMtmL( KUidMsgTypeMultimedia )); + iPlugin = NULL; + + TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles ); + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +Ctest_plugin* Ctest_plugin::NewL( + CTestModuleIf& aTestModuleIf ) + { + Ctest_plugin* self = new (ELeave) Ctest_plugin( aTestModuleIf ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::~Cimcache_test +// Destructor +// ----------------------------------------------------------------------------- +// +Ctest_plugin::~Ctest_plugin() + { + + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + } + +// ---------------------------------------------------------------------------- + // Ctest_plugin::HandleSessionEventL + // Implemented for MMsvSessionObserver + // ---------------------------------------------------------------------------- + // +void Ctest_plugin::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, + TAny */*aArg1*/, + TAny */*aArg2*/, + TAny */*aArg3*/) + { + + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + return ( CScriptBase* ) Ctest_plugin::NewL( aTestModuleIf ); + } + + +// End of File diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/msgplugin/tsrc/src/test_pluginblocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgappfw/plugins/msgplugin/tsrc/src/test_pluginblocks.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,985 @@ +/* +# +# 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: Main test class for CS Message Plugin +#*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "test_plugin.h" +#include "CCsPlugin.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Ctest_plugin::Delete +// +// ----------------------------------------------------------------------------- +// +void Ctest_plugin::Delete() + { + iResultConversationEntryList.ResetAndDestroy(); + iResultConversationEntryList.Close(); + + iTestConversationEntryList.ResetAndDestroy(); + iTestConversationEntryList.Close(); + + if( iPlugin ) + { + delete iPlugin; + iPlugin = NULL; + } + + if (iSession) + { + delete iSession; + iSession = NULL; + } + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::RunMethodL +// +// ----------------------------------------------------------------------------- +// +TInt Ctest_plugin::RunMethodL( CStifItemParser& aItem ) + { + TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + + ENTRY( "Example", Ctest_plugin::ExampleL ), + ENTRY( "CacheFromCcsPluginL", Ctest_plugin::CacheFromCcsPluginL ), + ENTRY( "CreateCCsMsgL", Ctest_plugin::CreateCCsMsgL ), + + ENTRY( "CreateCcsPluginL", Ctest_plugin::CreateCcsPluginL ), + ENTRY( "SendCcsMessageL", Ctest_plugin::SendCcsMessageL ), + ENTRY( "SmsMsgPluginValidationL", Ctest_plugin::SmsMsgPluginValidationL), + ENTRY( "MmsMsgPluginValidationL",Ctest_plugin::MmsMsgPluginValidationL), + ENTRY( "BioMsgPluginValidationL",Ctest_plugin::BioMsgPluginValidationL) + + }; + + const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo ); + return RunInternalL( KFunctions, count, aItem ); + } + +// ----------------------------------------------------------------------------- +// Ctestsmsplugin::ExampleL +// Example test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt Ctest_plugin::ExampleL( CStifItemParser& aItem ) + { + + // Print to UI + _LIT( Ktestplugin, "testplugin" ); + _LIT( KExample, "In Example" ); + TestModuleIf().Printf( 0, Ktestplugin, KExample ); + // Print to log file + iLog->Log( KExample ); + + TInt i = 0; + TPtrC string; + _LIT( KParam, "Param[%i]: %S" ); + while ( aItem.GetNextString ( string ) == KErrNone ) + { + TestModuleIf().Printf( i, Ktestplugin, + KParam, i, &string ); + i++; + } + + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CreateCCsMsgL +// Example test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt Ctest_plugin::CreateCCsMsgL( CStifItemParser& /*aItem*/ ) + { + + // Print to UI + _LIT( Ktestplugin, "CreateCCsMsgL" ); + _LIT( KFunction, "In CreateCCsMsgL" ); + TestModuleIf().Printf( 0, Ktestplugin, KFunction ); + // Print to log file + iLog->Log( KFunction ); + iPlugin = CCsMsg::NewL(this); + iPlugin->GetConversationsL(); + + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CacheFromCcsPluginL +// Creates the ccs plugin and initiates the caching +// ----------------------------------------------------------------------------- +// +TInt Ctest_plugin::CacheFromCcsPluginL( CStifItemParser& /*aItem*/ ) + { + // Print to UI + _LIT( Ktestplugin, "CacheFromCcsPluginL" ); + _LIT( KFunction, "In CacheFromCcsPluginL" ); + TestModuleIf().Printf( 0, Ktestplugin, KFunction ); + // Print to log file + iLog->Log( KFunction ); + + iTestConversationEntryList.ResetAndDestroy(); + iResultConversationEntryList.ResetAndDestroy(); + + iPlugin = CCsMsg::NewL(this); + iPlugin->GetConversationsL(); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CreateCcsPluginL +// Creates ccs plugin. +// ----------------------------------------------------------------------------- +// +TInt Ctest_plugin::CreateCcsPluginL( CStifItemParser& /*aItem*/ ) + { + // Print to UI + _LIT( Ktestplugin, "CreateCcsPluginL" ); + _LIT( KFunction, "In CreateCcsPluginL" ); + TestModuleIf().Printf( 0, Ktestplugin, KFunction ); + // Print to log file + iLog->Log( KFunction ); + + iTestConversationEntryList.ResetAndDestroy(); + iResultConversationEntryList.ResetAndDestroy(); + + iPlugin = CCsMsg::NewL(this); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// Ctestsmsplugin::SendCcsMessageL +// Send ccs message using RSendAs api +// ----------------------------------------------------------------------------- +// +TInt Ctest_plugin::SendCcsMessageL( CStifItemParser& /*aItem*/ ) + { + // Print to UI + _LIT( Ktestplugin, "SendCcsMessageL" ); + _LIT( KFunction, "In SendCcsMessageL" ); + TestModuleIf().Printf( 0, Ktestplugin, KFunction ); + // Print to log file + iLog->Log( KFunction ); + + iTestConversationEntryList.ResetAndDestroy(); + iResultConversationEntryList.ResetAndDestroy(); + + RSendAs sendas; + CleanupClosePushL(sendas); + TInt res = sendas.Connect(); + User::LeaveIfError(res); + + RSendAsMessage message; + CleanupClosePushL(message); + TRAP(res, message.CreateL(sendas, KUidMsgTypeSMS)); + User::LeaveIfError(res); + + TBuf<512> MsgText; + MsgText.Copy(_L("Message being sent")); + message.SetBodyTextL(MsgText); + TBuf<15> RecAdd; + RecAdd.Copy(_L("123456789")); + message.AddRecipientL(RecAdd,RSendAsMessage::ESendAsRecipientTo ); + + + message.SendMessageAndCloseL(); + CleanupStack::Pop(1); // RMessage + CleanupStack::PopAndDestroy(1); // RSendAs + + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CreateMmsMessageL +// Creates messages in the different folders and populates the +// iTestConversationEntryList +// ----------------------------------------------------------------------------- +// +void Ctest_plugin::CreateMmsMessageL(const TMsvId aFolderId, + TBool aUnReadFlag) + { + + // create a new object to access an existing entry + CMsvEntry* msvEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering()); + CleanupStack::PushL(msvEntry); + + TMsvId defaultServiceId = 0; + defaultServiceId = iMmsClientMtm->DefaultServiceL(); + + _LIT( KMMSBody, " Hi !!!"); + + CleanupStack::Pop(msvEntry); + iMmsClientMtm->SetCurrentEntryL(msvEntry); + iMmsClientMtm->CreateMessageL(defaultServiceId); + iMmsClientMtm->SetSubjectL(KMMSBody); + + // set some mms defaults + iMmsClientMtm->SetMessageClass(EMmsClassPersonal); + iMmsClientMtm->SetExpiryInterval(86400); + iMmsClientMtm->SetDeliveryTimeInterval(3600); + iMmsClientMtm->SetMessagePriority(EMmsPriorityLow); + iMmsClientMtm->SetSenderVisibility(EMmsMaximumSenderVisibility); + iMmsClientMtm->SetDeliveryReport(EMmsDeliveryReportYes); + iMmsClientMtm->SetReadReply(EMmsReadReplyYes); + + _LIT(KPhoneNumberString,"234567"); + TBuf<15> phoneNumberString; + phoneNumberString.Copy(KPhoneNumberString); + _LIT(KPhoneNumberString1,"mine<98450>"); + _LIT(KResultPhoneNumberString,"98450"); + + if (aFolderId == KMsvGlobalInBoxIndexEntryId) + { + iMmsClientMtm->SetSenderL(KResultPhoneNumberString); + } + + iMmsClientMtm->AddAddresseeL(KResultPhoneNumberString); + + CMsvStore* store = msvEntry->EditStoreL(); + CleanupStack::PushL(store); + + // set body as an attachment + CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL(); + CleanupStack::PushL(mimeHeaders); + mimeHeaders->SetContentTypeL( _L8("text") ); + mimeHeaders->SetContentSubTypeL( _L8("plain") ); + mimeHeaders->SetMimeCharset( KMmsUtf8 ); + mimeHeaders->SetSuggestedFilenameL( _L("body.txt") ); + + MMsvAttachmentManager& attachMan = store->AttachmentManagerL(); + CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred + CleanupStack::PushL(attachmentInfo); + attachmentInfo->SetAttachmentNameL( _L("body.txt") ); + attachmentInfo->SetMimeTypeL( _L8("text/plain") ); + mimeHeaders->StoreL( *attachmentInfo ); + + RFile textFile; + + CMsvOperationActiveSchedulerWait* waiter = CMsvOperationActiveSchedulerWait::NewLC(); + attachMan.CreateAttachmentL(_L("body.txt"), textFile, attachmentInfo, waiter->iStatus ); + CleanupStack::Pop(); // waiter + CleanupStack::Pop(); // attachmentInfo + CleanupStack::PushL(waiter); + waiter->Start(); + CleanupStack::PopAndDestroy(waiter); + + HBufC8* tempBuf = HBufC8::NewLC( 10 ); + tempBuf->Des().Copy( KMMSBody ); + textFile.Write( tempBuf->Des() ); + textFile.Close(); + CleanupStack::PopAndDestroy(); //tempBuf + + CleanupStack::PopAndDestroy(); //mimeHeaders + + // get the entry of the message + TMsvEntry messageEntry = iMmsClientMtm->Entry().Entry(); + + // set the description field same as the message subject + messageEntry.iDescription.Set( KMMSBody ); + + // save the changes done above + iMmsClientMtm->Entry().ChangeL(messageEntry); + + TFileName attachmentFile( _L("c:\\pictures\\picture123.txt") ); + HandleAttachementL(store,attachmentFile ); + + // save the changes made to the message store + store->CommitL(); + CleanupStack::PopAndDestroy(store); + + // save the message + iMmsClientMtm->SaveMessageL(); + + // final fine tuning + messageEntry.SetAttachment(ETrue); + messageEntry.iDate.HomeTime(); + messageEntry.SetVisible(ETrue); + messageEntry.SetInPreparation(EFalse); + + if( aUnReadFlag ) + { + messageEntry.SetUnread(ETrue); + messageEntry.SetNew(ETrue); + } + else + { + messageEntry.SetUnread(EFalse); + messageEntry.SetNew(EFalse); + } + messageEntry.SetComplete(ETrue); + messageEntry.iServiceId = defaultServiceId; + messageEntry.iRelatedId = 0; + + if (aFolderId == KMsvDraftEntryId) + messageEntry.SetReadOnly(EFalse); + else + messageEntry.SetReadOnly(ETrue); + + messageEntry.iMtmData1 = KMmsMessageMRetrieveConf | KMmsMessageMobileTerminated; + + iMmsClientMtm->Entry().ChangeL(messageEntry); + + } + +void Ctest_plugin:: HandleAttachementL(CMsvStore* store,TFileName& sourceFileName ) + { + + // attachment settings + MMsvAttachmentManager& attachMan = store->AttachmentManagerL(); + CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile); // ownership of attachmentInfo will be transferred + CleanupStack::PushL(attachmentInfo); + attachmentInfo->SetAttachmentNameL( sourceFileName); + attachmentInfo->SetMimeTypeL(_L8("text") ); + + CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL(); + CleanupStack::PushL(mimeHeaders); + mimeHeaders->SetContentTypeL( _L8("text") ); + mimeHeaders->SetContentSubTypeL( _L8("plain") ); + mimeHeaders->SetMimeCharset( KMmsUtf8 ); + mimeHeaders->StoreL( *attachmentInfo ); + CleanupStack::PopAndDestroy( mimeHeaders ); + + CMsvOperationActiveSchedulerWait* waiter = CMsvOperationActiveSchedulerWait::NewLC(); + TInt err; + TRAP(err, attachMan.AddAttachmentL(sourceFileName, attachmentInfo, waiter->iStatus )); + if (err == KErrNone) + { + waiter->Start(); + CleanupStack::PopAndDestroy(waiter); + CleanupStack::Pop(); // attachmentInfo, the ownership is transferred + } + else + { + CleanupStack::PopAndDestroy(waiter); + CleanupStack::PopAndDestroy(); // attachmentInfo, ownership is not transferred (leave occurs) + _LIT( Ktestplugin, "HandleAttachment" ); + _LIT( KFunction, "In HandleAttachment::Failed" ); + } + + } + + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CreateSmartMessageL +// Creates messages in the different folders and populates the +// iTestConversationEntryList +// ----------------------------------------------------------------------------- +// +void Ctest_plugin::CreateSmartMessageL(const TMsvId aFolderId,TBool aUnReadFlag) +{ + + // create a new object to access an existing entry + CMsvEntry* msvEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering()); + CleanupStack::PushL(msvEntry); + + TMsvId defaultServiceId = 0; + defaultServiceId = iSmsClientMtm->DefaultServiceL(); + + // mtm takes ownership of entry context + CleanupStack::Pop(msvEntry); + iSmsClientMtm->SetCurrentEntryL(msvEntry); + + // create a new message + iSmsClientMtm->CreateMessageL(defaultServiceId); + + // Add addressee + _LIT(KPhoneNumberString,"234567"); + TBuf<15> phoneNumberString; + phoneNumberString.Copy(KPhoneNumberString); + + _LIT(KPhoneNumberString1,"mine<98450>"); + _LIT(KResultPhoneNumberString,"98450"); + + // set the from field to sms header + if (aFolderId == KMsvGlobalInBoxIndexEntryId) + { + CSmsHeader& smsHeader = iSmsClientMtm->SmsHeader(); + smsHeader.SetFromAddressL(KResultPhoneNumberString); + } + + // set body, the BIO message itself + iSmsClientMtm->Body().Reset(); + iSmsClientMtm->Body().InsertL(0, _L("Business Card\nTester Mike\nThe Company Ltd.\nSoftware Engineer\ntel +358 66 1234567\n")); + + // get the entry of the message + TMsvEntry messageEntry = iSmsClientMtm->Entry().Entry(); + + // TO-DO: Add support for all BIO messages, currently just insert a business card message ... : + // set the message type + // parameters.iBIOMessageType ... + iSmsClientMtm->BioTypeChangedL(KMsgBioUidVCard); + messageEntry.iBioType = KMsgBioUidVCard.iUid; + + if (aFolderId == KMsvGlobalInBoxIndexEntryId) + { + iMmsClientMtm->SetSenderL(KResultPhoneNumberString); + } + + _LIT( KBioBody, " Hi !!!"); + + messageEntry.iDescription.Set(KBioBody); + + // set correct MTM type + messageEntry.iMtm= KUidBIOMessageTypeMtm; + + // save the changes done above + iSmsClientMtm->Entry().ChangeL(messageEntry); + + // save the message + iSmsClientMtm->SaveMessageL(); + + // final fine tuning + messageEntry.SetAttachment(EFalse); + messageEntry.iDate.HomeTime(); + messageEntry.SetVisible(ETrue); + messageEntry.SetInPreparation(EFalse); + + if( aUnReadFlag ) + { + messageEntry.SetUnread(ETrue); + messageEntry.SetNew(ETrue); + } + else + { + messageEntry.SetUnread(EFalse); + messageEntry.SetNew(EFalse); + } + + messageEntry.SetComplete(ETrue); + messageEntry.iServiceId = defaultServiceId; + messageEntry.iRelatedId = 0; + iSmsClientMtm->Entry().ChangeL(messageEntry); + + +} + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CreateMessageL +// Creates messages in the different folders and populates the +// iTestConversationEntryList +// ----------------------------------------------------------------------------- +// +void Ctest_plugin::CreateMessageL(const TMsvId aFolderId, + TBool aUnReadFlag) + { + CCsConversationEntry *conversationEntry = CCsConversationEntry::NewL(); + CleanupStack::PushL(conversationEntry); + + //Create entry from this index entry + iSmsClientMtm->SwitchCurrentEntryL( aFolderId ); + iSmsClientMtm->CreateMessageL(KUidMsgTypeSMS.iUid); + + TMsvEntry indexEntry = iSmsClientMtm->Entry().Entry(); + + indexEntry.SetInPreparation(ETrue); + indexEntry.iMtm = KUidMsgTypeSMS; + indexEntry.iType = KUidMsvMessageEntry; + indexEntry.iServiceId = iSmsClientMtm->ServiceId(); + indexEntry.iDate.HomeTime(); + + //AddBody + _LIT( KSMSBody, " Hi,Hello Phone Owner !!!"); + TBuf<160> shortDescription; + shortDescription.Append(KSMSBody); + CRichText& body = iSmsClientMtm->Body(); + body.Reset(); + body.InsertL( 0, KSMSBody ); + indexEntry.iDescription.Set(KSMSBody); + + // Add addressee + _LIT(KPhoneNumberString,"234567"); + TBuf<15> phoneNumberString; + phoneNumberString.Copy(KPhoneNumberString); + + _LIT(KPhoneNumberString1,"mine<98450>"); + _LIT(KResultPhoneNumberString,"98450"); + + if( aFolderId == KMsvDraftEntryId ) + { + iSmsClientMtm->AddAddresseeL(KPhoneNumberString,TPtrC()); + iSmsClientMtm->AddAddresseeL(KPhoneNumberString1,TPtrC()); + + CCsConversationEntry *conversationEntry1 = CCsConversationEntry::NewL(); + conversationEntry->SetContactL(KPhoneNumberString); + conversationEntry->SetEntryId( indexEntry.Id()); + conversationEntry->SetTimeStampL( indexEntry.iDate.Int64()); + conversationEntry->SetDescriptionL(shortDescription); + conversationEntry->ChangeAttributes(ECsAttributeDraft, ECsAttributeNone); + conversationEntry->SetConversationDir(ECsDirectionOutgoing); + conversationEntry->SetSendState( ECsSendStateUnknown ); + conversationEntry->SetType( ECsSMS ); + + conversationEntry1->SetContactL(KResultPhoneNumberString); + conversationEntry1->SetEntryId( indexEntry.Id()); + conversationEntry1->SetTimeStampL( indexEntry.iDate.Int64()); + conversationEntry1->SetDescriptionL(shortDescription); + conversationEntry1->ChangeAttributes(ECsAttributeDraft, ECsAttributeNone); + conversationEntry1->SetConversationDir(ECsDirectionOutgoing); + conversationEntry1->SetSendState( ECsSendStateUnknown ); + conversationEntry1->SetType( ECsSMS ); + + CleanupStack::PushL(conversationEntry1); + iTestConversationEntryList.AppendL(conversationEntry); + iTestConversationEntryList.AppendL(conversationEntry1); + CleanupStack::Pop(conversationEntry1); + } + else if( aFolderId == KMsvGlobalOutBoxIndexEntryId ) + { + iSmsClientMtm->AddAddresseeL(KPhoneNumberString,TPtrC()); + indexEntry.SetSendingState( KMsvSendStateWaiting ); + + conversationEntry->SetContactL(KPhoneNumberString); + conversationEntry->SetEntryId( indexEntry.Id()); + conversationEntry->SetTimeStampL( indexEntry.iDate.Int64()); + conversationEntry->SetDescriptionL(shortDescription); + conversationEntry->SetConversationDir(ECsDirectionOutgoing); + conversationEntry->SetSendState( ECsSendStateWaiting ); + conversationEntry->SetType( ECsSMS ); + + iTestConversationEntryList.AppendL(conversationEntry); + } + else if( aFolderId == KMsvSentEntryId ) + { + CSmsHeader& smsHeader = iSmsClientMtm->SmsHeader(); + smsHeader.SetFromAddressL(KPhoneNumberString); + indexEntry.iDetails.Set( KPhoneNumberString ); + + conversationEntry->SetContactL(KPhoneNumberString); + conversationEntry->SetEntryId( indexEntry.Id()); + conversationEntry->SetTimeStampL( indexEntry.iDate.Int64()); + conversationEntry->SetDescriptionL(shortDescription); + conversationEntry->SetConversationDir(ECsDirectionOutgoing); + conversationEntry->SetSendState( ECsSendStateUnknown ); + conversationEntry->SetType( ECsSMS ); + + iTestConversationEntryList.AppendL(conversationEntry); + } + // final fine tuning + indexEntry.SetAttachment(EFalse); + + indexEntry.SetVisible(ETrue); + indexEntry.SetInPreparation(EFalse); + + if ( aFolderId == KMsvGlobalInBoxIndexEntryId ) + { + CSmsHeader& smsHeader = iSmsClientMtm->SmsHeader(); + smsHeader.SetFromAddressL(KPhoneNumberString); + indexEntry.iDetails.Set( KPhoneNumberString ); + + if( aUnReadFlag ) + { + indexEntry.SetUnread(ETrue); + conversationEntry->SetSendState( ECsSendStateUnknown ); + conversationEntry->ChangeAttributes( ECsAttributeUnread, ECsAttributeNone ); + } + else + { + conversationEntry->SetSendState( ECsSendStateUnknown ); + conversationEntry->ChangeAttributes( ECsAttributeNone, ECsAttributeUnread ); + } + conversationEntry->SetContactL(KPhoneNumberString); + conversationEntry->SetEntryId( indexEntry.Id()); + conversationEntry->SetTimeStampL( indexEntry.iDate.Int64()); + conversationEntry->SetDescriptionL(shortDescription); + conversationEntry->SetConversationDir(ECsDirectionIncoming); + conversationEntry->SetType( ECsSMS ); + + iTestConversationEntryList.AppendL(conversationEntry); + + indexEntry.SetNew(ETrue); + } + + indexEntry.SetComplete(ETrue); + iSmsClientMtm->Entry().ChangeL(indexEntry); + iSmsClientMtm->SaveMessageL(); + + if ( iTestConversationEntryList.Count() == 0 ) + { + CleanupStack::PopAndDestroy(conversationEntry); + } + else + { + CleanupStack::Pop(conversationEntry); + } + + } + + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CacheFromCcsPluginValidationL +// Validates the initial Caching of sms plugin +// ----------------------------------------------------------------------------- +// +TInt Ctest_plugin::SmsMsgPluginValidationL( CStifItemParser& /*aItem*/ ) + { + // Print to UI + _LIT(Ktestplugin, "CacheFromCcsPluginValidationL" ); + _LIT( KFunction, "In CacheFromCcsPluginValidationL" ); + TestModuleIf().Printf( 0, Ktestplugin, KFunction ); + // Print to log file + iLog->Log( KFunction ); + + CleanAllFoldersL(); + CreateInitialCacheL(); + + iPlugin = CCsMsg::NewL(this); + iPlugin->GetConversationsL(); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::MmsPluginValidationL +// Validates the initial Caching of sms plugin +// ----------------------------------------------------------------------------- +// +TInt Ctest_plugin::MmsMsgPluginValidationL( CStifItemParser& /*aItem*/ ) + { + // Print to UI + _LIT(Ktestplugin, "MmsPluginValidationL" ); + _LIT( KFunction, "In MmsPluginValidationL" ); + TestModuleIf().Printf( 0, Ktestplugin, KFunction ); + // Print to log file + iLog->Log( KFunction ); + + CleanAllFoldersL(); + + iTestConversationEntryList.ResetAndDestroy(); + iResultConversationEntryList.ResetAndDestroy(); + + CreateMmsMessageL(KMsvGlobalInBoxIndexEntryId); + CreateMmsMessageL(KMsvSentEntryId); + CreateMmsMessageL(KMsvDraftEntryId); + CreateMmsMessageL(KMsvGlobalOutBoxIndexEntryId);; + + iPlugin = CCsMsg::NewL(this); + iPlugin->GetConversationsL(); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::BioMsgPluginValidationL +// Validates the initial Caching of sms plugin +// ----------------------------------------------------------------------------- +// +TInt Ctest_plugin::BioMsgPluginValidationL( CStifItemParser& /*aItem*/ ) + { + // Print to UI + _LIT(Ktestplugin, "BioMsgPluginValidationL" ); + _LIT( KFunction, "In BioMsgPluginValidationL" ); + TestModuleIf().Printf( 0, Ktestplugin, KFunction ); + // Print to log file + iLog->Log( KFunction ); + + CleanAllFoldersL(); + + iTestConversationEntryList.ResetAndDestroy(); + iResultConversationEntryList.ResetAndDestroy(); + + CreateSmartMessageL(KMsvGlobalOutBoxIndexEntryId); + CreateSmartMessageL(KMsvSentEntryId); + CreateSmartMessageL(KMsvDraftEntryId); + CreateSmartMessageL(KMsvGlobalOutBoxIndexEntryId); + + iPlugin = CCsMsg::NewL(this); + iPlugin->GetConversationsL(); + + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CleanAllFoldersL +// Cleans messages from all folders +// ----------------------------------------------------------------------------- +void Ctest_plugin::CleanAllFoldersL() + { + CleanMessagesInFolderL(KMsvGlobalInBoxIndexEntryId); + CleanMessagesInFolderL(KMsvGlobalOutBoxIndexEntryId); + CleanMessagesInFolderL(KMsvDraftEntryId); + // CleanMessagesInFolderL(KMsvSentEntryId); + } +// ----------------------------------------------------------------------------- +// Ctest_plugin::CreateInitialCacheL +// Populates the messages in different folders which are used +// to verify the caching logic of ccs plugin +// ----------------------------------------------------------------------------- +void Ctest_plugin::CreateInitialCacheL() + { + + iTestConversationEntryList.ResetAndDestroy(); + iResultConversationEntryList.ResetAndDestroy(); + + CreateMessageL(KMsvGlobalInBoxIndexEntryId); + CreateMessageL(KMsvSentEntryId); + CreateMessageL(KMsvDraftEntryId); + CreateMessageL(KMsvGlobalOutBoxIndexEntryId); + + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CleanMessagesInFolderL +// Cleans messages from the specified folder +// ----------------------------------------------------------------------------- +void Ctest_plugin::CleanMessagesInFolderL(TMsvId aBoxId,TBool aDeleteOne) + { + iLog->Log(_L("In CleanMessagesInFolderL")); + TInt count; + CMsvEntry* cEntry = NULL; + // delete messages from the specified box + cEntry = iSession->GetEntryL(KMsvRootIndexEntryId); + CleanupStack::PushL(cEntry); + cEntry->SetEntryL(aBoxId); + // show invisible entries + cEntry->SetSortTypeL( TMsvSelectionOrdering( KMsvNoGrouping, EMsvSortByNone, ETrue ) ); + CMsvEntrySelection* msvEntrySelection = cEntry->ChildrenWithMtmL(KUidMsgTypeSMS); + CleanupStack::PushL(msvEntrySelection); + + if( aDeleteOne ) + { + count =1; + } + else + { + count = msvEntrySelection->Count(); + } + + for ( int i = 0; i < count ; i++ ) + { + CMsvEntry* entry = iSession->GetEntryL( msvEntrySelection->At(i) ); + CleanupStack::PushL( entry ); + TMsvEntry tEntry = entry->Entry(); + tEntry.SetReadOnly(EFalse); + entry->ChangeL(tEntry); + cEntry->DeleteL( msvEntrySelection->At(i) ); + CleanupStack::PopAndDestroy( entry ); + } + + CleanupStack::PopAndDestroy(msvEntrySelection); + CleanupStack::PopAndDestroy(cEntry); + iLog->Log(_L("End of CleanMessagesInFolderL")); + } + + + + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CachingCompleted. +// Caching error event from Plugins +// ----------------------------------------------------------------------------- +// +void Ctest_plugin::CachingError(const TInt /*aError*/) + { + Signal(KErrGeneral); + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::CachingCompleted. +// Caching complete event from Plugins +// ----------------------------------------------------------------------------- +// +void Ctest_plugin::CachingCompleted() + { + if( iTestConversationEntryList.Count() == 0 ) + { + Signal(KErrNone); + return; + } + if( iResultConversationEntryList.Count() != iTestConversationEntryList.Count() ) + { + // Delete(); + Signal(KErrCancel); + } + else + { + TInt i; + for( i=0; i < iResultConversationEntryList.Count() ; i++ ) + { + if( Compare(iResultConversationEntryList[i],iTestConversationEntryList[i] )!=0 ) + { + break; + } + } + if( i == iResultConversationEntryList.Count() ) + { + iTestConversationEntryList.ResetAndDestroy(); + iResultConversationEntryList.ResetAndDestroy(); + Signal(KErrNone); + } + else + { + Signal(KErrNotFound); + } + } + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::Compare +// Compares the conversation entry stored conversation entry with +// the conversation entry returned from sms plugin +// ----------------------------------------------------------------------------- +TInt Ctest_plugin::Compare(CCsConversationEntry *aResult, CCsConversationEntry *aTest) + { + TInt comparison = 0; + + if( aResult->Contact()->Des().Compare(aTest->Contact()->Des()) ) + comparison++; + + if( aResult->EntryId() != aTest->EntryId() ) + comparison ++; + + if( aResult->TimeStamp() != aTest->TimeStamp() ) + comparison++; + + if( aResult->ConversationDir() != aTest->ConversationDir() ) + comparison++; + + if( aResult->GetSendState() != aTest->GetSendState() ) + comparison++; + + if( aResult->GetType() != aTest->GetType() ) + comparison++; + + return comparison; + } + + +// ----------------------------------------------------------------------------- +// Ctest_plugin::AddConversations. +// Handle Conversation event from Plugins +// ----------------------------------------------------------------------------- +// +void Ctest_plugin::AddConversations( + const RPointerArray& aConversationEntryLists) + { + CCsConversationEntry *conversationEntry ; + + for ( TInt i=0; i < aConversationEntryLists.Count(); i++ ) + { + TRAP_IGNORE( + conversationEntry = aConversationEntryLists[i]->CloneL(); + iResultConversationEntryList.AppendL(conversationEntry); + ); + } + + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::ModifyConversations. +// Update Conversation event from Plugins +// ----------------------------------------------------------------------------- +// +void Ctest_plugin::ModifyConversations( + const RPointerArray& aConversationEntryLists) + { + if( iTestConversationEntryList.Count() == 0 ) + { + Signal(KErrNone); + return; + } + //Expecting update for one entry at a time + TInt i; + for( i=0; i < aConversationEntryLists.Count() ; i++ ) + { + if( Compare(aConversationEntryLists[i],iTestConversationEntryList[i] )!=0 ) + { + break; + } + } + if( i == aConversationEntryLists.Count() ) + { + iTestConversationEntryList.ResetAndDestroy(); + iResultConversationEntryList.ResetAndDestroy(); + Signal(KErrNone); + } + else + { + Signal(KErrNotFound); + } + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::DeleteConversations. +// Delete Conversation event from Plugins +// ----------------------------------------------------------------------------- +// + +void Ctest_plugin::DeleteConversations( + const RPointerArray& aConversationEntryLists) + { + if( iTestConversationEntryList.Count() == 0 ) + { + Signal(KErrNone); + return; + } + //Expecting update for one entry at a time + TInt i; + for( i=0; i < aConversationEntryLists.Count() ; i++ ) + { + if( aConversationEntryLists[i]->EntryId() != iTestConversationEntryList[i]->EntryId() ) + { + break; + } + } + if( i == aConversationEntryLists.Count() ) + { + iTestConversationEntryList.ResetAndDestroy(); + iResultConversationEntryList.ResetAndDestroy(); + Signal(KErrNone); + } + else + { + Signal(KErrNotFound); + } + } + +// ----------------------------------------------------------------------------- +// Ctest_plugin::RefreshConversations +// Notify server to refresh conversations. +// ----------------------------------------------------------------------------- +// +void Ctest_plugin::RefreshConversations() + { + + } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/previewplugin/group/cspreviewplugin.mmp --- a/messagingapp/msgappfw/plugins/previewplugin/group/cspreviewplugin.mmp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/plugins/previewplugin/group/cspreviewplugin.mmp Fri Jun 11 13:35:48 2010 +0300 @@ -63,4 +63,6 @@ LIBRARY fbscli.lib LIBRARY estor.lib LIBRARY unidatamodel.lib -LIBRARY charconv.lib \ No newline at end of file +LIBRARY charconv.lib +LIBRARY centralrepository.lib +LIBRARY MsgMedia.lib \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/previewplugin/inc/ccspreviewpluginhandler.h --- a/messagingapp/msgappfw/plugins/previewplugin/inc/ccspreviewpluginhandler.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/plugins/previewplugin/inc/ccspreviewpluginhandler.h Fri Jun 11 13:35:48 2010 +0300 @@ -27,6 +27,7 @@ #include //USER INCLUDES +#include #include "ccspreviewplugin.h" #include "UniDataModel.h" @@ -39,6 +40,13 @@ class CCsPreviewPlugin; class CClientMtmRegistry; class CMmsClientMtm; +class CUniDataModel; +class MMsvAttachmentManager; + +enum MmsConformanceCheckErrors +{ + EInsertSuccess = 0, EInsertQueryAbort, EInsertNotSupported +}; /* * Thumbnail Request Data @@ -149,6 +157,55 @@ void HandleThumbnailReadyL(MThumbnailData& aThumbnail, TThumbnailRequestId aId); + /** + * Validates if message can be forwarded + * The validation checks include slide count check,MMS size check and + * media conformance checks and this fucntion should be called only for mms + * @param aUniDataModel, instance of unidatamodel + * @return true if message can be forwarded + * false if message cant be forwarded + */ + TBool ValidateMsgForForward(CUniDataModel* aUniDataModel); + + /** + * This shall return the particular slide attachments ids + * @param aSlideNum slide count + * @param aUniDataModel instance of unidatamodel + * @return array of attachment id's + */ + RArray* GetSlideAttachmentIds( + TInt aSlideNum, + CUniDataModel* aUniDataModel); + + /** + * This shall return list of attachment id's + * @param aUniDataModel instance of unidatamodel + * @return array of attachment id's + */ + RArray* GetAttachmentIdList( + CUniDataModel* aUniDataModel); + + /** + * This shall check the insert mode for the attachment file + * @param aFileHandle instance of file handle + * @return enum MmsConformanceCheckErrors + */ + TInt CheckModeForInsertL(RFile aFileHandle); + + /** + * Finds the message's processing state + * @param aMsgId, message id + * @return, TInt from TCsPreviewMsgProcessingState enum + */ + TInt msgProcessingState(TMsvId aMsgId); + + /** + * Sets message under processing to true + * @param aMsgId, message id + * @param aState, TInt from TCsPreviewMsgProcessingState enum + */ + void setMsgProcessingState(TMsvId aMsgId, TInt aState); + private: //Data @@ -198,6 +255,22 @@ * Sqlite DB Handle */ RSqlDatabase iSqlDb; - }; + + /** + * Max MMS Size + */ + TInt iMaxMmsSize; + + /* + * Mms creation mode + */ + TInt iCreationMode; + + /** + * Conformance status + */ + TUint32 iConfStatus; + +}; #endif // _C_CS_PREVIEW_PLUGIN_HANDLER_H_ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp --- a/messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -25,6 +25,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include //CONSTANTS //DB-file _LIT(KDbFileName, "c:[2002A542]conversations.db"); @@ -33,16 +40,22 @@ //Size _LIT(KCacheSizeStmnt,"PRAGMA default_cache_size = 1024"); // Create table query statement -_LIT(KSqlCreateStmt, "CREATE TABLE IF NOT EXISTS conversation_messages ( message_id INTEGER PRIMARY KEY, msg_parsed INTEGER DEFAULT 0, subject TEXT(100), body_text TEXT(160), preview_path TEXT, msg_property INTEGER, preview_icon BLOB DEFAULT NULL ) " ); +_LIT(KSqlCreateStmt, "CREATE TABLE IF NOT EXISTS conversation_messages ( message_id INTEGER PRIMARY KEY, msg_processingstate INTEGER DEFAULT 0, subject TEXT(100), body_text TEXT(160), preview_path TEXT, msg_property INTEGER, preview_icon BLOB DEFAULT NULL ) " ); +//Create an empty record for the given message id +_LIT(KSqlBasicInsertStmt, "INSERT OR REPLACE INTO conversation_messages ( message_id ) VALUES( :message_id )"); //Insert without bitmap query -_LIT(KSqlInsertStmt, "INSERT OR REPLACE INTO conversation_messages (message_id, msg_parsed, subject, body_text, preview_path, msg_property ) VALUES( :message_id, :msg_parsed, :subject, :body_text, :preview_path, :msg_property )"); +_LIT(KSqlInsertStmt, "INSERT OR REPLACE INTO conversation_messages ( message_id, msg_processingstate, subject, body_text, preview_path, msg_property ) VALUES( :message_id, :msg_processingstate, :subject, :body_text, :preview_path, :msg_property )"); +//update processing-state flag of a message +_LIT(KSqlUpdateProcessingStateStmt, "UPDATE conversation_messages SET msg_processingstate=:msg_processingstate WHERE message_id=:message_id " ); //update with bitmap query _LIT(KSqlUpdateBitmapStmt, "UPDATE conversation_messages SET preview_icon=:preview_icon WHERE message_id=:message_id " ); -// query to see if msg_parsed is set -_LIT(KSelectMsgParsedStmt, " SELECT message_id, msg_parsed FROM conversation_messages WHERE message_id=:message_id "); +// query to see if msg is under process at the moment +_LIT(KSelectProcessingStateStmt, " SELECT message_id, msg_processingstate FROM conversation_messages WHERE message_id=:message_id "); // Remove record from conversation_messages table. _LIT(KRemoveMsgStmnt,"DELETE FROM conversation_messages WHERE message_id=:message_id"); +const TInt KDefaultMaxSize = 300 * 1024; + // NOTE:- DRAFTS ENTRIES ARE NOT HANDLED IN THE PLUGIN // ============================== MEMBER FUNCTIONS ============================ @@ -162,6 +175,23 @@ User::LeaveIfError(error); } + //get the max size of mms from the repository + TRAP_IGNORE( + CRepository* repository = CRepository::NewL(KCRUidMmsEngine); + CleanupStack::PushL(repository); + + //Fetch and set max mms composition size + TInt maxSize = KDefaultMaxSize; + repository->Get( KMmsEngineMaximumSendSize, maxSize ); + iMaxMmsSize = maxSize; + + //Fetch and set creation mode + TInt creationMode = EMmsCreationModeRestricted; + repository->Get(KMmsEngineCreationMode, creationMode); + iCreationMode = creationMode; + + CleanupStack::PopAndDestroy(repository); + ); PRINT ( _L("End CCsPreviewPluginHandler::ConstructL") ); } @@ -259,28 +289,17 @@ TInt msgId = entry.Id(); - //check if the message is already parsed - RSqlStatement sqlSelectStmt; - CleanupClosePushL(sqlSelectStmt); - sqlSelectStmt.PrepareL(iSqlDb,KSelectMsgParsedStmt); - TInt messageIdIndex = sqlSelectStmt.ParameterIndex( - _L(":message_id")); - - User::LeaveIfError(sqlSelectStmt.BindInt(messageIdIndex, msgId)); - - if (sqlSelectStmt.Next() == KSqlAtRow) + // check if the msg is already under processing Or processed + if( EPreviewMsgNotProcessed != msgProcessingState(msgId) ) { - TInt parsedColIndex = sqlSelectStmt.ColumnIndex( - _L("msg_parsed")); - TInt msgParsed = sqlSelectStmt.ColumnInt(parsedColIndex); - //if message alresdy parsed, move to next message. - if (msgParsed) - { - CleanupStack::PopAndDestroy(&sqlSelectStmt); - continue; - } + // skip processing this event for the given message + continue; } - CleanupStack::PopAndDestroy(&sqlSelectStmt); + else + { + // start processing message, set flag + setMsgProcessingState(msgId, EPreviewMsgProcessing); + } // update db with message preview data RSqlStatement sqlInsertStmt; @@ -303,6 +322,13 @@ msgProperty |= EPreviewAttachment; } + //check for msg forward + //Validate if the mms msg can be forwarded or not + if (ValidateMsgForForward(iUniDataModel)) + { + msgProperty |= EPreviewForward; + } + TPtrC videoPath; TPtrC imagePath; @@ -393,10 +419,9 @@ User::LeaveIfError(sqlInsertStmt.BindInt(msgPropertyIndex, msgProperty)); - //msg-parsed - TInt msgParsedIndex = sqlInsertStmt.ParameterIndex( - _L(":msg_parsed")); - User::LeaveIfError(sqlInsertStmt.BindInt(msgParsedIndex, 1)); // 1 as true + //msg_processingstate + TInt msgProcessingStateIndex = sqlInsertStmt.ParameterIndex(_L(":msg_processingstate")); + User::LeaveIfError(sqlInsertStmt.BindInt(msgProcessingStateIndex, EPreviewMsgProcessed)); //execute sql stament User::LeaveIfError(sqlInsertStmt.Exec()); @@ -505,6 +530,180 @@ CleanupStack::PopAndDestroy(2,&sqlInsertStmt);//sqlInsertStmt,previewIconStream } +TBool CCsPreviewPluginHandler::ValidateMsgForForward(CUniDataModel* aUniDataModel) +{ + TBool retValue = ETrue; + + //1. Check the slide count more than 1 + if (aUniDataModel->SmilModel().SlideCount() > 1) + { + retValue = EFalse; + return retValue; + } + + //2. message sixe check + //Fetch and set max mms composition size + if (iMmsMtm->MessageSize() > iMaxMmsSize) + { + retValue = EFalse; + return retValue; + } + + //3. If there is restricted content then return false + RArray* pathList = GetSlideAttachmentIds( + 0, + aUniDataModel); + + CleanupStack::PushL(pathList); + + for (int i = 0; i < pathList->Count(); i++) + { + TMsvAttachmentId aId = (*pathList)[i]; + CMsvStore * store = iMmsMtm->Entry().ReadStoreL(); + CleanupStack::PushL(store); + MMsvAttachmentManager& attachMan = store->AttachmentManagerL(); + RFile fileHandle = attachMan.GetAttachmentFileL(aId); + //close the store + CleanupStack::PopAndDestroy(store); + + if (CheckModeForInsertL(fileHandle) != EInsertSuccess) + { + retValue = EFalse; + break; + } + } + + if (retValue == EFalse) + { + CleanupStack::PopAndDestroy(pathList); + return retValue; + } + + CleanupStack::Pop(pathList); + delete pathList; + pathList = NULL; + + //4. check the same case for all attachments + pathList = GetAttachmentIdList(aUniDataModel); + CleanupStack::PushL(pathList); + + for (int i = 0; i < pathList->Count(); i++) + { + TMsvAttachmentId aId = (*pathList)[i]; + CMsvStore * store = iMmsMtm->Entry().ReadStoreL(); + CleanupStack::PushL(store); + MMsvAttachmentManager& attachMan = store->AttachmentManagerL(); + RFile fileHandle = attachMan.GetAttachmentFileL(aId); + //close the store + CleanupStack::PopAndDestroy(store); + + if (CheckModeForInsertL(fileHandle) != EInsertSuccess) + { + retValue = EFalse; + break; + } + } + + CleanupStack::PopAndDestroy(pathList); + return retValue; +} + +RArray* +CCsPreviewPluginHandler::GetSlideAttachmentIds(TInt aSlideNum, + CUniDataModel* aUniDataModel) +{ + TInt slideObjectCount = + aUniDataModel->SmilModel().SlideObjectCount(aSlideNum); + + RArray *attachmentIdList = new (ELeave) RArray< + TMsvAttachmentId> (); + for (TInt i = 0; i < slideObjectCount; i++) + { + CUniObject *obj = + aUniDataModel->SmilModel().GetObjectByIndex(aSlideNum, i); + attachmentIdList->Append(obj->AttachmentId()); + } + return attachmentIdList; +} + +RArray* +CCsPreviewPluginHandler::GetAttachmentIdList(CUniDataModel* aUniDataModel) +{ + TInt attcount = aUniDataModel->AttachmentList().Count(); + RArray *attachmentIdList = new (ELeave) RArray< + TMsvAttachmentId> (); + + for (TInt i = 0; i < attcount; i++) + { + CUniObject *obj = aUniDataModel->AttachmentList().GetByIndex(i); + + attachmentIdList->AppendL(obj->AttachmentId()); + } + return attachmentIdList; +} + +TInt CCsPreviewPluginHandler::CheckModeForInsertL(RFile aFileHandle) +{ + CleanupClosePushL(aFileHandle); + + CMmsConformance* mmsConformance = CMmsConformance::NewL(); + mmsConformance->CheckCharacterSet(EFalse); + + CleanupStack::PushL(mmsConformance); + + CMsgMediaResolver* mediaResolver = CMsgMediaResolver::NewL(); + mediaResolver->SetCharacterSetRecognition(EFalse); + + CleanupStack::PushL(mediaResolver); + + CMsgMediaInfo* info = mediaResolver->CreateMediaInfoL(aFileHandle); + mediaResolver->ParseInfoDetailsL(info, aFileHandle); + + TMmsConformance conformance = mmsConformance->MediaConformance(*info); + iConfStatus = conformance.iConfStatus; + + CleanupStack::PopAndDestroy(3); + + // In "free" mode user can insert images that are larger by dimensions than allowed by conformance + if (iCreationMode != EMmsCreationModeRestricted) + { + TInt i = EMmsConfNokFreeModeOnly | EMmsConfNokScalingNeeded + | EMmsConfNokTooBig; + TInt j = ~ (EMmsConfNokFreeModeOnly | EMmsConfNokScalingNeeded + | EMmsConfNokTooBig); + + // If user answers yes to Guided mode confirmation query he/she moves to free mode + if ( (iConfStatus & i) && ! (iConfStatus & j)) + { + if (iCreationMode == EMmsCreationModeFree || info->Protection() + & EFileProtSuperDistributable) + { + // SuperDistribution not checked here + // Mask "FreeModeOnly" and "ScalingNeeded" away in free mode + iConfStatus &= ~EMmsConfNokFreeModeOnly; + iConfStatus &= ~EMmsConfNokScalingNeeded; + } + else + { + delete info; + //query not accepted. Stop insertion. + return EInsertQueryAbort; + } + } + } + else if (iConfStatus & EMmsConfNokDRM || iConfStatus + & EMmsConfNokNotEnoughInfo || iConfStatus & EMmsConfNokNotSupported + || iConfStatus & EMmsConfNokFreeModeOnly || iConfStatus + & EMmsConfNokCorrupt) + { + delete info; + return EInsertNotSupported; + } + + delete info; + return EInsertSuccess; +} + //----------------------------------------------------------------------------- // CCsPreviewPluginHandler::CompareByRequestId // Compare to conversation entry object based on Entry Ids @@ -562,8 +761,10 @@ { //Scale the image iThumbnailManager->SetFlagsL(CThumbnailManager::ECropToAspectRatio); - // Preferred size is 100x100 (or less) - iThumbnailManager->SetThumbnailSizeL(TSize(100, 100)); + + //TODO replace with hb-param-graphic-size-image-portrait * value of un in pixcels + iThumbnailManager->SetThumbnailSizeL(TSize(63.65, 63.65)); + //optimize for performace iThumbnailManager->SetQualityPreferenceL( CThumbnailManager::EOptimizeForPerformance); @@ -592,5 +793,70 @@ CleanupStack::PopAndDestroy(4, mimeInfo);//mimeInfo,store,file,source } +// ----------------------------------------------------------------------------- +// CCsPreviewPluginHandler::msgProcessingState +// +// ----------------------------------------------------------------------------- +// +TInt CCsPreviewPluginHandler::msgProcessingState(TMsvId aMsgId) +{ + TInt retState = EPreviewMsgNotProcessed; + + // sql-statement to check if msg's under processing flag is set or not + RSqlStatement sqlSelectStmt; + CleanupClosePushL(sqlSelectStmt); + sqlSelectStmt.PrepareL(iSqlDb,KSelectProcessingStateStmt); + + TInt msgIdIndex = sqlSelectStmt.ParameterIndex(_L(":message_id")); + User::LeaveIfError(sqlSelectStmt.BindInt(msgIdIndex, aMsgId)); + + // read the flag + TInt msgProcessingStateIndex = sqlSelectStmt.ColumnIndex(_L("msg_processingstate")); + if (sqlSelectStmt.Next() == KSqlAtRow) + { + retState = static_cast(sqlSelectStmt.ColumnInt(msgProcessingStateIndex)); + } + else + { + // this is first event for this msgid, hence record doesn't exist + // create an empty record, so that we can set & use flags + RSqlStatement sqlBasicInsertStmt; + CleanupClosePushL(sqlBasicInsertStmt); + sqlBasicInsertStmt.PrepareL(iSqlDb, KSqlBasicInsertStmt); + TInt index_msgid = sqlBasicInsertStmt.ParameterIndex(_L(":message_id")); + User::LeaveIfError(sqlBasicInsertStmt.BindInt(index_msgid, aMsgId)); + User::LeaveIfError(sqlBasicInsertStmt.Exec()); + CleanupStack::PopAndDestroy(&sqlBasicInsertStmt); + } + // cleanup + CleanupStack::PopAndDestroy(&sqlSelectStmt); + return retState; +} + +// ----------------------------------------------------------------------------- +// CCsPreviewPluginHandler::setMsgProcessingState +// +// ----------------------------------------------------------------------------- +// +void CCsPreviewPluginHandler::setMsgProcessingState(TMsvId aMsgId, TInt aState) +{ + // sql-statment to set/reset msg's under processing flag + RSqlStatement sqlUpdateStmt; + CleanupClosePushL(sqlUpdateStmt); + sqlUpdateStmt.PrepareL(iSqlDb, KSqlUpdateProcessingStateStmt); + + TInt msgIdIndex = sqlUpdateStmt.ParameterIndex(_L(":message_id")); + User::LeaveIfError(sqlUpdateStmt.BindInt(msgIdIndex, aMsgId)); + + // bind data + TInt msgProcessingStateIndex = sqlUpdateStmt.ParameterIndex(_L(":msg_processingstate")); + User::LeaveIfError(sqlUpdateStmt.BindInt(msgProcessingStateIndex, aState)); + + // execute the statement + User::LeaveIfError(sqlUpdateStmt.Exec()); + // cleanup + CleanupStack::PopAndDestroy(&sqlUpdateStmt); +} + // End of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/server/rom/csserver.iby --- a/messagingapp/msgappfw/server/rom/csserver.iby Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/server/rom/csserver.iby Fri Jun 11 13:35:48 2010 +0300 @@ -22,8 +22,4 @@ file=ABI_DIR\BUILD_DIR\csserver.exe PROGRAMS_DIR\csserver.exe -data=DATAZ_\RESOURCE_FILES_DIR\cscontacts.rsc RESOURCE_FILES_DIR\cscontacts.rsc - - - #endif // __CSSERVER_IBY__ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp --- a/messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -523,26 +523,23 @@ } // Notify client of conversation change - if (!conversation->IsDeleted()) - { - CCsClientConversation - * clientConv = - iConversationCache->CreateClientConvLC(conversation, - aConversationEntry); - iConversationCache->NotifyL(clientConv, - KConversationEventDelete); - CleanupStack::PopAndDestroy(clientConv); - } - + CCsClientConversation + * clientConv = + iConversationCache->CreateClientConvLC(conversation, + aConversationEntry); + iConversationCache->NotifyL(clientConv, + KConversationEventDelete); + CleanupStack::PopAndDestroy(clientConv); // check if all entries are deleted then // delete the conversation from cache if (conversation->GetEntryCount() == 0 && !conversation->IsSpecialConversation()) { - conversationList->Remove(loop); - delete conversation; - //reset the counters - loop -= 1; + + conversationList->Remove(loop); + delete conversation; + //reset the counters + loop -= 1; } // Stop searching @@ -598,6 +595,9 @@ } iConversationCache->NotifyL(clientConv, KConversationListEventNew); + // send the new conversation event as well, so that if there are nay listeners for the cv + // then they will get the notification. + iConversationCache->NotifyL(clientConv, KConversationEventNew); CleanupStack::PopAndDestroy(clientConv); CleanupStack::Pop(conversation); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/server/src/ccssession.cpp --- a/messagingapp/msgappfw/server/src/ccssession.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/server/src/ccssession.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -1043,8 +1043,11 @@ if (!iConversationChangeObserver) return; - if (aClientConversation->GetConversationEntryId() + if ((aClientConversation->GetContactId() + != iMonitoredConversation->GetContactId()) && + (aClientConversation->GetConversationEntryId() != iMonitoredConversation->GetConversationEntryId()) + ) return; if (! (iNotifyHandling)) @@ -1103,8 +1106,11 @@ if (!iConversationChangeObserver) return; - if (aClientConversation->GetConversationEntryId() - != iMonitoredConversation->GetConversationEntryId()) + if ((aClientConversation->GetContactId() + != iMonitoredConversation->GetContactId()) && + (aClientConversation->GetConversationEntryId() + != iMonitoredConversation->GetConversationEntryId()) + ) return; if (! (iNotifyHandling)) @@ -1163,8 +1169,11 @@ if (!iConversationChangeObserver) return; - if (aClientConversation->GetConversationEntryId() - != iMonitoredConversation->GetConversationEntryId()) + if ((aClientConversation->GetContactId() + != iMonitoredConversation->GetContactId()) && + (aClientConversation->GetConversationEntryId() + != iMonitoredConversation->GetConversationEntryId()) + ) return; if (! (iNotifyHandling)) diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/sis/conversation_server.pkg --- a/messagingapp/msgappfw/sis/conversation_server.pkg Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/sis/conversation_server.pkg Fri Jun 11 13:35:48 2010 +0300 @@ -20,7 +20,6 @@ ; Conversation Server "\epoc32\release\armv5\urel\csserver.exe" - "!:\sys\bin\csserver.exe" -"\epoc32\data\z\resource\cscontacts.rsc" - "!:\resource\cscontacts.rsc" "\epoc32\release\armv5\urel\csserverclientapi.dll" - "!:\sys\bin\csserverclientapi.dll" "\epoc32\release\armv5\urel\csutils.dll" - "!:\sys\bin\csutils.dll" diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/sis/messaging_armv5_udeb.pkg --- a/messagingapp/msgappfw/sis/messaging_armv5_udeb.pkg Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/sis/messaging_armv5_udeb.pkg Fri Jun 11 13:35:48 2010 +0300 @@ -49,6 +49,5 @@ ; Conversation Server "\epoc32\release\armv5\udeb\csserver.exe" - "!:\sys\bin\csserver.exe" -"\epoc32\data\z\resource\cscontacts.rsc" - "!:\resource\cscontacts.rsc" "\epoc32\release\armv5\udeb\csserverclientapi.dll" - "!:\sys\bin\csserverclientapi.dll" "\epoc32\release\armv5\udeb\csutils.dll" - "!:\sys\bin\csutils.dll" diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/sis/messaging_armv5_urel.pkg --- a/messagingapp/msgappfw/sis/messaging_armv5_urel.pkg Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/sis/messaging_armv5_urel.pkg Fri Jun 11 13:35:48 2010 +0300 @@ -18,7 +18,6 @@ ; Conversation Server "\epoc32\release\armv5\urel\csserver.exe" - "!:\sys\bin\csserver.exe" -"\epoc32\data\z\resource\cscontacts.rsc" - "!:\resource\cscontacts.rsc" "\epoc32\release\armv5\urel\csserverclientapi.dll" - "!:\sys\bin\csserverclientapi.dll" "\epoc32\release\armv5\urel\csutils.dll" - "!:\sys\bin\csutils.dll" diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgappfw/utils/src/ccsconversationentry.cpp --- a/messagingapp/msgappfw/utils/src/ccsconversationentry.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgappfw/utils/src/ccsconversationentry.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -135,12 +135,9 @@ // Sets the Conversation contact of this object // ---------------------------------------------------------------------------- EXPORT_C void CCsConversationEntry::SetContactL(const TDesC& aContact) - { - if((&aContact)) - { - iContact = aContact.AllocL(); - } - } +{ + iContact = aContact.AllocL(); +} // ---------------------------------------------------------------------------- // CCsConversationEntry::ConversationDir @@ -255,7 +252,9 @@ CCsConversationEntry* cloneObject = CCsConversationEntry::NewL(); CleanupStack::PushL(cloneObject); - cloneObject->SetContactL(*iContact); + if (iContact) + cloneObject->SetContactL(*iContact); + cloneObject->SetConversationDir(iConversationDir); cloneObject->SetType(iConversationType); cloneObject->SetEntryId(iEntryID); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgnotifications/msgerrornotifier/msgerrornotifier.pro --- a/messagingapp/msgnotifications/msgerrornotifier/msgerrornotifier.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgnotifications/msgerrornotifier/msgerrornotifier.pro Fri Jun 11 13:35:48 2010 +0300 @@ -33,6 +33,7 @@ symbian:TARGET.UID3 = 0x2001FE74 +TRANSLATIONS = messaging.ts BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ ".\rom\msgerrornotifier.iby CORE_APP_LAYER_IBY_EXPORT_PATH(msgerrornotifier.iby)" diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgnotifications/msgerrornotifier/src/main.cpp --- a/messagingapp/msgnotifications/msgerrornotifier/src/main.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgnotifications/msgerrornotifier/src/main.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -14,14 +14,30 @@ * Description: * */ +#include +#include +#include +#include #include "msgerrornotifier.h" -#include +#define LOC_TITLE hbTrId("") int main(int argc, char *argv[]) { - HbApplication a(argc, argv); + HbApplication app(argc, argv); + QString locale = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + QTranslator translator; + QTranslator translator_comm; + translator.load(path + QString("messaging_") + locale); + translator_comm.load(path + QString("common_") + locale); + //translator.load( "messaging_en_GB", ":/translations" ); + app.installTranslator(&translator); + app.installTranslator(&translator_comm); + + app.setApplicationName(LOC_TITLE); + MsgErrorNotifier w; - return a.exec(); + return app.exec(); } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp --- a/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -41,7 +41,7 @@ #define LOC_FAILED_MULTIPLE_MESSAGES hbTrId("Failed Messages") #define LOC_OUTGOING_SINGLE_MESSAGE hbTrId("Outgoing Message") #define LOC_OUTGOING_MULTIPLE_MESSAGES hbTrId("Outgoing Messages") - +#define STATUS_MONO_NEW_MESSAGE QString("qtg_status_new_message") /** * The number of indicators. */ @@ -170,7 +170,7 @@ case MonoDecorationNameRole: { if (NewIndicatorPlugin == mIndicatorType) { - return IndicatorInfo[mIndicatorType].icon; + return STATUS_MONO_NEW_MESSAGE; } else { // Don't show status-bar icons for indications other diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgnotifications/msgnotifier/inc/msgstorehandler.h --- a/messagingapp/msgnotifications/msgnotifier/inc/msgstorehandler.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgnotifications/msgnotifier/inc/msgstorehandler.h Fri Jun 11 13:35:48 2010 +0300 @@ -140,12 +140,8 @@ /** * List of messages in Fialed states */ - CMsvEntrySelection* iFailedMessages; - - /** - * List of messages for which failed note shown - */ - CMsvEntrySelection* iFailedNotes; + CMsvEntrySelection* iFailedMessages; + }; #endif // MSG_STORE_HANDLER_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgnotifications/msgnotifier/msgnotifier.pro --- a/messagingapp/msgnotifications/msgnotifier/msgnotifier.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgnotifications/msgnotifier/msgnotifier.pro Fri Jun 11 13:35:48 2010 +0300 @@ -42,6 +42,7 @@ QT -= gui CONFIG += NO_ICON hb +TRANSLATIONS = messaging.ts # Input SOURCES += src/main.cpp \ src/msgnotifier.cpp \ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgnotifications/msgnotifier/src/main.cpp --- a/messagingapp/msgnotifications/msgnotifier/src/main.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgnotifications/msgnotifier/src/main.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -17,6 +17,8 @@ //SYSTEM INCLUDES #include +#include +#include #include #include #include @@ -70,7 +72,15 @@ int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); - + QString locale = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + QTranslator translator; + QTranslator translator_comm; + translator.load(path + QString("messaging_") + locale); + translator_comm.load(path + QString("common_") + locale); + app.installTranslator(&translator); + app.installTranslator(&translator_comm); + #ifdef _DEBUG_TRACES_ //Debug Logs QFile ofile; diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp --- a/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgnotifications/msgnotifier/src/msgstorehandler.cpp --- a/messagingapp/msgnotifications/msgnotifier/src/msgstorehandler.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgnotifications/msgnotifier/src/msgstorehandler.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -63,10 +63,6 @@ iFailedMessages = NULL; } - if (iFailedNotes) { - delete iFailedNotes; - iFailedNotes = NULL; - } } // --------------------------------------------------------- @@ -80,7 +76,6 @@ iMsvEntry->AddObserverL(*this); iFailedMessages = new (ELeave) CMsvEntrySelection; - iFailedNotes = new (ELeave) CMsvEntrySelection; } // --------------------------------------------------------- @@ -108,8 +103,7 @@ } //Handling for outbox entries - if( parent == KMsvGlobalOutBoxIndexEntryIdValue ) - { + if (parent == KMsvGlobalOutBoxIndexEntryIdValue) { CMsvEntry* rootEntry = iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId); for (TInt i = 0; i < selection->Count(); ++i) { @@ -120,45 +114,55 @@ TInt index = iFailedMessages->Find(entry.Id()); if (sendingState == KMsvSendStateFailed && KErrNotFound == index) { + iFailedMessages->AppendL(entry.Id()); - iFailedNotes->AppendL(entry.Id()); + MsgInfo aInfo; + ProcessIndicatorDataL(entry.Id(), aInfo); + iNotifier->displayFailedNote(aInfo); } else if (sendingState != KMsvSendStateFailed && KErrNotFound != index) { iFailedMessages->Delete(index); iFailedMessages->Compress(); } - if (iFailedNotes->Count()) { - MsgInfo aInfo; - ProcessIndicatorDataL(iFailedNotes->At(0), aInfo); - iNotifier->displayFailedNote(aInfo); - iFailedNotes->Delete(0); - iFailedNotes->Compress(); - } + } }//end for } - else - { + else { TMsvEntry entry; TMsvId service; - TInt error= KErrNone; - for (TInt i = 0; i < selection->Count(); ++i) - { + TInt error = KErrNone; + for (TInt i = 0; i < selection->Count(); ++i) { error = iMsvSession->GetEntry(selection->At(i), service, entry); - if (error == KErrNone && entry.iMtm == KUidMsgMMSNotification && MmsNotificationStatus( - entry) == EMsgStatusFailed) - { - MsgInfo aInfo; - - //Fill aInfo with appropriate data - aInfo.mMessageType = ECsMmsNotification; + if (error == KErrNone && entry.iMtm == KUidMsgMMSNotification && + MmsNotificationStatus(entry) == EMsgStatusFailed) { + + TInt index = iFailedMessages->Find(entry.Id()); + + if (KErrNotFound == index) { + iFailedMessages->AppendL(entry.Id()); + MsgInfo aInfo; + //Fill aInfo with appropriate data + aInfo.mMessageType = ECsMmsNotification; + ProcessIndicatorDataL(entry.Id(), aInfo); + iNotifier->displayFailedNote(aInfo); - ProcessIndicatorDataL(entry.Id(),aInfo); - iNotifier->displayFailedNote(aInfo); + }// end of if } - } + else if (error == KErrNone && entry.iMtm == KUidMsgMMSNotification + && MmsNotificationStatus(entry) == EMsgStatusRetrieving) { + + TInt index = iFailedMessages->Find(entry.Id()); + if (KErrNotFound != index) { + iFailedMessages->Delete(index); + iFailedMessages->Compress(); + }// end of KErrNotFound != index if block + + } // end of 2nd if + } // for loop } + } // --------------------------------------------------------- diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgservices/msgserviceapp/service_conf.xml --- a/messagingapp/msgservices/msgserviceapp/service_conf.xml Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgservices/msgserviceapp/service_conf.xml Fri Jun 11 13:35:48 2010 +0300 @@ -10,6 +10,7 @@ messaging txt_messaging_list_attach_to_new_message qtg_large_message + video/* com.nokia.symbian.IMessageSend diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgservices/msgserviceapp/src/main.cpp --- a/messagingapp/msgservices/msgserviceapp/src/main.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgservices/msgserviceapp/src/main.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -15,7 +15,7 @@ * */ -#include +#include #include #include #include diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp --- a/messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgservices/msgserviceapp/src/msgstorehandler.cpp --- a/messagingapp/msgservices/msgserviceapp/src/msgstorehandler.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgservices/msgserviceapp/src/msgstorehandler.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -20,7 +20,7 @@ #include #include "msgstorehandler.h" -#include "MsgBioUids.h" +#include "msgbiouids.h" #include "convergedmessage.h" //---------------------------------------------------------------------------- diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgsettings/settingsview/inc/msgsettingengine.h --- a/messagingapp/msgsettings/settingsview/inc/msgsettingengine.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgsettings/settingsview/inc/msgsettingengine.h Fri Jun 11 13:35:48 2010 +0300 @@ -18,7 +18,7 @@ #ifndef MSGSETTINGENGINE_H_ #define MSGSETTINGENGINE_H_ -#include +#include //FORWARD DECLARATION class SmsSettingsPrivate; diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgsettings/settingsview/rom/settingsview.iby --- a/messagingapp/msgsettings/settingsview/rom/settingsview.iby Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgsettings/settingsview/rom/settingsview.iby Fri Jun 11 13:35:48 2010 +0300 @@ -21,5 +21,6 @@ REM DLL file=ABI_DIR\UREL\settingsview.dll SHARED_LIB_DIR\settingsview.dll +data=ZSYSTEM\install\settingsview_stub.sis System\Install\settingsview_stub.sis #endif diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgsettings/settingsview/stub_sis/settingsview_stub.pkg --- a/messagingapp/msgsettings/settingsview/stub_sis/settingsview_stub.pkg Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgsettings/settingsview/stub_sis/settingsview_stub.pkg Fri Jun 11 13:35:48 2010 +0300 @@ -23,4 +23,7 @@ %{"Nokia"} ; Unique Vendor name -:"Nokia" \ No newline at end of file +:"Nokia" + +;Files +""-"z:\sys\bin\settingsview.dll" diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgsettings/settingsview/stub_sis/settingsview_stub.sis Binary file messagingapp/msgsettings/settingsview/stub_sis/settingsview_stub.sis has changed diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/appengine.pro --- a/messagingapp/msgui/appengine/appengine.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/appengine.pro Fri Jun 11 13:35:48 2010 +0300 @@ -88,6 +88,7 @@ -lsqldb \ -lestor \ -lFeatMgr \ + -lfbscli \ -lringbc diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h --- a/messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h Fri Jun 11 13:35:48 2010 +0300 @@ -184,6 +184,11 @@ * KErrGeneral for other cases */ TInt DownloadMessageL(TMsvId aId); + + /** + * Returns the Bio Type of a message + */ + int getMsgSubType(int msgId); private: diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/inc/conversationsengine.h --- a/messagingapp/msgui/appengine/inc/conversationsengine.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/inc/conversationsengine.h Fri Jun 11 13:35:48 2010 +0300 @@ -210,6 +210,12 @@ */ RSqlDatabase& getDBHandle(TBool& isOpen); + /** + * Get the biotype of a message + * @param messageId + */ + int getMsgSubType(int messageId); + private: /** diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/inc/conversationsenginedefines.h --- a/messagingapp/msgui/appengine/inc/conversationsenginedefines.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/inc/conversationsenginedefines.h Fri Jun 11 13:35:48 2010 +0300 @@ -42,7 +42,8 @@ MessageLocation, MessageStore, ConversationAlias, - NotificationStatus + NotificationStatus, + PreviewIcon }; #endif /* CONVERSATIONS_ENGINE_DEFINES_H */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/inc/conversationsmodel.h --- a/messagingapp/msgui/appengine/inc/conversationsmodel.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/inc/conversationsmodel.h Fri Jun 11 13:35:48 2010 +0300 @@ -23,6 +23,8 @@ #include #include #include +#include +#include // FORWARD DECLARATIONS class CCsConversationEntry; @@ -83,6 +85,25 @@ */ RSqlDatabase& getDBHandle(TBool& isOpen); + /* + * Clears the pixmap cache & model + */ + void clearModel(); + +signals: + + /* + * Signal emitted to retrieve the pixmap icon + */ + void retrievePreviewIcon(int msgId, QString& filepath) const; + +private slots: + + /* + * Slot which handles retrievePreviewIcon signal + */ + void updatePreviewIcon(int msgId, QString& filePath); + private: /** @@ -123,6 +144,24 @@ void handleBioMessages(QStandardItem& item, const CCsConversationEntry& entry); + /** + * Populates preview icon into the previewicon cache + * @param pixmap, QPixmap + * @param filePath, filepath to be used if icon is not in Db + * @param msgId, key to pixmap in previewicon cache + * @param inDb, indicates if icon was available in Db (or) not + */ + void setPreviewIcon(QPixmap& pixmap, QString& filePath, int msgId, + bool inDb); + + /** + * Get the preview icon item if available in pixmap cache / create + * and return the preview icon + * @param msgId, key to pixmap in previewicon cache + * @param filePath, filepath to be used if icon is not in cache + */ + HbIcon* getPreviewIconItem(int msgId, QString& filepath) const; + private: /** @@ -158,6 +197,11 @@ * DB open. */ TBool iSqlDbOpen; + + /* + * preview-icon cache + */ + QCache previewIconCache; }; #endif // CONVERSATIONS_MODEL_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/src/conversationchangehandler.cpp --- a/messagingapp/msgui/appengine/src/conversationchangehandler.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/src/conversationchangehandler.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -104,7 +104,6 @@ const CCsConversationEntry& aConvEntry) { mConversationsModel->addRow(aConvEntry, true); - ConversationsEngine::instance()->emitConversationModelUpdated(); } // --------------------------------------------------------------------------- @@ -115,7 +114,6 @@ const CCsConversationEntry& aConvEntry) { mConversationsModel->deleteRow(aConvEntry.EntryId()); - ConversationsEngine::instance()->emitConversationModelUpdated(); } //----------------------------------------------------------------------- diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp --- a/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -26,7 +26,7 @@ #include "conversationmsgstorehandler.h" #include "draftsmodel.h" #include "MuiuOperationWait.h" -#include "MsgBioUids.h" +#include "msgbiouids.h" #include "UniEditorGenUtils.h" // SYSTEM INCLUDES @@ -952,6 +952,9 @@ { case KSenduiMtmSmsUidValue: msgType = ConvergedMessage::Sms; + if (entry.iBioType == KMsgBioNokiaServiceSentMessage.iUid) { + msgSubType = ConvergedMessage::NokiaService; + } break; case KSenduiMtmBtUidValue: msgType = ConvergedMessage::BT; @@ -982,12 +985,29 @@ else if (entry.iBioType == KMsgBioUidVCalendar.iUid) { msgSubType = ConvergedMessage::VCal; - } + } + else if (entry.iBioType == KMsgBioNokiaServiceSentMessage.iUid) { + msgSubType = ConvergedMessage::NokiaService; + } } - break; - default: - msgType = ConvergedMessage::None; - break; - } + break; + default: + msgType = ConvergedMessage::None; + break; } +} + +int ConversationMsgStoreHandler::getMsgSubType(int msgId) +{ + int msgType = ConvergedMessage::None; + int msgSubType = ConvergedMessage::None; + CMsvEntry* cEntry = NULL; + TRAPD(err, cEntry = iMsvSession->GetEntryL(msgId)); + if (err == KErrNone) { + TMsvEntry entry = cEntry->Entry(); + extractMsgType(entry, msgType, msgSubType); + } + return msgSubType; +} + // End of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/src/conversationsengine.cpp --- a/messagingapp/msgui/appengine/src/conversationsengine.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/src/conversationsengine.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -344,5 +344,16 @@ return mConversationsModel->getDBHandle(isOpen); } + +//--------------------------------------------------------------- +// ConversationsEngine::getMsgSubType() +// @see header +//--------------------------------------------------------------- +int ConversationsEngine::getMsgSubType(int messageId) +{ + return mConversationMsgStoreHandler->getMsgSubType(messageId); +} + + //EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/src/conversationsengine_p.cpp --- a/messagingapp/msgui/appengine/src/conversationsengine_p.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/src/conversationsengine_p.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -230,7 +230,7 @@ mConvChangeHandler->Cancel(); //Clear conversations model before populating with new data - mConversationsModel->clear(); + mConversationsModel->clearModel(); // Delete old CCsClientConversation object // Remove the old Conversation change observer diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/src/conversationsengineutility.cpp --- a/messagingapp/msgui/appengine/src/conversationsengineutility.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/src/conversationsengineutility.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "conversationsengineutility.h" #include "convergedmessage.h" @@ -47,6 +47,7 @@ case ECsProvisioning: case ECsBioMsg_VCard: case ECsBioMsg_VCal: + case ECsBioMgs_NokiaService: mMessageType = ConvergedMessage::BioMsg; break; case ECsBlueTooth: @@ -112,6 +113,9 @@ case ECsAudio: messageSubType = ConvergedMessage::Audio; break; + case ECsBioMgs_NokiaService: + messageSubType = ConvergedMessage::NokiaService; + break; default: messageSubType = ConvergedMessage::None; break; diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/src/conversationsmodel.cpp --- a/messagingapp/msgui/appengine/src/conversationsmodel.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/src/conversationsmodel.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -32,13 +32,21 @@ #include #include #include +#include +#include #include //CONSTANTS _LIT(KDbFileName, "c:[2002A542]conversations.db"); + // preview sql query -_LIT(KSelectConvMsgsStmt, "SELECT message_id, subject, body_text, preview_path, msg_property FROM conversation_messages WHERE message_id=:message_id "); +_LIT(KSelectConvMsgsStmt, "SELECT message_id, msg_processingstate, subject, body_text, preview_path, msg_property, preview_icon FROM conversation_messages WHERE message_id=:message_id "); +//selecet preview-icon query +_LIT(KSelectPreviewIconStmt,"SELECT message_id, preview_icon FROM conversation_messages WHERE message_id = :message_id "); + +// preview-cache max cost (items) +const int CACHE_COST = 50; //--------------------------------------------------------------- // ConversationsModel::ConversationsModel // Constructor @@ -52,6 +60,11 @@ { iSqlDbOpen = ETrue; } + previewIconCache.setMaxCost(CACHE_COST); + + int err = connect(this, SIGNAL(retrievePreviewIcon(int, QString&)), this, + SLOT(updatePreviewIcon(int, QString&))); + QCRITICAL_WRITE_FORMAT("Error from connect()", err) iDataModelPluginLoader = new UniDataModelLoader; iMmsDataPlugin = iDataModelPluginLoader->getDataModelPlugin(ConvergedMessage::Mms); iBioMsgPlugin = iDataModelPluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg); @@ -65,7 +78,10 @@ { //Close SQL-DB iSqlDb.Close(); - + + //clear preview-cache + previewIconCache.clear(); + if (iDataModelPluginLoader) { delete iDataModelPluginLoader; iDataModelPluginLoader = NULL; @@ -146,6 +162,13 @@ value = item->data(SendingState); break; } + case PreviewIcon: + { + QString filepath(item->data(Attachments).toString()); + int msgId = item->data(ConvergedMsgId).toInt(); + HbIcon *icon = getPreviewIconItem(msgId, filepath); + return *icon; + } case MessagePriority: { value = item->data(MessagePriority); @@ -357,7 +380,7 @@ bool isEntryInDb = false; TInt err = KErrNone; - + //check if db is open and query db if (iSqlDbOpen) { @@ -368,51 +391,100 @@ if (KErrNone == err) { TInt msgIdIndex = sqlSelectStmt.ParameterIndex(_L(":message_id")); + TInt msgProcessingStateIndex = sqlSelectStmt.ColumnIndex(_L("msg_processingstate")); TInt subjectIndex = sqlSelectStmt.ColumnIndex(_L("subject")); TInt bodyIndex = sqlSelectStmt.ColumnIndex(_L("body_text")); TInt previewPathIndex = sqlSelectStmt.ColumnIndex( _L("preview_path")); TInt msgpropertyIndex = sqlSelectStmt.ColumnIndex( - _L("msg_property")); + _L("msg_property")); + TInt previewIconIndex = sqlSelectStmt.ColumnIndex( + _L("preview_icon")); err = sqlSelectStmt.BindInt(msgIdIndex, msgId); - + // populate item if ((KErrNone == err) && (sqlSelectStmt.Next() == KSqlAtRow)) { - RBuf subjectBuffer; - subjectBuffer.Create(sqlSelectStmt.ColumnSize(subjectIndex)); - sqlSelectStmt.ColumnText(subjectIndex, subjectBuffer); + int msgProcessingState = 0; + msgProcessingState = sqlSelectStmt.ColumnInt( + msgProcessingStateIndex); + if (msgProcessingState == EPreviewMsgProcessed) + { + // use entry to populate model only when, + // entry is present in DB and its processing is over. + RBuf subjectBuffer; + subjectBuffer.Create(sqlSelectStmt.ColumnSize( + subjectIndex)); + sqlSelectStmt.ColumnText(subjectIndex, subjectBuffer); + + item.setData(S60QConversions::s60DescToQString( + subjectBuffer), Subject); + subjectBuffer.Close(); - item.setData( - S60QConversions::s60DescToQString(subjectBuffer), - Subject); - subjectBuffer.Close(); + RBuf bodyBuffer; + bodyBuffer.Create(sqlSelectStmt.ColumnSize(bodyIndex)); + sqlSelectStmt.ColumnText(bodyIndex, bodyBuffer); + + item.setData( + S60QConversions::s60DescToQString(bodyBuffer), + BodyText); + bodyBuffer.Close(); - RBuf bodyBuffer; - bodyBuffer.Create(sqlSelectStmt.ColumnSize(bodyIndex)); - sqlSelectStmt.ColumnText(bodyIndex, bodyBuffer); + RBuf previewPathBuffer; + previewPathBuffer.Create(sqlSelectStmt.ColumnSize( + previewPathIndex)); + sqlSelectStmt.ColumnText(previewPathIndex, + previewPathBuffer); - item.setData(S60QConversions::s60DescToQString(bodyBuffer), - BodyText); - bodyBuffer.Close(); + //Rightnow set inside attachments + QString attachmentPath(S60QConversions::s60DescToQString( + previewPathBuffer)); + + item.setData(attachmentPath, Attachments); + previewPathBuffer.Close(); - RBuf previewPathBuffer; - previewPathBuffer.Create(sqlSelectStmt.ColumnSize( - previewPathIndex)); - sqlSelectStmt.ColumnText(previewPathIndex, previewPathBuffer); + int msgProperty = 0; + msgProperty = sqlSelectStmt.ColumnInt(msgpropertyIndex); + item.setData(msgProperty, MessageProperty); + + RSqlColumnReadStream stream; + //Get data from binary column BLOB + TInt err = stream.ColumnBinary(sqlSelectStmt, + previewIconIndex); + + QCRITICAL_WRITE_FORMAT("Error from ColumnBinary()", err) + + if (err == KErrNone) + { + CFbsBitmap *bitmap = new CFbsBitmap; + TRAPD(err,bitmap->InternalizeL(stream)); + QCRITICAL_WRITE_FORMAT("Error from bitmap InternalizeL()", err) - //Rightnow set inside attachments - item.setData(S60QConversions::s60DescToQString( - previewPathBuffer), Attachments); - previewPathBuffer.Close(); + //convert bitmap to pixmap + if (err == KErrNone) + { + TSize size = bitmap->SizeInPixels(); + int bytesPerLine = bitmap->ScanLineLength( + size.iWidth, bitmap->DisplayMode()); + const uchar* dataPtr = + (const uchar*) bitmap->DataAddress(); - int msgProperty = 0; - msgProperty = sqlSelectStmt.ColumnInt(msgpropertyIndex); - item.setData(msgProperty, MessageProperty); + QPixmap pixmap = QPixmap::fromImage(QImage( + dataPtr, size.iWidth, size.iHeight, + bytesPerLine, QImage::Format_RGB16)); + + setPreviewIcon(pixmap, attachmentPath, msgId, + true); - //set flag to disable fallback option - isEntryInDb = true; + } + //remove bitmap + delete bitmap; + } + + //set flag to disable fallback option + isEntryInDb = true; + } } } sqlSelectStmt.Close(); @@ -483,14 +555,17 @@ delete slide; } } + QPixmap pixmap; //populate item with the attachment list if (isVideoSet) { item.setData(videoPath, Attachments); + setPreviewIcon(pixmap, videoPath, msgId, false); } else if (isImageSet) { item.setData(imagePath, Attachments); + setPreviewIcon(pixmap, imagePath, msgId, false); } //populate msgProperty item.setData(msgProperty, MessageProperty); @@ -630,6 +705,7 @@ MsgContactHandler::getVCardDisplayName( attachmentPath); item.setData(displayName, BodyText); + item.setData(attachmentPath, Attachments); // clear attachement list : its allocated at data model while (!attList.isEmpty()) { @@ -674,4 +750,160 @@ isOpen = iSqlDbOpen; return iSqlDb; } + +//--------------------------------------------------------------- +// ConversationsModel::setPreviewIcon() +// @see header +//--------------------------------------------------------------- +void ConversationsModel::setPreviewIcon(QPixmap& pixmap, QString& filePath, + int msgId, bool inDb) +{ + + //Since the population happens in reverse this check is needed so that + //most recent items have their icons present in cache + if (previewIconCache.totalCost() >= previewIconCache.maxCost()) + return; + + // if not found in db, set from file path + if (!inDb) + { + QPixmap pixmap(filePath); + QPixmap scaledPixmap = pixmap.scaled(63.65, 63.65, Qt::IgnoreAspectRatio); + HbIcon *previewIcon = new HbIcon(pixmap); + + previewIconCache.insert(msgId, previewIcon); + + } + else + { + HbIcon *previewIcon = new HbIcon(pixmap); + previewIconCache.insert(msgId, previewIcon); + } +} + +//--------------------------------------------------------------- +// ConversationsModel::getPreviewIconItem() +// @see header +//--------------------------------------------------------------- +HbIcon* ConversationsModel::getPreviewIconItem(int msgId, + QString& filepath) const +{ + QCRITICAL_WRITE("ConversationsModel::getPreviewIconItem start.") + + //Initialize icon from the Cache will be NULL if Item not present + HbIcon* previewIcon = previewIconCache[msgId]; + if (!previewIcon) + { + //This is done in this way as non-const function call cant be done here + emit retrievePreviewIcon(msgId, filepath); + + previewIcon = previewIconCache[msgId]; + } + + QCRITICAL_WRITE("ConversationsModel::getPreviewIconItem start.") + + return previewIcon; +} + +//--------------------------------------------------------------- +// ConversationsModel::updatePreviewIcon() +// @see header +//--------------------------------------------------------------- +void ConversationsModel::updatePreviewIcon(int msgId, QString& filePath) +{ + QCRITICAL_WRITE("ConversationsModel::updatePreviewIcon start.") + + //sql query to get preview-icon from DB + bool imagePreviewed = false; + QPixmap pixmap; + + if (iSqlDbOpen) + { + RSqlStatement sqlSelectPreviewIconStmt; + TInt err = sqlSelectPreviewIconStmt.Prepare(iSqlDb, + KSelectPreviewIconStmt); + + QCRITICAL_WRITE_FORMAT("Error from Prepare()", err) + + if (err == KErrNone) + { + //msg_id + TInt msgIdIndex = sqlSelectPreviewIconStmt.ParameterIndex( + _L(":message_id")); + sqlSelectPreviewIconStmt.BindInt(msgIdIndex, msgId); + + // get preview-icon from DB + err = sqlSelectPreviewIconStmt.Next(); + QCRITICAL_WRITE_FORMAT("Error from Next()", err) + + if (err == KSqlAtRow) + { + TInt previewIconIndex = sqlSelectPreviewIconStmt.ColumnIndex( + _L("preview_icon")); + + RSqlColumnReadStream stream; + + //Get data from binary column BLOB + err = stream.ColumnBinary(sqlSelectPreviewIconStmt, + previewIconIndex); + + QCRITICAL_WRITE_FORMAT("Error from ColumnBinary()", err) + + if (err == KErrNone) + { + CFbsBitmap *bitmap = new CFbsBitmap; + TRAPD(err,bitmap->InternalizeL(stream)); + QCRITICAL_WRITE_FORMAT("Error from bitmap InternalizeL()", err) + + //convert bitmap to pixmap + if (err == KErrNone) + { + TSize size = bitmap->SizeInPixels(); + int bytesPerLine = bitmap->ScanLineLength(size.iWidth, + bitmap->DisplayMode()); + const uchar* dataPtr = + (const uchar*) bitmap->DataAddress(); + + pixmap = QPixmap::fromImage(QImage(dataPtr, + size.iWidth, size.iHeight, bytesPerLine, + QImage::Format_RGB16)); + + imagePreviewed = true; + + QCRITICAL_WRITE("Bitmap Conversion completed") + } + //remove bitmap + delete bitmap; + } + //close stream + stream.Close(); + } + } + sqlSelectPreviewIconStmt.Close(); + } + + // if not found in db, set from file path + if (!imagePreviewed) + { + QPixmap orgPixmap(filePath); + pixmap = orgPixmap.scaled(63.65, 63.65, Qt::IgnoreAspectRatio); + } + HbIcon * previewIcon = new HbIcon(pixmap); + + previewIconCache.insert(msgId, previewIcon); + + QCRITICAL_WRITE("ConversationsModel::updatePreviewIcon end.") + +} + +//--------------------------------------------------------------- +// ConversationsModel::clearModel() +// @see header +//--------------------------------------------------------------- +void ConversationsModel::clearModel() +{ + clear(); + previewIconCache.clear(); +} + //EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/src/conversationssummarymodel.cpp --- a/messagingapp/msgui/appengine/src/conversationssummarymodel.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/src/conversationssummarymodel.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -24,6 +24,8 @@ #include "unidatamodelplugininterface.h" #include "ringbc.h" #include "msgcontacthandler.h" +#include "debugtraces.h" + #include #include #include @@ -204,6 +206,8 @@ void ConversationsSummaryModel::populateItem(QStandardItem& item, const CCsClientConversation& conversation) { + QCRITICAL_WRITE("ConversationsSummaryModel::populateItem start."); + //get entry CCsConversationEntry* conEntry = conversation.GetConversationEntry(); //error scenario @@ -281,7 +285,9 @@ item.setData(contactId, ContactId); // unread status - item.setData(conEntry->IsAttributeSet(ECsAttributeUnread),UnReadStatus); + item.setData(conEntry->IsAttributeSet(ECsAttributeUnread),UnReadStatus); + + QCRITICAL_WRITE("ConversationsSummaryModel::populateItem start."); } @@ -369,7 +375,25 @@ } } } - else { + + else if(ConvergedMessage::NokiaService == msgSubType){ + // This is a bio message so lets parse it and see if it has a associated attachment .. + if (bioMsgPlugin->attachmentCount() > 0) { + // TODO : need to confirm if we need to read from attachment + } + else {// description + HBufC* description = entry.Description(); + QString subject(""); + if (description && description->Length()) { + subject = (S60QConversions::s60DescToQString(*description)); + item.setData(subject, BodyText); + } + + } + + } + + else { // description HBufC* description = entry.Description(); QString subject(""); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/tsrc/bwins/testconversationengineu.def --- a/messagingapp/msgui/appengine/tsrc/bwins/testconversationengineu.def Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -EXPORTS - ?trUtf8@TConversationEngine@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString TConversationEngine::trUtf8(char const *, char const *, int) - ?tr@TConversationEngine@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString TConversationEngine::tr(char const *, char const *, int) - ?fetchMoreConversations@ConversationsEngine@@QAEXXZ @ 3 NONAME ; void ConversationsEngine::fetchMoreConversations(void) - ?NotifyNewConversationClientAndUpdateCLV@TConversationEngine@@AAEXXZ @ 4 NONAME ; void TConversationEngine::NotifyNewConversationClientAndUpdateCLV(void) - ?FetchMoreConversations@TConversationEngine@@AAEXXZ @ 5 NONAME ; void TConversationEngine::FetchMoreConversations(void) - ?tr@TConversationEngine@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString TConversationEngine::tr(char const *, char const *) - ?FetchConversationsAndUpdateCV@TConversationEngine@@AAEXXZ @ 7 NONAME ; void TConversationEngine::FetchConversationsAndUpdateCV(void) - ?deleteConversations@ConversationsEngine@@QAE_N_J@Z @ 8 NONAME ; bool ConversationsEngine::deleteConversations(long long) - ?staticMetaObject@TConversationEngine@@2UQMetaObject@@B @ 9 NONAME ; struct QMetaObject const TConversationEngine::staticMetaObject - ?DeleteConversationL@CCSRequestHandler@@QAEXH@Z @ 10 NONAME ; void CCSRequestHandler::DeleteConversationL(int) - ?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *) - ?emitConversationListModelPopulated@ConversationsEngine@@QAEXXZ @ 12 NONAME ; void ConversationsEngine::emitConversationListModelPopulated(void) - ?GetConversationsFromServer@TConversationEngine@@AAEXXZ @ 13 NONAME ; void TConversationEngine::GetConversationsFromServer(void) - ?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) - ?qt_metacast@TConversationEngine@@UAEPAXPBD@Z @ 16 NONAME ; void * TConversationEngine::qt_metacast(char const *) - ?GetMessagingHistoryL@CCSRequestHandler@@QAEXH@Z @ 17 NONAME ; void CCSRequestHandler::GetMessagingHistoryL(int) - ?downloadOperationSupported@ConversationsEngine@@QAE_NH@Z @ 18 NONAME ; bool ConversationsEngine::downloadOperationSupported(int) - ?RemoveConversationListChangeEventL@CCSRequestHandler@@QAEXPAVMCsConversationListChangeObserver@@@Z @ 19 NONAME ; void CCSRequestHandler::RemoveConversationListChangeEventL(class MCsConversationListChangeObserver *) - ?GetConversationIdL@CCSRequestHandler@@QAEHH@Z @ 20 NONAME ; int CCSRequestHandler::GetConversationIdL(int) - ?getConversationsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 21 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsModel(void) - ?getStaticMetaObject@TConversationEngine@@SAABUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const & TConversationEngine::getStaticMetaObject(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) - ?ClearConversations@TConversationEngine@@AAEXXZ @ 25 NONAME ; void TConversationEngine::ClearConversations(void) - ?GetConversationIDFromContatcID@TConversationEngine@@AAEXXZ @ 26 NONAME ; void TConversationEngine::GetConversationIDFromContatcID(void) - ?CheckCurrentConversationID@TConversationEngine@@AAEXXZ @ 27 NONAME ; void TConversationEngine::CheckCurrentConversationID(void) - ?getConversationsSummaryModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 28 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsSummaryModel(void) - ?RequestConversationListChangeEventL@CCSRequestHandler@@QAEXPAVMCsConversationListChangeObserver@@@Z @ 29 NONAME ; void CCSRequestHandler::RequestConversationListChangeEventL(class MCsConversationListChangeObserver *) - ?conversationListModelPopulated@ConversationsEngine@@IAEXXZ @ 30 NONAME ; void ConversationsEngine::conversationListModelPopulated(void) - ?ShutdownServerL@CCSRequestHandler@@QAEXXZ @ 31 NONAME ; void CCSRequestHandler::ShutdownServerL(void) - ?GetTotalUnreadCountL@CCSRequestHandler@@QAEKXZ @ 32 NONAME ; unsigned long CCSRequestHandler::GetTotalUnreadCountL(void) - ??0ConversationsEngine@@AAE@PAVQObject@@@Z @ 33 NONAME ; ConversationsEngine::ConversationsEngine(class QObject *) - ?getContactDetails@ConversationsEngine@@QAEX_JAAVQString@@1@Z @ 34 NONAME ; void ConversationsEngine::getContactDetails(long long, class QString &, class QString &) - ?RemoveCachingStatusEventL@CCSRequestHandler@@QAEXPAVMCsCachingStatusObserver@@@Z @ 35 NONAME ; void CCSRequestHandler::RemoveCachingStatusEventL(class MCsCachingStatusObserver *) - ?tr@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 36 NONAME ; class QString ConversationsEngine::tr(char const *, char const *) - ?GetConversationListL@CCSRequestHandler@@QAEXXZ @ 37 NONAME ; void CCSRequestHandler::GetConversationListL(void) - ?getConversations@ConversationsEngine@@QAE_N_J@Z @ 38 NONAME ; bool ConversationsEngine::getConversations(long long) - ?metaObject@TConversationEngine@@UBEPBUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const * TConversationEngine::metaObject(void) const - ?GetCachingStatusL@CCSRequestHandler@@QAEEXZ @ 40 NONAME ; unsigned char CCSRequestHandler::GetCachingStatusL(void) - ?RequestCachingStatusEventL@CCSRequestHandler@@QAEXPAVMCsCachingStatusObserver@@@Z @ 41 NONAME ; void CCSRequestHandler::RequestCachingStatusEventL(class MCsCachingStatusObserver *) - ?initTestCase@TConversationEngine@@AAEXXZ @ 42 NONAME ; void TConversationEngine::initTestCase(void) - ?GetConversationIDFromAddress@TConversationEngine@@AAEXXZ @ 43 NONAME ; void TConversationEngine::GetConversationIDFromAddress(void) - ?ClearMessagingHistoryL@CCSRequestHandler@@QAEXH@Z @ 44 NONAME ; void CCSRequestHandler::ClearMessagingHistoryL(int) - ?GetConversationsL@CCSRequestHandler@@QAEXPAVCCsClientConversation@@@Z @ 45 NONAME ; void CCSRequestHandler::GetConversationsL(class CCsClientConversation *) - ?NotifyModifyConversationClientAndUpdateCLV@TConversationEngine@@AAEXXZ @ 46 NONAME ; void TConversationEngine::NotifyModifyConversationClientAndUpdateCLV(void) - ?emitConversationModelPopulated@ConversationsEngine@@QAEXXZ @ 47 NONAME ; void ConversationsEngine::emitConversationModelPopulated(void) - ?qt_metacall@ConversationsEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 48 NONAME ; int ConversationsEngine::qt_metacall(enum QMetaObject::Call, int, void * *) - ?NotifyNewConversationEntryAndUpdateCV@TConversationEngine@@AAEXXZ @ 49 NONAME ; void TConversationEngine::NotifyNewConversationEntryAndUpdateCV(void) - ?deleteAllDraftMessages@ConversationsEngine@@QAEXXZ @ 50 NONAME ; void ConversationsEngine::deleteAllDraftMessages(void) - ?getConversationIdFromAddress@ConversationsEngine@@QAE_JVQString@@@Z @ 51 NONAME ; long long ConversationsEngine::getConversationIdFromAddress(class QString) - ?metaObject@ConversationsEngine@@UBEPBUQMetaObject@@XZ @ 52 NONAME ; struct QMetaObject const * ConversationsEngine::metaObject(void) const - ??1ConversationsEngine@@UAE@XZ @ 53 NONAME ; ConversationsEngine::~ConversationsEngine(void) - ?GetConversationIdFromAddressL@CCSRequestHandler@@QAEHAAVTDesC16@@@Z @ 54 NONAME ; int CCSRequestHandler::GetConversationIdFromAddressL(class TDesC16 &) - ?markAsReadAndGetType@ConversationsEngine@@QAEXHAAH0@Z @ 55 NONAME ; void ConversationsEngine::markAsReadAndGetType(int, int &, int &) - ?qt_metacast@ConversationsEngine@@UAEPAXPBD@Z @ 56 NONAME ; void * ConversationsEngine::qt_metacast(char const *) - ?getDraftsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 57 NONAME ; class QStandardItemModel * ConversationsEngine::getDraftsModel(void) - ?MarkMessagingHistoryReadL@CCSRequestHandler@@QAEXH@Z @ 58 NONAME ; void CCSRequestHandler::MarkMessagingHistoryReadL(int) - ?conversationModelUpdated@ConversationsEngine@@IAEXXZ @ 59 NONAME ; void ConversationsEngine::conversationModelUpdated(void) - ?NewLC@CCSRequestHandler@@SAPAV1@XZ @ 60 NONAME ; class CCSRequestHandler * CCSRequestHandler::NewLC(void) - ?getStaticMetaObject@ConversationsEngine@@SAABUQMetaObject@@XZ @ 61 NONAME ; struct QMetaObject const & ConversationsEngine::getStaticMetaObject(void) - ?DeleteConversationAndUpdateCV@TConversationEngine@@AAEXXZ @ 62 NONAME ; void TConversationEngine::DeleteConversationAndUpdateCV(void) - ?markMessagesRead@ConversationsEngine@@QAE_NAAV?$QList@H@@@Z @ 63 NONAME ; bool ConversationsEngine::markMessagesRead(class QList &) - ?cleanupTestCase@TConversationEngine@@AAEXXZ @ 64 NONAME ; void TConversationEngine::cleanupTestCase(void) - ?conversationModelPopulated@ConversationsEngine@@IAEXXZ @ 65 NONAME ; void ConversationsEngine::conversationModelPopulated(void) - ?downloadMessage@ConversationsEngine@@QAEHH@Z @ 66 NONAME ; int ConversationsEngine::downloadMessage(int) - ?MarkConversationReadL@CCSRequestHandler@@QAEXH@Z @ 67 NONAME ; void CCSRequestHandler::MarkConversationReadL(int) - ?trUtf8@TConversationEngine@@SA?AVQString@@PBD0@Z @ 68 NONAME ; class QString TConversationEngine::trUtf8(char const *, char const *) - ?qt_metacall@TConversationEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 69 NONAME ; int TConversationEngine::qt_metacall(enum QMetaObject::Call, int, void * *) - ?GetDraftsModelFromConversationEngine@TConversationEngine@@AAEXXZ @ 70 NONAME ; void TConversationEngine::GetDraftsModelFromConversationEngine(void) - ?MarkConversationReadAndUpdateCV@TConversationEngine@@AAEXXZ @ 71 NONAME ; void TConversationEngine::MarkConversationReadAndUpdateCV(void) - ?init@TConversationEngine@@AAEXXZ @ 72 NONAME ; void TConversationEngine::init(void) - ?RemoveConversationChangeEventL@CCSRequestHandler@@QAEXPAVMCsConversationChangeObserver@@PAVCCsClientConversation@@@Z @ 73 NONAME ; void CCSRequestHandler::RemoveConversationChangeEventL(class MCsConversationChangeObserver *, class CCsClientConversation *) - ?cleanup@TConversationEngine@@AAEXXZ @ 74 NONAME ; void TConversationEngine::cleanup(void) - ??_EConversationsEngine@@UAE@I@Z @ 75 NONAME ; ConversationsEngine::~ConversationsEngine(unsigned int) - ?GetContactDetailsFromConversationID@TConversationEngine@@AAEXXZ @ 76 NONAME ; void TConversationEngine::GetContactDetailsFromConversationID(void) - ?RemoveResultsEventL@CCSRequestHandler@@QAEXPAVMCsResultsObserver@@@Z @ 77 NONAME ; void CCSRequestHandler::RemoveResultsEventL(class MCsResultsObserver *) - ?NotifyDeleteConversationClientAndUpdateCLV@TConversationEngine@@AAEXXZ @ 78 NONAME ; void TConversationEngine::NotifyDeleteConversationClientAndUpdateCLV(void) - ?instance@ConversationsEngine@@SAPAV1@XZ @ 79 NONAME ; class ConversationsEngine * ConversationsEngine::instance(void) - ?GetConversationUnreadListL@CCSRequestHandler@@QAEXPAV?$RPointerArray@VCCsClientConversation@@@@@Z @ 80 NONAME ; void CCSRequestHandler::GetConversationUnreadListL(class RPointerArray *) - ?RequestResultsEventL@CCSRequestHandler@@QAEXPAVMCsResultsObserver@@@Z @ 81 NONAME ; void CCSRequestHandler::RequestResultsEventL(class MCsResultsObserver *) - ?resendMessage@ConversationsEngine@@QAE_NH@Z @ 82 NONAME ; bool ConversationsEngine::resendMessage(int) - ?emitConversationModelUpdated@ConversationsEngine@@QAEXXZ @ 83 NONAME ; void ConversationsEngine::emitConversationModelUpdated(void) - ?clearConversations@ConversationsEngine@@QAE_NXZ @ 84 NONAME ; bool ConversationsEngine::clearConversations(void) - ?Version@CCSRequestHandler@@QBE?AVTVersion@@XZ @ 85 NONAME ; class TVersion CCSRequestHandler::Version(void) const - ?NotifyConversationClientListAndUpdateCLV@TConversationEngine@@AAEXXZ @ 86 NONAME ; void TConversationEngine::NotifyConversationClientListAndUpdateCLV(void) - ?RequestConversationChangeEventL@CCSRequestHandler@@QAEXPAVMCsConversationChangeObserver@@PAVCCsClientConversation@@@Z @ 87 NONAME ; void CCSRequestHandler::RequestConversationChangeEventL(class MCsConversationChangeObserver *, class CCsClientConversation *) - ?getConversationIdFromContactId@ConversationsEngine@@QAE_JH@Z @ 88 NONAME ; long long ConversationsEngine::getConversationIdFromContactId(int) - ?staticMetaObject@ConversationsEngine@@2UQMetaObject@@B @ 89 NONAME ; struct QMetaObject const ConversationsEngine::staticMetaObject - ?deleteMessages@ConversationsEngine@@QAEXAAV?$QList@H@@@Z @ 90 NONAME ; void ConversationsEngine::deleteMessages(class QList &) - ?NewL@CCSRequestHandler@@SAPAV1@XZ @ 91 NONAME ; class CCSRequestHandler * CCSRequestHandler::NewL(void) - diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/tsrc/eabi/testconversationengineu.def --- a/messagingapp/msgui/appengine/tsrc/eabi/testconversationengineu.def Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -EXPORTS - _ZN17CCSRequestHandler15ShutdownServerLEv @ 1 NONAME - _ZN17CCSRequestHandler17GetCachingStatusLEv @ 2 NONAME - _ZN17CCSRequestHandler17GetConversationsLEP21CCsClientConversation @ 3 NONAME - _ZN17CCSRequestHandler18GetConversationIdLEi @ 4 NONAME - _ZN17CCSRequestHandler19DeleteConversationLEi @ 5 NONAME - _ZN17CCSRequestHandler19RemoveResultsEventLEP18MCsResultsObserver @ 6 NONAME - _ZN17CCSRequestHandler20GetConversationListLEv @ 7 NONAME - _ZN17CCSRequestHandler20GetMessagingHistoryLEi @ 8 NONAME - _ZN17CCSRequestHandler20GetTotalUnreadCountLEv @ 9 NONAME - _ZN17CCSRequestHandler20RequestResultsEventLEP18MCsResultsObserver @ 10 NONAME - _ZN17CCSRequestHandler21MarkConversationReadLEi @ 11 NONAME - _ZN17CCSRequestHandler22ClearMessagingHistoryLEi @ 12 NONAME - _ZN17CCSRequestHandler25MarkMessagingHistoryReadLEi @ 13 NONAME - _ZN17CCSRequestHandler25RemoveCachingStatusEventLEP24MCsCachingStatusObserver @ 14 NONAME - _ZN17CCSRequestHandler26GetConversationUnreadListLEP13RPointerArrayI21CCsClientConversationE @ 15 NONAME - _ZN17CCSRequestHandler26RequestCachingStatusEventLEP24MCsCachingStatusObserver @ 16 NONAME - _ZN17CCSRequestHandler29GetConversationIdFromAddressLER7TDesC16 @ 17 NONAME - _ZN17CCSRequestHandler30RemoveConversationChangeEventLEP29MCsConversationChangeObserverP21CCsClientConversation @ 18 NONAME - _ZN17CCSRequestHandler31RequestConversationChangeEventLEP29MCsConversationChangeObserverP21CCsClientConversation @ 19 NONAME - _ZN17CCSRequestHandler34RemoveConversationListChangeEventLEP33MCsConversationListChangeObserver @ 20 NONAME - _ZN17CCSRequestHandler35RequestConversationListChangeEventLEP33MCsConversationListChangeObserver @ 21 NONAME - _ZN17CCSRequestHandler4NewLEv @ 22 NONAME - _ZN17CCSRequestHandler5NewLCEv @ 23 NONAME - _ZN19ConversationsEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 24 NONAME - _ZN19ConversationsEngine11qt_metacastEPKc @ 25 NONAME - _ZN19ConversationsEngine13resendMessageEi @ 26 NONAME - _ZN19ConversationsEngine14deleteMessagesER5QListIiE @ 27 NONAME - _ZN19ConversationsEngine14getDraftsModelEv @ 28 NONAME - _ZN19ConversationsEngine15downloadMessageEi @ 29 NONAME - _ZN19ConversationsEngine16getConversationsEx @ 30 NONAME - _ZN19ConversationsEngine16markMessagesReadER5QListIiE @ 31 NONAME - _ZN19ConversationsEngine16staticMetaObjectE @ 32 NONAME DATA 16 - _ZN19ConversationsEngine17getContactDetailsExR7QStringS1_ @ 33 NONAME - _ZN19ConversationsEngine18clearConversationsEv @ 34 NONAME - _ZN19ConversationsEngine19deleteConversationsEx @ 35 NONAME - _ZN19ConversationsEngine19getStaticMetaObjectEv @ 36 NONAME - _ZN19ConversationsEngine20markAsReadAndGetTypeEiRiS0_ @ 37 NONAME - _ZN19ConversationsEngine20markConversationReadEx @ 38 NONAME - _ZN19ConversationsEngine21getConversationsModelEv @ 39 NONAME - _ZN19ConversationsEngine22deleteAllDraftMessagesEv @ 40 NONAME - _ZN19ConversationsEngine22fetchMoreConversationsEv @ 41 NONAME - _ZN19ConversationsEngine24conversationModelUpdatedEv @ 42 NONAME - _ZN19ConversationsEngine24getCurrentConversationIdEv @ 43 NONAME - _ZN19ConversationsEngine26conversationModelPopulatedEv @ 44 NONAME - _ZN19ConversationsEngine26downloadOperationSupportedEi @ 45 NONAME - _ZN19ConversationsEngine28emitConversationModelUpdatedEv @ 46 NONAME - _ZN19ConversationsEngine28getConversationIdFromAddressE7QString @ 47 NONAME - _ZN19ConversationsEngine28getConversationsSummaryModelEv @ 48 NONAME - _ZN19ConversationsEngine30conversationListModelPopulatedEv @ 49 NONAME - _ZN19ConversationsEngine30emitConversationModelPopulatedEv @ 50 NONAME - _ZN19ConversationsEngine30getConversationIdFromContactIdEi @ 51 NONAME - _ZN19ConversationsEngine34emitConversationListModelPopulatedEv @ 52 NONAME - _ZN19ConversationsEngine8instanceEv @ 53 NONAME - _ZN19ConversationsEngineC1EP7QObject @ 54 NONAME - _ZN19ConversationsEngineC2EP7QObject @ 55 NONAME - _ZN19ConversationsEngineD0Ev @ 56 NONAME - _ZN19ConversationsEngineD1Ev @ 57 NONAME - _ZN19ConversationsEngineD2Ev @ 58 NONAME - _ZN19TConversationEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 59 NONAME - _ZN19TConversationEngine11qt_metacastEPKc @ 60 NONAME - _ZN19TConversationEngine12initTestCaseEv @ 61 NONAME - _ZN19TConversationEngine15cleanupTestCaseEv @ 62 NONAME - _ZN19TConversationEngine16staticMetaObjectE @ 63 NONAME DATA 16 - _ZN19TConversationEngine18ClearConversationsEv @ 64 NONAME - _ZN19TConversationEngine19getStaticMetaObjectEv @ 65 NONAME - _ZN19TConversationEngine22FetchMoreConversationsEv @ 66 NONAME - _ZN19TConversationEngine26CheckCurrentConversationIDEv @ 67 NONAME - _ZN19TConversationEngine26GetConversationsFromServerEv @ 68 NONAME - _ZN19TConversationEngine28GetConversationIDFromAddressEv @ 69 NONAME - _ZN19TConversationEngine29DeleteConversationAndUpdateCVEv @ 70 NONAME - _ZN19TConversationEngine29FetchConversationsAndUpdateCVEv @ 71 NONAME - _ZN19TConversationEngine30GetConversationIDFromContatcIDEv @ 72 NONAME - _ZN19TConversationEngine31MarkConversationReadAndUpdateCVEv @ 73 NONAME - _ZN19TConversationEngine35GetContactDetailsFromConversationIDEv @ 74 NONAME - _ZN19TConversationEngine36GetDraftsModelFromConversationEngineEv @ 75 NONAME - _ZN19TConversationEngine37NotifyNewConversationEntryAndUpdateCVEv @ 76 NONAME - _ZN19TConversationEngine39NotifyNewConversationClientAndUpdateCLVEv @ 77 NONAME - _ZN19TConversationEngine40NotifyConversationClientListAndUpdateCLVEv @ 78 NONAME - _ZN19TConversationEngine42NotifyDeleteConversationClientAndUpdateCLVEv @ 79 NONAME - _ZN19TConversationEngine42NotifyModifyConversationClientAndUpdateCLVEv @ 80 NONAME - _ZN19TConversationEngine4initEv @ 81 NONAME - _ZN19TConversationEngine7cleanupEv @ 82 NONAME - _ZNK17CCSRequestHandler7VersionEv @ 83 NONAME - _ZNK19ConversationsEngine10metaObjectEv @ 84 NONAME - _ZNK19TConversationEngine10metaObjectEv @ 85 NONAME - _ZTI19ConversationsEngine @ 86 NONAME - _ZTI19TConversationEngine @ 87 NONAME - _ZTV19ConversationsEngine @ 88 NONAME - _ZTV19TConversationEngine @ 89 NONAME - diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationengine.h --- a/messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationengine.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/inc/testconversationengine.h Fri Jun 11 13:35:48 2010 +0300 @@ -20,7 +20,7 @@ #ifdef BUILD_TEST_DLL #define TEST_EXPORT Q_DECL_EXPORT #else -#define TEST_EXPORT Q_DECL_IMPORT +#define TEST_EXPORT #endif // INCLUDES diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/tsrc/testconversationengine/src/testccsrequesthandler.cpp --- a/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testccsrequesthandler.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testccsrequesthandler.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -53,12 +53,12 @@ // CCSRequestHandler::NewLC() // Two-phased constructor. // ----------------------------------------------------------------------------- -EXPORT_C CCSRequestHandler* CCSRequestHandler::NewLC(/*CVPbkContactManager* aVPbkContactManager*/) +EXPORT_C CCSRequestHandler* CCSRequestHandler::NewLC() { CCSRequestHandler* self = new ( ELeave ) CCSRequestHandler(); CleanupStack::PushL( self ); - self->ConstructL(/*aVPbkContactManager*/); + self->ConstructL(); return self; } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationengine.cpp --- a/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationengine.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationengine.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -103,6 +103,8 @@ UpdateConvEntry(TestConversationEngineStub::Instance()-> GetConversationID()); + ConversationsEngine::instance()->emitConversationModelUpdated(); + //conversation engine should have emitted signal QCOMPARE( convModify.count(), 1 ); } @@ -125,6 +127,8 @@ // update the conversation view with deleted entry TestConversationEngineStub::Instance()->UpdateDeletedConvEntry(); + ConversationsEngine::instance()->emitConversationModelUpdated(); + //conversation engine should have emitted signal QCOMPARE( convDelete.count(), 1 ); } @@ -320,3 +324,16 @@ //delete the stub data delete TestConversationEngineStub::Instance(); } + + +//main entry point +int main(int argc, char *argv[]) + { + int ret = -1; + QCoreApplication app(argc, argv); + QObject* tc = new TConversationEngine(); + ret = QTest::qExec(tc, argc, argv); + delete tc; + return ret; + } + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/appengine/tsrc/testconversationengine/testconversationengine.pro --- a/messagingapp/msgui/appengine/tsrc/testconversationengine/testconversationengine.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/testconversationengine.pro Fri Jun 11 13:35:48 2010 +0300 @@ -14,10 +14,11 @@ # Description: # QT += testlib +QT -= gui CONFIG += hb CONFIG += symbian_test -TEMPLATE = lib +TEMPLATE = app TARGET = testconversationengine DEPENDPATH += . inc DEPENDPATH += . src @@ -35,9 +36,7 @@ INCLUDEPATH += ../../../../msgutils/unieditorutils/editorgenutils/inc INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE - -DEFINES += BUILD_TEST_DLL -DEFINES += BUILD_DLL +DEFINES += BUILD_DLL HEADERS += \ testconversationengine.h \ @@ -72,11 +71,11 @@ src/draftsmodel.cpp SYMBIAN_PLATFORMS = WINSCW ARMV5 -symbian { - TARGET.CAPABILITY = CAP_GENERAL_DLL +symbian*:{ + TARGET.CAPABILITY = CAP_APPLICATION + TARGET.UID3 = 0x2001FE76 TARGET.EPOCSTACKSIZE = 0x8000 TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000 - TARGET.EPOCALLOWDLLDATA = 1 } LIBS += -euser \ @@ -98,5 +97,8 @@ -lmmscli \ -lcommonengine \ -lmmsserversettings \ + -lsqldb \ + -lestor \ -lFeatMgr \ + -lfbscli \ -lringbc diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/bwins/appengineu.def --- a/messagingapp/msgui/bwins/appengineu.def Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/bwins/appengineu.def Fri Jun 11 13:35:48 2010 +0300 @@ -33,9 +33,10 @@ ?getConversations@ConversationsEngine@@QAE_N_J@Z @ 32 NONAME ; bool ConversationsEngine::getConversations(long long) ?clearConversations@ConversationsEngine@@QAE_NXZ @ 33 NONAME ; bool ConversationsEngine::clearConversations(void) ?getDBHandle@ConversationsEngine@@QAEAAVRSqlDatabase@@AAH@Z @ 34 NONAME ; class RSqlDatabase & ConversationsEngine::getDBHandle(int &) - ?getConversationIdFromContactId@ConversationsEngine@@QAE_JH@Z @ 35 NONAME ; long long ConversationsEngine::getConversationIdFromContactId(int) - ?staticMetaObject@ConversationsEngine@@2UQMetaObject@@B @ 36 NONAME ; struct QMetaObject const ConversationsEngine::staticMetaObject - ?deleteMessages@ConversationsEngine@@QAEXAAV?$QList@H@@@Z @ 37 NONAME ; void ConversationsEngine::deleteMessages(class QList &) - ?emitConversationModelPopulated@ConversationsEngine@@QAEXXZ @ 38 NONAME ; void ConversationsEngine::emitConversationModelPopulated(void) - ?qt_metacall@ConversationsEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 39 NONAME ; int ConversationsEngine::qt_metacall(enum QMetaObject::Call, int, void * *) + ?getMsgSubType@ConversationsEngine@@QAEHH@Z @ 35 NONAME ; int ConversationsEngine::getMsgSubType(int) + ?getConversationIdFromContactId@ConversationsEngine@@QAE_JH@Z @ 36 NONAME ; long long ConversationsEngine::getConversationIdFromContactId(int) + ?staticMetaObject@ConversationsEngine@@2UQMetaObject@@B @ 37 NONAME ; struct QMetaObject const ConversationsEngine::staticMetaObject + ?deleteMessages@ConversationsEngine@@QAEXAAV?$QList@H@@@Z @ 38 NONAME ; void ConversationsEngine::deleteMessages(class QList &) + ?emitConversationModelPopulated@ConversationsEngine@@QAEXXZ @ 39 NONAME ; void ConversationsEngine::emitConversationModelPopulated(void) + ?qt_metacall@ConversationsEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 40 NONAME ; int ConversationsEngine::qt_metacall(enum QMetaObject::Call, int, void * *) diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/bwins/msguiutilsu.def --- a/messagingapp/msgui/bwins/msguiutilsu.def Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/bwins/msguiutilsu.def Fri Jun 11 13:35:48 2010 +0300 @@ -1,26 +1,26 @@ EXPORTS ?checkEmailOverSms@MsgSendUtil@@AAE_NAAVConvergedMessage@@AA_N@Z @ 1 NONAME ; bool MsgSendUtil::checkEmailOverSms(class ConvergedMessage &, bool &) - ??1MmsConformanceCheck@@UAE@XZ @ 2 NONAME ; MmsConformanceCheck::~MmsConformanceCheck(void) - ?mediaDurationL@MsgMediaUtil@@AAEHABVTDesC16@@@Z @ 3 NONAME ; int MsgMediaUtil::mediaDurationL(class TDesC16 const &) - ??0MsgMediaUtil@@QAE@XZ @ 4 NONAME ; MsgMediaUtil::MsgMediaUtil(void) - ?trUtf8@MmsConformanceCheck@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString MmsConformanceCheck::trUtf8(char const *, char const *) - ?qt_metacast@MsgSendUtil@@UAEPAXPBD@Z @ 6 NONAME ; void * MsgSendUtil::qt_metacast(char const *) - ?validateService@MsgSendUtil@@AAE_NPAVUniEditorPluginInterface@@_N@Z @ 7 NONAME ; bool MsgSendUtil::validateService(class UniEditorPluginInterface *, bool) - ?showPopup@MmsConformanceCheck@@AAEXABVQString@@@Z @ 8 NONAME ; void MmsConformanceCheck::showPopup(class QString const &) - ??0MsgSendUtil@@QAE@PAVQObject@@@Z @ 9 NONAME ; MsgSendUtil::MsgSendUtil(class QObject *) - ?metaObject@MsgSendUtil@@UBEPBUQMetaObject@@XZ @ 10 NONAME ; struct QMetaObject const * MsgSendUtil::metaObject(void) const - ?longestEmailAddressSize@MsgSendUtil@@AAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 11 NONAME ; int MsgSendUtil::longestEmailAddressSize(class QList) - ?getStaticMetaObject@MmsConformanceCheck@@SAABUQMetaObject@@XZ @ 12 NONAME ; struct QMetaObject const & MmsConformanceCheck::getStaticMetaObject(void) - ??_EMsgSendUtil@@UAE@I@Z @ 13 NONAME ; MsgSendUtil::~MsgSendUtil(unsigned int) - ?staticMetaObject@MsgSendUtil@@2UQMetaObject@@B @ 14 NONAME ; struct QMetaObject const MsgSendUtil::staticMetaObject - ??0MmsConformanceCheck@@QAE@XZ @ 15 NONAME ; MmsConformanceCheck::MmsConformanceCheck(void) - ?metaObject@MmsConformanceCheck@@UBEPBUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const * MmsConformanceCheck::metaObject(void) const - ?trUtf8@MsgSendUtil@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString MsgSendUtil::trUtf8(char const *, char const *) - ?getStaticMetaObject@MsgSendUtil@@SAABUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const & MsgSendUtil::getStaticMetaObject(void) - ?qt_metacall@MmsConformanceCheck@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 19 NONAME ; int MmsConformanceCheck::qt_metacall(enum QMetaObject::Call, int, void * *) - ?getSmsMsgSize@MsgSendUtil@@AAEHAAVConvergedMessage@@@Z @ 20 NONAME ; int MsgSendUtil::getSmsMsgSize(class ConvergedMessage &) - ?tr@MsgSendUtil@@SA?AVQString@@PBD0H@Z @ 21 NONAME ; class QString MsgSendUtil::tr(char const *, char const *, int) - ?validateMsgForForward@MmsConformanceCheck@@QAE_NH@Z @ 22 NONAME ; bool MmsConformanceCheck::validateMsgForForward(int) + ?deleteVCardFromTemp@MsgContactsUtil@@CAXABVQString@@@Z @ 2 NONAME ; void MsgContactsUtil::deleteVCardFromTemp(class QString const &) + ??1MmsConformanceCheck@@UAE@XZ @ 3 NONAME ; MmsConformanceCheck::~MmsConformanceCheck(void) + ?mediaDurationL@MsgMediaUtil@@AAEHABVTDesC16@@@Z @ 4 NONAME ; int MsgMediaUtil::mediaDurationL(class TDesC16 const &) + ??0MsgMediaUtil@@QAE@XZ @ 5 NONAME ; MsgMediaUtil::MsgMediaUtil(void) + ?trUtf8@MmsConformanceCheck@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString MmsConformanceCheck::trUtf8(char const *, char const *) + ?qt_metacast@MsgSendUtil@@UAEPAXPBD@Z @ 7 NONAME ; void * MsgSendUtil::qt_metacast(char const *) + ?validateService@MsgSendUtil@@AAE_NPAVUniEditorPluginInterface@@_N@Z @ 8 NONAME ; bool MsgSendUtil::validateService(class UniEditorPluginInterface *, bool) + ?showPopup@MmsConformanceCheck@@AAEXABVQString@@@Z @ 9 NONAME ; void MmsConformanceCheck::showPopup(class QString const &) + ??0MsgSendUtil@@QAE@PAVQObject@@@Z @ 10 NONAME ; MsgSendUtil::MsgSendUtil(class QObject *) + ?metaObject@MsgSendUtil@@UBEPBUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const * MsgSendUtil::metaObject(void) const + ?longestEmailAddressSize@MsgSendUtil@@AAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 12 NONAME ; int MsgSendUtil::longestEmailAddressSize(class QList) + ?getStaticMetaObject@MmsConformanceCheck@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & MmsConformanceCheck::getStaticMetaObject(void) + ??_EMsgSendUtil@@UAE@I@Z @ 14 NONAME ; MsgSendUtil::~MsgSendUtil(unsigned int) + ?staticMetaObject@MsgSendUtil@@2UQMetaObject@@B @ 15 NONAME ; struct QMetaObject const MsgSendUtil::staticMetaObject + ??0MmsConformanceCheck@@QAE@XZ @ 16 NONAME ; MmsConformanceCheck::MmsConformanceCheck(void) + ?metaObject@MmsConformanceCheck@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * MmsConformanceCheck::metaObject(void) const + ?trUtf8@MsgSendUtil@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString MsgSendUtil::trUtf8(char const *, char const *) + ?getStaticMetaObject@MsgSendUtil@@SAABUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const & MsgSendUtil::getStaticMetaObject(void) + ?qt_metacall@MmsConformanceCheck@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 20 NONAME ; int MmsConformanceCheck::qt_metacall(enum QMetaObject::Call, int, void * *) + ?getSmsMsgSize@MsgSendUtil@@AAEHAAVConvergedMessage@@@Z @ 21 NONAME ; int MsgSendUtil::getSmsMsgSize(class ConvergedMessage &) + ?tr@MsgSendUtil@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString MsgSendUtil::tr(char const *, char const *, int) ?checkMaxMsgSizeLimit@MsgSendUtil@@AAE_NAAVConvergedMessage@@@Z @ 23 NONAME ; bool MsgSendUtil::checkMaxMsgSizeLimit(class ConvergedMessage &) ?trUtf8@MmsConformanceCheck@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString MmsConformanceCheck::trUtf8(char const *, char const *, int) ?tr@MmsConformanceCheck@@SA?AVQString@@PBD0H@Z @ 25 NONAME ; class QString MmsConformanceCheck::tr(char const *, char const *, int) @@ -28,16 +28,18 @@ ?send@MsgSendUtil@@QAEHAAVConvergedMessage@@@Z @ 27 NONAME ; int MsgSendUtil::send(class ConvergedMessage &) ?trUtf8@MsgSendUtil@@SA?AVQString@@PBD0H@Z @ 28 NONAME ; class QString MsgSendUtil::trUtf8(char const *, char const *, int) ?checkMaxRecipientCount@MsgSendUtil@@AAE_NAAVConvergedMessage@@@Z @ 29 NONAME ; bool MsgSendUtil::checkMaxRecipientCount(class ConvergedMessage &) - ?getMmsMsgSize@MsgSendUtil@@AAEHAAVConvergedMessage@@@Z @ 30 NONAME ; int MsgSendUtil::getMmsMsgSize(class ConvergedMessage &) - ?onDialogInsertMedia@MmsConformanceCheck@@AAEXPAVHbAction@@@Z @ 31 NONAME ; void MmsConformanceCheck::onDialogInsertMedia(class HbAction *) - ?checkModeForInsert@MmsConformanceCheck@@QAEHABVQString@@_N@Z @ 32 NONAME ; int MmsConformanceCheck::checkModeForInsert(class QString const &, bool) - ?qt_metacast@MmsConformanceCheck@@UAEPAXPBD@Z @ 33 NONAME ; void * MmsConformanceCheck::qt_metacast(char const *) - ?tr@MmsConformanceCheck@@SA?AVQString@@PBD0@Z @ 34 NONAME ; class QString MmsConformanceCheck::tr(char const *, char const *) - ?staticMetaObject@MmsConformanceCheck@@2UQMetaObject@@B @ 35 NONAME ; struct QMetaObject const MmsConformanceCheck::staticMetaObject - ?saveToDrafts@MsgSendUtil@@QAEJAAVConvergedMessage@@@Z @ 36 NONAME ; long MsgSendUtil::saveToDrafts(class ConvergedMessage &) + ?copyVCardToTemp@MsgContactsUtil@@CA?AVQString@@ABV2@@Z @ 30 NONAME ; class QString MsgContactsUtil::copyVCardToTemp(class QString const &) + ?getMmsMsgSize@MsgSendUtil@@AAEHAAVConvergedMessage@@@Z @ 31 NONAME ; int MsgSendUtil::getMmsMsgSize(class ConvergedMessage &) + ?onDialogInsertMedia@MmsConformanceCheck@@AAEXPAVHbAction@@@Z @ 32 NONAME ; void MmsConformanceCheck::onDialogInsertMedia(class HbAction *) + ?checkModeForInsert@MmsConformanceCheck@@QAEHABVQString@@_N@Z @ 33 NONAME ; int MmsConformanceCheck::checkModeForInsert(class QString const &, bool) + ?qt_metacast@MmsConformanceCheck@@UAEPAXPBD@Z @ 34 NONAME ; void * MmsConformanceCheck::qt_metacast(char const *) + ?tr@MmsConformanceCheck@@SA?AVQString@@PBD0@Z @ 35 NONAME ; class QString MmsConformanceCheck::tr(char const *, char const *) + ?staticMetaObject@MmsConformanceCheck@@2UQMetaObject@@B @ 36 NONAME ; struct QMetaObject const MmsConformanceCheck::staticMetaObject ?tr@MsgSendUtil@@SA?AVQString@@PBD0@Z @ 37 NONAME ; class QString MsgSendUtil::tr(char const *, char const *) - ?mediaDuration@MsgMediaUtil@@QAE?AVQString@@ABV2@@Z @ 38 NONAME ; class QString MsgMediaUtil::mediaDuration(class QString const &) - ??_EMmsConformanceCheck@@UAE@I@Z @ 39 NONAME ; MmsConformanceCheck::~MmsConformanceCheck(unsigned int) - ??1MsgSendUtil@@UAE@XZ @ 40 NONAME ; MsgSendUtil::~MsgSendUtil(void) - ?qt_metacall@MsgSendUtil@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 41 NONAME ; int MsgSendUtil::qt_metacall(enum QMetaObject::Call, int, void * *) + ?saveToDrafts@MsgSendUtil@@QAEJAAVConvergedMessage@@@Z @ 38 NONAME ; long MsgSendUtil::saveToDrafts(class ConvergedMessage &) + ?launchVCardViewer@MsgContactsUtil@@SA_NABVQString@@@Z @ 39 NONAME ; bool MsgContactsUtil::launchVCardViewer(class QString const &) + ?mediaDuration@MsgMediaUtil@@QAE?AVQString@@ABV2@@Z @ 40 NONAME ; class QString MsgMediaUtil::mediaDuration(class QString const &) + ??_EMmsConformanceCheck@@UAE@I@Z @ 41 NONAME ; MmsConformanceCheck::~MmsConformanceCheck(unsigned int) + ??1MsgSendUtil@@UAE@XZ @ 42 NONAME ; MsgSendUtil::~MsgSendUtil(void) + ?qt_metacall@MsgSendUtil@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 43 NONAME ; int MsgSendUtil::qt_metacall(enum QMetaObject::Call, int, void * *) diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/bwins/unifiededitoru.def --- a/messagingapp/msgui/bwins/unifiededitoru.def Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/bwins/unifiededitoru.def Fri Jun 11 13:35:48 2010 +0300 @@ -37,28 +37,29 @@ ?vkbOpened@MsgUnifiedEditorView@@AAEXXZ @ 36 NONAME ; void MsgUnifiedEditorView::vkbOpened(void) ?ScaleImageL@CUniImageProcessor@@QAEXAAVRFile@@AAPAVCFbsBitmap@@1AAVTSize@@H@Z @ 37 NONAME ; void CUniImageProcessor::ScaleImageL(class RFile &, class CFbsBitmap * &, class CFbsBitmap * &, class TSize &, int) ?addMenu@MsgUnifiedEditorView@@AAEXXZ @ 38 NONAME ; void MsgUnifiedEditorView::addMenu(void) - ?initView@MsgUnifiedEditorView@@AAEXXZ @ 39 NONAME ; void MsgUnifiedEditorView::initView(void) - ??_EMsgUnifiedEditorView@@UAE@I@Z @ 40 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(unsigned int) - ??1MsgUnifiedEditorView@@UAE@XZ @ 41 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(void) - ?setAttachOptionEnabled@MsgUnifiedEditorView@@AAEXW4TBE_AttachOption@1@_N@Z @ 42 NONAME ; void MsgUnifiedEditorView::setAttachOptionEnabled(enum MsgUnifiedEditorView::TBE_AttachOption, bool) - ?hideChrome@MsgUnifiedEditorView@@AAEX_N@Z @ 43 NONAME ; void MsgUnifiedEditorView::hideChrome(bool) - ?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 44 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *) - ?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 45 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *) - ?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@AAVRFile@@ABVTSize@@ABVTDesC8@@H@Z @ 46 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class RFile &, class TSize const &, class TDesC8 const &, int) - ?getStaticMetaObject@MsgUnifiedEditorView@@SAABUQMetaObject@@XZ @ 47 NONAME ; struct QMetaObject const & MsgUnifiedEditorView::getStaticMetaObject(void) - ?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 48 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *, int) - ?populateContentIntoEditor@MsgUnifiedEditorView@@AAEXABVConvergedMessage@@@Z @ 49 NONAME ; void MsgUnifiedEditorView::populateContentIntoEditor(class ConvergedMessage const &) + ?enableSendButton@MsgUnifiedEditorView@@AAEX_N@Z @ 39 NONAME ; void MsgUnifiedEditorView::enableSendButton(bool) + ?initView@MsgUnifiedEditorView@@AAEXXZ @ 40 NONAME ; void MsgUnifiedEditorView::initView(void) + ??_EMsgUnifiedEditorView@@UAE@I@Z @ 41 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(unsigned int) + ??1MsgUnifiedEditorView@@UAE@XZ @ 42 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(void) + ?setAttachOptionEnabled@MsgUnifiedEditorView@@AAEXW4TBE_AttachOption@1@_N@Z @ 43 NONAME ; void MsgUnifiedEditorView::setAttachOptionEnabled(enum MsgUnifiedEditorView::TBE_AttachOption, bool) + ?hideChrome@MsgUnifiedEditorView@@AAEX_N@Z @ 44 NONAME ; void MsgUnifiedEditorView::hideChrome(bool) + ?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 45 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *) + ?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 46 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *) + ?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@AAVRFile@@ABVTSize@@ABVTDesC8@@H@Z @ 47 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class RFile &, class TSize const &, class TDesC8 const &, int) + ?getStaticMetaObject@MsgUnifiedEditorView@@SAABUQMetaObject@@XZ @ 48 NONAME ; struct QMetaObject const & MsgUnifiedEditorView::getStaticMetaObject(void) + ?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 49 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *, int) ?send@MsgUnifiedEditorView@@AAEXXZ @ 50 NONAME ; void MsgUnifiedEditorView::send(void) ?Reset@CUniImageProcessor@@QAEXXZ @ 51 NONAME ; void CUniImageProcessor::Reset(void) - ?openDraftsMessage@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 52 NONAME ; void MsgUnifiedEditorView::openDraftsMessage(class QList const &) - ?addToolBar@MsgUnifiedEditorView@@AAEXXZ @ 53 NONAME ; void MsgUnifiedEditorView::addToolBar(void) - ?contactsFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 54 NONAME ; void MsgUnifiedEditorView::contactsFetched(class QVariant const &) - ?removeAttachmentContainer@MsgUnifiedEditorView@@AAEXXZ @ 55 NONAME ; void MsgUnifiedEditorView::removeAttachmentContainer(void) - ?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 56 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *, int) - ?onDialogDeleteMsg@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 57 NONAME ; void MsgUnifiedEditorView::onDialogDeleteMsg(class HbAction *) - ??0MsgUnifiedEditorView@@QAE@PAVQGraphicsItem@@@Z @ 58 NONAME ; MsgUnifiedEditorView::MsgUnifiedEditorView(class QGraphicsItem *) - ?fetchContacts@MsgUnifiedEditorView@@AAEXXZ @ 59 NONAME ; void MsgUnifiedEditorView::fetchContacts(void) - ?deleteMessage@MsgUnifiedEditorView@@AAEXXZ @ 60 NONAME ; void MsgUnifiedEditorView::deleteMessage(void) - ?addAttachments@MsgUnifiedEditorView@@AAEXVQStringList@@@Z @ 61 NONAME ; void MsgUnifiedEditorView::addAttachments(class QStringList) - ?deactivateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 62 NONAME ; void MsgUnifiedEditorView::deactivateInputBlocker(void) + ?populateContentIntoEditor@MsgUnifiedEditorView@@AAEXABVConvergedMessage@@_N@Z @ 52 NONAME ; void MsgUnifiedEditorView::populateContentIntoEditor(class ConvergedMessage const &, bool) + ?openDraftsMessage@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 53 NONAME ; void MsgUnifiedEditorView::openDraftsMessage(class QList const &) + ?addToolBar@MsgUnifiedEditorView@@AAEXXZ @ 54 NONAME ; void MsgUnifiedEditorView::addToolBar(void) + ?contactsFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 55 NONAME ; void MsgUnifiedEditorView::contactsFetched(class QVariant const &) + ?removeAttachmentContainer@MsgUnifiedEditorView@@AAEXXZ @ 56 NONAME ; void MsgUnifiedEditorView::removeAttachmentContainer(void) + ?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 57 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *, int) + ?onDialogDeleteMsg@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 58 NONAME ; void MsgUnifiedEditorView::onDialogDeleteMsg(class HbAction *) + ??0MsgUnifiedEditorView@@QAE@PAVQGraphicsItem@@@Z @ 59 NONAME ; MsgUnifiedEditorView::MsgUnifiedEditorView(class QGraphicsItem *) + ?fetchContacts@MsgUnifiedEditorView@@AAEXXZ @ 60 NONAME ; void MsgUnifiedEditorView::fetchContacts(void) + ?deleteMessage@MsgUnifiedEditorView@@AAEXXZ @ 61 NONAME ; void MsgUnifiedEditorView::deleteMessage(void) + ?addAttachments@MsgUnifiedEditorView@@AAEXVQStringList@@@Z @ 62 NONAME ; void MsgUnifiedEditorView::addAttachments(class QStringList) + ?deactivateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 63 NONAME ; void MsgUnifiedEditorView::deactivateInputBlocker(void) diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/bwins/unifiedvieweru.def --- a/messagingapp/msgui/bwins/unifiedvieweru.def Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/bwins/unifiedvieweru.def Fri Jun 11 13:35:48 2010 +0300 @@ -5,19 +5,18 @@ ?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 *) - ??0UnifiedViewer@@QAE@HPAVQGraphicsItem@@@Z @ 7 NONAME ; UnifiedViewer::UnifiedViewer(int, class QGraphicsItem *) - ?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) + ?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 *) - ?validateMsgForForward@UnifiedViewer@@AAE_NXZ @ 15 NONAME ; bool UnifiedViewer::validateMsgForForward(void) - ?getStaticMetaObject@UnifiedViewer@@SAABUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const & UnifiedViewer::getStaticMetaObject(void) + ?getStaticMetaObject@UnifiedViewer@@SAABUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const & UnifiedViewer::getStaticMetaObject(void) + ??0UnifiedViewer@@QAE@HHPAVQGraphicsItem@@@Z @ 16 NONAME ; UnifiedViewer::UnifiedViewer(int, int, class QGraphicsItem *) ?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) - ?onDialogDeleteMsg@UnifiedViewer@@AAEXPAVHbAction@@@Z @ 21 NONAME ; void UnifiedViewer::onDialogDeleteMsg(class HbAction *) diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/conversationview.pro --- a/messagingapp/msgui/conversationview/conversationview.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/conversationview.pro Fri Jun 11 13:35:48 2010 +0300 @@ -21,7 +21,7 @@ inc \ ../inc \ src - + INCLUDEPATH += . INCLUDEPATH += ../../../inc INCLUDEPATH += ../msguiutils/inc @@ -37,6 +37,7 @@ INCLUDEPATH += ../../msgutils/unidatamodel/univcaldataplugin/inc CONFIG += hb +HB += hbfeedback QT += sql TARGET.UID3 = 0x20024322 @@ -95,9 +96,6 @@ -lgsmu \ -lsmcm \ -leditorgenutils \ - -lthumbnailmanagerqt \ - -lfbscli \ - -lestor \ - -lsqldb \ + -lthumbnailmanagerqt \ -lxqsettingsmanager diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h --- a/messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -25,14 +25,13 @@ class HbIconItem; class HbTextItem; class HbIcon; -class QGraphicsSceneMouseEvent; -//class HbGestureSceneFilter; class ThumbnailManager; #include "convergedmessageaddress.h" /** - * This class is a custom layout widget for Contact Card layout. + * @class MsgContactCardWidget + * @brief This class is a custom layout widget for Contact Card layout. */ class MsgContactCardWidget: public HbWidget { @@ -85,27 +84,14 @@ */ void clearContent(); - /** - * for tactile feed back. - * Depricated - */ - // HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const; +protected: /** - * To connect/disconnect clicked signal + * Event handler for gesture events. + * Reimplemented from HbWidgetBase. + * @see HbWidgetBase */ - void connectSignals(bool yes); - -protected: - /** - * reimplemented from base class. - */ - virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); - - /** - * reimplemented from base class. - */ - virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + virtual void gestureEvent(QGestureEvent *event); private: @@ -113,27 +99,23 @@ * Initialization function. */ void init(); - + /** Helper method to get contact id against phone number. * @param value phone number. */ int resolveContactId(const QString& value); /** - * Helper method to set back ground. + * Handles pressed state. */ - void setBackGround(const QString& bg); + void setPressed(bool pressed); private slots: + /** * show longpress menu for attachment object */ - void handleLongPress(QPointF position); - - /** - * Helper method to initialize gesture. - */ - void initGesture(); + void handleLongPress(const QPointF &position); /** * Slot for handling valid returns from the framework. @@ -170,26 +152,29 @@ * Called after service request is completed. */ void onServiceRequestCompleted(); - + /** * Slot hit when the thumbnail is ready. */ void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error); -signals: /** - * Emitted when contact card is short tapped. + * Ignore gesture events. */ - void clicked(); + void ignoreSignals(bool yes); + + /** + * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture + * events back to back. + */ + void regrabGesture(); private: - // Data - /** - * To supress short tap if long tap triggered. + * Bool variable on which gesture events are accepted/ignored. */ - bool mMenuShown; + bool mIgnoreEvents; /** * Contact Number for the conversation @@ -220,11 +205,6 @@ HbTextItem *mAddressTextItem; /** - * gesture filter for long press. - */ - // HbGestureSceneFilter* mGestureFilter; - - /** * ThumbnailManager * Own. */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/inc/msgconversationbaseview.h --- a/messagingapp/msgui/conversationview/inc/msgconversationbaseview.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/inc/msgconversationbaseview.h Fri Jun 11 13:35:48 2010 +0300 @@ -1,20 +1,19 @@ /* -* 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:Conversation Base view. + * 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:Conversation Base view. + * + */ #ifndef MSG_CONVERSATION_VIEW_INTERFACE_H #define MSG_CONVERSATION_VIEW_INTERFACE_H @@ -36,16 +35,16 @@ class XQSettingsManager; class XQPublishAndSubscribeUtils; -class CONVERSATION_VIEW_EXPORT MsgConversationBaseView : public MsgBaseView - { - Q_OBJECT +class CONVERSATION_VIEW_EXPORT MsgConversationBaseView: public MsgBaseView +{ +Q_OBJECT public: /** * Constructor */ - MsgConversationBaseView(QGraphicsItem* parent=0); + MsgConversationBaseView(QGraphicsItem* parent = 0); /** * Destructor @@ -72,51 +71,51 @@ * Saves the editors content in cv to drafts */ void saveContentToDrafts(); - + /** * conversationId * Get the conversationId */ - qint64 conversationId(); + qint64 conversationId(); -public slots: +public slots: /** * Close the conversation view * This slot is triggered when user presses back(seconday sofykey) */ void closeConversationView(); - + /** * Mark messages as read * Slot is triiggered when replying started */ void markMessagesAsRead(); - + /** * Publish the conversation id based on the flag. * @param setId if true previous conversation id * will be published else -1 will be published. */ void setPSCVId(bool setId); - + private slots: - /** - * Slot for delayed construction - */ + /** + * Slot for delayed construction + */ void doDelayedConstruction(); - - /** - * Hides chrome when itu-t is up - */ + + /** + * Hides chrome when itu-t is up + */ void hideChrome(bool hide); - - /** + + /** * Slot for handling valid returns from the framework. * * @param result const QVariant& */ void handleOk(const QVariant& result); - + /** * Slot for handling errors. Error ids are provided as * 32-bit integers. @@ -126,58 +125,56 @@ /** * Slot for handling the timer expiry event fired from view reay indication - */ + */ void handleViewReady(); - - signals: - /** - * Signal emitted when the conversation view is closed. - */ - void conversationViewClosed(); - -private : + +signals: + /** + * Signal emitted when the conversation view is closed. + */ + void conversationViewClosed(); + +private: /** * Create and initialise the view */ void initView(); - + private: - - /** + + /** * Conversation ID */ qint64 mConversationId; - + /** * MsgConversationView, main view class * Owned */ - MsgConversationView *mConversationView; - + MsgConversationView *mConversationView; + /** * Contact card widget. */ MsgContactCardWidget* mContactCard; - + /** * Main layout. */ QGraphicsLinearLayout* mMainLayout; - - /** + + /** * Object of XQSettingsKey. - */ + */ XQSettingsKey mCVIdkey; /** * mSettingsManager * Instance of the XQSettingsManager * Own. - */ - XQSettingsManager* mSettingsManager; - - }; + */ + XQSettingsManager* mSettingsManager; +}; #endif // MSG_CONVERSATION_VIEW_INTERFACE_H - // EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/inc/msgconversationview.h --- a/messagingapp/msgui/conversationview/inc/msgconversationview.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/inc/msgconversationview.h Fri Jun 11 13:35:48 2010 +0300 @@ -102,6 +102,22 @@ */ void onDialogSaveTone(HbAction* action); + /** + * This slot is called when the orientation is changed + * @param newOrientation orientation + */ + void onOrientationChanged(Qt::Orientation newOrientation); + + /** + * This slot is called when the orientation is about to bechanged + */ + void onOrientationAboutToBeChanged(); + + /** + * This slot is called when the view is successfully added to main window + */ + void onViewReady(); + private: /** @@ -181,15 +197,6 @@ * @see ConvergedMessage::MessageType */ void addDownloadItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu); - - /** - * Validates if message can be forwarded - * @param messageType - * @param messageId - * @return true if message can be forwarded - * false if message cant be forwarded - */ - bool validateMsgForForward(int &messageType,qint32 &messageId); /** * Launches the BT message display service. @@ -328,10 +335,11 @@ */ void replyStarted(); - /** - * This signal is emitted when vkb is open. - */ - void hideChrome(bool); + /** + * This signal is emitted when vkb is open/closed. + * @param state True if keypad is opened else false. + */ + void vkbOpened(bool state); private slots: /** @@ -410,11 +418,6 @@ */ QGraphicsLinearLayout *mMainLayout; - /** - * Flag to track if item has been long pressed. - * TODO: Remove it, once unique longpress and click event signal released in week16 - */ - bool mItemLongPressed; /* * Instance of VKB */ @@ -425,6 +428,11 @@ */ bool mVkbopened; + /** + * variable holding the visible model index + */ + QModelIndex mVisibleIndex; + }; #endif // MSG_CONVERSATION_VIEW_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/inc/msgconversationviewitem.h --- a/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h Fri Jun 11 13:35:48 2010 +0300 @@ -94,12 +94,19 @@ /* * Update item with sms content */ - void updateSmsTypeItem(const QModelIndex& index,int messageSubType = ConvergedMessage::None); - + void updateSmsTypeItem(const QModelIndex& index, int messageSubType = + ConvergedMessage::None); + /* * Update item with mms type content */ - void updateMmsTypeItem(const QModelIndex& index, int messageType,int messageSubType); + void updateMmsTypeItem(const QModelIndex& index, int messageType, + int messageSubType); + + /* + * Initializes the msgconverstionviewitem + */ + void init(); protected: @@ -125,10 +132,17 @@ MsgConversationWidget *mConversation; /** + * Graphics Item to hold message incoming state. + * Applicable for notification + * Owned + */ + HbIconItem *mIncomingMsgStateIconItem; + + /** * Graphics Item to hold message sending state. * Owned */ - HbIconItem *mMessageStateIconItem; + HbIconItem *mOutgoingMsgStateIconItem; }; #endif // MSG_CONVERSATION_VIEW_ITEM_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/inc/msgconversationwidget.h --- a/messagingapp/msgui/conversationview/inc/msgconversationwidget.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/inc/msgconversationwidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -20,6 +20,7 @@ // SYSTEM INCLUDES #include +#include // FORWORD DECLARATIONS class HbFrameItem; @@ -86,10 +87,10 @@ void setBodyText(const QString &bodyText); /** - * Set preview icon path for this widget - * @param QString + * Set preview icon for this widget + * @param HbIcon, preview-icon */ - void setPreviewIconPath(const QString& filePath,int msgId); + void setPreviewIcon(HbIcon& icon); /** * Set priority property diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget.css --- a/messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget.css Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget.css Fri Jun 11 13:35:48 2010 +0300 @@ -35,12 +35,3 @@ text-line-count-min:1; text-line-count-max:1; } - -MsgContactCardWidget::backgroundFrame -{ - zvalue:-1; - left:0un; - top:0un; - right:0un; - bottom:0un; -} diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget.widgetml --- a/messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget.widgetml Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget.widgetml Fri Jun 11 13:35:48 2010 +0300 @@ -10,6 +10,5 @@ - \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget_color.css --- a/messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget_color.css Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgcontactcardwidget_color.css Fri Jun 11 13:35:48 2010 +0300 @@ -1,5 +1,10 @@ -MsgContactCardWidget::addressText +MsgContactCardWidget[state="normal"]::addressText { color:var(qtc_groupbox_normal); } + +MsgContactCardWidget[state="pressed"]::addressText +{ + color:var(qtc_groupbox_pressed); +} diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/resources/layouts/msgconversationviewitem.css --- a/messagingapp/msgui/conversationview/resources/layouts/msgconversationviewitem.css Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgconversationviewitem.css Fri Jun 11 13:35:48 2010 +0300 @@ -1,28 +1,20 @@ -MsgConversationViewItem[isIncoming="true"] +MsgConversationViewItem { - layout:layout-incoming; + layout:layout-conversation; pref-height:-1; pref-width:-1; size-policy-vertical:minimum-expanding; } -MsgConversationViewItem[isIncoming="false"] +MsgConversationViewItem::msgconvwidget { - layout:layout-outgoing; - pref-height:-1; - pref-width:-1; - size-policy-vertical:minimum-expanding; -} - -MsgConversationViewItem[isIncoming="true"]::msgconvwidget -{ - left:-var(hb-param-margin-gene-left); + left:-var(hb-param-margin-gene-middle-horizontal); top:0.0un; right:var(hb-param-margin-gene-middle-horizontal); bottom:0.0un; } -MsgConversationViewItem[isIncoming="true"]::msgStateIcon +MsgConversationViewItem::msgStateIconIncoming { right:var(hb-param-margin-gene-right); size-policy:fixed fixed; @@ -31,15 +23,7 @@ pref-width:var(hb-param-graphic-size-primary-small); } -MsgConversationViewItem[isIncoming="false"]::msgconvwidget -{ - top:0.0un; - right:var(hb-param-margin-gene-right); - bottom:0.0un; - left:-var(hb-param-margin-gene-middle-horizontal); -} - -MsgConversationViewItem[isIncoming="false"]::msgStateIcon +MsgConversationViewItem::msgStateIconOutgoing { left:-var(hb-param-margin-gene-left); size-policy:fixed fixed; diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/resources/layouts/msgconversationviewitem.widgetml --- a/messagingapp/msgui/conversationview/resources/layouts/msgconversationviewitem.widgetml Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgconversationviewitem.widgetml Fri Jun 11 13:35:48 2010 +0300 @@ -1,24 +1,14 @@ - - - + + + + + + - + - + - - - - - - - - - - - - - diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.css --- a/messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.css Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.css Fri Jun 11 13:35:48 2010 +0300 @@ -86,7 +86,6 @@ left:-var(hb-param-margin-gene-left); top:-var(hb-param-margin-gene-top); bottom:var(hb-param-margin-gene-middle-vertical); - right:var(hb-param-margin-gene-middle-horizontal); text-align:left; text-height:var(hb-param-text-height-primary); font-variant:primary; @@ -115,7 +114,8 @@ MsgConversationWidget::attachment { - right:1.0un; + right:var(hb-param-margin-gene-right); + left:-var(hb-param-margin-gene-middle-horizontal); center-vertical:0.0un; aspect-ratio:ignore; size-policy:fixed fixed; @@ -127,7 +127,7 @@ MsgConversationWidget::priority { - right:0.5un; + left:-var(hb-param-margin-gene-middle-horizontal); center-vertical:0.0un; aspect-ratio:ignore; size-policy:fixed fixed; @@ -142,13 +142,14 @@ left:-var(hb-param-margin-gene-left); right:1.0un; bottom:var(hb-param-margin-gene-middle-vertical); - aspect-ratio:keep; + /*aspect-ratio:keep;*/ /*max-width:var(bubble_width);*/ - max-width:41.36un; - max-height:31.02un; + /*max-width:41.36un; + max-height:31.02un;*/ /*max-height:var(bubble_height);*/ - min-width:16un; - min-height:12un; + /*min-width:16un; + min-height:12un;*/ + size-policy:fixed fixed; } MsgConversationWidget[hasImage="true"]::preview:landscape @@ -156,11 +157,12 @@ left:-var(hb-param-margin-gene-left); top:-var(hb-param-margin-gene-top); bottom:var(hb-param-margin-gene-bottom); - aspect-ratio:keep; + /*aspect-ratio:keep; max-width:41.36un; max-height:31.02un; min-width:16un; - min-height:12un; + min-height:12un;*/ + size-policy:fixed fixed; } /****************************** TIMESTAMP TEXT ********************************/ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.widgetml --- a/messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.widgetml Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.widgetml Fri Jun 11 13:35:48 2010 +0300 @@ -5,7 +5,7 @@ - + @@ -14,8 +14,7 @@ - - + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp --- a/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -21,27 +21,24 @@ #include #include #include -#include -//#include -//#include -#include +#include +#include #include #include #include #include #include -#include +#include #include #include #include -#include #include +#include #include // USER INCLUDES #include "conversationsenginedefines.h" -#include "debugtraces.h" #include "conversationsengine.h" #include "convergedmessage.h" #include "msgcontacthandler.h" @@ -49,9 +46,8 @@ // LOCAL CONSTANTS const QString DEFAULT_AVATAR_ICON("qtg_large_avatar"); const QString BT_ICON("qtg_large_bluetooth"); -const QString BACKGROUND_FRAME_NORMAL("qtg_fr_groupbox"); -const QString GROUPBOX_BG_FRAME_PRESSED("qtg_fr_groupbox_pressed"); - +const QString BG_FRAME_NORMAL("qtg_fr_groupbox_normal"); +const QString BG_FRAME_PRESSED("qtg_fr_groupbox_pressed"); // LOCALIZATION CONSTANTS #define LOC_RECEIVED_FILES hbTrId("txt_messaging_title_received_files") @@ -66,14 +62,10 @@ // @see header //--------------------------------------------------------------- MsgContactCardWidget::MsgContactCardWidget(QGraphicsItem *parent) : - HbWidget(parent), mMenuShown(false), mAvatarIconItem(NULL), mPresenceIconItem(NULL), - mAddressTextItem(NULL),mThumbnailManager(NULL) + HbWidget(parent), mIgnoreEvents(false), mAvatarIconItem(NULL), mPresenceIconItem(NULL), + mAddressTextItem(NULL), mThumbnailManager(NULL) { init(); - setBackGround(BACKGROUND_FRAME_NORMAL); - connectSignals(true); - - connect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(initGesture())); } //--------------------------------------------------------------- @@ -82,9 +74,6 @@ //--------------------------------------------------------------- MsgContactCardWidget::~MsgContactCardWidget() { - /* if (mGestureFilter) { - removeSceneEventFilter(mGestureFilter); - }*/ } //--------------------------------------------------------------- @@ -93,6 +82,12 @@ //--------------------------------------------------------------- void MsgContactCardWidget::init() { + this->setProperty("state", "normal"); + this->grabGesture(Qt::TapGesture); + + HbFrameItem *frameItem = new HbFrameItem(BG_FRAME_NORMAL, HbFrameDrawer::NinePieces, this); + this->setBackgroundItem(frameItem); + mAvatarIconItem = new HbIconItem(this); HbStyle::setItemName(mAvatarIconItem, "avatar"); @@ -194,16 +189,13 @@ setAddress(contactName); // Set Avatar - QList contactList = - MsgContactHandler::findContactList(mContactNumber); - + QList contactList = MsgContactHandler::findContactList(mContactNumber); + if (!contactList.isEmpty()) { - QList avatarDetails = - contactList.at(0).details (); - + QList avatarDetails = contactList.at(0).details (); + if (!avatarDetails.isEmpty()) { - mThumbnailManager->getThumbnail( - avatarDetails.at(0).imageUrl().toString()); + mThumbnailManager->getThumbnail(avatarDetails.at(0).imageUrl().toString()); } } @@ -223,78 +215,81 @@ } //--------------------------------------------------------------- -// MsgContactCardWidget::initGesture +// MsgContactCardWidget::gestureEvent // @see header file //--------------------------------------------------------------- -void MsgContactCardWidget::initGesture() +void MsgContactCardWidget::gestureEvent(QGestureEvent *event) { - // Create gesture filter - /* QGraphicsScene* sc = this->scene(); - mGestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this); - - // Add gestures for longpress - HbGesture* gestureLongpressed = new HbGesture(HbGesture::longpress, 5); - - mGestureFilter->addGesture(gestureLongpressed); - - connect(gestureLongpressed, SIGNAL(longPress(QPointF)), this, SLOT(handleLongPress(QPointF))); - - //install gesture filter. - this->installSceneEventFilter(mGestureFilter); - - disconnect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(initGesture()));*/ + HbTapGesture *tapGesture = qobject_cast (event->gesture(Qt::TapGesture)); + if (tapGesture) { + switch (tapGesture->state()) { + case Qt::GestureStarted: + { + // Trigger haptic feedback. + HbInstantFeedback::play(HbFeedback::Basic); + setPressed(true); + break; + } + case Qt::GestureUpdated: + { + if (HbTapGesture::TapAndHold == tapGesture->tapStyleHint()) { + // Handle longtap. + setPressed(false); + handleLongPress(tapGesture->scenePosition()); + } + break; + } + case Qt::GestureFinished: + { + HbInstantFeedback::play(HbFeedback::Basic); + if (HbTapGesture::Tap == tapGesture->tapStyleHint()) { + // Handle short tap. + setPressed(false); + openContactInfo(); + } + break; + } + case Qt::GestureCanceled: + { + HbInstantFeedback::play(HbFeedback::Basic); + setPressed(false); + break; + } + } + } + else { + HbWidget::gestureEvent(event); + } } //--------------------------------------------------------------- -// MsgContactCardWidget::mousePressEvent -// @see header file -//--------------------------------------------------------------- -void MsgContactCardWidget::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - mMenuShown = false; - - HbWidgetFeedback::triggered(this, Hb::InstantPressed); - - setBackGround(GROUPBOX_BG_FRAME_PRESSED); - - event->accept(); -} - -//--------------------------------------------------------------- -// MsgContactCardWidget::mouseReleaseEvent +// MsgContactCardWidget::setPressed // @see header file //--------------------------------------------------------------- -void MsgContactCardWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +void MsgContactCardWidget::setPressed(bool pressed) { - setBackGround(BACKGROUND_FRAME_NORMAL); - - if (this->rect().contains(event->pos()) && !mMenuShown) { - HbWidgetFeedback::triggered(this, Hb::InstantClicked); - emit clicked(); + HbFrameItem *frameItem = static_cast (this->backgroundItem()); + if (pressed) { + this->setProperty("state", "pressed"); + frameItem->frameDrawer().setFrameGraphicsName(BG_FRAME_PRESSED); } - - event->accept(); -} - -//--------------------------------------------------------------- -// MsgContactCardWidget::setBackGround -// @see header file -//--------------------------------------------------------------- -void MsgContactCardWidget::setBackGround(const QString& bg) -{ - HbFrameItem* backGround = new HbFrameItem(this); - backGround->frameDrawer().setFrameGraphicsName(bg); - backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - this->setBackgroundItem(backGround); - this->repolish(); + else { + this->setProperty("state", "normal"); + frameItem->frameDrawer().setFrameGraphicsName(BG_FRAME_NORMAL); + } } //--------------------------------------------------------------- // MsgContactCardWidget::handleLongPress // @see header file //--------------------------------------------------------------- -void MsgContactCardWidget::handleLongPress(QPointF position) +void MsgContactCardWidget::handleLongPress(const QPointF &position) { + // Check if events need to be ignored/accepted + if (mIgnoreEvents) { + return; + } + if (KBluetoothMsgsConversationId != ConversationsEngine::instance()->getCurrentConversationId()) { HbMenu* contextMenu = new HbMenu(); contextMenu->setDismissPolicy(HbPopup::TapAnywhere); @@ -311,32 +306,22 @@ } contextMenu->show(); - - mMenuShown = true; } } //--------------------------------------------------------------- -// MsgContactCardWidget::overrideFeedback -// @see header file -//--------------------------------------------------------------- -/*HbFeedback::InstantEffect MsgContactCardWidget::overrideFeedback(Hb::InstantInteraction interaction) const -{ - switch (interaction) { - case Hb::InstantPressed: - case Hb::InstantClicked: - return HbFeedback::Basic; - default: - return HbFeedback::None; - } -}*/ - -//--------------------------------------------------------------- // MsgContactCardWidget::openContactInfo // @see header //--------------------------------------------------------------- void MsgContactCardWidget::openContactInfo() { + this->ungrabGesture(Qt::TapGesture); + + // Check if events need to be ignored/accepted + if (mIgnoreEvents) { + return; + } + QString operation; QList args; if (KBluetoothMsgsConversationId != ConversationsEngine::instance()->getCurrentConversationId()) { @@ -373,6 +358,9 @@ request->send(); delete request; } + + //fire timer to regrab gesture after some delay. + QTimer::singleShot(300,this,SLOT(regrabGesture())); } //--------------------------------------------------------------- @@ -382,11 +370,9 @@ int MsgContactCardWidget::resolveContactId(const QString& value) { QString displayLabel; - - return MsgContactHandler::resolveContactDisplayName( - value, - displayLabel, - 0); + + int count; + return MsgContactHandler::resolveContactDisplayName(value, displayLabel, count); } //--------------------------------------------------------------- @@ -396,7 +382,7 @@ void MsgContactCardWidget::call() { //Launch dialer service - QString serviceName("com.nokia.services.telephony"); + QString serviceName("com.nokia.symbian.ICallDial"); QString operation("dial(QString)"); XQServiceRequest* serviceRequest = new XQServiceRequest(serviceName, operation, false); @@ -426,18 +412,15 @@ { Q_UNUSED(result) - QList matchingContacts = - MsgContactHandler::findContactList(mContactNumber); + QList matchingContacts = MsgContactHandler::findContactList(mContactNumber); if (!matchingContacts.isEmpty()) { setAddress(matchingContacts.at(0).displayLabel()); - - QList avatarDetails = - matchingContacts.at(0).details (); - + + QList avatarDetails = matchingContacts.at(0).details (); + if (!avatarDetails.isEmpty()) { - mThumbnailManager->getThumbnail( - avatarDetails.at(0).imageUrl().toString()); + mThumbnailManager->getThumbnail(avatarDetails.at(0).imageUrl().toString()); } } } @@ -482,17 +465,22 @@ setAvatar(HbIcon(DEFAULT_AVATAR_ICON)); } } + //--------------------------------------------------------------- -// MsgContactCardWidget::connectSignals +// MsgContactCardWidget::ignoreSignals // @see header //--------------------------------------------------------------- -void MsgContactCardWidget::connectSignals(bool yes) +void MsgContactCardWidget::ignoreSignals(bool yes) { - if (yes) { - connect(this, SIGNAL(clicked()), this, SLOT(openContactInfo())); - } - else { - disconnect(this, SIGNAL(clicked()), this, SLOT(openContactInfo())); - } + mIgnoreEvents = yes; +} + +//--------------------------------------------------------------- +// MsgContactCardWidget::regrabGesture +// @see header file +//--------------------------------------------------------------- +void MsgContactCardWidget::regrabGesture() +{ + this->grabGesture(Qt::TapGesture); } // EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp --- a/messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -50,12 +50,10 @@ // Constructor //--------------------------------------------------------------- MsgConversationBaseView::MsgConversationBaseView(QGraphicsItem* parent) : -MsgBaseView(parent), -mConversationId(-1), -mCVIdkey(XQSettingsKey::TargetPublishAndSubscribe,KMsgCVIdProperty, - KMsgCVIdKey) -{ - connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); + MsgBaseView(parent), mConversationId(-1), mCVIdkey(XQSettingsKey::TargetPublishAndSubscribe, + KMsgCVIdProperty, KMsgCVIdKey) +{ + connect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(doDelayedConstruction())); initView(); } @@ -64,7 +62,7 @@ // Destructor //--------------------------------------------------------------- MsgConversationBaseView::~MsgConversationBaseView() -{ +{ } //--------------------------------------------------------------- @@ -75,15 +73,14 @@ { ConversationsEngine::instance()->getConversations(convId); mConversationId = convId; - connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); - - // publsih conversation id - mSettingsManager->writeItemValue(mCVIdkey,(int)mConversationId); - - if(mConversationView) - { + connect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(doDelayedConstruction())); + + // publsih conversation id + mSettingsManager->writeItemValue(mCVIdkey, (int) mConversationId); + + if (mConversationView) { mConversationView->refreshView(); - } + } } //--------------------------------------------------------------- @@ -91,8 +88,8 @@ // create and initialise the conversationview //--------------------------------------------------------------- void MsgConversationBaseView::initView() - { - +{ + // Create header widget mContactCard = new MsgContactCardWidget(this); @@ -100,8 +97,7 @@ qreal spacing = HbDeviceProfile::profile(this).unitValue(); mMainLayout->setSpacing(spacing); - mMainLayout->setContentsMargins(CONTENT_MARGIN, CONTENT_MARGIN, - CONTENT_MARGIN, CONTENT_MARGIN); + mMainLayout->setContentsMargins(CONTENT_MARGIN, CONTENT_MARGIN, CONTENT_MARGIN, CONTENT_MARGIN); mMainLayout->addItem(mContactCard); @@ -114,25 +110,24 @@ mConversationView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - connect(mConversationView, SIGNAL(closeConversationView()), - this, SLOT(closeConversationView())); + connect(mConversationView, SIGNAL(closeConversationView()), this, SLOT(closeConversationView())); + + connect(mConversationView, SIGNAL(replyStarted()), this, SLOT(markMessagesAsRead())); - connect(mConversationView,SIGNAL(replyStarted()), - this,SLOT(markMessagesAsRead())); + connect(mConversationView, SIGNAL(switchView(const QVariantList&)), this, + SIGNAL(switchView(const QVariantList&))); - connect(mConversationView, SIGNAL(switchView(const QVariantList&)), - this, SIGNAL(switchView(const QVariantList&))); - - connect(mConversationView,SIGNAL(hideChrome(bool)),this,SLOT(hideChrome(bool))); + connect(mConversationView, SIGNAL(vkbOpened(bool)), this, SLOT(hideChrome(bool))); + connect(mConversationView, SIGNAL(vkbOpened(bool)), mContactCard, SLOT(ignoreSignals(bool))); this->setMenu(mConversationView->menu()); mMainLayout->addItem(mConversationView); this->setLayout(mMainLayout); - + mSettingsManager = new XQSettingsManager(this); - + } //--------------------------------------------------------------- @@ -141,7 +136,7 @@ //--------------------------------------------------------------- void MsgConversationBaseView::closeConversationView() { - markMessagesAsRead(); + markMessagesAsRead(); } //--------------------------------------------------------------- @@ -149,39 +144,36 @@ // Mark unread msgs in cv as read //--------------------------------------------------------------- void MsgConversationBaseView::markMessagesAsRead() - { - if( mConversationId >= 0) - { +{ + if (mConversationId >= 0) { ConversationsEngine::instance()->markConversationRead(mConversationId); - } } +} //--------------------------------------------------------------- // MsgConversationBaseView::saveContentToDrafts // saves the editors content to drafts //--------------------------------------------------------------- void MsgConversationBaseView::saveContentToDrafts() - { +{ bool result = false; - if( mConversationId >= 0) - { + if (mConversationId >= 0) { result = mConversationView->saveContentToDrafts(); - } - - if(result) - { + } + + if (result) { HbNotificationDialog::launchDialog(LOC_SAVED_TO_DRAFTS); - } } +} //--------------------------------------------------------------- // MsgConversationBaseView::conversationId // get the conversation ID //--------------------------------------------------------------- -qint64 MsgConversationBaseView::conversationId() - { - return mConversationId; - } +qint64 MsgConversationBaseView::conversationId() +{ + return mConversationId; +} //--------------------------------------------------------------- // MsgConversationBaseView::clearContent @@ -198,19 +190,19 @@ // //--------------------------------------------------------------- void MsgConversationBaseView::handleOk(const QVariant& result) - { +{ Q_UNUSED(result) - } +} //--------------------------------------------------------------- // MsgConversationBaseView::handleError // //--------------------------------------------------------------- void MsgConversationBaseView::handleError(int errorCode, const QString& errorMessage) - { +{ Q_UNUSED(errorMessage) Q_UNUSED(errorCode) - } +} //--------------------------------------------------------------- // MsgConversationBaseView::doDelayedConstruction @@ -218,49 +210,44 @@ //--------------------------------------------------------------- void MsgConversationBaseView::doDelayedConstruction() { - disconnect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); - QTimer::singleShot(50,this,SLOT(handleViewReady())); + disconnect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(doDelayedConstruction())); + QTimer::singleShot(50, this, SLOT(handleViewReady())); } - //--------------------------------------------------------------- // MsgConversationBaseView::handleViewReady // //--------------------------------------------------------------- void MsgConversationBaseView::handleViewReady() - { +{ ConversationsEngine::instance()->fetchMoreConversations(); - } +} //--------------------------------------------------------------- // MsgConversationBaseView::hideChrome // //--------------------------------------------------------------- void MsgConversationBaseView::hideChrome(bool hide) - { - if(hide) - { +{ + if (hide) { this->hideItems(Hb::StatusBarItem | Hb::TitleBarItem); this->setContentFullScreen(true); - - if(this->mainWindow()->orientation() == Qt::Horizontal) - { + + if (this->mainWindow()->orientation() == Qt::Horizontal) { mMainLayout->removeItem(mContactCard); mContactCard->hide(); - } } - else - { + } + else { this->showItems(Hb::StatusBarItem | Hb::TitleBarItem); this->setContentFullScreen(false); - - if(!mContactCard->isVisible()) - { - mMainLayout->insertItem(0,mContactCard); + + if (!mContactCard->isVisible()) { + mMainLayout->insertItem(0, mContactCard); mContactCard->show(); - } } } +} //--------------------------------------------------------------- // MsgConversationBaseView::setPSCVId @@ -268,11 +255,11 @@ //--------------------------------------------------------------- void MsgConversationBaseView::setPSCVId(bool setId) { - if(setId){ - mSettingsManager->writeItemValue(mCVIdkey,(int)mConversationId); + if (setId) { + mSettingsManager->writeItemValue(mCVIdkey, (int) mConversationId); } else { - mSettingsManager->writeItemValue(mCVIdkey,-1); + mSettingsManager->writeItemValue(mCVIdkey, -1); } } // EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/src/msgconversationview.cpp --- a/messagingapp/msgui/conversationview/src/msgconversationview.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/src/msgconversationview.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -24,11 +24,12 @@ #include #include #include -#include +#include #include #include #include #include +#include #include #include @@ -41,6 +42,7 @@ #include // USER INCLUDES +#include "msgcontactsutil.h" #include "msgsendutil.h" #include "msgconversationviewitem.h" #include "conversationsengine.h" @@ -62,7 +64,7 @@ #define LOC_COMMON_DELETE hbTrId("txt_common_menu_delete") #define LOC_COMMON_FORWARD hbTrId("txt_common_menu_forward") #define LOC_COMMON_DOWNLOAD hbTrId("txt_messaging_menu_download") -#define LOC_COMMON_SEND hbTrId("txt_common_menu_send") +#define LOC_COMMON_SEND hbTrId("txt_common_button_send") #define LOC_COMMON_SAVE hbTrId("txt_common_menu_save") #define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete") #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel") @@ -78,12 +80,10 @@ #define LOC_ADD_RECIPIENTS hbTrId("txt_messaging_opt_add_recipients") #define LOC_ADD_SUBJECT hbTrId("txt_messaging_opt_add_subject") -#define LOC_MSG_SEND_FAILED hbTrId("txt_messaging_dpopinfo_sending_failed") - +#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_SAVE_RINGTONE hbTrId("txt_conversations_dialog_save_ringing_tone") - - +#define LOC_CONTACT_SAVED hbTrId("txt_messaging_dpopinfo_contact_saved") const int INVALID_MSGID = -1; const int INVALID_CONVID = -1; @@ -102,10 +102,11 @@ mEditorWidget(NULL), mContactCardWidget(contactCardWidget), mSendUtil(NULL), - mItemLongPressed(false), mVkbHost(NULL), - mVkbopened(false) + mVkbopened(false), + mVisibleIndex() { + connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(onViewReady())); //create send utils mSendUtil = new MsgSendUtil(this); //initialize view @@ -152,6 +153,11 @@ connect(mConversationList, SIGNAL(activated(QModelIndex)), this, SLOT(openItem(QModelIndex))); + connect(this->mainWindow(), SIGNAL(aboutToChangeOrientation()), + this, SLOT(onOrientationAboutToBeChanged())); + + connect(this->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), + this, SLOT(onOrientationChanged(Qt::Orientation))); // Long tap list item connect(mConversationList, SIGNAL(longPressed(HbAbstractViewItem*, QPointF)), @@ -241,8 +247,6 @@ void MsgConversationView::longPressed(HbAbstractViewItem* viewItem, const QPointF& point) { - mItemLongPressed = true; - MsgConversationViewItem* item = qgraphicsitem_cast< MsgConversationViewItem *> (viewItem); @@ -266,11 +270,7 @@ contextMenu->show(); } - else - { - // For cases where the long tap check failed - mItemLongPressed = false; - } + } //--------------------------------------------------------------- @@ -296,6 +296,8 @@ void MsgConversationView::addSaveItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState) { + Q_UNUSED(sendingState) + int messageSubType = item->modelIndex().data(MessageSubType).toInt(); int direction = item->modelIndex().data(Direction).toInt(); if ((messageSubType == ConvergedMessage::RingingTone) && @@ -374,12 +376,18 @@ } qint32 messageId = item->modelIndex().data(ConvergedMsgId).toInt(); + qint32 messageProperty = item->modelIndex().data(MessageProperty).toInt(); + + bool canForwardMessage = true; + if (messageType == ConvergedMessage::Mms){ + canForwardMessage = (messageProperty & EPreviewForward)? true:false; + } if( ((sendingState == ConvergedMessage::SentState) || (sendingState == ConvergedMessage::Resend) || (sendingState == ConvergedMessage::Failed) || (direction == ConvergedMessage::Incoming) ) && - (validateMsgForForward(messageType,messageId)) ) + canForwardMessage) { HbAction *contextItem = contextMenu->addAction(LOC_COMMON_FORWARD); connect(contextItem, SIGNAL(triggered()),this, SLOT(forwardMessage())); @@ -536,11 +544,12 @@ //--------------------------------------------------------------- void MsgConversationView::fetchImages() { - QString interface("Image"); - QString operation("fetch(QVariantMap,QVariant)"); + QString service("photos"); + QString interface("com.nokia.symbian.IImageFetch"); + QString operation("fetch(void)"); XQAiwRequest* request = NULL; XQApplicationManager appManager; - request = appManager.create(interface, operation, true); // embedded + request = appManager.create(service,interface, operation, true); // embedded request->setSynchronous(true); // synchronous if(!request) { @@ -553,11 +562,6 @@ connect(request, SIGNAL(requestError(int,const QString&)), this, SLOT(serviceRequestError(int,const QString&))); - // Set arguments for request - QList args; - args << QVariantMap(); - args << QVariant(); - request->setArguments(args); // Make the request if (!request->send()) { @@ -814,14 +818,23 @@ { qint32 messageId = index.data(ConvergedMsgId).toLongLong(); - QString interface("com.nokia.services.btmsgdispservices.displaymsg"); + QList args; + QString serviceName("com.nokia.services.btmsgdispservices.displaymsg"); QString operation("displaymsg(int)"); + XQAiwRequest* request; + XQApplicationManager appManager; + request = appManager.create(serviceName, "displaymsg", operation, true); // embedded + + if ( request == NULL ) + { + return; + } - XQServiceRequest request(interface, operation, false); - - request << messageId; - - bool result = request.send(); + args << QVariant(messageId); + + request->setArguments(args); + request->send(); + delete request; } //--------------------------------------------------------------- @@ -861,49 +874,63 @@ //@see header //--------------------------------------------------------------- void MsgConversationView::openItem(const QModelIndex & index) - { +{ // Return if invalid index. if (!index.isValid() || mVkbopened) - { + { return; - } - - if(mItemLongPressed) - { - //reset the flag - mItemLongPressed = false; - return; - } + } int messageType = index.data(MessageType).toInt(); int messageSubType = index.data(MessageSubType).toInt(); + int messageId = index.data(ConvergedMsgId).toInt(); - if (ConvergedMessage::BioMsg == messageType) { - if (ConvergedMessage::RingingTone == messageSubType) { + if (ConvergedMessage::BioMsg == messageType) + { + if (ConvergedMessage::RingingTone == messageSubType) + { HbMessageBox::question(LOC_DIALOG_SAVE_RINGTONE, this, SLOT(onDialogSaveTone(HbAction*)), LOC_COMMON_SAVE, LOC_BUTTON_CANCEL); return; } else if(ConvergedMessage::Provisioning == messageSubType) - { + { int messageId = index.data(ConvergedMsgId).toInt(); handleProvisoningMsg(messageId); QList msgIdList; if(index.data(UnReadStatus).toInt()) - { + { msgIdList.clear(); msgIdList << messageId; ConversationsEngine::instance()->markMessagesRead(msgIdList); - } - return; } - // Unsupported messages - else if (ConvergedMessage::VCard == messageSubType - || ConvergedMessage::VCal == messageSubType) { + return; + } + else if(ConvergedMessage::VCard == messageSubType) + { + QString filepath = index.data(Attachments).toStringList().at(0); + bool result = MsgContactsUtil::launchVCardViewer(filepath); + if(result) + { + HbNotificationDialog::launchDialog(LOC_CONTACT_SAVED); + int messageId = index.data(ConvergedMsgId).toInt(); + QList msgIdList; + if(index.data(UnReadStatus).toInt()) + { + msgIdList.clear(); + msgIdList << messageId; + ConversationsEngine::instance()->markMessagesRead(msgIdList); + } + } + return; + } + else if(ConvergedMessage::VCal == messageSubType) + { return; } } - else if (ConvergedMessage::BT == messageType) { + else if (ConvergedMessage::BT == messageType) + { launchBtDisplayService(index); return; } @@ -929,7 +956,14 @@ } } - ConvergedMessage message; + int direction = index.data(Direction).toInt(); + + if (direction == ConvergedMessage::Outgoing && ConvergedMessage::Sms == messageType + && ConversationsEngine::instance()->getMsgSubType(messageId)== ConvergedMessage::NokiaService) + { + return; + } + // check whether message is in sending progress, then donot launch viewer. int location = index.data(MessageLocation).toInt(); int sendingState = index.data(SendingState).toInt(); @@ -951,7 +985,7 @@ (sendingState == ConvergedMessage::SentState)|| (sendingState == ConvergedMessage::Failed) || (sendingState == ConvergedMessage::Resend))) - {// do not launch viewer, show a note + {// do not launch viewer, show a note HbNotificationDialog* dlg = new HbNotificationDialog(); dlg->setFocusPolicy(Qt::NoFocus); QString text(tr("Message Locked")); @@ -960,69 +994,45 @@ dlg->setAttribute(Qt::WA_DeleteOnClose, true); dlg->show(); return; - } - - // message id - qint32 messageId = index.data(ConvergedMsgId).toLongLong(); - ConvergedMessageId msgId(messageId); - message.setMessageId(msgId); - - // contact Id - qint32 contactId = index.data(ContactId).toLongLong(); - - // message type - - message.setMessageType((ConvergedMessage::MessageType) messageType); - message.setMessageSubType((ConvergedMessage::MessageSubType) messageSubType); - - if (messageType == ConvergedMessage::Mms) - { - message.setSubject(index.data(Subject).toString()); - message.setPriority((ConvergedMessage::Priority) index.data( - MessagePriority).toInt()); - } - else if (messageType == ConvergedMessage::IM) - { - // add body text and send to the message for IM case - message.setBodyText(index.data(BodyText).toString()); - } - - // time stamp - message.setTimeStamp(index.data(TimeStamp).toLongLong()); - - //Message direction - message.setDirection((ConvergedMessage::Direction)index.data(Direction).toInt()); - - // conatct name as address - ConvergedMessageAddress address; - address.setAlias(mContactCardWidget->address().at(0)->alias()); - address.setAddress(mContactCardWidget->address().at(0)->address()); - message.addToRecipient(address); - - // Mark this message as read if its unread - QByteArray dataArray; - QDataStream messageStream - (&dataArray, QIODevice::WriteOnly | QIODevice::Append); - message.serialize(messageStream); - //if message unread, mark as read before opening view - QList msgIdList; - if(index.data(UnReadStatus).toInt()) - { + } + + + // contact Id + qint32 contactId = index.data(ContactId).toLongLong(); + + //if message unread, mark as read before opening view + QList msgIdList; + if(index.data(UnReadStatus).toInt()) + { msgIdList.clear(); msgIdList << messageId; ConversationsEngine::instance()->markMessagesRead(msgIdList); - } + } + + qint32 messageProperty = index.data(MessageProperty).toInt(); - //switch view - QVariantList param; - param << MsgBaseView::UNIVIEWER; // target view - param << MsgBaseView::CV; // source view + bool canForwardMessage = true; + if (messageType == ConvergedMessage::Mms){ + canForwardMessage = (messageProperty & EPreviewForward)? true:false; + } + + //switch view + QVariantList param; + param << MsgBaseView::UNIVIEWER; // target view + param << MsgBaseView::CV; // source view - param << contactId; - param << dataArray; - param << mMessageModel->rowCount(); - - emit switchView(param); + param << contactId; + param << messageId; + param << mMessageModel->rowCount(); + if (canForwardMessage == true) + { + param << 1; + } + else + { + param << 0; + } + emit switchView(param); } //--------------------------------------------------------------- @@ -1174,26 +1184,6 @@ } //--------------------------------------------------------------- -// MsgConversationView::validateMsgForForward -// @see header file -//--------------------------------------------------------------- -bool MsgConversationView::validateMsgForForward(int &messageType, - qint32 &messageId) -{ - bool retValue = true; - if (messageType == ConvergedMessage::Mms) - { - //Validate if the mms msg can be forwarded or not - MmsConformanceCheck* mmsConformanceCheck = new MmsConformanceCheck; - retValue = mmsConformanceCheck->validateMsgForForward(messageId); - - delete mmsConformanceCheck; - } - - return retValue; -} - -//--------------------------------------------------------------- // MsgConversationView::vkbOpened // @see header file //--------------------------------------------------------------- @@ -1201,9 +1191,7 @@ { mVkbopened = true; - mContactCardWidget->connectSignals(false); - - emit hideChrome(true); + emit vkbOpened(true); QRectF appRect = mVkbHost->applicationArea(); qreal spacing = 0.0; @@ -1229,9 +1217,7 @@ { mVkbopened = false; - mContactCardWidget->connectSignals(true); - - emit hideChrome(false); + emit vkbOpened(false); this->setMaximumHeight(-1); connect(mVkbHost,SIGNAL(keypadOpened()),this,SLOT(vkbOpened())); @@ -1251,27 +1237,25 @@ //--------------------------------------------------------------- // MsgConversationView::activateInputBlocker // @see header file -//-------------------------------------------------------------- +//--------------------------------------------------------------- void MsgConversationView::activateInputBlocker() - { - this->grabMouse(); - this->grabKeyboard(); - } +{ + mainWindow()->setInteractive(false); +} //--------------------------------------------------------------- // MsgConversationView::deactivateInputBlocker // @see header file -//-------------------------------------------------------------- +//--------------------------------------------------------------- void MsgConversationView::deactivateInputBlocker() - { - this->ungrabKeyboard(); - this->ungrabMouse(); - } +{ + mainWindow()->setInteractive(true); +} //--------------------------------------------------------------- // MsgConversationView::handleProvisoningMsg // @see header file -//-------------------------------------------------------------- +//--------------------------------------------------------------- void MsgConversationView::handleProvisoningMsg(int msgId) { QString messageId; @@ -1301,7 +1285,7 @@ //--------------------------------------------------------------- // MsgConversationView::onDialogSettingsLaunch // @see header file -//-------------------------------------------------------------- +//--------------------------------------------------------------- void MsgConversationView::onDialogSettingsLaunch(HbAction* action) { HbMessageBox *dlg = qobject_cast (sender()); @@ -1319,7 +1303,7 @@ //--------------------------------------------------------------- // MsgConversationView::onDialogdeleteMsg // @see header file -//-------------------------------------------------------------- +//--------------------------------------------------------------- void MsgConversationView::onDialogdeleteMsg(HbAction* action) { HbMessageBox *dlg = qobject_cast (sender()); @@ -1371,4 +1355,43 @@ } } +//--------------------------------------------------------------- +// MsgConversationView::onOrientationChanged +// @see header file +//--------------------------------------------------------------- +void MsgConversationView::onOrientationChanged(Qt::Orientation newOrientation) +{ + Q_UNUSED(newOrientation) + + // On orientation change always make the preserved index(last visible item) to be visible + if(mVisibleIndex.isValid()) + { + mConversationList->scrollTo(mVisibleIndex, HbAbstractItemView::PositionAtBottom); + mVisibleIndex = QModelIndex(); + } +} + +//--------------------------------------------------------------- +// MsgConversationView::onOrientationAboutToBeChanged +// @see header file +//--------------------------------------------------------------- +void MsgConversationView::onOrientationAboutToBeChanged() +{ + // Preserve the model index of the last visible item to be scrolled on orientation change + QListitems = mConversationList->visibleItems(); + if (items.count() > 0) { + mVisibleIndex = items.last()->modelIndex(); + } +} + +//--------------------------------------------------------------- +// MsgConversationView::onViewReady +// @see header file +//--------------------------------------------------------------- +void MsgConversationView::onViewReady() +{ + //Disconnect list View's signals, for avoiding execution of the default implementaion + disconnect(mainWindow(), SIGNAL(aboutToChangeOrientation()), mConversationList, 0); + disconnect(mainWindow(), SIGNAL(orientationChanged(Qt: rientation)), mConversationList, 0); +} // EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp --- a/messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -55,7 +55,7 @@ //--------------------------------------------------------------- MsgConversationViewItem::MsgConversationViewItem(QGraphicsItem* parent) : HbListViewItem(parent), mIncoming(false), mConversation(0), - mMessageStateIconItem(0) + mIncomingMsgStateIconItem(0), mOutgoingMsgStateIconItem(0) { } @@ -72,23 +72,18 @@ // Create a new decorator item. //--------------------------------------------------------------- MsgConversationViewItem* MsgConversationViewItem::createItem() - { - return new MsgConversationViewItem(*this); - } +{ + MsgConversationViewItem *item = new MsgConversationViewItem(*this); + item->init(); + return item; +} //--------------------------------------------------------------- // MsgConversationViewItem::updateChildItems // //--------------------------------------------------------------- void MsgConversationViewItem::updateChildItems() - { - - if (!mMessageStateIconItem) - { - mMessageStateIconItem = new HbIconItem(this); - HbStyle::setItemName(mMessageStateIconItem, "msgStateIcon"); - } - +{ QModelIndex index = modelIndex(); #ifdef _DEBUG_TRACES_ @@ -136,14 +131,10 @@ // MsgConversationViewItem::updateSmsTypeItem // @see header file //--------------------------------------------------------------- -void MsgConversationViewItem::updateSmsTypeItem(const QModelIndex& index, int messageSubType) - { - - if (!mConversation) - { - mConversation = new MsgConversationWidget(this); - HbStyle::setItemName(mConversation, "msgconvwidget"); - } +void MsgConversationViewItem::updateSmsTypeItem(const QModelIndex& index, + int messageSubType) +{ + mIncoming = false; mConversation->resetProperties(); @@ -154,8 +145,8 @@ setIncoming(true); mConversation->setIncoming(true); - mMessageStateIconItem->setVisible(false); - } + mIncomingMsgStateIconItem->setVisible(false); + } else if (direction == ConvergedMessage::Outgoing) { setIncoming(false); @@ -238,7 +229,7 @@ } else { - mMessageStateIconItem->setVisible(false); + mIncomingMsgStateIconItem->setVisible(false); } } else if (direction == ConvergedMessage::Outgoing) @@ -297,9 +288,13 @@ bool hasImage = (msgProperty & EPreviewImage) ? true : false; if (hasImage) - { - int msgId = index.data(ConvergedMsgId).toInt(); - mConversation->setPreviewIconPath(previewPath, msgId); + { + QVariant previewData = index.data(PreviewIcon); + + HbIcon previewIcon; + previewIcon = qvariant_cast (previewData); + + mConversation->setPreviewIcon(previewIcon); mConversation->setImage(true); } @@ -331,6 +326,7 @@ mConversation->setAudio(true); mConversation->displayAudioIcon(); mConversation->setSubject(LOC_RINGING_TONE); + mConversation->setBodyText(bodyText); } else if (messageSubType == ConvergedMessage::VCard) { @@ -380,8 +376,8 @@ //--------------------------------------------------------------- bool MsgConversationViewItem::containsPoint(const QPointF& point) { - return mConversation->boundingRect(). - contains(mConversation->mapFromScene(point)); + return mConversation->boundingRect(). contains(mConversation->mapFromScene( + point)); } //--------------------------------------------------------------- @@ -391,6 +387,21 @@ void MsgConversationViewItem::setIncoming(bool incoming) { mIncoming = incoming; + + if (mIncoming) + { + HbStyle::setItemName(mOutgoingMsgStateIconItem, ""); + mOutgoingMsgStateIconItem->setVisible(false); + HbStyle::setItemName(mIncomingMsgStateIconItem, + "msgStateIconIncoming"); + } + else + { + HbStyle::setItemName(mIncomingMsgStateIconItem, ""); + mIncomingMsgStateIconItem->setVisible(false); + HbStyle::setItemName(mOutgoingMsgStateIconItem, + "msgStateIconOutgoing"); + } } //--------------------------------------------------------------- @@ -408,51 +419,52 @@ //--------------------------------------------------------------- void MsgConversationViewItem::setMessageStateIcon(int messageState) { - HbIconAnimator& iconAnimator = mMessageStateIconItem->animator(); - HbIconAnimationManager* iconAnimationManager = HbIconAnimationManager::global(); + HbIconAnimator& iconAnimator = mOutgoingMsgStateIconItem->animator(); + HbIconAnimationManager* iconAnimationManager = + HbIconAnimationManager::global(); switch (messageState) { case ConvergedMessage::Waiting: case ConvergedMessage::Scheduled: case ConvergedMessage::Sending: - { - bool defined = iconAnimationManager->addDefinitionFile(ANIMATION_FILE); - HbIcon animIcon; + { + bool defined = iconAnimationManager->addDefinitionFile( + ANIMATION_FILE); + HbIcon animIcon; animIcon.setIconName(ANIMATION_ICON_NAME); - QSizeF size = mMessageStateIconItem->size(); - mMessageStateIconItem->setIcon(animIcon); - mMessageStateIconItem->setVisible(true); + QSizeF size = mOutgoingMsgStateIconItem->size(); + mOutgoingMsgStateIconItem->setIcon(animIcon); + mOutgoingMsgStateIconItem->setVisible(true); iconAnimator.startAnimation(); - repolish(); break; } case ConvergedMessage::Suspended: { - iconAnimator.stopAnimation(); - mMessageStateIconItem->setIcon(MSG_OUTBOX_ICON); - mMessageStateIconItem->setVisible(true); - break; - + iconAnimator.stopAnimation(); + mOutgoingMsgStateIconItem->setIcon(MSG_OUTBOX_ICON); + mOutgoingMsgStateIconItem->setVisible(true); + break; + } case ConvergedMessage::Resend: { iconAnimator.stopAnimation(); - mMessageStateIconItem->setIcon(MSG_OUTBOX_ICON); - mMessageStateIconItem->setVisible(true); + mOutgoingMsgStateIconItem->setIcon(MSG_OUTBOX_ICON); + mOutgoingMsgStateIconItem->setVisible(true); break; } case ConvergedMessage::Failed: { iconAnimator.stopAnimation(); - mMessageStateIconItem->setIcon(MSG_FAIL_ICON); - mMessageStateIconItem->setVisible(true); + mOutgoingMsgStateIconItem->setIcon(MSG_FAIL_ICON); + mOutgoingMsgStateIconItem->setVisible(true); break; } case ConvergedMessage::Unknown: default: { iconAnimator.stopAnimation(); - mMessageStateIconItem->setVisible(false); + mOutgoingMsgStateIconItem->setVisible(false); break; } } @@ -465,28 +477,29 @@ void MsgConversationViewItem::setNotificationStateIcon(int notificationState) { - HbIconAnimator& iconAnimator = mMessageStateIconItem->animator(); - HbIconAnimationManager* iconAnimationManager = HbIconAnimationManager::global(); + HbIconAnimator& iconAnimator = mIncomingMsgStateIconItem->animator(); + HbIconAnimationManager* iconAnimationManager = + HbIconAnimationManager::global(); switch (notificationState) { case ConvergedMessage::NotifRetrieving: case ConvergedMessage::NotifWaiting: { //TODO: Temp icon until official icons are received - bool defined = iconAnimationManager->addDefinitionFile(ANIMATION_FILE); + bool defined = iconAnimationManager->addDefinitionFile( + ANIMATION_FILE); HbIcon animIcon; animIcon.setIconName(ANIMATION_ICON_NAME); - QSizeF size = mMessageStateIconItem->size(); - mMessageStateIconItem->setIcon(animIcon); - mMessageStateIconItem->setVisible(true); + QSizeF size = mIncomingMsgStateIconItem->size(); + mIncomingMsgStateIconItem->setIcon(animIcon); + mIncomingMsgStateIconItem->setVisible(true); iconAnimator.startAnimation(); - repolish(); break; } default: { iconAnimator.stopAnimation(); - mMessageStateIconItem->setVisible(false); + mIncomingMsgStateIconItem->setVisible(false); break; } } @@ -501,4 +514,18 @@ mConversation->pressStateChanged(pressed, animate); } +//--------------------------------------------------------------- +// MsgConversationViewItem::init +// @see header file +//--------------------------------------------------------------- +void MsgConversationViewItem::init() +{ + mConversation = new MsgConversationWidget(this); + HbStyle::setItemName(mConversation, "msgconvwidget"); + + mIncomingMsgStateIconItem = new HbIconItem(this); + + mOutgoingMsgStateIconItem = new HbIconItem(this); +} + // EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/src/msgconversationwidget.cpp --- a/messagingapp/msgui/conversationview/src/msgconversationwidget.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/src/msgconversationwidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -56,9 +56,6 @@ const QString CV_SENT_HIGHLIGHT_FR("qtg_fr_convlist_sent_highlight"); const QString NEW_ITEM_FRAME("qtg_fr_list_new_item"); -//selecet preview-icon query -_LIT(KSelectPreviewIconStmt,"SELECT message_id, preview_icon FROM conversation_messages WHERE message_id = :message_id "); - //--------------------------------------------------------------- // MsgConversationWidget::MsgConversationWidget // @see header file @@ -130,7 +127,7 @@ if (!mSubjectTextItem) { mSubjectTextItem = new HbTextItem(this); - mSubjectTextItem->setTextWrapping(Hb::TextWordWrap); + mSubjectTextItem->setTextWrapping(Hb::TextNoWrap); } HbStyle::setItemName(mSubjectTextItem, "subject"); mSubjectTextItem->setText(subject); @@ -155,107 +152,28 @@ } //--------------------------------------------------------------- -// MsgConversationWidget::setPreviewIconPath +// MsgConversationWidget::setPreviewIcon // @see header file //--------------------------------------------------------------- -void MsgConversationWidget::setPreviewIconPath(const QString &filePath,int msgId) +void MsgConversationWidget::setPreviewIcon(HbIcon& icon) { + QCRITICAL_WRITE("setPreviewIcon start.") + if (!mPreviewIconItem) { mPreviewIconItem = new HbIconItem(this); - mPreviewIconItem->setAlignment(Qt::AlignHCenter | Qt::AlignTop); + mPreviewIconItem->setAlignment(Qt::AlignHCenter | Qt::AlignTop); } HbStyle::setItemName(mPreviewIconItem, "preview"); - //sql query to get preview-icon from DB - TBool isOpen = EFalse; - bool imagePreviewed = false; - - //get DB handle and check if it is open - RSqlDatabase& sqlDb = ConversationsEngine::instance()->getDBHandle(isOpen); - if (isOpen) - { - RSqlStatement sqlSelectPreviewIconStmt; - TInt err = sqlSelectPreviewIconStmt.Prepare(sqlDb, - KSelectPreviewIconStmt); - - QCRITICAL_WRITE_FORMAT("Error from Prepare()", err) - - if (err == KErrNone) - { - //msg_id - TInt msgIdIndex = sqlSelectPreviewIconStmt.ParameterIndex( - _L(":message_id")); - sqlSelectPreviewIconStmt.BindInt(msgIdIndex, msgId); - - // get preview-icon from DB - err = sqlSelectPreviewIconStmt.Next(); - QCRITICAL_WRITE_FORMAT("Error from Next()", err) - - if (err == KSqlAtRow) - { - TInt previewIconIndex = sqlSelectPreviewIconStmt.ColumnIndex( - _L("preview_icon")); - - RSqlColumnReadStream stream; - - //Get data from binary column BLOB - err = stream.ColumnBinary(sqlSelectPreviewIconStmt, - previewIconIndex); - - QCRITICAL_WRITE_FORMAT("Error from ColumnBinary()", err) - - if (err == KErrNone) - { - CFbsBitmap *bitmap = new CFbsBitmap; - TRAPD(err,bitmap->InternalizeL(stream)); - QCRITICAL_WRITE_FORMAT("Error from bitmap InternalizeL()", err) - //convert bitmap to pixmap - if (err == KErrNone) - { - TSize size = bitmap->SizeInPixels(); - int bytesPerLine = bitmap->ScanLineLength(size.iWidth, - bitmap->DisplayMode()); - const uchar* dataPtr = - (const uchar*) bitmap->DataAddress(); - - QPixmap pixmap = QPixmap::fromImage(QImage(dataPtr, - size.iWidth, size.iHeight, bytesPerLine, - QImage::Format_RGB16)); + mPreviewIconItem->setIcon(icon); + mPreviewIconItem->setPreferredSize(icon.size()); + mPreviewIconItem->show(); - mPreviewIconItem->setIcon(HbIcon(pixmap)); - mPreviewIconItem->setPreferredSize(pixmap.size()); - mPreviewIconItem->setEnabled(true); - mPreviewIconItem->show(); - imagePreviewed = true; - - QCRITICAL_WRITE("Bitmap Conversion completed") - } - //remove bitmap - delete bitmap; - } - //close stream - stream.Close(); - } - } - sqlSelectPreviewIconStmt.Close(); - } + QCRITICAL_WRITE("setPreviewIcon end.") +} - // if not found in db, set from file path - if(!imagePreviewed) - { - QPixmap pixmap(filePath); - QPixmap scaledPixmap =pixmap.scaled(100,100,Qt::IgnoreAspectRatio); - mPreviewIconItem->setIcon(HbIcon(scaledPixmap)); - mPreviewIconItem->setPreferredSize(scaledPixmap.size()); - mPreviewIconItem->setEnabled(true); - mPreviewIconItem->show(); - } - - QCRITICAL_WRITE("MsgConversationWidget::setPreviewIconPath end.") - -} //--------------------------------------------------------------- // MsgConversationWidget::setPriority @@ -698,7 +616,11 @@ } } - void MsgConversationWidget::resetProperties() +//--------------------------------------------------------------- +// MsgConversationWidget::resetProperties +// @see header file +//--------------------------------------------------------------- +void MsgConversationWidget::resetProperties() { mHasAttachment = false; mHasImage = false; @@ -761,8 +683,12 @@ mPreviewIconItem->hide(); } } - - void MsgConversationWidget::repolishWidget() + +//--------------------------------------------------------------- +// MsgConversationWidget::repolishWidget +// @see header file +//--------------------------------------------------------------- +void MsgConversationWidget::repolishWidget() { QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); repolish(); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/src/msgeditorwidget.cpp --- a/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -31,14 +31,14 @@ #include #include "unieditorpluginloader.h" #include "unieditorplugininterface.h" -#include "unisendingsettings.h" -#include "unieditorgenutils.h" +#include "UniSendingSettings.h" +#include "UniEditorGenUtils.h" #include "debugtraces.h" // LOCAL CONSTANTS const QString SEND_ICON("qtg_mono_send"); -const QString BACKGROUND("qtg_fr_input_bg"); +const QString BACKGROUND("qtg_fr_input_v_bg"); const QString BACKGROUND_FRAME("qtg_fr_btn_normal"); const QString SEND_BUTTON_NORMAL("qtg_fr_input_btn_function_normal"); @@ -48,6 +48,8 @@ #define LOC_SMS_CHAR_LIMIT_REACHED hbTrId("txt_messaging_dialog_sms_character_count_exceeded") #define LOC_DIALOG_OK hbTrId("txt_common_button_ok") #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel") +#define LOC_HINT_TEXT hbTrId("txt_messaging_formlabel_enter_message_here") + const TInt KShowCounterLimit = 10; @@ -356,7 +358,8 @@ MsgEditor::MsgEditor(QGraphicsItem *parent) :HbLineEdit(parent) { - + this->setSmileysEnabled(true); + this->setPlaceholderText(LOC_HINT_TEXT); } //--------------------------------------------------------------- diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/tsrc/tsrc.pro Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,19 @@ +# +# Copyright (c) 2010 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: +# +# + +SUBDIRS += unittests +TEMPLATE = subdirs diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/hbwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/hbwidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010 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 T_MSGCONVERSATIONVIEW_HBWIDGET_H +#define T_MSGCONVERSATIONVIEW_HBWIDGET_H + +#include + +/* + Mocked HbWidget class' external variables. + */ +extern QGraphicsWidget *hbwidget_parent; + +/* + Mocked HbWidget class. + */ +class HbWidget : public QGraphicsWidget +{ + Q_OBJECT +public: + HbWidget(QGraphicsWidget *parent = NULL) + : QGraphicsWidget(hbwidget_parent = parent) + { + } + ~HbWidget() + { + } + + void repolish() {} + +private: + Q_DISABLE_COPY(HbWidget) +private: +}; + +#endif /* T_MSGCONVERSATIONVIEW_HBWIDGET_H */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/msgconversationwidgetheaders.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/msgconversationwidgetheaders.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,282 @@ +/* + * Copyright (c) 2010 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 T_MSGCONVERSATIONWIDGET_HEADERS_H +#define T_MSGCONVERSATIONWIDGET_HEADERS_H + +#include + +#include "convergedmessage.h" +#include "debugtraces.h" + +#define QCoreApplication QCoreApplication2 + +/* + Mocked HbEvent class. + */ +class HbEvent : public QObject +{ + Q_OBJECT +public: + enum Flags{ + ThemeChanged + }; + + HbEvent(HbEvent::Flags flag) + { + } + ~HbEvent() + { + } + +private: + Q_DISABLE_COPY(HbEvent) +}; + +/* + Mocked QCoreApplication class. + */ + class MSG; + +class QCoreApplication2 : public QObject +{ + Q_OBJECT +public: + enum EventFilter + { + CodecForTr, UnicodeUTF8, DefaultCodec + }; + + QCoreApplication ( int & argc, char ** argv ) {} + ~QCoreApplication () {} + bool filterEvent ( void * message, long * result ) {} + virtual bool notify ( QObject * receiver, QEvent * event ) {} + EventFilter setEventFilter ( EventFilter filter ) {} + virtual bool winEventFilter ( MSG * msg, long * result ) {} + static void postEvent(QObject* ref, HbEvent* ob) {} + +private: + Q_DISABLE_COPY(QCoreApplication) +}; + +/* + Mocked Hb class. + */ +class Hb : public QObject +{ + Q_OBJECT +public: + enum Flags{ + TextCursorHidden + + }; + + Hb(QObject *parent = NULL) + { + } + ~Hb() + { + } + +private: + Q_DISABLE_COPY(Hb) +}; + +/* + Mocked HbIcon class. + */ +class HbIcon +{ + +public: + + HbIcon (const QString &iconName) {} + HbIcon (const QIcon &icon) {} + HbIcon (const HbIcon &other) {} + + QSizeF size() const {} +private: + //Q_DISABLE_COPY(HbIcon) +}; + +/* + Mocked HbIconItem class. + */ + +class HbIconItem : public QGraphicsWidget +{ + Q_OBJECT +public: + HbIconItem(QGraphicsWidget *parent = NULL) + { + } + ~HbIconItem() + { + } + void setAlignment(Qt::Alignment alignment) {} + void setIcon(const HbIcon &icon) {} + void setPreferredSize(QSizeF size) {} + void show(){} + void setIconName(const QString& name) {} +private: + Q_DISABLE_COPY(HbIconItem) +private: +}; + +/* + Mocked HbTextItem class. + */ +class HbTextItem : public QGraphicsWidget +{ + Q_OBJECT +public: + HbTextItem(QGraphicsWidget *parent = NULL) + { + } + ~HbTextItem() + { + } + void setText(const QString &timeStamp){} + void show(){} +private: + Q_DISABLE_COPY(HbTextItem) +private: +}; + +/* + Mocked HbIconItem class. + */ +extern int hbtextedit_setsmileysenabled_callcount; +extern int hbtextedit_setreadonly_callcount; + +class HbTextEdit : public QGraphicsWidget +{ + Q_OBJECT +public: + HbTextEdit(QGraphicsWidget *parent = NULL) + { + } + ~HbTextEdit() + { + } + void setReadOnly(bool status) { + hbtextedit_setreadonly_callcount++; + } + void setBackgroundItem(int back) {} + void setSmileysEnabled(bool status) { + hbtextedit_setsmileysenabled_callcount++; + } + void setFlag(QGraphicsWidget::GraphicsItemFlag flag,bool status) {} + void setPlainText(QString text) {} + void show() {} + void setCursorVisibility(Hb::Flags flag) {} +private: + Q_DISABLE_COPY(HbTextEdit) +private: +}; + +/* + Mocked HbStyle class. + */ +extern int hbstyle_setitemname_callcount; + +class HbStyle: public QObject +{ + Q_OBJECT +public: + enum{ + P_None + }; + HbStyle(QObject *parent = NULL) + { + } + + void static setItemName(QGraphicsWidget* bubbleFrameItem, QString type) + { + hbstyle_setitemname_callcount++; + } + +private: + Q_DISABLE_COPY(HbStyle) +}; + +/* + Mocked HbFrameDrawer class. + */ + extern int hbframedrawer_setframetype_callcount; + +class HbFrameDrawer: public QObject +{ + Q_OBJECT +public: + enum PieceSize{ + OnePieces, + TwoPieces, + ThreePiecesVertical, + FourPieces, + NinePieces + }; + HbFrameDrawer(QObject *parent = NULL) + { + } + void setFrameType(HbFrameDrawer::PieceSize piece) + { + hbframedrawer_setframetype_callcount++; + } + + void setFrameGraphicsName(const QString name) {} + +private: + Q_DISABLE_COPY(HbFrameDrawer) +}; + +/* + Mocked HbFrameItem class. + */ +extern int hbframeitem_framedrawer_callcount; + +class HbFrameItem : public QGraphicsWidget +{ + Q_OBJECT + +public: + + HbFrameItem(QGraphicsWidget *parent = NULL) + { + } + ~HbFrameItem() + { + } + +HbFrameDrawer& frameDrawer ( ) +{ + hbframeitem_framedrawer_callcount++; + return frameDraw; +} + +private: + Q_DISABLE_COPY(HbFrameItem) +private: + HbFrameDrawer frameDraw; +}; + +/* + Include the header file of the class under test. + */ +#include "../../../inc/msgconversationwidget.h" + +#endif /* T_MSGCONVERSATIONWIDGET_HEADERS_H */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/unittest_msgconversationwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/unittest_msgconversationwidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2010 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 "msgconversationwidgetheaders.h" + +/* + Global variables that are used to control the test environment and/or + observe the individual tests. The naming convention can be described with + a ternary template + + _[_], + + where is the name of a mocked class, is the name of a + variable, a function, or a property under consideration, and is + an optional description. For example, if we wish to observe the number of + A::B() calls, we declare a global integer a_b_callcount and increment it + every time A::B() is called. The variable is also declared in the header + file of the mocked class by using the extern keyword. Typically, these + global variables are defined and reset in the unit-test class' helper + functions. + + Mocked HbLabel class' global variables: + + • argument of setNumber() and/or setPlainText(), + • number of setNumber() calls, and + • number of setPlaintText() calls. + */ + +int hbframeitem_framedrawer_callcount; +int hbstyle_setitemname_callcount; +int hbframedrawer_setframetype_callcount; +int hbtextedit_setreadonly_callcount; +int hbtextedit_setsmileysenabled_callcount; +const QString SUBJECT = "Subject"; +const QString BODYTEXT = "Body Text"; + +QGraphicsWidget *hbwidget_parent; + +/* + The unit-test class. The class definition contains four helper functions + and a number of test functions. The helper functions are responsible for + the initialization and cleanup of the test environment, whereas the test + functions implement the actual testing. Although the test functions are + executed in the order they are defined, they should not depend on each + other in any way. In other words, one should be able to scramble the test + functions and still compile a working unit test. + */ +class TestMsgConversationWidget : public QObject +{ + Q_OBJECT +private slots: + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + void testConstructor(); + void testSetSubject(); + void testSetBodyText(); +}; + +/* + Initializes the test environment. This function is automatically invoked + before the first test function. + */ +void TestMsgConversationWidget::initTestCase() +{ +} + +/* + Cleans up the test environment. This function is automatically invoked + after the last test function. + */ +void TestMsgConversationWidget::cleanupTestCase() +{ +} + +/* + Performs initialization for a single test function. This function is + automatically invoked before each test function. + */ +void TestMsgConversationWidget::init() +{ + hbframeitem_framedrawer_callcount = 0; + hbstyle_setitemname_callcount = 0; + hbframedrawer_setframetype_callcount = 0; + hbtextedit_setsmileysenabled_callcount = 0; + hbtextedit_setreadonly_callcount = 0; + hbwidget_parent = NULL; +} + +/* + Performs cleanup for a single test function. This function is auto- + matically invoked after each test function. + */ +void TestMsgConversationWidget::cleanup() +{ +} + +/* + Test the constructor with different parent arguments: + + 1. null parent (i.e. default parent argument) and + 2. non-null parent. + */ +void TestMsgConversationWidget::testConstructor() +{ + // 1. + MsgConversationWidget *widget = new MsgConversationWidget(); + QVERIFY(!hbwidget_parent); + delete widget; + + // 2. + MsgConversationWidget parent(NULL); + widget = new MsgConversationWidget(&parent); + QVERIFY(hbwidget_parent == &parent); + + QVERIFY(6 == hbframeitem_framedrawer_callcount); + QVERIFY(6 == hbframedrawer_setframetype_callcount); + QVERIFY(6 == hbstyle_setitemname_callcount); + + delete widget; +} + +void TestMsgConversationWidget::testSetSubject() +{ + // 1. + MsgConversationWidget* myWidget = new MsgConversationWidget(); + myWidget->setSubject(SUBJECT); + QVERIFY(1 == hbtextedit_setreadonly_callcount); + QVERIFY(1 == hbtextedit_setsmileysenabled_callcount); + + delete myWidget; +} + +void TestMsgConversationWidget::testSetBodyText() +{ + // 1. + MsgConversationWidget* myWidget = new MsgConversationWidget(); + myWidget->setBodyText(BODYTEXT); + QVERIFY(1 == hbtextedit_setreadonly_callcount); + QVERIFY(1 == hbtextedit_setsmileysenabled_callcount); + + delete myWidget; +} + +/* + Implement a main() function that initializes the test environment, + executes all tests in the order they were defined, and finally cleans up + the test environment. + */ +QTEST_APPLESS_MAIN(TestMsgConversationWidget) + +/* + Because both the declaration and the implementation of our test class are + in a single .cpp file, we also need to include the generated moc file to + make Qt's introspection work. + */ +#include "unittest_msgconversationwidget.moc" diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/unittest_msgconversationwidget.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/unittest_msgconversationwidget.pro Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2010 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: +# +# + +CONFIG += qtestlib symbian_test +INCLUDEPATH += . +MMP_RULES += "USERINCLUDE . ../../../../../../inc" +MOC_DIR = moc +TARGET = unittest_msgconversationwidget +TARGET.CAPABILITY = All -TCB +TEMPLATE = app + +HEADERS += hbwidget.h \ + msgconversationwidgetheaders.h \ + ../../../inc/msgconversationwidget.h + +SOURCES += unittest_msgconversationwidget.cpp \ + ../../../src/msgconversationwidget.cpp diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/conversationview/tsrc/unittests/unittests.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/tsrc/unittests/unittests.pro Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,22 @@ +# +# Copyright (c) 2010 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: +# +# + +CONFIG += symbian_test +SUBDIRS += unittest_nmexampleadapterclass \ + unittest_nmexamplesymbianclass \ + unittest_nmexampleview +TEMPLATE = subdirs diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/eabi/appengineu.def --- a/messagingapp/msgui/eabi/appengineu.def Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/eabi/appengineu.def Fri Jun 11 13:35:48 2010 +0300 @@ -2,40 +2,41 @@ _ZN19ConversationsEngine11getDBHandleERi @ 1 NONAME _ZN19ConversationsEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME _ZN19ConversationsEngine11qt_metacastEPKc @ 3 NONAME - _ZN19ConversationsEngine13resendMessageEi @ 4 NONAME - _ZN19ConversationsEngine14deleteMessagesER5QListIiE @ 5 NONAME - _ZN19ConversationsEngine14getDraftsModelEv @ 6 NONAME - _ZN19ConversationsEngine15downloadMessageEi @ 7 NONAME - _ZN19ConversationsEngine16getConversationsEx @ 8 NONAME - _ZN19ConversationsEngine16markMessagesReadER5QListIiE @ 9 NONAME - _ZN19ConversationsEngine16staticMetaObjectE @ 10 NONAME DATA 16 - _ZN19ConversationsEngine17getContactDetailsExR7QStringS1_ @ 11 NONAME - _ZN19ConversationsEngine18clearConversationsEv @ 12 NONAME - _ZN19ConversationsEngine19deleteConversationsEx @ 13 NONAME - _ZN19ConversationsEngine19getStaticMetaObjectEv @ 14 NONAME - _ZN19ConversationsEngine20markAsReadAndGetTypeEiRiS0_ @ 15 NONAME - _ZN19ConversationsEngine20markConversationReadEx @ 16 NONAME - _ZN19ConversationsEngine21getConversationsModelEv @ 17 NONAME - _ZN19ConversationsEngine22deleteAllDraftMessagesEv @ 18 NONAME - _ZN19ConversationsEngine22fetchMoreConversationsEv @ 19 NONAME - _ZN19ConversationsEngine24conversationModelUpdatedEv @ 20 NONAME - _ZN19ConversationsEngine24getCurrentConversationIdEv @ 21 NONAME - _ZN19ConversationsEngine26conversationModelPopulatedEv @ 22 NONAME - _ZN19ConversationsEngine26downloadOperationSupportedEi @ 23 NONAME - _ZN19ConversationsEngine28emitConversationModelUpdatedEv @ 24 NONAME - _ZN19ConversationsEngine28getConversationIdFromAddressE7QString @ 25 NONAME - _ZN19ConversationsEngine28getConversationsSummaryModelEv @ 26 NONAME - _ZN19ConversationsEngine30conversationListModelPopulatedEv @ 27 NONAME - _ZN19ConversationsEngine30emitConversationModelPopulatedEv @ 28 NONAME - _ZN19ConversationsEngine30getConversationIdFromContactIdEi @ 29 NONAME - _ZN19ConversationsEngine34emitConversationListModelPopulatedEv @ 30 NONAME - _ZN19ConversationsEngine8instanceEv @ 31 NONAME - _ZN19ConversationsEngineC1EP7QObject @ 32 NONAME - _ZN19ConversationsEngineC2EP7QObject @ 33 NONAME - _ZN19ConversationsEngineD0Ev @ 34 NONAME - _ZN19ConversationsEngineD1Ev @ 35 NONAME - _ZN19ConversationsEngineD2Ev @ 36 NONAME - _ZNK19ConversationsEngine10metaObjectEv @ 37 NONAME - _ZTI19ConversationsEngine @ 38 NONAME - _ZTV19ConversationsEngine @ 39 NONAME + _ZN19ConversationsEngine13getMsgSubTypeEi @ 4 NONAME + _ZN19ConversationsEngine13resendMessageEi @ 5 NONAME + _ZN19ConversationsEngine14deleteMessagesER5QListIiE @ 6 NONAME + _ZN19ConversationsEngine14getDraftsModelEv @ 7 NONAME + _ZN19ConversationsEngine15downloadMessageEi @ 8 NONAME + _ZN19ConversationsEngine16getConversationsEx @ 9 NONAME + _ZN19ConversationsEngine16markMessagesReadER5QListIiE @ 10 NONAME + _ZN19ConversationsEngine16staticMetaObjectE @ 11 NONAME DATA 16 + _ZN19ConversationsEngine17getContactDetailsExR7QStringS1_ @ 12 NONAME + _ZN19ConversationsEngine18clearConversationsEv @ 13 NONAME + _ZN19ConversationsEngine19deleteConversationsEx @ 14 NONAME + _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 diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/eabi/msguiutilsu.def --- a/messagingapp/msgui/eabi/msguiutilsu.def Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/eabi/msguiutilsu.def Fri Jun 11 13:35:48 2010 +0300 @@ -23,23 +23,25 @@ _ZN12MsgMediaUtilC2Ev @ 22 NONAME _ZN12MsgMediaUtilD1Ev @ 23 NONAME _ZN12MsgMediaUtilD2Ev @ 24 NONAME - _ZN19MmsConformanceCheck11qt_metacallEN11QMetaObject4CallEiPPv @ 25 NONAME - _ZN19MmsConformanceCheck11qt_metacastEPKc @ 26 NONAME - _ZN19MmsConformanceCheck16staticMetaObjectE @ 27 NONAME DATA 16 - _ZN19MmsConformanceCheck18checkModeForInsertERK7QStringb @ 28 NONAME - _ZN19MmsConformanceCheck19getStaticMetaObjectEv @ 29 NONAME - _ZN19MmsConformanceCheck19onDialogInsertMediaEP8HbAction @ 30 NONAME - _ZN19MmsConformanceCheck21validateMsgForForwardEi @ 31 NONAME - _ZN19MmsConformanceCheck9showPopupERK7QString @ 32 NONAME - _ZN19MmsConformanceCheckC1Ev @ 33 NONAME - _ZN19MmsConformanceCheckC2Ev @ 34 NONAME - _ZN19MmsConformanceCheckD0Ev @ 35 NONAME - _ZN19MmsConformanceCheckD1Ev @ 36 NONAME - _ZN19MmsConformanceCheckD2Ev @ 37 NONAME - _ZNK11MsgSendUtil10metaObjectEv @ 38 NONAME - _ZNK19MmsConformanceCheck10metaObjectEv @ 39 NONAME - _ZTI11MsgSendUtil @ 40 NONAME - _ZTI19MmsConformanceCheck @ 41 NONAME - _ZTV11MsgSendUtil @ 42 NONAME - _ZTV19MmsConformanceCheck @ 43 NONAME + _ZN15MsgContactsUtil15copyVCardToTempERK7QString @ 25 NONAME + _ZN15MsgContactsUtil17launchVCardViewerERK7QString @ 26 NONAME + _ZN15MsgContactsUtil19deleteVCardFromTempERK7QString @ 27 NONAME + _ZN19MmsConformanceCheck11qt_metacallEN11QMetaObject4CallEiPPv @ 28 NONAME + _ZN19MmsConformanceCheck11qt_metacastEPKc @ 29 NONAME + _ZN19MmsConformanceCheck16staticMetaObjectE @ 30 NONAME DATA 16 + _ZN19MmsConformanceCheck18checkModeForInsertERK7QStringb @ 31 NONAME + _ZN19MmsConformanceCheck19getStaticMetaObjectEv @ 32 NONAME + _ZN19MmsConformanceCheck19onDialogInsertMediaEP8HbAction @ 33 NONAME + _ZN19MmsConformanceCheck9showPopupERK7QString @ 34 NONAME + _ZN19MmsConformanceCheckC1Ev @ 35 NONAME + _ZN19MmsConformanceCheckC2Ev @ 36 NONAME + _ZN19MmsConformanceCheckD0Ev @ 37 NONAME + _ZN19MmsConformanceCheckD1Ev @ 38 NONAME + _ZN19MmsConformanceCheckD2Ev @ 39 NONAME + _ZNK11MsgSendUtil10metaObjectEv @ 40 NONAME + _ZNK19MmsConformanceCheck10metaObjectEv @ 41 NONAME + _ZTI11MsgSendUtil @ 42 NONAME + _ZTI19MmsConformanceCheck @ 43 NONAME + _ZTV11MsgSendUtil @ 44 NONAME + _ZTV19MmsConformanceCheck @ 45 NONAME diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/eabi/unifiededitoru.def --- a/messagingapp/msgui/eabi/unifiededitoru.def Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/eabi/unifiededitoru.def Fri Jun 11 13:35:48 2010 +0300 @@ -28,42 +28,43 @@ _ZN20MsgUnifiedEditorView15contactsFetchedERK8QVariant @ 27 NONAME _ZN20MsgUnifiedEditorView15populateContentERK5QListI8QVariantE @ 28 NONAME _ZN20MsgUnifiedEditorView16createTempFolderEv @ 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 - _ZN20MsgUnifiedEditorView22deactivateInputBlockerEv @ 43 NONAME - _ZN20MsgUnifiedEditorView22setAttachOptionEnabledENS_16TBE_AttachOptionEb @ 44 NONAME - _ZN20MsgUnifiedEditorView23handleViewExtnActivatedEP16HbListWidgetItem @ 45 NONAME - _ZN20MsgUnifiedEditorView25populateContentIntoEditorERK16ConvergedMessage @ 46 NONAME - _ZN20MsgUnifiedEditorView25removeAttachmentContainerEv @ 47 NONAME - _ZN20MsgUnifiedEditorView25updateOtherRecipientCountEb @ 48 NONAME - _ZN20MsgUnifiedEditorView4sendEv @ 49 NONAME - _ZN20MsgUnifiedEditorView7addMenuEv @ 50 NONAME - _ZN20MsgUnifiedEditorView8addCcBccEv @ 51 NONAME - _ZN20MsgUnifiedEditorView8initViewEv @ 52 NONAME - _ZN20MsgUnifiedEditorView8setFocusEP26MsgUnifiedEditorBaseWidget @ 53 NONAME - _ZN20MsgUnifiedEditorView9vkbClosedEv @ 54 NONAME - _ZN20MsgUnifiedEditorView9vkbOpenedEv @ 55 NONAME - _ZN20MsgUnifiedEditorViewC1EP13QGraphicsItem @ 56 NONAME - _ZN20MsgUnifiedEditorViewC2EP13QGraphicsItem @ 57 NONAME - _ZN20MsgUnifiedEditorViewD0Ev @ 58 NONAME - _ZN20MsgUnifiedEditorViewD1Ev @ 59 NONAME - _ZN20MsgUnifiedEditorViewD2Ev @ 60 NONAME - _ZNK20MsgUnifiedEditorView10metaObjectEv @ 61 NONAME - _ZTI20MsgUnifiedEditorView @ 62 NONAME - _ZTV20MsgUnifiedEditorView @ 63 NONAME - _ZThn16_N20MsgUnifiedEditorViewD0Ev @ 64 NONAME - _ZThn16_N20MsgUnifiedEditorViewD1Ev @ 65 NONAME - _ZThn8_N20MsgUnifiedEditorViewD0Ev @ 66 NONAME - _ZThn8_N20MsgUnifiedEditorViewD1Ev @ 67 NONAME + _ZN20MsgUnifiedEditorView16enableSendButtonEb @ 30 NONAME + _ZN20MsgUnifiedEditorView16generateFileNameER7QString @ 31 NONAME + _ZN20MsgUnifiedEditorView16onContentChangedEv @ 32 NONAME + _ZN20MsgUnifiedEditorView16removeTempFolderEv @ 33 NONAME + _ZN20MsgUnifiedEditorView16staticMetaObjectE @ 34 NONAME DATA 16 + _ZN20MsgUnifiedEditorView17onDialogDeleteMsgEP8HbAction @ 35 NONAME + _ZN20MsgUnifiedEditorView17openDraftsMessageERK5QListI8QVariantE @ 36 NONAME + _ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 37 NONAME + _ZN20MsgUnifiedEditorView19onDialogMmsSettingsEP8HbAction @ 38 NONAME + _ZN20MsgUnifiedEditorView19onDialogSmsSettingsEP8HbAction @ 39 NONAME + _ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 40 NONAME + _ZN20MsgUnifiedEditorView19serviceRequestErrorEiRK7QString @ 41 NONAME + _ZN20MsgUnifiedEditorView20activateInputBlockerEv @ 42 NONAME + _ZN20MsgUnifiedEditorView21doDelayedConstructionEv @ 43 NONAME + _ZN20MsgUnifiedEditorView22deactivateInputBlockerEv @ 44 NONAME + _ZN20MsgUnifiedEditorView22setAttachOptionEnabledENS_16TBE_AttachOptionEb @ 45 NONAME + _ZN20MsgUnifiedEditorView23handleViewExtnActivatedEP16HbListWidgetItem @ 46 NONAME + _ZN20MsgUnifiedEditorView25populateContentIntoEditorERK16ConvergedMessageb @ 47 NONAME + _ZN20MsgUnifiedEditorView25removeAttachmentContainerEv @ 48 NONAME + _ZN20MsgUnifiedEditorView25updateOtherRecipientCountEb @ 49 NONAME + _ZN20MsgUnifiedEditorView4sendEv @ 50 NONAME + _ZN20MsgUnifiedEditorView7addMenuEv @ 51 NONAME + _ZN20MsgUnifiedEditorView8addCcBccEv @ 52 NONAME + _ZN20MsgUnifiedEditorView8initViewEv @ 53 NONAME + _ZN20MsgUnifiedEditorView8setFocusEP26MsgUnifiedEditorBaseWidget @ 54 NONAME + _ZN20MsgUnifiedEditorView9vkbClosedEv @ 55 NONAME + _ZN20MsgUnifiedEditorView9vkbOpenedEv @ 56 NONAME + _ZN20MsgUnifiedEditorViewC1EP13QGraphicsItem @ 57 NONAME + _ZN20MsgUnifiedEditorViewC2EP13QGraphicsItem @ 58 NONAME + _ZN20MsgUnifiedEditorViewD0Ev @ 59 NONAME + _ZN20MsgUnifiedEditorViewD1Ev @ 60 NONAME + _ZN20MsgUnifiedEditorViewD2Ev @ 61 NONAME + _ZNK20MsgUnifiedEditorView10metaObjectEv @ 62 NONAME + _ZTI20MsgUnifiedEditorView @ 63 NONAME + _ZTV20MsgUnifiedEditorView @ 64 NONAME + _ZThn16_N20MsgUnifiedEditorViewD0Ev @ 65 NONAME + _ZThn16_N20MsgUnifiedEditorViewD1Ev @ 66 NONAME + _ZThn8_N20MsgUnifiedEditorViewD0Ev @ 67 NONAME + _ZThn8_N20MsgUnifiedEditorViewD1Ev @ 68 NONAME diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/eabi/unifiedvieweru.def --- a/messagingapp/msgui/eabi/unifiedvieweru.def Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/eabi/unifiedvieweru.def Fri Jun 11 13:35:48 2010 +0300 @@ -8,11 +8,11 @@ _ZN13UnifiedViewer15handleFwdActionEv @ 7 NONAME _ZN13UnifiedViewer15populateContentEibi @ 8 NONAME _ZN13UnifiedViewer16staticMetaObjectE @ 9 NONAME DATA 16 - _ZN13UnifiedViewer18handleDeleteActionEv @ 10 NONAME - _ZN13UnifiedViewer19getStaticMetaObjectEv @ 11 NONAME - _ZN13UnifiedViewer21validateMsgForForwardEv @ 12 NONAME - _ZN13UnifiedViewerC1EiP13QGraphicsItem @ 13 NONAME - _ZN13UnifiedViewerC2EiP13QGraphicsItem @ 14 NONAME + _ZN13UnifiedViewer17onDialogDeleteMsgEP8HbAction @ 10 NONAME + _ZN13UnifiedViewer18handleDeleteActionEv @ 11 NONAME + _ZN13UnifiedViewer19getStaticMetaObjectEv @ 12 NONAME + _ZN13UnifiedViewerC1EiiP13QGraphicsItem @ 13 NONAME + _ZN13UnifiedViewerC2EiiP13QGraphicsItem @ 14 NONAME _ZN13UnifiedViewerD0Ev @ 15 NONAME _ZN13UnifiedViewerD1Ev @ 16 NONAME _ZN13UnifiedViewerD2Ev @ 17 NONAME @@ -23,5 +23,4 @@ _ZThn16_N13UnifiedViewerD1Ev @ 22 NONAME _ZThn8_N13UnifiedViewerD0Ev @ 23 NONAME _ZThn8_N13UnifiedViewerD1Ev @ 24 NONAME - _ZN13UnifiedViewer17onDialogDeleteMsgEP8HbAction @ 25 NONAME diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/inc/draftslistview.h --- a/messagingapp/msgui/msgapp/inc/draftslistview.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/inc/draftslistview.h Fri Jun 11 13:35:48 2010 +0300 @@ -153,11 +153,6 @@ DRAFTS_EXTN = 0x00, CONVERSATIONS_EXTN = 0x01 }; - /** - * Flag to track if item has been long pressed. - * TODO: Remove it, once unique longpress and click event signal released in week16 - */ - bool mItemLongPressed; }; #endif /* DRAFTS_LISTVIEW_H */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/inc/msgactivityhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/msgapp/inc/msgactivityhandler.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,75 @@ +/* + * 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: + * Handles saving and opening activites. + * + */ + +#ifndef MSGACTIVITYHANDLER_H_ +#define MSGACTIVITYHANDLER_H_ + +#include +#include + +class MsgMainWindow; +class MsgViewManager; + +class MsgActivityHandler: public QObject +{ +Q_OBJECT + +public: + /** + * Constructor + */ + MsgActivityHandler( QObject* parent = 0); + + /** + * Destructor. + */ + ~MsgActivityHandler(); + +public slots: + + /** + * Saves the current running activity. + */ + void saveActivity(); + + /** + * Open the activity which is requested. + * @param activitry data. + */ + void handleActivity(const QVariant &activityData); + +public: + /** + * Set the message main window pointer. + * @param mainWindow message main window. + */ + void setMainWindow(MsgMainWindow* mainWindow); + + /** + * Clears all saved messaging activities. + */ + void clearActivities(); + +private: + /** + * main window reference not owned. + */ + MsgMainWindow* mMainWindow; +}; + +#endif /* MSGACTIVITYHANDLER_H_ */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/inc/msglistview.h --- a/messagingapp/msgui/msgapp/inc/msglistview.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/inc/msglistview.h Fri Jun 11 13:35:48 2010 +0300 @@ -27,6 +27,8 @@ class HbListWidget; class HbListWidgetItem; class HbAction; +class QGraphicsLinearLayout; + /** * This class provides the message list view for the messaging application. * Data source for this view is the conversation list model. @@ -154,10 +156,10 @@ }; /** - * Flag to track if item has been long pressed. - * TODO: Remove it, once unique longpress and click event signal released in week16 - */ - bool mItemLongPressed; + * Main layout + * Own + */ + QGraphicsLinearLayout *mMainLayout; }; #endif // MSG_LIST_VIEW_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/inc/msglistviewitem.h --- a/messagingapp/msgui/msgapp/inc/msglistviewitem.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/inc/msglistviewitem.h Fri Jun 11 13:35:48 2010 +0300 @@ -76,21 +76,26 @@ private: /** - * Returns the preview text based on message type, sub type and state. + * Create permanent items. + */ + void initItems(); + + /** + * Returns the preview text based on message type, sub type. + * Also sets the indicator icon. * @return QString */ - QString previewText(int msgType, int msgSubType, int msgState,int msgDirection); + QString defaultPreviewText(int msgType, int msgSubType); /** - * return the preview text based on state. - * @return bool + * Sets the preview text and timestamp. */ - QString textBySendState(int sendState,int msgDirection); - + void setTimestampAndPreviewText(); + private: /** - * Property to change the color of text - */ + * Property to change the color of text + */ bool mUnReadMsg; /** diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/inc/msgmainwindow.h --- a/messagingapp/msgui/msgapp/inc/msgmainwindow.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/inc/msgmainwindow.h Fri Jun 11 13:35:48 2010 +0300 @@ -47,11 +47,14 @@ */ virtual ~MsgMainWindow(); - + /** + * Returns view manager. + */ + MsgViewManager* viewManager(); private: MsgServiceInterface* mMsgSI; MsgSendServiceInterface* mMsgSendSI; - + MsgViewManager* mViewManager; }; #endif // MSG_MAIN_WINDOW_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/inc/msgviewmanager.h --- a/messagingapp/msgui/msgapp/inc/msgviewmanager.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/inc/msgviewmanager.h Fri Jun 11 13:35:48 2010 +0300 @@ -84,6 +84,11 @@ */ void view(int msgId); + /** + * Returns the current active view. + */ + int currentView(); + private: /** * swiches back to last view after service request is complete. diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/msgapp.pro --- a/messagingapp/msgui/msgapp/msgapp.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/msgapp.pro Fri Jun 11 13:35:48 2010 +0300 @@ -51,8 +51,12 @@ "sis/msgapp_stub.sis /epoc32/data/z/system/install/msgapp_stub.sis" \ "rom/messaging_uda.confml CONFML_EXPORT_PATH(messaging_uda.confml,uda_content)" \ "rom/messaging_uda_copy.implml CRML_EXPORT_PATH(messaging_uda_copy.implml,uda_content)" \ - "rom/private.zip CRML_EXPORT_PATH(../content/zip/,uda_content)" - + "rom/private.zip CRML_EXPORT_PATH(../content/zip/,uda_content)" \ + "resources/xml/messaging101.docml /epoc32/data/z/resource/hb/splashml/messaging101.docml" \ + "resources/xml/messaging101.splashml /epoc32/data/z/resource/hb/splashml/messaging101.splashml" \ + "resources/xml/messaging101_dummy.docml /epoc32/data/z/resource/hb/splashml/messaging101_dummy.docml" \ + "resources/xml/messaging101_dummy.splashml /epoc32/data/z/resource/hb/splashml/messaging101_dummy.splashml" + # Input HEADERS += msgmainwindow.h \ msglistview.h \ @@ -62,7 +66,8 @@ msgviewmanager.h \ msgbaseview.h \ msgsendserviceinterface.h \ - msgserviceinterface.h + msgserviceinterface.h \ + msgactivityhandler.h SOURCES += main.cpp \ msgmainwindow.cpp \ @@ -72,7 +77,8 @@ msgutils.cpp \ msgviewmanager.cpp \ msgsendserviceinterface.cpp \ - msgserviceinterface.cpp + msgserviceinterface.cpp \ + msgactivityhandler.cpp RESOURCES += msgapp.qrc diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/resources/xml/messaging101.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/msgapp/resources/xml/messaging101.docml Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/resources/xml/messaging101.splashml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/msgapp/resources/xml/messaging101.splashml Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,7 @@ + + clv + messaging101.docml + view + 0x2001FE79 + Messaging + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/resources/xml/messaging101_dummy.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/msgapp/resources/xml/messaging101_dummy.docml Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/resources/xml/messaging101_dummy.splashml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/msgapp/resources/xml/messaging101_dummy.splashml Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,7 @@ + + dummy + messaging101_dummy.docml + view + 0x2001FE79 + Messaging + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/resources/xml/msglistviewitem_color.css --- a/messagingapp/msgui/msgapp/resources/xml/msglistviewitem_color.css Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/resources/xml/msglistviewitem_color.css Fri Jun 11 13:35:48 2010 +0300 @@ -7,6 +7,10 @@ color: var(qtc_list_item_content_normal); } +MsgListViewItem[state="pressed"]::addressLabel { + color: var(qtc_list_item_pressed); +} + MsgListViewItem[unReadMsg="true"]::previewLabel { color: var(qtc_list_item_title_normal); } @@ -15,6 +19,10 @@ color: var(qtc_list_item_content_normal); } +MsgListViewItem[state="pressed"]::previewLabel { + color: var(qtc_list_item_pressed); +} + MsgListViewItem[unReadMsg="true"]::unreadCount { color: var(qtc_list_item_title_normal); } @@ -23,6 +31,10 @@ color: var(qtc_list_item_content_normal); } +MsgListViewItem[state="pressed"]::unreadCount { + color: var(qtc_list_item_pressed); +} + MsgListViewItem[unReadMsg="true"]::timeLabel { color: var(qtc_list_item_title_normal); } @@ -31,3 +43,11 @@ color: var(qtc_list_item_content_normal); } +MsgListViewItem[state="pressed"]::timeLabel { + color: var(qtc_list_item_pressed); +} + +MsgListViewItem::presenceIndicator { + color: var(qtc_list_item_title_normal); +} + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/rom/msgapp.iby --- a/messagingapp/msgui/msgapp/rom/msgapp.iby Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/rom/msgapp.iby Fri Jun 11 13:35:48 2010 +0300 @@ -19,8 +19,15 @@ file=ABI_DIR\UREL\messaging101.exe SHARED_LIB_DIR\messaging101.exe data=DATAZ_\private\10003a3f\import\apps\messaging101_reg.rsc private\10003a3f\import\apps\messaging101_reg.rsc -data=DATAZ_\resource\apps\0x2001FE79.mif resource\apps\0x2001FE79.mif +data=DATAZ_\resource\apps\messaging101.mif resource\apps\messaging101.mif data=DATAZ_\system\install\msgapp_stub.sis system\install\msgapp_stub.sis + + data=ZRESOURCE\hb\splashml\messaging101.splashml RESOURCE_FILES_DIR\hb\splashml\messaging101.splashml + data=ZRESOURCE\hb\splashml\messaging101.docml RESOURCE_FILES_DIR\hb\splashml\messaging101.docml + data=ZRESOURCE\hb\splashml\messaging101_dummy.splashml RESOURCE_FILES_DIR\hb\splashml\messaging101_dummy.splashml + data=ZRESOURCE\hb\splashml\messaging101_dummy.docml RESOURCE_FILES_DIR\hb\splashml\messaging101_dummy.docml + + #endif // __MSGAPP_IBY__ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/src/draftslistview.cpp --- a/messagingapp/msgui/msgapp/src/draftslistview.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/src/draftslistview.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -77,8 +77,7 @@ MsgBaseView(parent), mListView(0), mViewExtnList(0), - mToolBar(0), - mItemLongPressed(false) + mToolBar(0) { // Delayed loading. connect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(doDelayedLoading())); @@ -267,12 +266,6 @@ //------------------------------------------------------------------------------ void DraftsListView::openDraftMessage(const QModelIndex &index) { - if(mItemLongPressed) - { - //reset the flag - mItemLongPressed = false; - return; - } QVariant msgId = index.data(ConvergedMsgId); QVariant msgType = index.data(MessageType); ConvergedMessageId convergedMsgId = ConvergedMessageId(msgId.toInt()); @@ -299,7 +292,6 @@ //------------------------------------------------------------------------------ void DraftsListView::handleLongPressed(HbAbstractViewItem *item, const QPointF &coords) { - mItemLongPressed = true; if (this->isVisible()) { // Set the current index as tapped items index. diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/src/main.cpp --- a/messagingapp/msgui/msgapp/src/main.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/src/main.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -22,13 +22,17 @@ #include "debugtraces.h" #include #include +#include #include "msgmainwindow.h" +#include "msgactivityhandler.h" //Localised constants #define LOC_TITLE hbTrId("txt_messaging_title_messaging") const QString debugFileName("c:/art2_app_log.txt"); +const QString activityParam("-activity"); + #ifdef _DEBUG_TRACES_ void debugInit(QtMsgType type, const char *msg) { @@ -74,6 +78,22 @@ #endif int main(int argc, char *argv[]) { + + QCRITICAL_WRITE("MsgApp start."); + + QString firstArg(argv[1]); + bool serviceRequest = false; + // check for argc is greater than 1 and its not from activity + if(argc >1 && firstArg != activityParam ) + { + serviceRequest = true; + HbSplashScreen::setScreenId("dummy"); + } + else + { + HbSplashScreen::setScreenId("clv"); + } + // Application HbApplication app(argc, argv); @@ -99,20 +119,38 @@ } qInstallMsgHandler(debugInit); #endif - bool serviceRequest = false; - if(argc >1) - { - serviceRequest = true; + + + + MsgActivityHandler* activityHandler = new MsgActivityHandler(&app); + // clear the old activities + activityHandler->clearActivities(); + + // connect to aboutToQuit signal to save activity + QObject::connect(&app, SIGNAL(aboutToQuit()), + activityHandler, SLOT(saveActivity())); + + if(app.activateReason() == Hb::ActivationReasonActivity) { + // restoring an activity, not a fresh startup or a service + QVariant data = app.activateData(); + activityHandler->handleActivity(data); + // set service request to false , since its a activity launch + serviceRequest = false; } + // Main window QPointer mainWindow = new MsgMainWindow(serviceRequest); + // Set the main window pointer to activity handler. + activityHandler->setMainWindow(mainWindow); mainWindow->show(); // Event loop int error = app.exec(); - + HbApplication::processEvents(); + // delete main window and return error delete mainWindow; + return error; } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/src/msgactivityhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/msgapp/src/msgactivityhandler.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,106 @@ +/* + * 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: + * Handles saving and opening activites. + * + */ + +#include "msgactivityhandler.h" + +#include "msgviewmanager.h" +#include "msgbaseview.h" +#include "msgmainwindow.h" +#include +#include +#include + +// Activity Names +const QString ListViewActivityName("MsgConversationsList"); + +//----------------------------------------------------------------------------- +// MsgActivityHandler::MsgActivityHandler +// Constructor +//----------------------------------------------------------------------------- +MsgActivityHandler::MsgActivityHandler(QObject* parent): + QObject(parent) +{ + +} + +//----------------------------------------------------------------------------- +// MsgActivityHandler::MsgActivityHandler +// Destructor +//----------------------------------------------------------------------------- +MsgActivityHandler::~MsgActivityHandler() +{ + +} + +//----------------------------------------------------------------------------- +// MsgActivityHandler::saveActivity +// @see header +//----------------------------------------------------------------------------- +void MsgActivityHandler::saveActivity() +{ + HbActivityManager* activityManager = + qobject_cast(qApp)->activityManager(); + + if( mMainWindow->viewManager()->currentView()== MsgBaseView::CLV) + { + // get a screenshot for saving to the activity manager + QVariantHash metadata; + metadata.insert("screenshot", + QPixmap::grabWidget(mMainWindow, mMainWindow->rect())); + + // save any data necessary to save the state + QByteArray serializedActivity; + QDataStream stream(&serializedActivity, + QIODevice::WriteOnly | QIODevice::Append); + stream << ListViewActivityName; + + // add the activity to the activity manager + bool ok = activityManager->addActivity(ListViewActivityName, + serializedActivity, metadata); + } +} + +//----------------------------------------------------------------------------- +// MsgActivityHandler::handleActivity +// @see header +//----------------------------------------------------------------------------- +void MsgActivityHandler::handleActivity(const QVariant &activityData) +{ + // To be handled later + Q_UNUSED(activityData) +} + +//----------------------------------------------------------------------------- +// MsgActivityHandler::clearActivities +// @see header +//----------------------------------------------------------------------------- +void MsgActivityHandler::clearActivities() +{ + HbActivityManager* activityManager = + qobject_cast(qApp)->activityManager(); + activityManager->removeActivity(ListViewActivityName); +} + +//----------------------------------------------------------------------------- +// MsgActivityHandler::setMainWindow +// @see header +//----------------------------------------------------------------------------- +void MsgActivityHandler::setMainWindow(MsgMainWindow* mainWindow) +{ + mMainWindow = mainWindow; +} diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/src/msglistview.cpp --- a/messagingapp/msgui/msgapp/src/msglistview.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/src/msglistview.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -80,9 +80,26 @@ // @see header //--------------------------------------------------------------- MsgListView::MsgListView(QGraphicsItem *parent) : - MsgBaseView(parent), - mItemLongPressed(false) + MsgBaseView(parent) { + //These changes are needed for splash implementation to avoid flicker + setupToolBar(); + setupMenu(); + + // Create parent layout. + mMainLayout = new QGraphicsLinearLayout(Qt::Vertical); + mMainLayout->setContentsMargins(0, 0, 0, 0); + mMainLayout->setSpacing(0); + + // Create view heading. + HbGroupBox *viewHeading = new HbGroupBox(); + viewHeading->setHeading(LOC_VIEW_HEADING); + + // Add view heading widget to main layout. + mMainLayout->addItem(viewHeading); + + this->setLayout(mMainLayout); + connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); } @@ -101,7 +118,6 @@ //--------------------------------------------------------------- void MsgListView::longPressed(HbAbstractViewItem* viewItem, const QPointF& point) { - mItemLongPressed = true; if (this->isVisible()) { // Set the current index as the present Item's index. // By default it will not be set. @@ -144,11 +160,6 @@ //--------------------------------------------------------------- void MsgListView::openConversation(const QModelIndex& index) { - if(mItemLongPressed) - { - mItemLongPressed = false; - return; - } //TODO: model populating possibilities. if (index.isValid()) { QVariant conversationId = index.data(ConversationId); @@ -232,15 +243,6 @@ //--------------------------------------------------------------- void MsgListView::setupListView() { - // Create parent layout. - QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical); - mainLayout->setContentsMargins(0, 0, 0, 0); - mainLayout->setSpacing(0); - - // Create view heading. - HbGroupBox *viewHeading = new HbGroupBox(); - viewHeading->setHeading(LOC_VIEW_HEADING); - // Register the custorm css path. HbStyleLoader::registerFilePath(":/clv"); @@ -275,11 +277,8 @@ connect(mMsgList, SIGNAL(longPressed(HbAbstractViewItem*, const QPointF&)), this, SLOT(longPressed(HbAbstractViewItem*, const QPointF&))); - // Add all widgets to main layout. - mainLayout->addItem(viewHeading); - mainLayout->addItem(mMsgList); - - this->setLayout(mainLayout); + // Add list view to main layout. + mMainLayout->addItem(mMsgList); } //--------------------------------------------------------------- @@ -347,10 +346,8 @@ // @see header //--------------------------------------------------------------- void MsgListView::doDelayedConstruction() - { - setupToolBar(); + { setupListView(); - setupMenu(); disconnect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction())); } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/src/msglistviewitem.cpp --- a/messagingapp/msgui/msgapp/src/msglistviewitem.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/src/msglistviewitem.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -78,49 +78,13 @@ //--------------------------------------------------------------- void MsgListViewItem::updateChildItems() { - if (!mAddressLabelItem) - { - mAddressLabelItem = new HbTextItem(this); - HbStyle::setItemName(mAddressLabelItem, "addressLabel"); - } - if (!mTimestampItem) - { - mTimestampItem = new HbTextItem(this); - HbStyle::setItemName(mTimestampItem, "timeLabel"); - } - if (!mPreviewLabelItem) - { - mPreviewLabelItem = new HbTextItem(this); - mPreviewLabelItem->setTextWrapping(Hb::TextWordWrap); - HbStyle::setItemName(mPreviewLabelItem, "previewLabel"); - } - if (!mUnreadCountItem) - { - mUnreadCountItem = new HbTextItem(this); - HbStyle::setItemName(mUnreadCountItem, "unreadCount"); - } - if (!mNewMsgIndicatorItem) - { - mNewMsgIndicatorItem = new HbFrameItem(this); - HbStyle::setItemName(mNewMsgIndicatorItem, "newMsgIndicator"); + initItems(); - mNewMsgIndicatorItem->frameDrawer().setFrameType( - HbFrameDrawer::ThreePiecesVertical); - } - - // Set the message text depending upon the message type - int messageType = modelIndex().data(MessageType).toInt(); - int messageSubType = modelIndex().data(MessageSubType).toInt(); - int messageState = modelIndex().data(SendingState).toInt(); - int messageDirection = modelIndex().data(Direction).toInt(); - QString prevText; - prevText = previewText(messageType, messageSubType, messageState,messageDirection); - prevText.replace(QChar::ParagraphSeparator, QChar::LineSeparator); - prevText.replace('\r', QChar::LineSeparator); - mPreviewLabelItem->setText(prevText); + setTimestampAndPreviewText(); // Address label QString contactName; + int messageType = modelIndex().data(MessageType).toInt(); if(messageType == ConvergedMessage::BT) { contactName = LOC_RECEIVED_FILES; @@ -148,33 +112,72 @@ { QString unRead(tr("(%n)", "", unreadCount)); mUnreadCountItem->setText(unRead); - mUnReadMsg = true; - mNewMsgIndicatorItem->frameDrawer().setFrameGraphicsName(NEW_ITEM_FRAME); + if(!mUnReadMsg) + { + mUnReadMsg = true; + mNewMsgIndicatorItem->frameDrawer().setFrameGraphicsName(NEW_ITEM_FRAME); + repolish(); + } } else { - mUnreadCountItem->setText(QString()); - mNewMsgIndicatorItem->frameDrawer().setFrameGraphicsName(QString()); - mUnReadMsg = false; - repolish(); + mUnreadCountItem->setText(QString()); + if(mUnReadMsg) + { + mUnReadMsg = false; + mNewMsgIndicatorItem->frameDrawer().setFrameGraphicsName(QString()); + repolish(); + } } HbListViewItem::updateChildItems(); } //--------------------------------------------------------------- -// MsgListViewItem::previewText +// MsgListViewItem::initItems // @see header //--------------------------------------------------------------- -QString MsgListViewItem::previewText(int msgType, - int msgSubType, - int msgState, - int msgDirection) +void MsgListViewItem::initItems() +{ + if (!mAddressLabelItem) { + mAddressLabelItem = new HbTextItem(this); + HbStyle::setItemName(mAddressLabelItem, "addressLabel"); + } + if (!mTimestampItem) { + mTimestampItem = new HbTextItem(this); + HbStyle::setItemName(mTimestampItem, "timeLabel"); + } + if (!mPreviewLabelItem) { + mPreviewLabelItem = new HbTextItem(this); + mPreviewLabelItem->setTextWrapping(Hb::TextWordWrap); + HbStyle::setItemName(mPreviewLabelItem, "previewLabel"); + } + if (!mUnreadCountItem) { + mUnreadCountItem = new HbTextItem(this); + HbStyle::setItemName(mUnreadCountItem, "unreadCount"); + } + if (!mNewMsgIndicatorItem) { + mNewMsgIndicatorItem = new HbFrameItem(this); + HbStyle::setItemName(mNewMsgIndicatorItem, "newMsgIndicator"); + + mNewMsgIndicatorItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical); + } + if (!mPresenceIndicatorItem) { + mPresenceIndicatorItem = new HbIconItem(this); + HbStyle::setItemName(mPresenceIndicatorItem, "presenceIndicator"); + } +} +//--------------------------------------------------------------- +// MsgListViewItem::defaultPreviewText +// @see header +//--------------------------------------------------------------- +QString MsgListViewItem::defaultPreviewText(int msgType, int msgSubType) { QString bodyText(modelIndex().data(BodyText).toString()); QString previewText; // Set the message text & icons, depending upon the message type if (msgType == ConvergedMessage::BioMsg) { + if (msgSubType == ConvergedMessage::RingingTone) { previewText = LOC_RINGING_TONE; } @@ -184,14 +187,19 @@ previewText.append(bodyText); } else if (msgSubType == ConvergedMessage::Provisioning) { - previewText = bodyText; - } + previewText = bodyText; + } + else if (msgSubType == ConvergedMessage::NokiaService) { + previewText = bodyText; + } else { previewText = LOC_UNSUPPORTED_MSG_TYPE; } + + mPresenceIndicatorItem->setVisible(false); } else if (msgType == ConvergedMessage::BT) { - + if (msgSubType == ConvergedMessage::VCard) { previewText = LOC_BUSINESS_CARD; previewText.append(QChar::LineSeparator); @@ -200,26 +208,26 @@ else { previewText = bodyText; } - if (!mPresenceIndicatorItem) { - mPresenceIndicatorItem = new HbIconItem(this); - HbStyle::setItemName(mPresenceIndicatorItem, "presenceIndicator"); - mPresenceIndicatorItem->setIconName(BT_ICON); - } + + mPresenceIndicatorItem->setIconName(BT_ICON); + mPresenceIndicatorItem->setVisible(true); } else { - previewText = textBySendState(msgState,msgDirection); + // All message types except BIO & BT. + previewText = modelIndex().data(BodyText).toString(); + mPresenceIndicatorItem->setVisible(false); } return previewText; } //--------------------------------------------------------------- -// MsgListViewItem::textBySendState +// MsgListViewItem::setTimestampAndPreviewText // @see header //--------------------------------------------------------------- -QString MsgListViewItem::textBySendState(int sendState,int msgDirection) +void MsgListViewItem::setTimestampAndPreviewText() { - QString previewText; + // Get timestamp QDateTime dateTime; dateTime.setTime_t(modelIndex().data(TimeStamp).toUInt()); QString dateString; @@ -230,80 +238,55 @@ dateString = MsgUtils::dateTimeToString(dateTime, DATE_FORMAT); } - if (msgDirection == ConvergedMessage::Outgoing) - { - switch (sendState) - { - case ConvergedMessage::Resend: - { - - QString resendString = LOC_MSG_RESEND_AT + dateString; - previewText = resendString; - dateString = QString(""); - if (!mPresenceIndicatorItem) - { - mPresenceIndicatorItem = new HbIconItem(this); - } - HbStyle::setItemName(mPresenceIndicatorItem, - "presenceIndicator"); - mPresenceIndicatorItem->setIconName(MSG_OUTGOING_ICON); - mPresenceIndicatorItem->setVisible(true); - break; - } + // Set preview text & time based on direction + int msgType = modelIndex().data(MessageType).toInt(); + int msgSubType = modelIndex().data(MessageSubType).toInt(); + int sendState = modelIndex().data(SendingState).toInt(); + int msgDirection = modelIndex().data(Direction).toInt(); + QString previewText; + if (ConvergedMessage::Incoming == msgDirection) { + previewText = defaultPreviewText(msgType, msgSubType); + } + else if (msgDirection == ConvergedMessage::Outgoing) { - case ConvergedMessage::Sending: - case ConvergedMessage::Suspended: - case ConvergedMessage::Scheduled: - case ConvergedMessage::Waiting: - { - previewText = QString(LOC_MSG_OUTGOING); - if (!mPresenceIndicatorItem) - { - mPresenceIndicatorItem = new HbIconItem(this); - } - HbStyle::setItemName(mPresenceIndicatorItem, - "presenceIndicator"); - mPresenceIndicatorItem->setIconName(MSG_OUTGOING_ICON); - mPresenceIndicatorItem->setVisible(true); - break; - } - case ConvergedMessage::Failed: - { - previewText = QString(LOC_MSG_SEND_FAILED); - if (!mPresenceIndicatorItem) - { - mPresenceIndicatorItem = new HbIconItem(this); - } - HbStyle::setItemName(mPresenceIndicatorItem, - "presenceIndicator"); - mPresenceIndicatorItem->setIconName(MSG_FAILED_ICON); - mPresenceIndicatorItem->setVisible(true); - break; - } - default: - QString postFix = QString(""); - previewText = modelIndex().data(BodyText).toString(); - previewText += (QChar(QChar::LineSeparator) + postFix); - - if (!mPresenceIndicatorItem) - { - mPresenceIndicatorItem = new HbIconItem(this); - } - - HbStyle::setItemName(mPresenceIndicatorItem, - "presenceIndicator"); - mPresenceIndicatorItem->setIconName(MSG_FAILED_ICON); - mPresenceIndicatorItem->setVisible(false); - - break; + switch (sendState) { + case ConvergedMessage::Resend: + { + previewText = LOC_MSG_RESEND_AT + dateString; + dateString = QString(); + mPresenceIndicatorItem->setIconName(MSG_OUTGOING_ICON); + mPresenceIndicatorItem->setVisible(true); + break; + } + case ConvergedMessage::Sending: + case ConvergedMessage::Suspended: + case ConvergedMessage::Scheduled: + case ConvergedMessage::Waiting: + { + previewText = QString(LOC_MSG_OUTGOING); + mPresenceIndicatorItem->setIconName(MSG_OUTGOING_ICON); + mPresenceIndicatorItem->setVisible(true); + break; + } + case ConvergedMessage::Failed: + { + previewText = QString(LOC_MSG_SEND_FAILED); + mPresenceIndicatorItem->setIconName(MSG_FAILED_ICON); + mPresenceIndicatorItem->setVisible(true); + break; + } + default: + { + // Successful case + previewText = defaultPreviewText(msgType, msgSubType); + break; + } } } - else - { - previewText = modelIndex().data(BodyText).toString(); - } + previewText.replace(QChar::ParagraphSeparator, QChar::LineSeparator); + previewText.replace('\r', QChar::LineSeparator); + mPreviewLabelItem->setText(previewText); mTimestampItem->setText(dateString); - return previewText; } //--------------------------------------------------------------- diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/src/msgmainwindow.cpp --- a/messagingapp/msgui/msgapp/src/msgmainwindow.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/src/msgmainwindow.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -31,9 +31,9 @@ MsgMainWindow::MsgMainWindow(bool serviceRequest, QWidget *parent) : HbMainWindow(parent), mMsgSI(0), mMsgSendSI(0) { - MsgViewManager* viewManager = new MsgViewManager(serviceRequest,this,this); - mMsgSI = new MsgServiceInterface(NULL,viewManager); - mMsgSendSI = new MsgSendServiceInterface(NULL,viewManager); + mViewManager = new MsgViewManager(serviceRequest,this,this); + mMsgSI = new MsgServiceInterface(NULL,mViewManager); + mMsgSendSI = new MsgSendServiceInterface(NULL,mViewManager); //Model creation ConversationsEngine::instance(); @@ -60,4 +60,12 @@ delete ConversationsEngine::instance(); } +//--------------------------------------------------------------- +// MsgMainWindow::viewManager +// Constructor +//--------------------------------------------------------------- +MsgViewManager* MsgMainWindow::viewManager() +{ + return mViewManager; +} // End of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/src/msgserviceinterface.cpp --- a/messagingapp/msgui/msgapp/src/msgserviceinterface.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/src/msgserviceinterface.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -91,10 +91,11 @@ ContactDetail &contactDetail) { QString displayLabel = QString(""); + int count; int localId = MsgContactHandler::resolveContactDisplayName(address.address(), displayLabel, - 0); + count); if (localId != -1) { @@ -104,5 +105,5 @@ } return false; - } +} diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msgapp/src/msgviewmanager.cpp --- a/messagingapp/msgui/msgapp/src/msgviewmanager.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msgapp/src/msgviewmanager.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include "conversationsengine.h" @@ -211,9 +211,6 @@ void MsgViewManager::switchView(const QVariantList& data) { - - connect(mMainWindow, SIGNAL(viewReady()),this,SLOT(setViewInteractive())); - mMainWindow->setInteractive(false); int viewId = data.at(0).toInt(); @@ -679,22 +676,18 @@ //switch to univiewer. if (data.length() > 2) { qint32 contactId = data.at(2).toLongLong(); - QByteArray dataArray = data.at(3).toByteArray(); + qint32 messageId = data.at(3).toInt(); int msgCount = data.at(4).toInt(); - - ConvergedMessage *message = new ConvergedMessage; - QDataStream stream(&dataArray, QIODevice::ReadOnly); - message->deserialize(stream); - qint32 messageId = message->id()->getId(); + int canForwardMessage = data.at(5).toInt(); + if (!mUniViewer) { - mUniViewer = new UnifiedViewer(messageId); + mUniViewer = new UnifiedViewer(messageId, canForwardMessage); mUniViewer->setNavigationAction(mBackAction); mMainWindow->addView(mUniViewer); connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this, SLOT(switchView(const QVariantList&))); } - mUniViewer->populateContent(messageId, true, msgCount); - delete message; + mUniViewer->populateContent(messageId, true, msgCount); } if(mPreviousView==MsgBaseView::CV && mConversationView) @@ -948,3 +941,11 @@ HbApplication::quit(); } +// ---------------------------------------------------------------------------- +// MsgViewManager::currentView +// @see header +// ---------------------------------------------------------------------------- +int MsgViewManager::currentView() + { + return mCurrentView; + } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msguiutils/inc/mmsconformancecheck.h --- a/messagingapp/msgui/msguiutils/inc/mmsconformancecheck.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msguiutils/inc/mmsconformancecheck.h Fri Jun 11 13:35:48 2010 +0300 @@ -20,7 +20,7 @@ #include -#include +#include #include #ifdef BUILD_MSGUI_UTILS_DLL @@ -70,16 +70,6 @@ */ int checkModeForInsert(const QString& file,bool showNote = true); - /** - * Validates if message can be forwarded - * The validation checks include slide count check,MMS size check and - * media conformance checks and this fucntion should be called only for mms - * @param messageId message Id of the message to be validate - * @return true if message can be forwarded - * false if message cant be forwarded - */ - bool validateMsgForForward(int messageId); - private: /* diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msguiutils/inc/msgcontactsutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/msguiutils/inc/msgcontactsutil.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,43 @@ +/* + * 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: This static utility class handles all contacts & phbk + * services related common functions for UI modules. + * + */ + +#ifndef MSGCONTACTSUTIL_H_ +#define MSGCONTACTSUTIL_H_ + +#ifdef BUILD_MSGUI_UTILS_DLL +#define MSGUI_UTILS_DLL_EXPORT Q_DECL_EXPORT +#else +#define MSGUI_UTILS_DLL_EXPORT Q_DECL_IMPORT +#endif + +/** + * static utility class to handle contacts related common functionality + * for UI modules + */ +class MSGUI_UTILS_DLL_EXPORT MsgContactsUtil +{ + +public: + static bool launchVCardViewer(const QString& filepath); + +private: + static QString copyVCardToTemp(const QString& filepath); + static void deleteVCardFromTemp(const QString& filepath); +}; + +#endif /* MSGCONTACTSUTIL_H_ */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msguiutils/msguiutils.pro --- a/messagingapp/msgui/msguiutils/msguiutils.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msguiutils/msguiutils.pro Fri Jun 11 13:35:48 2010 +0300 @@ -46,11 +46,13 @@ # Input HEADERS += msgsendutil.h \ mmsconformancecheck.h \ - msgmediautil.h + msgmediautil.h \ + msgcontactsutil.h SOURCES += msgsendutil.cpp \ mmsconformancecheck.cpp \ - msgmediautil.cpp + msgmediautil.cpp \ + msgcontactsutil.cpp # Libs LIBS += -lxqservice \ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp --- a/messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -21,19 +21,19 @@ #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include "unidatamodelloader.h" #include "unidatamodelplugininterface.h" -#include "unieditorgenutils.h" // This is needed for KDefaultMaxSize +#include "UniEditorGenUtils.h" // This is needed for KDefaultMaxSize #include "s60qconversions.h" #include "debugtraces.h" @@ -163,78 +163,6 @@ return EInsertSuccess; } -// --------------------------------------------------------- -// MmsConformanceCheck::validateMsgForForward -// --------------------------------------------------------- -// -bool MmsConformanceCheck::validateMsgForForward(int messageId) -{ - UniDataModelLoader* pluginLoader = new UniDataModelLoader(); - UniDataModelPluginInterface* pluginInterface = - pluginLoader->getDataModelPlugin(ConvergedMessage::Mms); - pluginInterface->setMessageId(messageId); - - //Check if slide count is greater than 1 - if (pluginInterface->slideCount() > 1) - { - delete pluginLoader; - return false; - } - - //Check if message size is inside max mms composition limits - if (pluginInterface->messageSize() > iMaxMmsSize) - { - return false; - } - - //If there is restricted content then return false - UniMessageInfoList slideContentList = pluginInterface->slideContent(0); - bool retValue = true; - - for (int i = 0; i < slideContentList.size(); ++i) - { - if (checkModeForInsert(slideContentList.at(i)->path(), false) - != EInsertSuccess) - { - retValue = false; - break; - } - } - - foreach(UniMessageInfo *slide,slideContentList) - { - delete slide; - } - - if (!retValue) - { - delete pluginLoader; - - return false; - } - - UniMessageInfoList modelAttachmentList = pluginInterface->attachmentList(); - - for (int i = 0; i < modelAttachmentList.count(); ++i) - { - if (checkModeForInsert(modelAttachmentList.at(i)->path(), false) - != EInsertSuccess) - { - retValue = false; - break; - } - } - - foreach(UniMessageInfo *attachment,modelAttachmentList) - { - delete attachment; - } - - delete pluginLoader; - - return retValue; -} - // ----------------------------------------------------------------------------- // MmsConformanceCheck::onDialogInsertMedia // ----------------------------------------------------------------------------- diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msguiutils/src/msgcontactsutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/msguiutils/src/msgcontactsutil.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2010 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: This static utility class handles all contacts & phbk services related + * common functions for UI modules. + * + */ + +#include +#include +#include +#include +#include "msgcontactsutil.h" + + +//--------------------------------------------------------------- +// MsgContactsUtil::copyVCardToTemp +// @see header file +//--------------------------------------------------------------- +QString MsgContactsUtil::copyVCardToTemp(const QString& filepath) +{ + QDir tempDir; + QString tempFilePath(QDir::toNativeSeparators(tempDir.tempPath())); + tempFilePath.append(QDir::separator()); + QFileInfo fInfo(filepath); + tempFilePath.append(fInfo.fileName()); + QFile::copy(filepath, tempFilePath); + return tempFilePath; +} + +//--------------------------------------------------------------- +// MsgContactsUtil::deleteVCardFromTemp +// @see header file +//--------------------------------------------------------------- +void MsgContactsUtil::deleteVCardFromTemp(const QString& filepath) +{ + QFile::remove(filepath); +} + +//--------------------------------------------------------------- +// MsgContactsUtil::launchVCardViewer +// @see header file +//--------------------------------------------------------------- +bool MsgContactsUtil::launchVCardViewer(const QString& filepath) +{ + //TODO: remove copyVcsFile after capabilities fix from Contacts + QString newfilepath = copyVCardToTemp(filepath); + + QString service("com.nokia.services.phonebookservices"); + QString interface("Fetch"); + QString operation("editCreateNew(QString)"); + XQApplicationManager appManager; + XQAiwRequest* request = appManager.create(service, interface, operation, true); //embedded + if(request) + { + QList args; + args << newfilepath; + request->setArguments(args); + QVariant retValue; + bool res = request->send(retValue); + delete request; + } + else + { + return false; + } + //TODO: remove deleteVcsFile after capabilities fix from Contacts + deleteVCardFromTemp(newfilepath); + return true; +} + + +// EOF + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/msguiutils/src/msgmediautil.cpp --- a/messagingapp/msgui/msguiutils/src/msgmediautil.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/msguiutils/src/msgmediautil.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -15,7 +15,7 @@ * */ #include -#include +#include #include "msgmediautil.h" diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/mmssettingsdefs.h --- a/messagingapp/msgui/unifiededitor/inc/mmssettingsdefs.h Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +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: MMS settings specific enumerations, constants, declaration. - * - */ - -#ifndef MMSSETTINGSDEFS_H -#define MMSSETTINGSDEFS_H - -// INCLUDES - -// CONSTANTS -// Following definitions are applicable when the Unified SMS and MMS editor is in the build. -// (Naming like KMmsImageSmallWidth cannot be used, because it is defined in mmsconst.h) -// Small image: 640*480 -const TInt KMmsUniImageSmallWidth = 640; -const TInt KMmsUniImageSmallHeight = 480; -// Large image: 1600*1200 -const TInt KMmsUniImageLargeWidth = 1600; -const TInt KMmsUniImageLargeHeight = 1200; - -#endif // MMSSETTINGSDEFS_H - -// End of File diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgattachmentcontainer.h --- a/messagingapp/msgui/unifiededitor/inc/msgattachmentcontainer.h Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +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: Container class for msg attachments - * - */ -#ifndef MSGATTACHMENTCONTAINER_H -#define MSGATTACHMENTCONTAINER_H - -#include -#include "msgunieditorattachment.h" - -class QGraphicsLinearLayout; -class MmsConformanceCheck; - -class MsgAttachmentContainer : public HbWidget - { - Q_OBJECT - -public: - /** - * Add Attachment success/failure states - */ - enum AddAttachmentStatus - { - EAddSuccess = 0, EAddNotSupported, EAddSizeExceed - }; - - /** - * Constructor - */ - MsgAttachmentContainer( QGraphicsItem *parent = 0); - - /** - * Destructor - */ - ~MsgAttachmentContainer(); - - /** - * add attachment to the container - * @param filepath of the attachment - * @return add operation status - */ - MsgAttachmentContainer::AddAttachmentStatus addAttachment( - const QString& filepath); - - /** - * count of attachments in the container - * @return count - */ - int count(); - - /** - * List of attachments in the container - * @return attachments list - */ - MsgUnifiedEditorAttachmentList attachmentList(); - - /** - * Check if the container hold multimedia content - * @return true, if multimedia content is present - * false, otherwise. - */ - bool hasMMContent(); - - /** - * Size of the attachment container - * @return size - */ - int containerSize(); - -signals: - /** - * emit when container content changes - */ - void contentChanged(); - - /** - * emit to indicate view that container is now empty - * View deletes the container if it becomes empty - */ - void emptyAttachmentContainer(); - -private slots: - /** - * delete attachment from the container - */ - void deleteAttachment(MsgUnifiedEditorAttachment* attachment); - -private: - /** - * size of the msg - */ - int messageSize(); - -private: - - /** - * container's layout - */ - QGraphicsLinearLayout* mLayout; - - /** - * MMS conformance check utility class - */ - MmsConformanceCheck* mMmsConformanceCheck; - - /** - * attachment list - */ - MsgUnifiedEditorAttachmentList mAttachmentList; - - /** - * flag to tell, if container is holding MM content - */ - bool mIsMMContent; - }; - -#endif // MSGATTACHMENTCONTAINER_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgmonitor.h --- a/messagingapp/msgui/unifiededitor/inc/msgmonitor.h Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,217 +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: Helper class to monitor msg construction in unified editor - * - */ - -#ifndef MSG_MONITOR_H -#define MSG_MONITOR_H - -#include -#include "convergedmessage.h" -class MsgUnifiedEditorView; -class HbWidget; -class UniEditorGenUtils; - -/** - * Helper class to monitor message's contruction in unified editor. - * This class is for only reading editor's content to run its logic. - * This class is NOT a place for content editing inside editor. - */ -class MsgMonitor : public QObject - { - Q_OBJECT - -public: - /** - * Constructor - */ - MsgMonitor(QObject* parent=0); - - /** - * Destructor - */ - ~MsgMonitor(); - - /** - * Set to skip showing note for first time - * @param skip true/false - */ - inline void setSkipNote(bool skip = true); - - /** - * Seeker method to access current message type - */ - static inline ConvergedMessage::MessageType messageType(); - - /** - * seeker function to get current msg size in bytes - */ - static inline int messageSize(); - - /** - * seeker function to get current msg's body size - * in bytes - */ - static inline int bodySize(); - - /** - * seeker function to get current msg's attachment - * container size in bytes - */ - static inline int containerSize(); - - /** - * seeker function to get current msg's subject - * size in bytes - */ - static inline int subjectSize(); - - /** - * seeker function to get max possible mms size - * in bytes - */ - static inline int maxMmsSize(); - - /** - * seeker funtion to get max recipient count for sms - */ - static inline int maxSmsRecipients(); - - /** - * seeker funtion to get max recipient count for mms - */ - static inline int maxMmsRecipients(); - - /** - * get total address count in To, Cc & Bcc fields - */ - static inline int msgAddressCount(); - -public slots: - /** - * slot to handle content change in any editor component - */ - void handleContentChange(); - -private: - /** - * setter method to initialize content - */ - void init(); - - /** - * Determine the projected msg type due to change in editor content - */ - ConvergedMessage::MessageType projectedMsgType(); - - /** - * update various msg info changes during editing - * @param senderWidget, Editor widget which triggered - * content change slot - */ - void updateMsgInfo(HbWidget* senderWidget); - - /** - * show type change discreet note - */ - void showPopup(const QString& text); - - /** - * accessor for view - */ - MsgUnifiedEditorView* view(); - - /** - * check editor body for MMS content - * @return true if MMS content is present - */ - bool bodyHasMMSContent(); - - /** - * check editor subject for MMS content - * @return true if MMS content is present - */ - bool subjectHasMMSContent(); - - /** - * check editor attachment container for MMS content - * @return true if MMS content is present - */ - bool containerHasMMSContent(); - - /** - * check for other MMS content criteria - * @return true if MMS criteria is met - */ - bool otherMMSCriteriaMet(); - -private: - - /** - * Flag to skip showing the type change popup. - * Note need to be skipped when an mms is opened from draft. - */ - bool mSkipNote; - - /** - * Type of msg under composition in the editor - */ - static ConvergedMessage::MessageType mMessageType; - - /** - * msg body size in bytes - */ - static int mBodySize; - - /** - * msg container size in bytes - */ - static int mContainerSize; - - /** - * msg subject size in bytes - */ - static int mSubjectSize; - - /** - * max mms size in bytes - */ - static int mMaxMmsSize; - - /** - * max recipient count in an sms - */ - static int mMaxSmsRecipients; - - /** - * max recipient count in an sms - */ - static int mMaxMmsRecipients; - - /** - * current msg address count (to + cc + bcc) - */ - static int mMsgCurrAddressCount; - - /** - * UniEditorGenUtils object - * Owned - */ - UniEditorGenUtils* mUniEditorGenUtils; - }; - -#include "msgmonitor.inl" - -#endif //MSG_MONITOR_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgmonitor.inl --- a/messagingapp/msgui/unifiededitor/inc/msgmonitor.inl Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* Copyright (c) 2007 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: msgmonitor.inl -*/ - - - -// ========== INLINE METHODS =============================== - -//--------------------------------------------------------------- -// MsgMonitor::setSkipNote -// @see header file -//--------------------------------------------------------------- -inline void MsgMonitor::setSkipNote(bool skip) -{ - mSkipNote = skip; -} - -//--------------------------------------------------------------- -// MsgMonitor::messageType -// @see header file -//--------------------------------------------------------------- -inline ConvergedMessage::MessageType MsgMonitor::messageType() -{ - return mMessageType; -} - -//--------------------------------------------------------------- -// MsgMonitor::messageSize -// @see header file -//--------------------------------------------------------------- -inline int MsgMonitor::messageSize() -{ - return mBodySize + mContainerSize + mSubjectSize; -} - -//--------------------------------------------------------------- -// MsgMonitor::bodySize -// @see header file -//--------------------------------------------------------------- -inline int MsgMonitor::bodySize() -{ - return mBodySize; -} - -//--------------------------------------------------------------- -// MsgMonitor::containerSize -// @see header file -//--------------------------------------------------------------- -inline int MsgMonitor::containerSize() -{ - return mContainerSize; -} - -//--------------------------------------------------------------- -// MsgMonitor::subjectSize -// @see header file -//--------------------------------------------------------------- -inline int MsgMonitor::subjectSize() -{ - return mSubjectSize; -} - -//--------------------------------------------------------------- -// MsgMonitor::maxMmsSize -// @see header file -//--------------------------------------------------------------- -inline int MsgMonitor::maxMmsSize() -{ - return mMaxMmsSize; -} - -//--------------------------------------------------------------- -// MsgMonitor::maxSmsRecipients -// @see header file -//--------------------------------------------------------------- -inline int MsgMonitor::maxSmsRecipients() -{ - return mMaxSmsRecipients; -} - -//--------------------------------------------------------------- -// MsgMonitor::maxMmsRecipients -// @see header file -//--------------------------------------------------------------- -inline int MsgMonitor::maxMmsRecipients() -{ - return mMaxMmsRecipients; -} - -//--------------------------------------------------------------- -// MsgMonitor::msgAddressCount -// @see header file -//--------------------------------------------------------------- -inline int MsgMonitor::msgAddressCount() -{ - return mMsgCurrAddressCount; -} - -// End of File diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h Fri Jun 11 13:35:48 2010 +0300 @@ -15,10 +15,10 @@ * */ -#ifndef UNIFIED_EDITOR_ADDRESS_H -#define UNIFIED_EDITOR_ADDRESS_H +#ifndef MSG_UNIFIED_EDITOR_ADDRESS_H +#define MSG_UNIFIED_EDITOR_ADDRESS_H -#include +#include #include #include @@ -132,6 +132,11 @@ * Handle invalid contact dialog useraction */ void handleInvalidContactDialog(HbAction* act); + + /** + * Unblocks signals for pbk buttion after some delay. + */ + void unblockSignals(); private: /** @@ -153,6 +158,13 @@ * Reset the addresslist to previous list */ void resetToPrevious(); + + /** + * checks if the passed sting is a valid address or not. + * @param addr + * @retunr true/false based on valid/invalid. + */ + bool checkValidAddress(const QString& addr); private: @@ -202,4 +214,4 @@ int mExceedsMaxMmsRecipientsBy; }; -#endif //UNIFIED_EDITOR_ADDRESS_H +#endif //MSG_UNIFIED_EDITOR_ADDRESS_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h Fri Jun 11 13:35:48 2010 +0300 @@ -15,8 +15,8 @@ * */ -#ifndef UNIFIED_EDITOR_ATTACHMENT_H -#define UNIFIED_EDITOR_ATTACHMENT_H +#ifndef MSG_UNIFIED_EDITOR_ATTACHMENT_H +#define MSG_UNIFIED_EDITOR_ATTACHMENT_H #include #include @@ -24,6 +24,8 @@ class HbTextItem; class HbIconItem; class HbGestureSceneFilter; +class HbFrameItem; +class MsgUnifiedEditorUtils; class MsgUnifiedEditorAttachment : public HbWidget { @@ -67,24 +69,16 @@ */ bool isMultimediaContent(); - /* - * Depricated - */ - // HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const; - protected: /** * reimplemented from base class. */ - virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); - virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + virtual void gestureEvent(QGestureEvent *event); private: - /** - * Helper method to initialize gesture. - */ - void initGesture(); + + void setPressed(bool pressed); signals: @@ -102,22 +96,33 @@ /** * show longpress menu for attachment object */ - void longPressed(QPointF position); + void handleLongTap(QPointF position); + + /** + * Handles short tap event. + */ + void handleShortTap(); /** * slot to remove attachment from msg editor */ - void removeAttachment(); + void handleRemove(); /** * slot to open attachment */ - void openAttachment(); + void handleOpen(); /** * slot to view details of the attachment file */ void viewDetails(); + + /** + * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture + * events back to back. + */ + void regrabGesture(); private: /** @@ -159,9 +164,21 @@ * Max limit on sms size. Store at class level for optimization */ int mMaxSmsSize; + + /** + * Background item + * Own + */ + HbFrameItem* mBackGround; + + /** + * MsgUnifiedEditorUtils object. + * Own + */ + MsgUnifiedEditorUtils *mEditorUtils; }; typedef QList MsgUnifiedEditorAttachmentList; -#endif //UNIFIED_EDITOR_ATTACHMENT_H +#endif //MSG_UNIFIED_EDITOR_ATTACHMENT_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorattachmentcontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorattachmentcontainer.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,129 @@ +/* + * 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: Container class for msg attachments + * + */ +#ifndef MSG_UNIFIED_EDITOR_ATTACHMENT_CONTAINER_H +#define MSG_UNIFIED_EDITOR_ATTACHMENT_CONTAINER_H + +#include +#include "msgunieditorattachment.h" + +class QGraphicsLinearLayout; +class MmsConformanceCheck; + +class MsgAttachmentContainer : public HbWidget + { + Q_OBJECT + +public: + /** + * Add Attachment success/failure states + */ + enum AddAttachmentStatus + { + EAddSuccess = 0, EAddNotSupported, EAddSizeExceed + }; + + /** + * Constructor + */ + MsgAttachmentContainer( QGraphicsItem *parent = 0); + + /** + * Destructor + */ + ~MsgAttachmentContainer(); + + /** + * add attachment to the container + * @param filepath of the attachment + * @return add operation status + */ + MsgAttachmentContainer::AddAttachmentStatus addAttachment( + const QString& filepath); + + /** + * count of attachments in the container + * @return count + */ + int count(); + + /** + * List of attachments in the container + * @return attachments list + */ + MsgUnifiedEditorAttachmentList attachmentList(); + + /** + * Check if the container hold multimedia content + * @return true, if multimedia content is present + * false, otherwise. + */ + bool hasMMContent(); + + /** + * Size of the attachment container + * @return size + */ + int containerSize(); + +signals: + /** + * emit when container content changes + */ + void contentChanged(); + + /** + * emit to indicate view that container is now empty + * View deletes the container if it becomes empty + */ + void emptyAttachmentContainer(); + +private slots: + /** + * delete attachment from the container + */ + void deleteAttachment(MsgUnifiedEditorAttachment* attachment); + +private: + /** + * size of the msg + */ + int messageSize(); + +private: + + /** + * container's layout + */ + QGraphicsLinearLayout* mLayout; + + /** + * MMS conformance check utility class + */ + MmsConformanceCheck* mMmsConformanceCheck; + + /** + * attachment list + */ + MsgUnifiedEditorAttachmentList mAttachmentList; + + /** + * flag to tell, if container is holding MM content + */ + bool mIsMMContent; + }; + +#endif // MSG_UNIFIED_EDITOR_ATTACHMENT_CONTAINER_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditoraudiowidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditoraudiowidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,116 @@ +/* + * 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: This widget is used to display audio content. + * + */ + +#ifndef MSG_UNIFIED_EDITOR_AUDIO_WIDGET_H +#define MSG_UNIFIED_EDITOR_AUDIO_WIDGET_H + +// FORWARD DECLARATIONS +class MsgUnifiedEditorUtils; + +#include + +/** + * @class MsgUniFiedEditorAudioWidget + * @brief This widget is used to display audio content in univiewer. + */ +class MsgUniFiedEditorAudioWidget: public HbPushButton +{ +Q_OBJECT + +public: + + /** + * Constructor + */ + explicit MsgUniFiedEditorAudioWidget(QGraphicsItem *parent = 0); + + /** + * Destructor + */ + ~MsgUniFiedEditorAudioWidget(); + + /** + * Populates the widget contents. + * @param mimeType Mime type of media. + * @param filePath File path of media. + */ + void populate(const QString &filePath); + +signals: + + /** + * Signal emitted when widget is clicked. + * @param mediaPath File path of the media. + */ + void shortTap(const QString &mediaPath); + + /** + * Signal emitted when widget is long tapped. + * @param position Scene coordinates of tap. + */ + void longTap(const QPointF &position); + + /** + * Emitted when remove action is triggered. + */ + void remove(); + +private slots: + + /** + * Handles short tap event. + */ + void handleShortTap(); + + /** + * Handles long tap event. + * @param position Scene coordinates of tap. + */ + void handleLongTap(const QPointF &position); + + /** + * Handles opening of media. + */ + void handleOpen(); + + /** + * Handles removing of media. + */ + void handleRemove(); + + /** + * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture + * events back to back. + */ + void regrabGesture(); + +private: + + /** + * MsgUnifiedEditorUtils object. + * Own + */ + MsgUnifiedEditorUtils *mEditorUtils; + + /** + * Media file path. + */ + QString mMediaPath; +}; + +#endif //MSG_UNIFIED_EDITOR_AUDIO_WIDGET_H +// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorbasewidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorbasewidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,35 @@ +/* + * 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:common base class for editor fields(address field,subject field, + * and body field. + * + */ + +#include + +#ifndef MSG_UNIFIED_EDITOR_BASEWIDGET_H +#define MSG_UNIFIED_EDITOR_BASEWIDGET_H + +class MsgUnifiedEditorBaseWidget: public HbWidget +{ + Q_OBJECT + +public: + MsgUnifiedEditorBaseWidget(QGraphicsItem *parent = 0):HbWidget(parent){} + virtual void setFocus(){} + +}; + + +#endif /* MSG_UNIFIED_EDITOR_BASEWIDGET_H */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h Fri Jun 11 13:35:48 2010 +0300 @@ -15,24 +15,23 @@ * */ -#ifndef UNIFIED_EDITOR_BODY_H -#define UNIFIED_EDITOR_BODY_H +#ifndef MSG_UNIFIED_EDITOR_BODY_H +#define MSG_UNIFIED_EDITOR_BODY_H -#include +#include #include #include "msgunieditorprocessimageoperation.h" class HbTextEdit; class HbTextItem; class HbFrameItem; -class HbIconItem; -class HbPushButton; -//class HbGestureSceneFilter; class CMsgMediaResolver; class CMsgImageInfo; class MmsConformanceCheck; class UniEditorPluginInterface; class UniEditorPluginLoader; +class MsgUnifiedEditorPixmapWidget; +class MsgUniFiedEditorAudioWidget; class MsgUnifiedEditorBody : public MsgUnifiedEditorBaseWidget, @@ -97,13 +96,21 @@ * @return bool */ bool hasAudio(); + + /** + * from MUniEditorProcessImageOperationObserver + * @see MUniEditorProcessImageOperationObserver + */ + void EditorOperationEvent( TUniEditorProcessImageOperationEvent aEvent, + TFileName aFileName ); public slots: /** * Called to insert image content in editor. * @param medialist list of absolute paths of media. + * @param draftMessage specifies draft message */ - void setImage(QString& imagefile); + void setImage(QString& imagefile, bool draftMessage = false); /** * Called to insert audio content in editor. @@ -127,14 +134,14 @@ * Emitted when msg-body content changes */ void contentChanged(); + + /** + * Emitted when image is being processed. + * @param enable, true to enable/ false to disable. + */ + void enableSendButton(bool enable) const; -public: // from MUniEditorProcessImageOperationObserver - - /* - * @see MUniEditorProcessImageOperationObserver - */ - void EditorOperationEvent( TUniEditorProcessImageOperationEvent aEvent, - TFileName aFileName ); + protected: // from HbWidget @@ -145,41 +152,17 @@ QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; private slots: - /** - * called on long press on the media objects - */ - void longPressed(QPointF position); /** * called from the media object's item specific menu */ void removeMedia(); - - /** - * called from the media object's item specific menu - */ - void openMedia(); - - /** - * called from the media object's item specific menu - */ - void viewDetails(); /** * handle text changes in body field */ void onTextChanged(); - /** - * Service launch complete. - */ - void handleOk(const QVariant& result); - - /** - * Service launch errors. - */ - void handleError(int errorCode, const QString& errorMessage); - private: /** @@ -192,12 +175,6 @@ * Set that body now contains an audio */ void setAudio(bool audio = false); - - /** - * Get the region (image/audio/video) where longpress happened - * @return region - */ - QString getHitRegion(QPointF position); /** * size of the msg @@ -238,19 +215,14 @@ HbTextEdit* mTextEdit; /** - * frame for editor. - */ - HbFrameItem* mEditorFrame; - - /** * icon item to preview images. */ - HbIconItem* mIconItem; + MsgUnifiedEditorPixmapWidget* mPixmapItem; /** * inline audio item */ - HbPushButton* mAudioItem; + MsgUniFiedEditorAudioWidget* mAudioItem; /** * Image file contained inside body @@ -271,11 +243,6 @@ * Video file contained inside body */ QString mVideoFile; - - /** - * To setup longpress gesture on media objects - */ - //HbGestureSceneFilter* mGestureFilter; /** * MMs conformance check utility class @@ -359,6 +326,11 @@ * Content widget for processing animation. */ HbWidget* mProcessingWidget; + + /** + * boolean specifying a draft message + */ + bool mDraftMessage ; }; -#endif //UNIFIED_EDITOR_BODY_H +#endif //MSG_UNIFIED_EDITOR_BODY_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorimageprocessor.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorimageprocessor.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorimageprocessor.h Fri Jun 11 13:35:48 2010 +0300 @@ -18,8 +18,8 @@ -#ifndef C_UNIIMAGEPROCESSOR_H -#define C_UNIIMAGEPROCESSOR_H +#ifndef MSG_UNIFIED_EDITOR_IMAGE_PROCESSOR_H +#define MSG_UNIFIED_EDITOR_IMAGE_PROCESSOR_H // INCLUDES #include @@ -412,4 +412,4 @@ #include -#endif // C_UNIIMAGEPROCESSOR_H +#endif // MSG_UNIFIED_EDITOR_IMAGE_PROCESSOR_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorlineedit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorlineedit.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,103 @@ +/* +* 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: Derieved HbLineEdit class for custom address editor +* +*/ + +#ifndef MSG_UNIFIED_EDITOR_LINEEDIT_H +#define MSG_UNIFIED_EDITOR_LINEEDIT_H + +#include +#include + + +class MsgUnifiedEditorLineEdit : public HbLineEdit +{ + Q_OBJECT + +public: + /** + * Constructor + */ + MsgUnifiedEditorLineEdit(const QString& label, QGraphicsItem* parent=0); + + /** + * Destructor + */ + ~MsgUnifiedEditorLineEdit(); + + /** + * seeker method for getting address list + */ + QStringList addresses(); + + /** + * Flag to retain or override base-class behaviour + * Needed because address & subject field classes derieve + * from this class, but have different behaviour + */ + void setDefaultBehaviour(bool defaultBehaviour = false); + + /** + * seeker method for getting the text content held by editing field + */ + QString content() const; + + /** + * setter method to clear text content of the editing field + */ + void clearContent(); + + /** + * set highlight on invalid contact + * @param invalidStr, String to be highlighted + */ + void highlightInvalidString(QString invalidStr); + +signals: + void contentsChanged(const QString& text); + +public slots: + void setText(const QString &text, bool underlined = true); + +private slots: + void selectionChanged(const QTextCursor &oldCursor, const QTextCursor& newCursor); + void onContentsChanged(); + void aboutToShowContextMenu(HbMenu *contextMenu, const QPointF &pos); + +protected: // from HbLineEdit + void inputMethodEvent(QInputMethodEvent *event); + void keyPressEvent(QKeyEvent *event); + void gestureEvent(QGestureEvent* event); + void focusInEvent(QFocusEvent* event); + void focusOutEvent(QFocusEvent *event); + void timerEvent (QTimerEvent *event); + + +private: + void setHighlight(int currentPos); + QString text() const; + void handleTap(); + +private: + QRegExp mLabelExpr; + QString mLabel; + QBasicTimer mSelectionSnapTimer; + + int mSelectionStart; + int mSelectionEnd; + bool mDefaultBehaviour; +}; + +#endif // MSG_UNIFIED_EDITOR_LINEEDIT_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditormmssettingsdefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditormmssettingsdefs.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,35 @@ +/* + * 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: MMS settings specific enumerations, constants, declaration. + * + */ + +#ifndef MSG_UNIFIED_EDITOR_MMS_SETTINGSDEFS_H +#define MSG_UNIFIED_EDITOR_MMS_SETTINGSDEFS_H + +// INCLUDES + +// CONSTANTS +// Following definitions are applicable when the Unified SMS and MMS editor is in the build. +// (Naming like KMmsImageSmallWidth cannot be used, because it is defined in mmsconst.h) +// Small image: 640*480 +const TInt KMmsUniImageSmallWidth = 640; +const TInt KMmsUniImageSmallHeight = 480; +// Large image: 1600*1200 +const TInt KMmsUniImageLargeWidth = 1600; +const TInt KMmsUniImageLargeHeight = 1200; + +#endif // MSG_UNIFIED_EDITOR_MMS_SETTINGSDEFS_H + +// End of File diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditormonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditormonitor.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,217 @@ +/* + * 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: Helper class to monitor msg construction in unified editor + * + */ + +#ifndef MSG_UNIFIED_EDITOR_MONITOR_H +#define MSG_UNIFIED_EDITOR_MONITOR_H + +#include +#include "convergedmessage.h" +class MsgUnifiedEditorView; +class HbWidget; +class UniEditorGenUtils; + +/** + * Helper class to monitor message's contruction in unified editor. + * This class is for only reading editor's content to run its logic. + * This class is NOT a place for content editing inside editor. + */ +class MsgUnifiedEditorMonitor : public QObject + { + Q_OBJECT + +public: + /** + * Constructor + */ + MsgUnifiedEditorMonitor(QObject* parent=0); + + /** + * Destructor + */ + ~MsgUnifiedEditorMonitor(); + + /** + * Set to skip showing note for first time + * @param skip true/false + */ + inline void setSkipNote(bool skip = true); + + /** + * Seeker method to access current message type + */ + static inline ConvergedMessage::MessageType messageType(); + + /** + * seeker function to get current msg size in bytes + */ + static inline int messageSize(); + + /** + * seeker function to get current msg's body size + * in bytes + */ + static inline int bodySize(); + + /** + * seeker function to get current msg's attachment + * container size in bytes + */ + static inline int containerSize(); + + /** + * seeker function to get current msg's subject + * size in bytes + */ + static inline int subjectSize(); + + /** + * seeker function to get max possible mms size + * in bytes + */ + static inline int maxMmsSize(); + + /** + * seeker funtion to get max recipient count for sms + */ + static inline int maxSmsRecipients(); + + /** + * seeker funtion to get max recipient count for mms + */ + static inline int maxMmsRecipients(); + + /** + * get total address count in To, Cc & Bcc fields + */ + static inline int msgAddressCount(); + +public slots: + /** + * slot to handle content change in any editor component + */ + void handleContentChange(); + +private: + /** + * setter method to initialize content + */ + void init(); + + /** + * Determine the projected msg type due to change in editor content + */ + ConvergedMessage::MessageType projectedMsgType(); + + /** + * update various msg info changes during editing + * @param senderWidget, Editor widget which triggered + * content change slot + */ + void updateMsgInfo(HbWidget* senderWidget); + + /** + * show type change discreet note + */ + void showPopup(const QString& text); + + /** + * accessor for view + */ + MsgUnifiedEditorView* view(); + + /** + * check editor body for MMS content + * @return true if MMS content is present + */ + bool bodyHasMMSContent(); + + /** + * check editor subject for MMS content + * @return true if MMS content is present + */ + bool subjectHasMMSContent(); + + /** + * check editor attachment container for MMS content + * @return true if MMS content is present + */ + bool containerHasMMSContent(); + + /** + * check for other MMS content criteria + * @return true if MMS criteria is met + */ + bool otherMMSCriteriaMet(); + +private: + + /** + * Flag to skip showing the type change popup. + * Note need to be skipped when an mms is opened from draft. + */ + bool mSkipNote; + + /** + * Type of msg under composition in the editor + */ + static ConvergedMessage::MessageType mMessageType; + + /** + * msg body size in bytes + */ + static int mBodySize; + + /** + * msg container size in bytes + */ + static int mContainerSize; + + /** + * msg subject size in bytes + */ + static int mSubjectSize; + + /** + * max mms size in bytes + */ + static int mMaxMmsSize; + + /** + * max recipient count in an sms + */ + static int mMaxSmsRecipients; + + /** + * max recipient count in an sms + */ + static int mMaxMmsRecipients; + + /** + * current msg address count (to + cc + bcc) + */ + static int mMsgCurrAddressCount; + + /** + * UniEditorGenUtils object + * Owned + */ + UniEditorGenUtils* mUniEditorGenUtils; + }; + +#include "msgunieditormonitor.inl" + +#endif //MSG_UNIFIED_EDITOR_MONITOR_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditormonitor.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditormonitor.inl Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2007 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: msgmonitor.inl +*/ + + + +// ========== INLINE METHODS =============================== + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::setSkipNote +// @see header file +//--------------------------------------------------------------- +inline void MsgUnifiedEditorMonitor::setSkipNote(bool skip) +{ + mSkipNote = skip; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::messageType +// @see header file +//--------------------------------------------------------------- +inline ConvergedMessage::MessageType MsgUnifiedEditorMonitor::messageType() +{ + return mMessageType; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::messageSize +// @see header file +//--------------------------------------------------------------- +inline int MsgUnifiedEditorMonitor::messageSize() +{ + return mBodySize + mContainerSize + mSubjectSize; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::bodySize +// @see header file +//--------------------------------------------------------------- +inline int MsgUnifiedEditorMonitor::bodySize() +{ + return mBodySize; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::containerSize +// @see header file +//--------------------------------------------------------------- +inline int MsgUnifiedEditorMonitor::containerSize() +{ + return mContainerSize; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::subjectSize +// @see header file +//--------------------------------------------------------------- +inline int MsgUnifiedEditorMonitor::subjectSize() +{ + return mSubjectSize; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::maxMmsSize +// @see header file +//--------------------------------------------------------------- +inline int MsgUnifiedEditorMonitor::maxMmsSize() +{ + return mMaxMmsSize; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::maxSmsRecipients +// @see header file +//--------------------------------------------------------------- +inline int MsgUnifiedEditorMonitor::maxSmsRecipients() +{ + return mMaxSmsRecipients; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::maxMmsRecipients +// @see header file +//--------------------------------------------------------------- +inline int MsgUnifiedEditorMonitor::maxMmsRecipients() +{ + return mMaxMmsRecipients; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::msgAddressCount +// @see header file +//--------------------------------------------------------------- +inline int MsgUnifiedEditorMonitor::msgAddressCount() +{ + return mMsgCurrAddressCount; +} + +// End of File diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorpixmapwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorpixmapwidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,131 @@ +/* + * 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: This widget displays the pixmap content. + * + */ + +#ifndef MSG_UNIFIED_EDITOR_PIXMAP_WIDGET_H +#define MSG_UNIFIED_EDITOR_PIXMAP_WIDGET_H + +#include + +// FORWARD DECLARATIONS +class MsgUnifiedEditorUtils; + +/** + * This widget displays the pixmap content. + */ +class MsgUnifiedEditorPixmapWidget: public HbIconItem +{ +Q_OBJECT + +public: + + /** + * Constructor + */ + MsgUnifiedEditorPixmapWidget(QGraphicsItem *parent = 0); + + /** + * Destructor + */ + ~MsgUnifiedEditorPixmapWidget(); + + /** + * Sets the pixmap content to be displayed. + * @param imagePath File path of the image. + */ + void populate(const QString &imagePath); + +signals: + + /** + * Signal emitted when widget is clicked. + * @param mediaPath File path of the media. + */ + void shortTap(const QString &mediaPath); + + /** + * Signal emitted when widget is long tapped. + * @param position Scene coordinates of tap. + */ + void longTap(const QPointF &position); + + /** + * Emitted when remove action is triggered. + */ + void remove(); + +protected: + + /** + * Event handler for gesture events. + * Reimplemented from HbWidgetBase. + * @see HbWidgetBase + */ + virtual void gestureEvent(QGestureEvent *event); + +private slots: + + /** + * Handles opening of media. + */ + void handleOpen(); + + /** + * Handles removing of media. + */ + void handleRemove(); + + /** + * Handles opening of details view. + */ + void viewDetails(); + + /** + * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture + * events back to back. + */ + void regrabGesture(); + +private: + + /** + * Handles short tap event. + */ + void handleShortTap(); + + /** + * Handles long tap event. + * @param position Scene coordinates of tap. + */ + void handleLongTap(const QPointF &position); + +private: + + /** + * MsgUnifiedEditorUtils object. + * Own + */ + MsgUnifiedEditorUtils *mEditorUtils; + + /** + * Pixmap file path being set. + */ + QString mPixmapPath; +}; + +#endif /* MSG_UNIFIED_EDITOR_PIXMAP_WIDGET_H */ + +// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorprocessimageoperation.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorprocessimageoperation.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorprocessimageoperation.h Fri Jun 11 13:35:48 2010 +0300 @@ -17,8 +17,8 @@ -#ifndef __UNIEDITORPROCESSIMAGEOPERATION_H -#define __UNIEDITORPROCESSIMAGEOPERATION_H +#ifndef MSG_UNIFIED_EDITOR_PROCESS_IMAGEOPERATION_H +#define MSG_UNIFIED_EDITOR_PROCESS_IMAGEOPERATION_H // INCLUDES @@ -262,4 +262,4 @@ TBool largeImageQuery; }; -#endif //__UNIEDITORPROCESSIMAGEOPERATION_H +#endif //MSG_UNIFIED_EDITOR_PROCESS_IMAGEOPERATION_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h Fri Jun 11 13:35:48 2010 +0300 @@ -14,10 +14,10 @@ * Description: */ -#ifndef UNIFIED_EDITOR_SUBJECT_H -#define UNIFIED_EDITOR_SUBJECT_H +#ifndef MSG_UNIFIED_EDITOR_SUBJECT_H +#define MSG_UNIFIED_EDITOR_SUBJECT_H -#include +#include #include "convergedmessage.h" @@ -120,4 +120,4 @@ QString mPrevBuffer; }; -#endif //UNIFIED_EDITOR_SUBJECT_H +#endif //MSG_UNIFIED_EDITOR_SUBJECT_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorutils.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,90 @@ +/* + * 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: Utility class for unieditor. + * + */ + +#ifndef MSG_UNIFIED_EDITOR_UTILS_H +#define MSG_UNIFIED_EDITOR_UTILS_H + +// SYSTEM INCLUDES +#include + +// FORWARD DECLARATIONS + +/** + * @class MsgUnifiedEditorUtils + * @brief Utility class for univiewer. Contains common functionality required + * for widgets. + */ + +class MsgUnifiedEditorUtils: public QObject +{ +Q_OBJECT + +public: + + /** + * Constructor + */ + explicit MsgUnifiedEditorUtils(QObject *parent = 0); + + /** + * Destructor + */ + virtual ~MsgUnifiedEditorUtils(); + + /** + * Utility function to launch different content viewers. + * @param mimeType Mime type of the content. + * @param filePath Absolute file path of content. + */ + void launchContentViewer(const QString &mimeType, const QString &filePath); + +signals: + + /** + * Service launch complete. + */ + void requestOk(const QVariant& result); + + /** + * Service launch errors. + */ + void requestError(int errorCode, const QString& errorMessage); + +private slots: + + /** + * Service launch complete. + */ + void handleOk(const QVariant& result); + + /** + * Service launch errors. + */ + void handleError(int errorCode, const QString& errorMessage); + +private: + + /** + * Launch content viewer using XQSharableFile. + * @param filePath Absolute path of content. + */ + void launchViaSharableFile(const QString &filePath); + +}; + +#endif // MSG_UNIFIED_EDITOR_UTILS_H +//eof diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunieditorview.h --- a/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h Fri Jun 11 13:35:48 2010 +0300 @@ -15,8 +15,8 @@ * */ -#ifndef UNIFIED_EDITOR_VIEW_H -#define UNIFIED_EDITOR_VIEW_H +#ifndef MSG_UNIFIED_EDITOR_VIEW_H +#define MSG_UNIFIED_EDITOR_VIEW_H #ifdef UNIFIEDEDITOR_DLL #define UNIFIEDEDITOR_EXPORT Q_DECL_EXPORT @@ -35,7 +35,7 @@ class MsgUnifiedEditorSubject; class MsgUnifiedEditorAddress; class MsgUnifiedEditorBody; -class MsgMonitor; +class MsgUnifiedEditorMonitor; class MsgAttachmentContainer; class UniEditorPluginLoader; class HbListWidgetItem; @@ -105,9 +105,11 @@ /** * Populate editor with prepopulated msg content + * @param messageDetails message details + * @param draftMessage boolean for specifying draft message */ void populateContentIntoEditor( - const ConvergedMessage& messageDetails); + const ConvergedMessage& messageDetails, bool draftMessage = false); /** * Populate the editor with the forwarded message's content @@ -317,10 +319,17 @@ * @param action selected action (yes or no). */ void onDialogMmsSettings(HbAction* action); + + /** + * Enable/Disable send tool button. + * @param true/false to enable/disable. + */ + void enableSendButton(bool enable); private: HbAction* mSubjectAction; HbAction* mCcBccAction; + HbAction* mSendAction; QGraphicsLinearLayout* mMainLayout; MsgUnifiedEditorSubject* mSubjectField; MsgUnifiedEditorAddress* mToField; @@ -330,7 +339,7 @@ HbWidget* mContentWidget; - MsgMonitor* mMsgMonitor; + MsgUnifiedEditorMonitor* mMsgMonitor; MsgAttachmentContainer* mAttachmentContainer; UniEditorPluginLoader* mPluginLoader; ConvergedMessageId mOpenedMessageId; @@ -347,7 +356,7 @@ */ HbAbstractVkbHost* mVkbHost; - friend class MsgMonitor; + friend class MsgUnifiedEditorMonitor; }; -#endif //UNIFIED_EDITOR_VIEW_H +#endif //MSG_UNIFIED_EDITOR_VIEW_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunifiededitorbasewidget.h --- a/messagingapp/msgui/unifiededitor/inc/msgunifiededitorbasewidget.h Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +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:common base class for editor fields(address field,subject field, - * and body field. - * - */ - -#include - -#ifndef MSGUNIFIEDEDITORBASEWIDGET_H_ -#define MSGUNIFIEDEDITORBASEWIDGET_H_ - -class MsgUnifiedEditorBaseWidget: public HbWidget -{ - Q_OBJECT - -public: - MsgUnifiedEditorBaseWidget(QGraphicsItem *parent = 0):HbWidget(parent){} - virtual void setFocus(){} - -}; - - -#endif /* MSGUNIFIEDEDITORBASEWIDGET_H_ */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/inc/msgunifiededitorlineedit.h --- a/messagingapp/msgui/unifiededitor/inc/msgunifiededitorlineedit.h Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +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: Derieved HbLineEdit class for custom address editor -* -*/ - -#ifndef MSGUNIFIEDEDITORLINEEDIT_H -#define MSGUNIFIEDEDITORLINEEDIT_H - -#include -#include - - -class MsgUnifiedEditorLineEdit : public HbLineEdit -{ - Q_OBJECT - -public: - /** - * Constructor - */ - MsgUnifiedEditorLineEdit(const QString& label, QGraphicsItem* parent=0); - - /** - * Destructor - */ - ~MsgUnifiedEditorLineEdit(); - - /** - * seeker method for getting address list - */ - QStringList addresses(); - - /** - * Flag to retain or override base-class behaviour - * Needed because address & subject field classes derieve - * from this class, but have different behaviour - */ - void setDefaultBehaviour(bool defaultBehaviour = false); - - /** - * seeker method for getting the text content held by editing field - */ - QString content() const; - - /** - * setter method to clear text content of the editing field - */ - void clearContent(); - - /** - * set highlight on invalid contact - * @param invalidStr, String to be highlighted - */ - void highlightInvalidString(QString invalidStr); - -signals: - void contentsChanged(const QString& text); - -public slots: - void setText(const QString &text, bool underlined = true); - void cut(); - void selectAll(); - -private slots: - void selectionChanged(const QTextCursor &oldCursor, const QTextCursor& newCursor); - void onContentsChanged(); - -protected: // from HbLineEdit - void inputMethodEvent(QInputMethodEvent *event); - void keyPressEvent(QKeyEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); - void focusInEvent(QFocusEvent* event); - void focusOutEvent(QFocusEvent *event); - void timerEvent (QTimerEvent *event); - - -private: - void setHighlight(int currentPos); - QString text() const; - -private: - QRegExp mLabelExpr; - QString mLabel; - QBasicTimer mSelectionSnapTimer; - - int mSelectionStart; - int mSelectionEnd; - bool mDefaultBehaviour; -}; - -#endif // MSGUNIFIEDEDITORLINEEDIT_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment.css --- a/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment.css Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment.css Fri Jun 11 13:35:48 2010 +0300 @@ -33,12 +33,7 @@ text-height:var(hb-param-text-height-tiny); text-line-count-min:1; text-line-count-max:1; - fixed-width: 13.0un; + size-policy:fixed fixed; text-align:right; } -MsgUnifiedEditorAttachment::bgFrame -{ - zvalue:-1; -} - diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment.widgetml --- a/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment.widgetml Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment.widgetml Fri Jun 11 13:35:48 2010 +0300 @@ -11,11 +11,6 @@ - - - - - \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorattachment_color.css Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,20 @@ + +MsgUnifiedEditorAttachment[state="normal"]::attachmentDetails +{ + color:var(qtc_list_item_title_normal); +} + +MsgUnifiedEditorAttachment[state="pressed"]::attachmentDetails +{ + color:var(qtc_list_item_pressed); +} + +MsgUnifiedEditorAttachment[state="normal"]::attachmentName +{ + color:var(qtc_list_item_title_normal); +} + +MsgUnifiedEditorAttachment[state="pressed"]::attachmentName +{ + color:var(qtc_list_item_pressed); +} diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml --- a/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/resources/layouts/msgunifiededitorbody.widgetml Fri Jun 11 13:35:48 2010 +0300 @@ -15,11 +15,6 @@ - - - - - @@ -41,11 +36,6 @@ - - - - - @@ -67,11 +57,6 @@ - - - - - diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgattachmentcontainer.cpp --- a/messagingapp/msgui/unifiededitor/src/msgattachmentcontainer.cpp Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +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: attachment container class - * - */ - - -// INCLUDES -#include -#include -#include -#include - -// USER INCLUDES -#include "msgattachmentcontainer.h" -#include "unieditorgenutils.h" -#include "msgmonitor.h" -#include "mmsconformancecheck.h" - -// Constants - -//--------------------------------------------------------------- -// MsgAttachmentContainer::MsgAttachmentContainer -// @see header file -//--------------------------------------------------------------- -MsgAttachmentContainer::MsgAttachmentContainer( QGraphicsItem *parent ) : -HbWidget(parent), -mIsMMContent(false) -{ - mLayout = new QGraphicsLinearLayout(Qt::Vertical, this); - mLayout->setContentsMargins(0,0,0,0); - mLayout->setSpacing(0); - mMmsConformanceCheck = new MmsConformanceCheck; -} - -//--------------------------------------------------------------- -// MsgAttachmentContainer::~MsgAttachmentContainer -// @see header file -//--------------------------------------------------------------- -MsgAttachmentContainer::~MsgAttachmentContainer() -{ - delete mMmsConformanceCheck; -} - -//--------------------------------------------------------------- -// MsgAttachmentContainer::addAttachment -// @see header file -//--------------------------------------------------------------- -MsgAttachmentContainer::AddAttachmentStatus - MsgAttachmentContainer::addAttachment(const QString& filepath) -{ - //check for insert conformance - if(EInsertSuccess != mMmsConformanceCheck->checkModeForInsert(filepath)) - return EAddNotSupported; - - int msgSize = messageSize(); - QFileInfo fileinfo(filepath); - int fileSize = fileinfo.size() + KEstimatedMimeHeaderSize; - - if( (fileSize + msgSize) <= MsgMonitor::maxMmsSize()) - { - MsgUnifiedEditorAttachment* att = new MsgUnifiedEditorAttachment( - filepath, fileSize, this); - if( ((mAttachmentList.count() == 0) && att->isMultimediaContent()) || - ((mAttachmentList.count() == 1) && !mIsMMContent) ) - { - mIsMMContent = true; - } - mAttachmentList << att; - int index = mLayout->count(); - mLayout->insertItem(index,att); - connect(att, SIGNAL(deleteMe(MsgUnifiedEditorAttachment*)), - this, SLOT(deleteAttachment(MsgUnifiedEditorAttachment*))); - - // emit to signal that container content & size changed - emit contentChanged(); - } - else - { - return EAddSizeExceed; - } - return EAddSuccess; -} - -//--------------------------------------------------------------- -// MsgAttachmentContainer::deleteAttachment -// @see header file -//--------------------------------------------------------------- -void MsgAttachmentContainer::deleteAttachment(MsgUnifiedEditorAttachment* attachment) -{ - mAttachmentList.removeOne(attachment); - mLayout->removeItem(attachment); - attachment->setParent(NULL); - delete attachment; - - if( ((mAttachmentList.count() == 1) && !mAttachmentList.first()->isMultimediaContent()) || - ((mAttachmentList.count() == 0) && mIsMMContent) ) - { - mIsMMContent = false; - } - - // emit to indicate change in container content & size - emit contentChanged(); - if(mAttachmentList.count() == 0) - { - emit emptyAttachmentContainer(); - } -} - -//--------------------------------------------------------------- -// MsgAttachmentContainer::count -// @see header file -//--------------------------------------------------------------- -int MsgAttachmentContainer::count() -{ - return mAttachmentList.count(); -} - -//--------------------------------------------------------------- -// MsgAttachmentContainer::attachmentList -// @see header file -//--------------------------------------------------------------- -MsgUnifiedEditorAttachmentList MsgAttachmentContainer::attachmentList() -{ - return mAttachmentList; -} - -//--------------------------------------------------------------- -// MsgAttachmentContainer::containerSize -// @see header file -//--------------------------------------------------------------- -int MsgAttachmentContainer::containerSize() -{ - int attCount = count(); - int containerSize = 0; - - for(int i=0; isize(); - } - return containerSize; -} - -//--------------------------------------------------------------- -// MsgAttachmentContainer::messageSize -// @see header file -//--------------------------------------------------------------- -int MsgAttachmentContainer::messageSize() -{ - return containerSize() + MsgMonitor::bodySize() + MsgMonitor::subjectSize(); -} - -//--------------------------------------------------------------- -// MsgAttachmentContainer::hasMMContent -// @see header file -//--------------------------------------------------------------- -bool MsgAttachmentContainer::hasMMContent() -{ - return mIsMMContent; -} - -//EOF - diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgmonitor.cpp --- a/messagingapp/msgui/unifiededitor/src/msgmonitor.cpp Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,332 +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: Helper class to monitor msg construction in unified editor - * - */ - -// INCLUDES -#include "debugtraces.h" -#include -#include - -// USER INCLUDES -#include "msgmonitor.h" -#include "msgunieditorview.h" -#include "msgunieditoraddress.h" -#include "msgunieditorsubject.h" -#include "msgunieditorbody.h" -#include "msgattachmentcontainer.h" -#include "UniEditorGenUtils.h" - -// Constants - -// Define static -ConvergedMessage::MessageType MsgMonitor::mMessageType; -int MsgMonitor::mBodySize; -int MsgMonitor::mContainerSize; -int MsgMonitor::mSubjectSize; -int MsgMonitor::mMaxMmsSize; -int MsgMonitor::mMaxSmsRecipients; -int MsgMonitor::mMaxMmsRecipients; -int MsgMonitor::mMsgCurrAddressCount; - -//Localized strings -#define LOC_POP_MESSAGE_CHANGE_MUL hbTrId("txt_messaging_dpopinfo_message_type_changed_to_mul") -#define LOC_POP_MESSAGE_CHANGE_TEXT hbTrId("txt_messaging_dpopinfo_message_type_changed_to_tex") - -//--------------------------------------------------------------- -// MsgMonitor::MsgMonitor -// @see header file -//--------------------------------------------------------------- -MsgMonitor::MsgMonitor(QObject* parent) : -QObject(parent), -mSkipNote(false) -{ - init(); - mUniEditorGenUtils = new UniEditorGenUtils; -} - -//--------------------------------------------------------------- -// MsgMonitor::~MsgMonitor -// @see header file -//--------------------------------------------------------------- -MsgMonitor::~MsgMonitor() -{ - delete mUniEditorGenUtils; -} - -//--------------------------------------------------------------- -// MsgMonitor::init -// @see header file -//--------------------------------------------------------------- -void MsgMonitor::init() -{ - mMessageType = ConvergedMessage::Sms; - mBodySize = 0; - mContainerSize = 0; - mSubjectSize = 0; - mMsgCurrAddressCount = 0; - - UniEditorGenUtils* uniEditorGenUtils = new UniEditorGenUtils; - - mMaxMmsSize = KDefaultMaxSize; - TRAP_IGNORE(mMaxMmsSize = uniEditorGenUtils->MaxMmsMsgSizeL()); - - mMaxSmsRecipients = KDefaultSmsRecipients; - TRAP_IGNORE(mMaxSmsRecipients = uniEditorGenUtils->MaxSmsRecipientsL()); - - mMaxMmsRecipients = KDefaultMmsRecipients; - TRAP_IGNORE(mMaxMmsRecipients = uniEditorGenUtils->MaxMmsRecipientsL()); - - delete uniEditorGenUtils; -} - -//--------------------------------------------------------------- -// MsgMonitor::handleContentChange -// @see header file -//--------------------------------------------------------------- -void MsgMonitor::handleContentChange() -{ - // get the projected message type & show the type change note - ConvergedMessage::MessageType newMsgType = projectedMsgType(); - if(mMessageType != newMsgType) - { - mMessageType = newMsgType; - QString noteStr; - if(newMsgType == ConvergedMessage::Sms) - { - noteStr = LOC_POP_MESSAGE_CHANGE_TEXT; - } - else - { - noteStr = LOC_POP_MESSAGE_CHANGE_MUL; - } - showPopup(noteStr); - } - - HbWidget* senderWidget = qobject_cast(sender()); - updateMsgInfo(senderWidget); -} - -//--------------------------------------------------------------- -// MsgMonitor::projectedMsgType -// @see header file -//--------------------------------------------------------------- -ConvergedMessage::MessageType MsgMonitor::projectedMsgType() -{ - ConvergedMessage::MessageType newMsgType = ConvergedMessage::Sms; - - // check if MMS content is present in any of the editor component - if( bodyHasMMSContent() || - subjectHasMMSContent() || - containerHasMMSContent() || - otherMMSCriteriaMet() ) - { - newMsgType = ConvergedMessage::Mms; - } - return newMsgType; -} - -//--------------------------------------------------------------- -// MsgMonitor::updateMsgInfo -// @see header file -//--------------------------------------------------------------- -void MsgMonitor::updateMsgInfo(HbWidget* senderWidget) -{ - if(mMessageType == ConvergedMessage::Mms) - { - //Disable char counter & add subject - view()->mBody->disableCharCounter(); - view()->addSubject(); - } - - // check if sent by body widget - MsgUnifiedEditorBody* body = NULL; - body = qobject_cast(senderWidget); - if(body) - { - mBodySize = view()->mBody->bodySize(); - view()->setAttachOptionEnabled( - MsgUnifiedEditorView::TBE_PHOTO, !view()->mBody->hasImage()); - view()->setAttachOptionEnabled( - MsgUnifiedEditorView::TBE_SOUND, !view()->mBody->hasAudio()); - return; - } - - // check if sent by subject widget - MsgUnifiedEditorSubject* subject = NULL; - subject = qobject_cast(senderWidget); - if(subject) - { - mSubjectSize = view()->mSubjectField->subjectSize(); - return; - } - - // check if sent by attachment container widget - MsgAttachmentContainer* container = NULL; - container = qobject_cast(senderWidget); - if(container) - { - mContainerSize = view()->mAttachmentContainer->containerSize(); - return; - } - - // handle content change from other widgets e.g. To, Cc, Bcc address field - int totalAddressCount = view()->mToField->addressCount(); - if(view()->mCcField && view()->mBccField) - { - totalAddressCount += view()->mCcField->addressCount() + - view()->mBccField->addressCount(); - } - mMsgCurrAddressCount = totalAddressCount; - return; -} - -//--------------------------------------------------------------- -// MsgMonitor::showPopup -// @see header file -//--------------------------------------------------------------- -void MsgMonitor::showPopup(const QString& text) -{ - if(!mSkipNote) - { - HbNotificationDialog* dlg = new HbNotificationDialog(); - dlg->setFocusPolicy(Qt::NoFocus); - dlg->setDismissPolicy(HbPopup::TapAnywhere); - dlg->setAttribute(Qt::WA_DeleteOnClose, true); - dlg->setText(text); - dlg->show(); - } - // reset skip note flag - mSkipNote = false; -} - -//--------------------------------------------------------------- -// MsgMonitor::view -// @see header file -//--------------------------------------------------------------- -MsgUnifiedEditorView* MsgMonitor::view() -{ - return static_cast(this->parent()); -} - -//--------------------------------------------------------------- -// MsgMonitor::bodyHasMMSContent -// @see header file -//--------------------------------------------------------------- -bool MsgMonitor::bodyHasMMSContent() -{ - MsgUnifiedEditorBody* edBody = view()->mBody; - // If any media-object is present inside body - if(!edBody->mediaContent().isEmpty()) - { - return true; - } - - int bodyTextSize = mUniEditorGenUtils->UTF8Size(edBody->text()); - int maxSmsSize = 0; - TRAP_IGNORE(maxSmsSize = - mUniEditorGenUtils->MaxSmsMsgSizeL(edBody->isUnicode())); - // If body text size exceeds sms text-size limit - if(bodyTextSize > maxSmsSize) - { - return true; - } - return false; -} - -//--------------------------------------------------------------- -// MsgMonitor::subjectHasMMSContent -// @see header file -//--------------------------------------------------------------- -bool MsgMonitor::subjectHasMMSContent() -{ - MsgUnifiedEditorSubject* edSubject = view()->mSubjectField; - ConvergedMessage::Priority priority = ConvergedMessage::Normal; - QString subjectText; - if(edSubject) - { - priority = edSubject->priority(); - subjectText = edSubject->text(); - } - // If priority is set to other than Normal or - // If subject has some content - if( (priority != ConvergedMessage::Normal) || - !subjectText.isEmpty() ) - { - return true; - } - return false; -} - -//--------------------------------------------------------------- -// MsgMonitor::containerHasMMSContent -// @see header file -//--------------------------------------------------------------- -bool MsgMonitor::containerHasMMSContent() -{ - QString bodyText = view()->mBody->text(); - MsgAttachmentContainer* edContainer = view()->mAttachmentContainer; - bool hasMMAttachmentContent = false; - int attachmentCount = 0; - if(edContainer) - { - hasMMAttachmentContent = edContainer->hasMMContent(); - attachmentCount = edContainer->count(); - } - // If MM attachments are present or - // If only one non-MM attachment is present e.g. vcf along with body text - if( hasMMAttachmentContent || - ((attachmentCount == 1) && !bodyText.isEmpty()) ) - { - return true; - } - return false; -} - -//--------------------------------------------------------------- -// MsgMonitor::otherMMSCriteriaMet -// @see header file -//--------------------------------------------------------------- -bool MsgMonitor::otherMMSCriteriaMet() -{ - MsgUnifiedEditorAddress* edCc = view()->mCcField; - MsgUnifiedEditorAddress* edBcc = view()->mBccField; - int ccCount = 0; - int bccCount = 0; - if(edCc && edBcc) - { - ccCount = edCc->addressCount(); - bccCount = edBcc->addressCount(); - } - // If CC/BCC has some content or - // If to-recipients count exceeds max sms recipient count - if( ccCount || bccCount || - (view()->mToField->addressCount() > mMaxSmsRecipients) ) - { - return true; - } - - // If to-field contains an email address - bool isEmailPresent = false; - ConvergedMessageAddressList addrList = view()->mToField->addresses(); - TRAP_IGNORE(isEmailPresent = mUniEditorGenUtils->VerifyEmailAddressesL(addrList)); - if(isEmailPresent) - { - return true; - } - return false; -} - -//EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -34,13 +34,14 @@ // USER INCLUDES #include "debugtraces.h" #include "msgunieditoraddress.h" -#include "msgunifiededitorlineedit.h" -#include "msgmonitor.h" -#include "unieditorgenutils.h" +#include "msgunieditorlineedit.h" +#include "msgunieditormonitor.h" +#include "UniEditorGenUtils.h" const QString PBK_ICON("qtg_mono_contacts"); const QString SEND_ICON("qtg_mono_send"); -const QString replacementStr("; "); +const QString REPLACEMENT_STR("; "); +const QString COMMA_SEPERATOR(","); // Constants const int KDefaultGsmNumberMatchLength = 7; //matching unique ph numbers @@ -49,6 +50,12 @@ #define LOC_DIALOG_OK hbTrId("txt_common_button_ok") #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel") #define LOC_INVALID_RECIPIENT hbTrId("txt_messaging_dialog_invalid_recipient_found") +#define LOC_INVALID_RECIPIENT_NOT_ADDED hbTrId("txt_messaging_dialog_invalid_recipient_not_added") +#define LOC_INVALID_RECIPIENTS_NOT_ADDED hbTrId("txt_messaging_dialog_invalid_recipients_not_added") + + + + MsgUnifiedEditorAddress::MsgUnifiedEditorAddress( const QString& label, QGraphicsItem *parent ) : @@ -90,6 +97,8 @@ void MsgUnifiedEditorAddress::fetchContacts() { + mLaunchBtn->blockSignals(true); + QList args; QString serviceName("com.nokia.services.phonebookservices"); QString operation("fetch(QString,QString,QString)"); @@ -112,6 +121,9 @@ request->setArguments(args); request->send(); delete request; + + //unblock click signal after some delay. + QTimer::singleShot(250,this,SLOT(unblockSignals())); } void MsgUnifiedEditorAddress::handleOk(const QVariant& value) @@ -197,37 +209,64 @@ // first, we check if MMS max-recipient count will exceed int count = addrlist.count(); - int futureCount = count + MsgMonitor::msgAddressCount(); - if(futureCount > MsgMonitor::maxMmsRecipients()) + int futureCount = count + MsgUnifiedEditorMonitor::msgAddressCount(); + if(futureCount > MsgUnifiedEditorMonitor::maxMmsRecipients()) { mAboutToExceedMaxMmsRecipients = true; mExceedsMaxMmsRecipientsBy = - futureCount - MsgMonitor::maxMmsRecipients(); + futureCount - MsgUnifiedEditorMonitor::maxMmsRecipients(); } // else, check if SMS max-recipient count will exceed else if(!mSkipMaxRecipientQuery) { futureCount = count + addressCount(); - if( (addressCount() <= MsgMonitor::maxSmsRecipients()) && - (futureCount > MsgMonitor::maxSmsRecipients()) ) + if( (addressCount() <= MsgUnifiedEditorMonitor::maxSmsRecipients()) && + (futureCount > MsgUnifiedEditorMonitor::maxSmsRecipients()) ) { mAboutToExceedMaxSmsRecipients = true; } } - + int invalidCount= 0; + QString invalidContacts; for(int i = 0; i < count; i++ ) - { - mAddressMap.insertMulti(addrlist[i]->address(), addrlist[i]->alias()); - if(!addrlist[i]->alias().isEmpty()) { - mAddressEdit->setText(addrlist[i]->alias()); - } - else + bool isValid = false; + isValid = checkValidAddress(addrlist.at(i)->address()); + if(!isValid) + { + invalidCount ++; + // append the comma till last but one contact. + // add the invalid ocntacts to the " , " seperated string. + if(invalidCount > 1) + { + invalidContacts.append(COMMA_SEPERATOR); + } + invalidContacts.append(addrlist.at(i)->alias()); + } + else + { + mAddressMap.insertMulti(addrlist[i]->address(), addrlist[i]->alias()); + if(!addrlist[i]->alias().isEmpty()) + { + mAddressEdit->setText(addrlist[i]->alias()); + } + else + { + mAddressEdit->setText(addrlist[i]->address(), false); + } + } + + } + if(invalidCount) { - mAddressEdit->setText(addrlist[i]->address(), false); + QString invalidStr; + (invalidCount == 1)?(invalidStr = QString(LOC_INVALID_RECIPIENT_NOT_ADDED)) :(invalidStr = QString(LOC_INVALID_RECIPIENTS_NOT_ADDED)); + // append line seperator + invalidStr.append("
"); + invalidStr.append(invalidContacts); + HbMessageBox::information(invalidStr); } - } // addition operation complete, reset flags mAboutToExceedMaxSmsRecipients = false; @@ -256,7 +295,7 @@ { // Max MMS recipient count check if( mAboutToExceedMaxMmsRecipients || - (MsgMonitor::msgAddressCount() >= MsgMonitor::maxMmsRecipients()) ) + (MsgUnifiedEditorMonitor::msgAddressCount() >= MsgUnifiedEditorMonitor::maxMmsRecipients()) ) { if(mAboutToExceedMaxMmsRecipients) {// show discreet note only once @@ -272,7 +311,7 @@ { // update monitor data emit contentChanged(); - if(MsgMonitor::msgAddressCount() > MsgMonitor::maxMmsRecipients()) + if(MsgUnifiedEditorMonitor::msgAddressCount() > MsgUnifiedEditorMonitor::maxMmsRecipients()) { HbNotificationDialog::launchDialog( LOC_MMS_RECIPIENT_LIMIT_REACHED); @@ -290,8 +329,8 @@ // Max SMS recipient count check if( !mSkipMaxRecipientQuery && - (MsgMonitor::messageType() == ConvergedMessage::Sms) && - (mAddressEdit->addresses().count() > MsgMonitor::maxSmsRecipients()) ) + (MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Sms) && + (mAddressEdit->addresses().count() > MsgUnifiedEditorMonitor::maxSmsRecipients()) ) { // when we show this dialog, we don't want the intermediate states // to be signalled to us @@ -414,7 +453,7 @@ this, SLOT(onContentsChanged(const QString&))); mAddressEdit->clearContent(); - QStringList list = mPrevBuffer.split(replacementStr, + QStringList list = mPrevBuffer.split(REPLACEMENT_STR, QString::SkipEmptyParts); int count = list.count(); QStringList valList = mAddressMap.values(); @@ -467,27 +506,15 @@ // get the list of contacts in address-field QStringList fieldAddresses(mAddressEdit->addresses()); - bool allValid = true; + bool isValid = true; foreach(QString addr, fieldAddresses) { // run address validation only if address is unmapped // (i.e. user-inserted) if(mAddressMap.contains(addr)) { - // 1. perform number validation - allValid = CommonPhoneParser::IsValidPhoneNumber( - *XQConversions::qStringToS60Desc(addr), - CommonPhoneParser::ESMSNumber ); - - // 2. if number validity fails, then perform email addr validation - if( !allValid && - (MsgMonitor::messageType() == ConvergedMessage::Mms) ) - { // additional check for MMS only - allValid = genUtils->IsValidEmailAddress( - *XQConversions::qStringToS60Desc(addr) ); - } - - if(!allValid) + isValid = checkValidAddress(addr); + if(!isValid) { mAddressEdit->highlightInvalidString(addr); QString invalidAddrStr = @@ -502,9 +529,32 @@ } } } + + return isValid; +} +// ---------------------------------------------------------------------------- +// MsgUnifiedEditorAddress::checkValidAddress +// @see header +// ---------------------------------------------------------------------------- +bool MsgUnifiedEditorAddress::checkValidAddress(const QString& addr) + { + bool isValid = false; + // 1. perform number validation + isValid = CommonPhoneParser::IsValidPhoneNumber( + *XQConversions::qStringToS60Desc(addr), + CommonPhoneParser::ESMSNumber ); + + // 2. if number validity fails, then perform email addr validation + UniEditorGenUtils* genUtils = new UniEditorGenUtils; + if( !isValid && + ( MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Mms) ) + { // additional check for MMS only + isValid = genUtils->IsValidEmailAddress( + *XQConversions::qStringToS60Desc(addr) ); + } delete genUtils; - return allValid; -} + return isValid; + } void MsgUnifiedEditorAddress::handleInvalidContactDialog( HbAction* act) @@ -513,6 +563,11 @@ QTimer::singleShot(250, this, SLOT(setFocus())); } +void MsgUnifiedEditorAddress::unblockSignals() +{ + mLaunchBtn->blockSignals(false); +} + Q_IMPLEMENT_USER_METATYPE(CntServicesContact) Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList) diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -25,15 +25,19 @@ #include #include #include -//#include -//#include +#include +#include #include #include +#include +#include // USER INCLUDES +#include "msgcontactsutil.h" #include "msgunieditorattachment.h" -#include "unieditorgenutils.h" +#include "UniEditorGenUtils.h" #include "s60qconversions.h" +#include "msgunieditorutils.h" // Constants #define BYTES_TO_KBYTES_FACTOR 1024 @@ -57,63 +61,63 @@ mSize(filesize), mAttachmentIcon(0), mAttachmentName(0), -//mGestureFilter(0), -mMaxSmsSize(KFirstNormalSmsLength) +mMaxSmsSize(KFirstNormalSmsLength), +mEditorUtils(0) { - //back ground - HbFrameItem* backGround = new HbFrameItem(this); - backGround->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME_NORMAL); - backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - this->setBackgroundItem(backGround); + this->grabGesture(Qt::TapGesture); + setProperty("state", "normal"); + + //back ground + mBackGround = new HbFrameItem(this); + mBackGround->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME_NORMAL); + mBackGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); + this->setBackgroundItem(mBackGround); - mAttachmentIcon = new HbIconItem(ATTACHMENT_ICON, this); - HbStyle::setItemName(mAttachmentIcon,"attachmentIcon"); + mAttachmentIcon = new HbIconItem(ATTACHMENT_ICON, this); + HbStyle::setItemName(mAttachmentIcon,"attachmentIcon"); - int at_size = 0; - TMsgMediaType mediaType = EMsgMediaUnknown; - UniEditorGenUtils* genUtils = new UniEditorGenUtils; - TRAP_IGNORE(genUtils->getFileInfoL(mPath,at_size, - mMimeType,mediaType)); - TRAP_IGNORE(mMaxSmsSize = genUtils->MaxSmsMsgSizeL()); - delete genUtils; - QFileInfo fileinfo(attachmentpath); - QString filename = fileinfo.fileName(); - mAttachmentName = new HbTextItem(filename,this); - HbStyle::setItemName(mAttachmentName,"attachmentName"); - mAttachmentName->setElideMode(Qt::ElideRight); - - // for sms, pure size should be shown - // for mms, additional mimeheader size must be included - qreal displaySize = mSize; - if(!isMultimediaContent()) - { - displaySize = fileinfo.size(); - } - int sizeInKb = displaySize/BYTES_TO_KBYTES_FACTOR; - QString fileDetails; - // if size exceeds 1kb, then show kb or else only bytes - if(sizeInKb >= 1) - { - fileDetails = QString().append(QString("(%1 Kb)").arg(sizeInKb)); - } - else - { - fileDetails = QString().append(QString("(%1 B)").arg(displaySize)); - } + int at_size = 0; + TMsgMediaType mediaType = EMsgMediaUnknown; + UniEditorGenUtils* genUtils = new UniEditorGenUtils; + TRAP_IGNORE(genUtils->getFileInfoL(mPath,at_size, + mMimeType,mediaType)); + TRAP_IGNORE(mMaxSmsSize = genUtils->MaxSmsMsgSizeL()); + delete genUtils; + QFileInfo fileinfo(attachmentpath); + QString filename = fileinfo.fileName(); + mAttachmentName = new HbTextItem(filename,this); + HbStyle::setItemName(mAttachmentName,"attachmentName"); + mAttachmentName->setElideMode(Qt::ElideRight); - mAttachmentDetails = new HbTextItem(fileDetails, this); - HbStyle::setItemName(mAttachmentDetails,"attachmentDetails"); - mAttachmentDetails->setElideMode(Qt::ElideNone); - - initGesture(); + // for sms, pure size should be shown + // for mms, additional mimeheader size must be included + qreal displaySize = mSize; + if(!isMultimediaContent()) + { + displaySize = fileinfo.size(); + } + int sizeInKb = displaySize/BYTES_TO_KBYTES_FACTOR; + QString fileDetails; + // if size exceeds 1kb, then show kb or else only bytes + if(sizeInKb >= 1) + { + fileDetails = QString().append(QString("(%1 Kb)").arg(sizeInKb)); + } + else + { + fileDetails = QString().append(QString("(%1 B)").arg(displaySize)); + } + + mAttachmentDetails = new HbTextItem(fileDetails, this); + HbStyle::setItemName(mAttachmentDetails,"attachmentDetails"); + mAttachmentDetails->setElideMode(Qt::ElideNone); + + HbEffect::add("attachmentWidget", "listviewitem_press", "pressed"); + HbEffect::add("attachmentWidget", "listviewitem_release", "released"); } MsgUnifiedEditorAttachment::~MsgUnifiedEditorAttachment() { - /* if(mGestureFilter) - { - removeSceneEventFilter(mGestureFilter); - }*/ } const QString& MsgUnifiedEditorAttachment::path() @@ -131,11 +135,11 @@ return mMimeType; } -void MsgUnifiedEditorAttachment::longPressed(QPointF position) +void MsgUnifiedEditorAttachment::handleLongTap(QPointF position) { HbMenu* menu = new HbMenu; - menu->addAction(LOC_OPEN, this, SLOT(openAttachment())); - menu->addAction(LOC_REMOVE, this, SLOT(removeAttachment())); + menu->addAction(LOC_OPEN, this, SLOT(handleOpen())); + menu->addAction(LOC_REMOVE, this, SLOT(handleRemove())); menu->addAction(LOC_DETAILS, this, SLOT(viewDetails())); menu->setDismissPolicy(HbPopup::TapAnywhere); menu->setAttribute(Qt::WA_DeleteOnClose, true); @@ -143,14 +147,25 @@ menu->show(); } -void MsgUnifiedEditorAttachment::removeAttachment() +void MsgUnifiedEditorAttachment::handleRemove() { emit deleteMe(this); } -void MsgUnifiedEditorAttachment::openAttachment() +void MsgUnifiedEditorAttachment::handleOpen() { - //open corresponding viewer app. + this->ungrabGesture(Qt::TapGesture); + + //open corresponding viewer app + + if (!mEditorUtils) + { + mEditorUtils = new MsgUnifiedEditorUtils(this); + } + mEditorUtils->launchContentViewer(mMimeType, mPath); + + //fire timer to regrab gesture after some delay. + QTimer::singleShot(300,this,SLOT(regrabGesture())); } void MsgUnifiedEditorAttachment::viewDetails() @@ -181,61 +196,76 @@ return ret; } -void MsgUnifiedEditorAttachment::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - HbWidgetFeedback::triggered(this, Hb::InstantPressed); - - HbFrameItem* backGround = new HbFrameItem(this); - backGround->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME_PRESSED); - backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - this->setBackgroundItem(backGround); - - event->accept(); -} - -void MsgUnifiedEditorAttachment::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +void MsgUnifiedEditorAttachment::gestureEvent(QGestureEvent *event) { - HbFrameItem* backGround = new HbFrameItem(this); - backGround->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME_NORMAL); - backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - this->setBackgroundItem(backGround); - - if(this->rect().contains(event->pos())) + HbTapGesture *tapGesture = qobject_cast (event->gesture(Qt::TapGesture)); + if (tapGesture) { + switch (tapGesture->state()) { + case Qt::GestureStarted: + { + // Trigger haptic feedback. + HbInstantFeedback::play(HbFeedback::Basic); + setPressed(true); + break; + } + case Qt::GestureUpdated: { - HbWidgetFeedback::triggered(this, Hb::InstantClicked); - emit clicked(); + if (HbTapGesture::TapAndHold == tapGesture->tapStyleHint()) { + // Handle longtap. + setPressed(false); + handleLongTap(tapGesture->scenePosition()); + } + break; } - - event->accept(); + case Qt::GestureFinished: + { + HbInstantFeedback::play(HbFeedback::Basic); + if (HbTapGesture::Tap == tapGesture->tapStyleHint()) { + // Handle short tap. + setPressed(false); + handleShortTap(); + } + break; + } + case Qt::GestureCanceled: + { + HbInstantFeedback::play(HbFeedback::Basic); + setPressed(false); + break; + } + } + } + else { + HbWidget::gestureEvent(event); + } } -void MsgUnifiedEditorAttachment::initGesture() +void MsgUnifiedEditorAttachment::handleShortTap() { - // Create gesture filter - /* mGestureFilter = new HbGestureSceneFilter( Qt::LeftButton, this ); - - // Add gestures for longpress - HbGesture* gestureLongpressed = new HbGesture( HbGesture::longpress,5 ); - - mGestureFilter->addGesture( gestureLongpressed ); - - connect( gestureLongpressed, SIGNAL(longPress(QPointF)), - this, SLOT(longPressed(QPointF)) ); - - //install gesture filter. - this->installSceneEventFilter(mGestureFilter);*/ + handleOpen(); } -/*HbFeedback::InstantEffect MsgUnifiedEditorAttachment::overrideFeedback(Hb::InstantInteraction interaction) const - { - switch(interaction) - { - case Hb::InstantPressed: - case Hb::InstantClicked: - return HbFeedback::Basic; - default: - return HbFeedback::None; - } - }*/ +void MsgUnifiedEditorAttachment::setPressed(bool pressed) +{ + if (pressed) + { + setProperty("state", "pressed"); + mBackGround->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME_PRESSED); + HbEffect::cancel(mBackGround, "released"); + HbEffect::start(mBackGround, "attachmentWidget", "pressed"); + } + else + { + setProperty("state", "normal"); + mBackGround->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME_NORMAL); + HbEffect::cancel(mBackGround, "pressed"); + HbEffect::start(mBackGround, "attachmentWidget", "released"); + } +} + +void MsgUnifiedEditorAttachment::regrabGesture() +{ + this->grabGesture(Qt::TapGesture); +} // EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditorattachmentcontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorattachmentcontainer.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,174 @@ +/* + * 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: attachment container class + * + */ + + +// INCLUDES +#include +#include +#include +#include + +// USER INCLUDES +#include "msgunieditorattachmentcontainer.h" +#include "UniEditorGenUtils.h" +#include "msgunieditormonitor.h" +#include "mmsconformancecheck.h" + +// Constants + +//--------------------------------------------------------------- +// MsgAttachmentContainer::MsgAttachmentContainer +// @see header file +//--------------------------------------------------------------- +MsgAttachmentContainer::MsgAttachmentContainer( QGraphicsItem *parent ) : +HbWidget(parent), +mIsMMContent(false) +{ + mLayout = new QGraphicsLinearLayout(Qt::Vertical, this); + mLayout->setContentsMargins(0,0,0,0); + mLayout->setSpacing(0); + mMmsConformanceCheck = new MmsConformanceCheck; +} + +//--------------------------------------------------------------- +// MsgAttachmentContainer::~MsgAttachmentContainer +// @see header file +//--------------------------------------------------------------- +MsgAttachmentContainer::~MsgAttachmentContainer() +{ + delete mMmsConformanceCheck; +} + +//--------------------------------------------------------------- +// MsgAttachmentContainer::addAttachment +// @see header file +//--------------------------------------------------------------- +MsgAttachmentContainer::AddAttachmentStatus + MsgAttachmentContainer::addAttachment(const QString& filepath) +{ + //check for insert conformance + if(EInsertSuccess != mMmsConformanceCheck->checkModeForInsert(filepath)) + return EAddNotSupported; + + int msgSize = messageSize(); + QFileInfo fileinfo(filepath); + int fileSize = fileinfo.size() + KEstimatedMimeHeaderSize; + + if( (fileSize + msgSize) <= MsgUnifiedEditorMonitor::maxMmsSize()) + { + MsgUnifiedEditorAttachment* att = new MsgUnifiedEditorAttachment( + filepath, fileSize, this); + if( ((mAttachmentList.count() == 0) && att->isMultimediaContent()) || + ((mAttachmentList.count() == 1) && !mIsMMContent) ) + { + mIsMMContent = true; + } + mAttachmentList << att; + int index = mLayout->count(); + mLayout->insertItem(index,att); + connect(att, SIGNAL(deleteMe(MsgUnifiedEditorAttachment*)), + this, SLOT(deleteAttachment(MsgUnifiedEditorAttachment*))); + + // emit to signal that container content & size changed + emit contentChanged(); + } + else + { + return EAddSizeExceed; + } + return EAddSuccess; +} + +//--------------------------------------------------------------- +// MsgAttachmentContainer::deleteAttachment +// @see header file +//--------------------------------------------------------------- +void MsgAttachmentContainer::deleteAttachment(MsgUnifiedEditorAttachment* attachment) +{ + mAttachmentList.removeOne(attachment); + mLayout->removeItem(attachment); + attachment->setParent(NULL); + delete attachment; + + if( ((mAttachmentList.count() == 1) && !mAttachmentList.first()->isMultimediaContent()) || + ((mAttachmentList.count() == 0) && mIsMMContent) ) + { + mIsMMContent = false; + } + + // emit to indicate change in container content & size + emit contentChanged(); + if(mAttachmentList.count() == 0) + { + emit emptyAttachmentContainer(); + } +} + +//--------------------------------------------------------------- +// MsgAttachmentContainer::count +// @see header file +//--------------------------------------------------------------- +int MsgAttachmentContainer::count() +{ + return mAttachmentList.count(); +} + +//--------------------------------------------------------------- +// MsgAttachmentContainer::attachmentList +// @see header file +//--------------------------------------------------------------- +MsgUnifiedEditorAttachmentList MsgAttachmentContainer::attachmentList() +{ + return mAttachmentList; +} + +//--------------------------------------------------------------- +// MsgAttachmentContainer::containerSize +// @see header file +//--------------------------------------------------------------- +int MsgAttachmentContainer::containerSize() +{ + int attCount = count(); + int containerSize = 0; + + for(int i=0; isize(); + } + return containerSize; +} + +//--------------------------------------------------------------- +// MsgAttachmentContainer::messageSize +// @see header file +//--------------------------------------------------------------- +int MsgAttachmentContainer::messageSize() +{ + return containerSize() + MsgUnifiedEditorMonitor::bodySize() + MsgUnifiedEditorMonitor::subjectSize(); +} + +//--------------------------------------------------------------- +// MsgAttachmentContainer::hasMMContent +// @see header file +//--------------------------------------------------------------- +bool MsgAttachmentContainer::hasMMContent() +{ + return mIsMMContent; +} + +//EOF + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditoraudiowidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditoraudiowidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,137 @@ +/* + * 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: This widget is used to display audio content in univiewer. + * + */ +#include "msgunieditoraudiowidget.h" + +// SYSTEM INCLUDES +#include +#include +#include + +// USER INCLUDES +#include "msgmediautil.h" +#include "msgunieditorutils.h" + +// LOCAL CONSTANTS +#define LOC_OPEN hbTrId("txt_common_menu_open") +#define LOC_REMOVE hbTrId("txt_common_menu_remove") + +const QString AUDIO_ICON("qtg_mono_audio"); +const QString AUDIO_MIMETYPE("audio"); + +//---------------------------------------------------------------------------- +// MsgUniFiedEditorAudioWidget::MsgUniFiedEditorAudioWidget +// @see header file +//---------------------------------------------------------------------------- +MsgUniFiedEditorAudioWidget::MsgUniFiedEditorAudioWidget(QGraphicsItem *parent) : +HbPushButton(parent), +mEditorUtils(0) +{ + connect(this, SIGNAL(clicked()), this, SLOT(handleShortTap())); + connect(this, SIGNAL(longPress(QPointF)), this, SLOT(handleLongTap(QPointF))); +} + +//---------------------------------------------------------------------------- +// MsgUniFiedEditorAudioWidget::~MsgUniFiedEditorAudioWidget +// @see header file +//---------------------------------------------------------------------------- +MsgUniFiedEditorAudioWidget::~MsgUniFiedEditorAudioWidget() +{ +} + +//---------------------------------------------------------------------------- +// MsgUniFiedEditorAudioWidget::~MsgUniFiedEditorAudioWidget +// @see header file +//---------------------------------------------------------------------------- +void MsgUniFiedEditorAudioWidget::populate(const QString &filePath) +{ + mMediaPath = filePath; + + this->setIcon(HbIcon(AUDIO_ICON)); + QFileInfo fileInfo(mMediaPath); + this->setText(fileInfo.baseName()); + MsgMediaUtil mediaUtil; + this->setAdditionalText(mediaUtil.mediaDuration(mMediaPath)); + this->setTextAlignment(Qt::AlignVCenter | Qt::AlignLeft); +} + +//---------------------------------------------------------------------------- +// MsgUniFiedEditorAudioWidget::handleShortTap +// @see header file +//---------------------------------------------------------------------------- +void MsgUniFiedEditorAudioWidget::handleShortTap() +{ + emit shortTap(mMediaPath); + + // Open the media. + handleOpen(); +} + +//---------------------------------------------------------------------------- +// MsgUniFiedEditorAudioWidget::handleLongTap +// @see header file +//---------------------------------------------------------------------------- +void MsgUniFiedEditorAudioWidget::handleLongTap(const QPointF &position) +{ + emit longTap(position); + + // Display context sensitive menu. + HbMenu* menu = new HbMenu; + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->setDismissPolicy(HbPopup::TapAnywhere); + + menu->addAction(LOC_OPEN, this, SLOT(handleOpen())); + menu->addAction(LOC_REMOVE, this, SLOT(handleRemove())); + menu->setPreferredPos(position); + menu->show(); +} + +//---------------------------------------------------------------------------- +// MsgUniFiedEditorAudioWidget::handleOpen +// @see header file +//---------------------------------------------------------------------------- +void MsgUniFiedEditorAudioWidget::handleOpen() +{ + this->ungrabGesture(Qt::TapGesture); + + if (!mEditorUtils) + { + mEditorUtils = new MsgUnifiedEditorUtils(this); + } + mEditorUtils->launchContentViewer(AUDIO_MIMETYPE, mMediaPath); + + //fire timer to regrab gesture after some delay. + QTimer::singleShot(300,this,SLOT(regrabGesture())); +} + +//---------------------------------------------------------------------------- +// MsgUniFiedEditorAudioWidget::handleRemove +// @see header file +//---------------------------------------------------------------------------- +void MsgUniFiedEditorAudioWidget::handleRemove() +{ + emit remove(); +} + +//--------------------------------------------------------------- +// MsgUniFiedEditorAudioWidget::regrabGesture +// @see header file +//--------------------------------------------------------------- +void MsgUniFiedEditorAudioWidget::regrabGesture() +{ + this->grabGesture(Qt::TapGesture); +} +// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -21,12 +21,8 @@ #include #include #include -#include #include #include -//#include -//#include -#include #include #include #include @@ -49,36 +45,31 @@ // USER INCLUDES #include "msgunieditorbody.h" #include "UniEditorGenUtils.h" -#include "unisendingsettings.h" -#include "msgmonitor.h" +#include "UniSendingSettings.h" +#include "msgunieditormonitor.h" #include "s60qconversions.h" #include "mmsconformancecheck.h" #include "unieditorpluginloader.h" #include "unieditorplugininterface.h" #include "convergedmessage.h" #include "msgmediautil.h" +#include "msgunieditorpixmapwidget.h" +#include "msgunieditoraudiowidget.h" // Constants -const QString EDITOR_FRAME("qtg_fr_lineedit_normal"); const QString BACKGROUND_FRAME("qtg_fr_btn_normal"); -const QString AUDIO_REGION("AudioRegion"); -const QString VIDEO_REGION("VideoRegion"); -const QString IMAGE_REGION("ImageRegion"); -const QString INVALID_REGION("InvalidRegion"); const QString SEND_ICON("qtg_mono_send"); + const int KShowCounterLimit = 10; const int BYTES_TO_KBYTES_FACTOR = 1024; //Localized Constants for item specific menu -#define LOC_OPEN hbTrId("txt_common_menu_open") -#define LOC_REMOVE hbTrId("txt_common_menu_remove") -#define LOC_DETAILS hbTrId("txt_common_menu_details") #define LOC_TITLE hbTrId("txt_messaging_title_messaging") #define LOC_UNABLE_TO_ADD_CONTENT hbTrId("txt_messaging_dpopinfo_unable_to_add_more_content") #define LOC_UNABLE_TO_ATTACH_ITEM hbTrId("txt_messaging_dpopinfo_unable_to_attach_item_avai") #define LOC_PROCESSING hbTrId("txt_messaging_formlabel_loading") +#define LOC_HINT_TEXT hbTrId("txt_messaging_formlabel_enter_message_here") -const QString AUDIO_ICON("qtg_mono_audio"); const QString ANIMATION_ICON("qtg_anim_loading"); const QString ANIMATION_FILE(":/qtg_anim_loading.axml"); // LOCAL FUNCTIONS @@ -90,7 +81,7 @@ void showInsertFailureNote() { int availableSize = - (MsgMonitor::maxMmsSize() - MsgMonitor::messageSize()) + (MsgUnifiedEditorMonitor::maxMmsSize() - MsgUnifiedEditorMonitor::messageSize()) /BYTES_TO_KBYTES_FACTOR; QString displayStr = QString(LOC_UNABLE_TO_ATTACH_ITEM) .arg(availableSize); @@ -108,8 +99,7 @@ mHasImage(false), mHasAudio(false), mTextEdit(0), -mEditorFrame(0), -mIconItem(0), +mPixmapItem(0), mAudioItem(0), mImageSize(0), mAudioSize(0), @@ -117,31 +107,21 @@ mProcessImageOperation(0), mMediaResolver(0), mImageInfo(0), -mProcessingWidget(0) +mProcessingWidget(0), +mDraftMessage(false) { mTextEdit = new HbTextEdit(this); + mTextEdit->setSmileysEnabled(true); + mTextEdit->setPlaceholderText(LOC_HINT_TEXT); HbStyle::setItemName(mTextEdit,"textEdit"); + connect(mTextEdit, SIGNAL(contentsChanged()), this, SLOT(onTextChanged())); - HbFrameDrawer* frameDrawer = new HbFrameDrawer(EDITOR_FRAME, - HbFrameDrawer::NinePieces); - - mEditorFrame = new HbFrameItem(frameDrawer,this); - HbStyle::setItemName(mEditorFrame,"textEditFrame"); - mEditorFrame->setZValue(-1); - // add "Send" action in VKB HbEditorInterface editorInterface(mTextEdit); HbAction *sendAction = new HbAction(HbIcon(SEND_ICON), QString(),this); connect(sendAction, SIGNAL(triggered()),this, SIGNAL(sendMessage())); editorInterface.addAction(sendAction); - /* mGestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this); - mGestureFilter->setLongpressAnimation(true); - HbGesture *gesture = new HbGesture(HbGesture::longpress, 5); - mGestureFilter->addGesture(gesture); - connect(gesture, SIGNAL(longPress(QPointF)), this, SLOT(longPressed(QPointF)));*/ - connect(mTextEdit, SIGNAL(contentsChanged()), this, SLOT(onTextChanged())); - mMmsConformanceCheck = new MmsConformanceCheck; mCharCounter = new HbTextItem(this); @@ -198,17 +178,19 @@ return mTextEdit->toPlainText(); } -void MsgUnifiedEditorBody::setImage(QString& imagefile) +void MsgUnifiedEditorBody::setImage(QString& imagefile , bool draftMessage) { + mDraftMessage = draftMessage; if (!mImageInfo) { setImage(true); mImageFile = imagefile; - if (mIconItem) + if (mPixmapItem) { - delete mIconItem; - mIconItem = NULL; + mPixmapItem->setParent(NULL); + delete mPixmapItem; + mPixmapItem = NULL; mImageSize = 0; } @@ -269,7 +251,7 @@ int msgSize = messageSize(); QFileInfo fileinfo(mImageFile); int imageSize = fileinfo.size() + KEstimatedMimeHeaderSize; - if ( (imageSize + msgSize) <= MsgMonitor::maxMmsSize()) + if ( (imageSize + msgSize) <= MsgUnifiedEditorMonitor::maxMmsSize()) { mImageSize = imageSize; } @@ -282,21 +264,21 @@ return; } - mIconItem = new HbIconItem(this); - mIconItem->hide(); - //mIconItem->setIconName(mImageFile); - QPixmap pixmap(mImageFile); - mIconItem->setIcon(HbIcon(pixmap)); - - HbStyle::setItemName(mIconItem, "pixmap"); - mIconItem->setAlignment(Qt::AlignHCenter | Qt::AlignTop); - // mIconItem->installSceneEventFilter(mGestureFilter); - + mPixmapItem = new MsgUnifiedEditorPixmapWidget(this); + mPixmapItem->hide(); + HbStyle::setItemName(mPixmapItem, "pixmap"); + mPixmapItem->setAlignment(Qt::AlignHCenter | Qt::AlignTop); + mPixmapItem->populate(mImageFile); + connect(mPixmapItem,SIGNAL(remove()),this,SLOT(removeMedia())); + // repolish the body widget this->repolish(); // emit signal to indicate addition of image - emit contentChanged(); + if(!mDraftMessage) + { + emit contentChanged(); + } } void MsgUnifiedEditorBody::setAudio(QString& audiofile) @@ -309,6 +291,7 @@ mAudioFile = audiofile; if(mAudioItem) { + mAudioItem->setParent(NULL); delete mAudioItem; mAudioItem = NULL; mAudioSize = 0; @@ -317,7 +300,7 @@ int msgSize = messageSize(); QFileInfo fileinfo(mAudioFile); int audioSize = fileinfo.size() + KEstimatedMimeHeaderSize; - if((audioSize + msgSize) <= MsgMonitor::maxMmsSize() ) + if((audioSize + msgSize) <= MsgUnifiedEditorMonitor::maxMmsSize() ) { mAudioSize = audioSize; } @@ -330,16 +313,11 @@ return; } - HbIconItem* audioIcon = new HbIconItem(AUDIO_ICON); - mAudioItem = new HbPushButton(this); + mAudioItem = new MsgUniFiedEditorAudioWidget(this); mAudioItem->hide(); HbStyle::setItemName(mAudioItem,"audioItem"); - mAudioItem->setIcon(audioIcon->icon()); - mAudioItem->setText(fileinfo.baseName()); - MsgMediaUtil mediaUtil; - mAudioItem->setAdditionalText(mediaUtil.mediaDuration(mAudioFile)); - mAudioItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignLeft); - connect(mAudioItem, SIGNAL(longPress(QPointF)), this, SLOT(longPressed(QPointF))); + mAudioItem->populate(mAudioFile); + connect(mAudioItem,SIGNAL(remove()),this,SLOT(removeMedia())); // repolish the body widget this->repolish(); @@ -363,8 +341,6 @@ if(mHasAudio) mediaFiles << mAudioFile; - //TODO: append video content - return mediaFiles; } @@ -427,7 +403,7 @@ mAudioItem->show(); } - if(mIconItem || mProcessingWidget) + if(mPixmapItem || mProcessingWidget) { QSizeF imageSize(0.0,0.0); QSizeF defaultImageSize(QImageReader(mImageFile).size()); @@ -461,17 +437,18 @@ imageSize.setWidth(newWidth); } - if(mIconItem) + if(mPixmapItem) { - mIconItem->setPreferredSize(imageSize); - mIconItem->setSize(imageSize); + mPixmapItem->setPreferredSize(imageSize); + mPixmapItem->setSize(imageSize); if(mMainWindow->orientation() == Qt::Horizontal) { - QPointF currPos = mIconItem->pos(); + QPointF currPos = mPixmapItem->pos(); currPos.setX(leftMargin+((maxWidth-imageSize.width())/2)); - mIconItem->setPos(currPos); + mPixmapItem->setPos(currPos); } - mIconItem->show(); + mPixmapItem->show(); + emit enableSendButton(true); } if(mProcessingWidget) @@ -490,147 +467,46 @@ return szHint; } -void MsgUnifiedEditorBody::longPressed(QPointF position) -{ - HbMenu* menu = new HbMenu; - menu->addAction(LOC_OPEN, this, SLOT(openMedia())); - menu->addAction(LOC_REMOVE, this, SLOT(removeMedia())); - menu->addAction(LOC_DETAILS, this, SLOT(viewDetails())); - - menu->setDismissPolicy(HbPopup::TapAnywhere); - menu->setAttribute(Qt::WA_DeleteOnClose, true); - menu->setPreferredPos(position); - - menu->setObjectName(getHitRegion(position)); - menu->show(); -} - void MsgUnifiedEditorBody::removeMedia() { - HbAction* action = qobject_cast(sender()); - QString objName = action->parent()->objectName(); - if(objName == IMAGE_REGION) + QObject* senderObject = sender(); + + MsgUnifiedEditorPixmapWidget* pixmap = + qobject_cast(senderObject); + + MsgUniFiedEditorAudioWidget* audio = + qobject_cast(senderObject); + + if(pixmap) //remove image { mImageFile.clear(); - if(mIconItem) + if(mPixmapItem) { - // mIconItem->removeSceneEventFilter(mGestureFilter); - delete mIconItem; - mIconItem = NULL; + mPixmapItem->setParent(NULL); + delete mPixmapItem; + mPixmapItem = NULL; } setImage(false); mImageSize = 0; } - else if(objName == AUDIO_REGION) - { - mAudioFile.clear(); - if(mAudioItem) + else if(audio)//remove audio item { - delete mAudioItem; - mAudioItem = NULL; + mAudioFile.clear(); + if(mAudioItem) + { + mAudioItem->setParent(NULL); + delete mAudioItem; + mAudioItem = NULL; + } + setAudio(false); + mAudioSize = 0; } - setAudio(false); - mAudioSize = 0; - } - else if(objName == VIDEO_REGION) - { - //TODO: complete this with video handling story - } - else - { - // return without doing anything - return; - } this->repolish(); emit contentChanged(); } -//--------------------------------------------------------------- -// MsgUnifiedEditorBody :: openMedia -// @see header file -//--------------------------------------------------------------- -void MsgUnifiedEditorBody::openMedia() -{ - HbAction* action = qobject_cast(sender()); - QString objName = action->parent()->objectName(); - - QString fileName; - if ( objName == IMAGE_REGION ) - { - fileName = mImageFile; - } - else if ( objName == AUDIO_REGION ) - { - fileName = mAudioFile; - } - else - { - return; - } - - XQSharableFile sf; - XQAiwRequest* request = 0; - - if ( !sf.open(fileName) ) - { - return; - } - - // Get handlers - XQApplicationManager appManager; - QList fileHandlers = appManager.list(sf); - if (fileHandlers.count() > 0) - { - XQAiwInterfaceDescriptor d = fileHandlers.first(); - request = appManager.create(sf, d); - - if ( !request ) - { - sf.close(); - return ; - } - } - else - { - sf.close(); - return; - } - - // Result handlers - connect (request, SIGNAL(requestOk(const QVariant&)), - this, SLOT(handleOk(const QVariant&))); - connect (request, SIGNAL(requestError(const QVariant&)), - this, SLOT(handleError(const QVariant&))); - - request->setEmbedded(true); - request->setSynchronous(true); - - // Fill args - QList args; - args << qVariantFromValue(sf); - request->setArguments(args); - - // Fill headers - QString key("WindowTitle"); - QVariant value(QString(LOC_TITLE)); - XQRequestInfo info; - info.setInfo(key, value); - request->setInfo(info); - - request->send(); - - // Cleanup - sf.close(); - delete request; -} - -void MsgUnifiedEditorBody::viewDetails() -{ - //open details view. -} - bool MsgUnifiedEditorBody::hasImage() { return mHasImage; @@ -676,32 +552,7 @@ estimatedMediaSize = KEstimatedMmsSmilHeaderSize; } - return estimatedMediaSize + MsgMonitor::subjectSize() + MsgMonitor::containerSize(); -} - -QString MsgUnifiedEditorBody::getHitRegion(QPointF position) -{ - if(mIconItem) - { - QPolygonF imageHitRegion = mIconItem->mapToScene(mIconItem->boundingRect()); - if(imageHitRegion.containsPoint(position, Qt::OddEvenFill)) - { - return IMAGE_REGION; - } - } - - if(mAudioItem) - { - QPolygonF audioHitRegion = mAudioItem->mapToScene(mAudioItem->boundingRect()); - if(audioHitRegion.containsPoint(position, Qt::OddEvenFill)) - { - return AUDIO_REGION; - } - } - - //TODO : add hit test for video region with video userstory - - return INVALID_REGION; + return estimatedMediaSize + MsgUnifiedEditorMonitor::subjectSize() + MsgUnifiedEditorMonitor::containerSize(); } void MsgUnifiedEditorBody::onTextChanged() @@ -709,12 +560,12 @@ QString string = text(); if( string.size() > mPrevBuffer.size() && - MsgMonitor::messageType() == ConvergedMessage::Mms ) + MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Mms ) { // reject any text input if mms size limit is reached int futureSize = bodySize() + - MsgMonitor::containerSize() + MsgMonitor::subjectSize(); - if(futureSize > MsgMonitor::maxMmsSize()) + MsgUnifiedEditorMonitor::containerSize() + MsgUnifiedEditorMonitor::subjectSize(); + if(futureSize > MsgUnifiedEditorMonitor::maxMmsSize()) { mTextEdit->setPlainText(mPrevBuffer); HbNotificationDialog::launchDialog(LOC_UNABLE_TO_ADD_CONTENT); @@ -754,7 +605,7 @@ // emit signal to indicate change in content emit contentChanged(); - if(MsgMonitor::messageType() == ConvergedMessage::Sms) + if(MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Sms) { //Set char counter value QString display = QString("%1(%2)").arg(numOfRemainingChars).arg( @@ -798,6 +649,10 @@ void MsgUnifiedEditorBody::startResizeAnimation() { + // emit signal to indicate disable the send tool button. + emit enableSendButton(false); + + QGraphicsLinearLayout* processingLayout = new QGraphicsLinearLayout(Qt::Vertical); mProcessingWidget = new HbWidget(this); @@ -828,6 +683,7 @@ delete mProcessingWidget; mProcessingWidget = NULL; } + } // --------------------------------------------------------- @@ -850,26 +706,6 @@ } //--------------------------------------------------------------- -// MsgUnifiedEditorBody :: handleOk -// @see header file -//--------------------------------------------------------------- -void MsgUnifiedEditorBody::handleOk(const QVariant& result) -{ - Q_UNUSED(result) -} - -//--------------------------------------------------------------- -// MsgUnifiedEditorBody :: handleError -// @see header file -//--------------------------------------------------------------- -void MsgUnifiedEditorBody::handleError(int errorCode, - const QString& errorMessage) -{ - Q_UNUSED(errorMessage) - Q_UNUSED(errorCode) -} - -//--------------------------------------------------------------- // MsgUnifiedEditorBody :: setFocus // @see header file //--------------------------------------------------------------- diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditorlineedit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorlineedit.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,640 @@ +/* + * 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 "msgunieditorlineedit.h" +#include +#include +#include +#include + +const QRegExp expr("[,;\n]$"); +const QRegExp sepAtEnd("; $"); +const QRegExp sepAtMiddle("; "); + +const QString replacementStr("; "); +const QString labelSeperator(": "); + +const int fadedAlpha(125); +const int solidAlpha(255); + +const int SNAP_DELAY = 350; + +//Localization +#define LOC_PASTE hbTrId("txt_common_menu_paste") + +MsgUnifiedEditorLineEdit::MsgUnifiedEditorLineEdit(const QString& label,QGraphicsItem *parent): +HbLineEdit(parent), +mSelectionStart(-1), +mSelectionEnd(-1), +mDefaultBehaviour(false) +{ + QString labelStr = label.trimmed(); + + QTextCursor cursor(this->textCursor()); + QTextCharFormat colorFormat(cursor.charFormat()); + + QColor fgColor = this->palette().color(QPalette::Text); + fgColor.setAlpha(fadedAlpha); + colorFormat.setForeground(fgColor); + cursor.insertText(labelStr , colorFormat); + + fgColor.setAlpha(solidAlpha); + colorFormat.setForeground(fgColor); + + cursor.insertText(" ",colorFormat); + + mLabelExpr.setPattern(QString("^"+labelStr+" $")); + mLabel = labelStr+" "; + + moveCursor(QTextCursor::EndOfBlock); + + connect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), + this,SLOT(selectionChanged(QTextCursor,QTextCursor))); + connect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); + + connect(this,SIGNAL(aboutToShowContextMenu(HbMenu*,const QPointF &)), + this,SLOT(aboutToShowContextMenu(HbMenu*,const QPointF &))); + +} + +MsgUnifiedEditorLineEdit::~MsgUnifiedEditorLineEdit() +{ +} + +void MsgUnifiedEditorLineEdit::inputMethodEvent(QInputMethodEvent *event) +{ + //let it go in default way. + if(mDefaultBehaviour) + { + HbAbstractEdit::inputMethodEvent(event); + event->accept(); + return; + } + + if (!event->commitString().isEmpty() || event->replacementLength()) + { + if (event->commitString().contains(expr)) + { + if(this->text().isEmpty() || this->text().contains(sepAtEnd) || this->text().contains(mLabelExpr)) + { + event->accept(); + return; + } + + this->setCursorPosition(this->text().length()); + + QString str = event->commitString(); + str.replace(expr, replacementStr); + + event->setCommitString(str, event->replacementStart(), event->replacementLength()); + } + else if(this->hasSelectedText()) + {// all user inputs get appended at the end + this->setCursorPosition(this->text().length()); + } + + HbAbstractEdit::inputMethodEvent(event); + event->accept(); + } +} + +void MsgUnifiedEditorLineEdit::keyPressEvent(QKeyEvent *event) +{ + QString str = event->text(); + + if(event->key()== Qt::Key_Enter || event->key()== Qt::Key_Return) + { + if(mDefaultBehaviour) + { + HbAbstractEdit::keyReleaseEvent(event); + event->accept(); + return; + } + if(this->text().isEmpty() || this->text().contains(sepAtEnd) || this->text().contains(mLabelExpr)) + { + event->accept(); + return; + } + this->setCursorPosition(this->text().length()); + str = replacementStr; + QKeyEvent eve(event->type(), Qt::Key_Any, event->modifiers(), str); + HbAbstractEdit::keyPressEvent(&eve); + event->accept(); + return; + } + + if(event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete ) + { + int pos = this->cursorPosition(); + bool pbkContact = true; + + if(!this->hasSelectedText()) + { + this->setCursorPosition(pos-2); + pbkContact = this->textCursor().charFormat().fontUnderline(); + this->setCursorPosition(pos); + } + + QString text = this->text(); + text = text.left(pos); + + if(text.contains(mLabelExpr)) + { + event->accept(); + return; + } + + if(pbkContact) + { + //if already selected delete it. + if(this->hasSelectedText()) + { + // deleting phbkContact is an atomic operation + // ensure that the signal is emitted only once + disconnect(this, SIGNAL(contentsChanged()), + this, SLOT(onContentsChanged())); + HbLineEdit::keyPressEvent(event); + event->accept(); + //delete seperator (i.e."; "). + QKeyEvent eve(event->type(), Qt::Key_Delete, Qt::NoModifier); + HbLineEdit::keyPressEvent(&eve); + HbLineEdit::keyPressEvent(&eve); + connect(this, SIGNAL(contentsChanged()), + this, SLOT(onContentsChanged())); + onContentsChanged(); + } + else //make it selected + { + this->setCursorPosition(pos-3); + setHighlight(pos-3); + } + } + else + { + QString str = text.right(2); + if(str == replacementStr) + { + // deleting contact is an atomic operation + // ensure that the signal is emitted only once + disconnect(this, SIGNAL(contentsChanged()), + this, SLOT(onContentsChanged())); + //delete seperator (i.e."; "). + QKeyEvent eve(event->type(), Qt::Key_Backspace, Qt::NoModifier); + HbLineEdit::keyPressEvent(&eve); + HbLineEdit::keyPressEvent(&eve); + connect(this, SIGNAL(contentsChanged()), + this, SLOT(onContentsChanged())); + onContentsChanged(); + } + else + { + HbLineEdit::keyPressEvent(event); + } + event->accept(); + } + + event->accept(); + return; + } + + if (event->key() == Qt::Key_Left ) + { + bool selectedText = this->hasSelectedText(); + + //look ahead left. + int pos = this->cursorPosition(); + + QString text = this->text(); + text = text.left(pos); + + //no text other than label; + if(text.contains(mLabelExpr)) + { + event->accept(); + return; + } + + //look for next seperator while going left. + int newPos = text.lastIndexOf(sepAtMiddle); + + if(newPos < 0 && selectedText) + { + event->accept(); + return; + } + + bool pbkContact = true; + + if(!selectedText) + { + this->setCursorPosition(pos-2); + pbkContact = this->textCursor().charFormat().fontUnderline(); + this->setCursorPosition(pos); + } + else + { + this->setCursorPosition(newPos); + pbkContact = this->textCursor().charFormat().fontUnderline(); + this->setCursorPosition(pos); + } + + + if(pbkContact && newPos >0) + { + + setHighlight(newPos-1); + } + else + { + //move left, char by char. if seperator met jump over it. + if( (newPos > 0 && selectedText) || (pos-2 == newPos)) + { + this->setCursorPosition(newPos+1); + } + + HbLineEdit::keyPressEvent(event); + + } + event->accept(); + return; + } + + if (event->key() == Qt::Key_Right) + { + bool selectedText = this->hasSelectedText(); + + //look ahead. + int pos = this->cursorPosition(); + this->setCursorPosition(pos+3); + bool pbkContact = this->textCursor().charFormat().fontUnderline(); + this->setCursorPosition(pos); + + //look for next seperator. + QString text = this->text(); + int newPos = text.indexOf(sepAtMiddle,pos+2); + + if(pbkContact && newPos >0) + { + this->setCursorPosition(newPos-1); + setHighlight(newPos-1); + } + else + { + int seperatorPos = text.indexOf(sepAtMiddle,pos); + + if(selectedText || seperatorPos == pos) + { + this->setCursorPosition(pos+1); + this->deselect(); + } + HbAbstractEdit::keyPressEvent(event); + } + event->accept(); + return; + } + + if(!str.isEmpty()) + { + if(mDefaultBehaviour) + { + HbAbstractEdit::keyPressEvent(event); + event->accept(); + return; + } + if (str.contains(expr)) + { + if(this->text().isEmpty() || this->text().contains(sepAtEnd) || this->text().contains(mLabelExpr)) + { + event->accept(); + return; + } + + // auto-complete the last incomplete word + int contentLength = this->text().length(); + int pos = this->cursorPosition(); + QString incompleteWord(this->text().right(contentLength-(pos-1))); + if(!incompleteWord.contains(sepAtMiddle)) + { + this->setCursorPosition(this->text().length()); + } + + str.replace(expr, replacementStr); + QKeyEvent eve(event->type(), event->key(), event->modifiers(), str); + HbAbstractEdit::keyPressEvent(&eve); + } + else + { + HbAbstractEdit::keyPressEvent(event); + event->accept(); + return; + } + } +} + +void MsgUnifiedEditorLineEdit::handleTap() +{ + int currentPos = this->cursorPosition(); + + QString txt = this->text(); + + QString tempTxt = txt.left(currentPos+2); + int seperatorPos = tempTxt.lastIndexOf(sepAtMiddle,currentPos); + + txt = txt.right(txt.length() - currentPos); + int labelPos = txt.indexOf(labelSeperator); + + if(labelPos >= 0 )//pressed on label. + { + this->setCursorPosition(currentPos + labelPos + 2); + } + else if(seperatorPos == currentPos-1 || seperatorPos == currentPos)//pressed just on seperator. + { + this->setCursorPosition(seperatorPos+2); + } + else + { + this->setCursorPosition(currentPos+1); + bool pbkContact = this->textCursor().charFormat().fontUnderline(); + if(pbkContact) + { + setHighlight(currentPos); + } + } + + this->update(); +} + +void MsgUnifiedEditorLineEdit::gestureEvent(QGestureEvent* event) +{ + //passing gesture event to base class. + HbLineEdit::gestureEvent(event); + + + if(HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) + { + //capturing gesture position, and map to local co-ordinates. + QPointF pos = mapFromScene(tap->scenePosition()); + + switch (tap->state()) + { + case Qt::GestureFinished: + { + if (HbTapGesture::Tap == tap->tapStyleHint()) + { + handleTap(); + } + break; + } + default: + break; + } + event->accept(); + } + else + { + event->ignore(); + } +} + +void MsgUnifiedEditorLineEdit::setText(const QString& text, bool underlined) +{ + + if(!mDefaultBehaviour) + { + // atomic operation, ensure one signal only at the end + disconnect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); + + //make sure previous text is complete. + if(this->content().length() > 0) + { + QInputMethodEvent e; + e.setCommitString(";"); + this->inputMethodEvent(&e); + } + this->setCursorPosition(this->text().length()); + + QTextCursor cursor(this->textCursor()); + QTextCharFormat colorFormat(cursor.charFormat()); + if(underlined) + { + QColor fgColor = colorFormat.foreground().color(); + fgColor.setAlpha(fadedAlpha); + colorFormat.setUnderlineColor(fgColor); + colorFormat.setFontUnderline(true); + } + cursor.insertText(text , colorFormat); + colorFormat.setFontUnderline(false); + + cursor.insertText(replacementStr,colorFormat); + connect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); + onContentsChanged(); + } + else + { + this->setCursorPosition(this->text().length()); + QTextCursor cursor(this->textCursor()); + cursor.insertText(text); + } + + moveCursor(QTextCursor::EndOfBlock); +} + +QStringList MsgUnifiedEditorLineEdit::addresses() +{ + QString text = this->content(); + QStringList list = text.split(replacementStr,QString::SkipEmptyParts); + return list; +} + +void MsgUnifiedEditorLineEdit::focusInEvent(QFocusEvent* event) +{ + HbLineEdit::focusInEvent(event); + this->setCursorVisibility(Hb::TextCursorVisible); +} + +void MsgUnifiedEditorLineEdit::focusOutEvent(QFocusEvent* event) +{ + HbLineEdit::focusOutEvent(event); + this->setCursorVisibility(Hb::TextCursorHidden); +} + +void MsgUnifiedEditorLineEdit::setHighlight(int currentPos) +{ + QString txt = this->text(); + + int endPos = qMax(txt.indexOf(sepAtMiddle,currentPos), + txt.indexOf(labelSeperator,currentPos)); + + int startPos = qMax(txt.lastIndexOf(sepAtMiddle,currentPos), + txt.lastIndexOf(labelSeperator,currentPos)); + + disconnect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), + this,SLOT(selectionChanged(QTextCursor,QTextCursor))); + + //highlight if pbk contact. + if(startPos > 0 && endPos > 0 && startPos != endPos) + { + this->setSelection(startPos + 2, endPos - startPos - 2); + this->update(); + } + else + { + this->deselect(); + } + + this->update(); + + connect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), + this,SLOT(selectionChanged(QTextCursor,QTextCursor))); +} + +void MsgUnifiedEditorLineEdit::selectionChanged(const QTextCursor &oldCursor, const QTextCursor& newCursor) +{ + + if(mSelectionSnapTimer.isActive()) + { + mSelectionSnapTimer.stop(); + } + + if(newCursor.selectionStart() < mLabel.length()) + { + this->setTextCursor(oldCursor); + return; + } + + if(!mDefaultBehaviour) + { + mSelectionStart = newCursor.selectionStart(); + mSelectionEnd = newCursor.selectionEnd(); + + if(mSelectionStart == mSelectionEnd ) + { + return; + } + + mSelectionSnapTimer.start(SNAP_DELAY,this); + } +} + +void MsgUnifiedEditorLineEdit::timerEvent(QTimerEvent *event) +{ + //passing event to base class. + HbLineEdit::timerEvent(event); + + if (event->timerId() == mSelectionSnapTimer.timerId()) + { + mSelectionSnapTimer.stop(); + + disconnect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), + this,SLOT(selectionChanged(QTextCursor,QTextCursor))); + + QString txt = this->text(); + + int startPos = qMax(txt.lastIndexOf(sepAtMiddle,mSelectionStart), + txt.lastIndexOf(labelSeperator,mSelectionStart)); + + int endPos = qMax(txt.indexOf(sepAtMiddle,mSelectionEnd), + txt.indexOf(labelSeperator,mSelectionEnd)); + + if(endPos < 0 ) + { + endPos = mSelectionEnd; + } + + this->setSelection(startPos + 2, endPos - startPos - 2); + + connect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), + this,SLOT(selectionChanged(QTextCursor,QTextCursor))); + + event->accept(); + } +} + +void MsgUnifiedEditorLineEdit::setDefaultBehaviour(bool defaultBehaviour) +{ + mDefaultBehaviour = defaultBehaviour; +} + +QString MsgUnifiedEditorLineEdit::text() const +{ + return HbLineEdit::text(); +} + +QString MsgUnifiedEditorLineEdit::content() const +{ + QString text = this->text(); + text.remove(mLabel); + return text; +} + +void MsgUnifiedEditorLineEdit::clearContent() +{ + // avoid getting updates during local editing + disconnect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); + + int startPos = mLabel.length(); + this->setSelection(startPos, content().length()); + QKeyEvent eve(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier); + this->keyPressEvent(&eve); + this->deselect(); + + // re-connect signal to start getting updates + connect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); +} + +void MsgUnifiedEditorLineEdit::onContentsChanged() +{ + emit contentsChanged(content()); +} + +void MsgUnifiedEditorLineEdit::highlightInvalidString(QString invalidStr) +{ + // for only address editor + if(!mDefaultBehaviour) + { + QString txtContent = this->text(); + int searchStartPos = mLabel.length(); + int startPos = txtContent.indexOf(invalidStr, searchStartPos); + disconnect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), + this,SLOT(selectionChanged(QTextCursor,QTextCursor))); + // if invalidStr found + if(startPos > 0) + { + this->setSelection(startPos, invalidStr.length()); + } + connect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), + this,SLOT(selectionChanged(QTextCursor,QTextCursor))); + } +} + +void MsgUnifiedEditorLineEdit::aboutToShowContextMenu(HbMenu *contextMenu, const QPointF &pos) +{ + Q_UNUSED(pos) + //clear all menu actions. + contextMenu->clearActions(); + + const QMimeData *mimedata = QApplication::clipboard()->mimeData(); + if(mimedata) + { + if(canInsertFromMimeData(mimedata)) + { + contextMenu->addAction(LOC_PASTE,this,SLOT(paste())); + } + } + +} +// eof diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditormonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditormonitor.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,332 @@ +/* + * 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: Helper class to monitor msg construction in unified editor + * + */ + +// INCLUDES +#include "debugtraces.h" +#include +#include + +// USER INCLUDES +#include "msgunieditormonitor.h" +#include "msgunieditorview.h" +#include "msgunieditoraddress.h" +#include "msgunieditorsubject.h" +#include "msgunieditorbody.h" +#include "msgunieditorattachmentcontainer.h" +#include "UniEditorGenUtils.h" + +// Constants + +// Define static +ConvergedMessage::MessageType MsgUnifiedEditorMonitor::mMessageType; +int MsgUnifiedEditorMonitor::mBodySize; +int MsgUnifiedEditorMonitor::mContainerSize; +int MsgUnifiedEditorMonitor::mSubjectSize; +int MsgUnifiedEditorMonitor::mMaxMmsSize; +int MsgUnifiedEditorMonitor::mMaxSmsRecipients; +int MsgUnifiedEditorMonitor::mMaxMmsRecipients; +int MsgUnifiedEditorMonitor::mMsgCurrAddressCount; + +//Localized strings +#define LOC_POP_MESSAGE_CHANGE_MUL hbTrId("txt_messaging_dpopinfo_message_type_changed_to_mul") +#define LOC_POP_MESSAGE_CHANGE_TEXT hbTrId("txt_messaging_dpopinfo_message_type_changed_to_tex") + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::MsgUnifiedEditorMonitor +// @see header file +//--------------------------------------------------------------- +MsgUnifiedEditorMonitor::MsgUnifiedEditorMonitor(QObject* parent) : +QObject(parent), +mSkipNote(false) +{ + init(); + mUniEditorGenUtils = new UniEditorGenUtils; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::~MsgUnifiedEditorMonitor +// @see header file +//--------------------------------------------------------------- +MsgUnifiedEditorMonitor::~MsgUnifiedEditorMonitor() +{ + delete mUniEditorGenUtils; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::init +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorMonitor::init() +{ + mMessageType = ConvergedMessage::Sms; + mBodySize = 0; + mContainerSize = 0; + mSubjectSize = 0; + mMsgCurrAddressCount = 0; + + UniEditorGenUtils* uniEditorGenUtils = new UniEditorGenUtils; + + mMaxMmsSize = KDefaultMaxSize; + TRAP_IGNORE(mMaxMmsSize = uniEditorGenUtils->MaxMmsMsgSizeL()); + + mMaxSmsRecipients = KDefaultSmsRecipients; + TRAP_IGNORE(mMaxSmsRecipients = uniEditorGenUtils->MaxSmsRecipientsL()); + + mMaxMmsRecipients = KDefaultMmsRecipients; + TRAP_IGNORE(mMaxMmsRecipients = uniEditorGenUtils->MaxMmsRecipientsL()); + + delete uniEditorGenUtils; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::handleContentChange +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorMonitor::handleContentChange() +{ + // get the projected message type & show the type change note + ConvergedMessage::MessageType newMsgType = projectedMsgType(); + if(mMessageType != newMsgType) + { + mMessageType = newMsgType; + QString noteStr; + if(newMsgType == ConvergedMessage::Sms) + { + noteStr = LOC_POP_MESSAGE_CHANGE_TEXT; + } + else + { + noteStr = LOC_POP_MESSAGE_CHANGE_MUL; + } + showPopup(noteStr); + } + + HbWidget* senderWidget = qobject_cast(sender()); + updateMsgInfo(senderWidget); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::projectedMsgType +// @see header file +//--------------------------------------------------------------- +ConvergedMessage::MessageType MsgUnifiedEditorMonitor::projectedMsgType() +{ + ConvergedMessage::MessageType newMsgType = ConvergedMessage::Sms; + + // check if MMS content is present in any of the editor component + if( bodyHasMMSContent() || + subjectHasMMSContent() || + containerHasMMSContent() || + otherMMSCriteriaMet() ) + { + newMsgType = ConvergedMessage::Mms; + } + return newMsgType; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::updateMsgInfo +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorMonitor::updateMsgInfo(HbWidget* senderWidget) +{ + if(mMessageType == ConvergedMessage::Mms) + { + //Disable char counter & add subject + view()->mBody->disableCharCounter(); + view()->addSubject(); + } + + // check if sent by body widget + MsgUnifiedEditorBody* body = NULL; + body = qobject_cast(senderWidget); + if(body) + { + mBodySize = view()->mBody->bodySize(); + view()->setAttachOptionEnabled( + MsgUnifiedEditorView::TBE_PHOTO, !view()->mBody->hasImage()); + view()->setAttachOptionEnabled( + MsgUnifiedEditorView::TBE_SOUND, !view()->mBody->hasAudio()); + return; + } + + // check if sent by subject widget + MsgUnifiedEditorSubject* subject = NULL; + subject = qobject_cast(senderWidget); + if(subject) + { + mSubjectSize = view()->mSubjectField->subjectSize(); + return; + } + + // check if sent by attachment container widget + MsgAttachmentContainer* container = NULL; + container = qobject_cast(senderWidget); + if(container) + { + mContainerSize = view()->mAttachmentContainer->containerSize(); + return; + } + + // handle content change from other widgets e.g. To, Cc, Bcc address field + int totalAddressCount = view()->mToField->addressCount(); + if(view()->mCcField && view()->mBccField) + { + totalAddressCount += view()->mCcField->addressCount() + + view()->mBccField->addressCount(); + } + mMsgCurrAddressCount = totalAddressCount; + return; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::showPopup +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorMonitor::showPopup(const QString& text) +{ + if(!mSkipNote) + { + HbNotificationDialog* dlg = new HbNotificationDialog(); + dlg->setFocusPolicy(Qt::NoFocus); + dlg->setDismissPolicy(HbPopup::TapAnywhere); + dlg->setAttribute(Qt::WA_DeleteOnClose, true); + dlg->setText(text); + dlg->show(); + } + // reset skip note flag + mSkipNote = false; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::view +// @see header file +//--------------------------------------------------------------- +MsgUnifiedEditorView* MsgUnifiedEditorMonitor::view() +{ + return static_cast(this->parent()); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::bodyHasMMSContent +// @see header file +//--------------------------------------------------------------- +bool MsgUnifiedEditorMonitor::bodyHasMMSContent() +{ + MsgUnifiedEditorBody* edBody = view()->mBody; + // If any media-object is present inside body + if(!edBody->mediaContent().isEmpty()) + { + return true; + } + + int bodyTextSize = mUniEditorGenUtils->UTF8Size(edBody->text()); + int maxSmsSize = 0; + TRAP_IGNORE(maxSmsSize = + mUniEditorGenUtils->MaxSmsMsgSizeL(edBody->isUnicode())); + // If body text size exceeds sms text-size limit + if(bodyTextSize > maxSmsSize) + { + return true; + } + return false; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::subjectHasMMSContent +// @see header file +//--------------------------------------------------------------- +bool MsgUnifiedEditorMonitor::subjectHasMMSContent() +{ + MsgUnifiedEditorSubject* edSubject = view()->mSubjectField; + ConvergedMessage::Priority priority = ConvergedMessage::Normal; + QString subjectText; + if(edSubject) + { + priority = edSubject->priority(); + subjectText = edSubject->text(); + } + // If priority is set to other than Normal or + // If subject has some content + if( (priority != ConvergedMessage::Normal) || + !subjectText.isEmpty() ) + { + return true; + } + return false; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::containerHasMMSContent +// @see header file +//--------------------------------------------------------------- +bool MsgUnifiedEditorMonitor::containerHasMMSContent() +{ + QString bodyText = view()->mBody->text(); + MsgAttachmentContainer* edContainer = view()->mAttachmentContainer; + bool hasMMAttachmentContent = false; + int attachmentCount = 0; + if(edContainer) + { + hasMMAttachmentContent = edContainer->hasMMContent(); + attachmentCount = edContainer->count(); + } + // If MM attachments are present or + // If only one non-MM attachment is present e.g. vcf along with body text + if( hasMMAttachmentContent || + ((attachmentCount == 1) && !bodyText.isEmpty()) ) + { + return true; + } + return false; +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorMonitor::otherMMSCriteriaMet +// @see header file +//--------------------------------------------------------------- +bool MsgUnifiedEditorMonitor::otherMMSCriteriaMet() +{ + MsgUnifiedEditorAddress* edCc = view()->mCcField; + MsgUnifiedEditorAddress* edBcc = view()->mBccField; + int ccCount = 0; + int bccCount = 0; + if(edCc && edBcc) + { + ccCount = edCc->addressCount(); + bccCount = edBcc->addressCount(); + } + // If CC/BCC has some content or + // If to-recipients count exceeds max sms recipient count + if( ccCount || bccCount || + (view()->mToField->addressCount() > mMaxSmsRecipients) ) + { + return true; + } + + // If to-field contains an email address + bool isEmailPresent = false; + ConvergedMessageAddressList addrList = view()->mToField->addresses(); + TRAP_IGNORE(isEmailPresent = mUniEditorGenUtils->VerifyEmailAddressesL(addrList)); + if(isEmailPresent) + { + return true; + } + return false; +} + +//EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditorpixmapwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorpixmapwidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,187 @@ +/* + * 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: This widget displays the pixmap content. + * + */ + +#include "msgunieditorpixmapwidget.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include + +// USER INCLUDES +#include "msgunieditorutils.h" + +// LOCAL CONSTANTS +#define LOC_OPEN hbTrId("txt_common_menu_open") +#define LOC_REMOVE hbTrId("txt_common_menu_remove") +#define LOC_DETAILS hbTrId("txt_common_menu_details") + +const QString IMAGE_MIMETYPE("image"); + +//--------------------------------------------------------------- +// MsgUnifiedEditorPixmapWidget::MsgUnifiedEditorPixmapWidget +// @see header file +//--------------------------------------------------------------- +MsgUnifiedEditorPixmapWidget::MsgUnifiedEditorPixmapWidget(QGraphicsItem *parent) : +HbIconItem(parent), +mEditorUtils(0) +{ + this->grabGesture(Qt::TapGesture); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorPixmapWidget::~MsgUnifiedEditorPixmapWidget +// @see header file +//--------------------------------------------------------------- +MsgUnifiedEditorPixmapWidget::~MsgUnifiedEditorPixmapWidget() +{ +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorPixmapWidget::setPixmap +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorPixmapWidget::populate(const QString &pixmapPath) +{ + mPixmapPath = pixmapPath; + QPixmap pixmap(mPixmapPath); + this->setIcon(HbIcon(pixmap)); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorPixmapWidget::gestureEvent +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorPixmapWidget::gestureEvent(QGestureEvent *event) +{ + HbTapGesture *tapGesture = qobject_cast (event->gesture(Qt::TapGesture)); + if (tapGesture) { + switch (tapGesture->state()) { + case Qt::GestureStarted: + { + // Trigger haptic feedback. + HbInstantFeedback::play(HbFeedback::Basic); + break; + } + case Qt::GestureUpdated: + { + if (HbTapGesture::TapAndHold == tapGesture->tapStyleHint()) { + // Handle longtap. + handleLongTap(tapGesture->scenePosition()); + } + break; + } + case Qt::GestureFinished: + { + HbInstantFeedback::play(HbFeedback::Basic); + if (HbTapGesture::Tap == tapGesture->tapStyleHint()) { + // Handle short tap + handleShortTap(); + } + break; + } + case Qt::GestureCanceled: + { + HbInstantFeedback::play(HbFeedback::Basic); + break; + } + } + } + else { + HbIconItem::gestureEvent(event); + } +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorPixmapWidget::handleOpen +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorPixmapWidget::handleOpen() +{ + this->ungrabGesture(Qt::TapGesture); + + if (!mEditorUtils) { + mEditorUtils = new MsgUnifiedEditorUtils(this); + } + mEditorUtils->launchContentViewer(IMAGE_MIMETYPE, mPixmapPath); + + //fire timer to regrab gesture after some delay. + QTimer::singleShot(300,this,SLOT(regrabGesture())); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorPixmapWidget::handleSave +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorPixmapWidget::handleRemove() +{ + emit remove(); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorPixmapWidget::handleSave +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorPixmapWidget::viewDetails() +{ + +} + +//---------------------------------------------------------------------------- +// MsgUnifiedEditorPixmapWidget::handleShortTap +// @see header file +//---------------------------------------------------------------------------- +void MsgUnifiedEditorPixmapWidget::handleShortTap() +{ + emit shortTap(mPixmapPath); + + // Open the media. + handleOpen(); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorPixmapWidget::handleLongTap +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorPixmapWidget::handleLongTap(const QPointF &position) +{ + emit longTap(position); + + HbMenu* menu = new HbMenu; + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->setDismissPolicy(HbPopup::TapAnywhere); + + menu->addAction(LOC_OPEN, this, SLOT(handleOpen())); + menu->addAction(LOC_REMOVE, this, SLOT(handleRemove())); + menu->addAction(LOC_DETAILS, this, SLOT(viewDetails())); + + menu->setPreferredPos(position); + menu->show(); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorPixmapWidget::regrabGesture +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorPixmapWidget::regrabGesture() +{ + this->grabGesture(Qt::TapGesture); +} +// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditorprocessimageoperation.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorprocessimageoperation.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorprocessimageoperation.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -19,13 +19,13 @@ // ========== INCLUDE FILES ================================ -#include +#include #include #include -#include -#include // for Central Repository keys +#include +#include // for Central Repository keys #include #include @@ -43,12 +43,12 @@ #include #include -#include +#include #include #include #include -#include "msgmonitor.h" +#include "msgunieditormonitor.h" #include "msgunieditorprocessimageoperation.h" // ========== CONSTANTS ==================================== @@ -85,7 +85,7 @@ CleanupStack::PushL( self ); self->ConstructL(); - CleanupStack::Pop( self ); + CleanupStack::Pop(); return self; } @@ -149,7 +149,7 @@ delete repository; - iMaxMmsSize = MsgMonitor::maxMmsSize(); + iMaxMmsSize = MsgUnifiedEditorMonitor::maxMmsSize(); } // --------------------------------------------------------- @@ -476,9 +476,9 @@ if ( !( iProcessMethod & EUniProcessImgMethodScale ) && ( iImageInfo->FileSize() + - MsgMonitor::messageSize() ) > iMaxMmsSize && + MsgUnifiedEditorMonitor::messageSize() ) > iMaxMmsSize && iImageInfo->MimeType().CompareF( KMsgMimeImageJpeg ) == 0 && - (MsgMonitor::messageSize()) < KUniCompressionMargin ) + (MsgUnifiedEditorMonitor::messageSize()) < KUniCompressionMargin ) { // Only compression needed as image is JPEG that is larger than can be fitted // into the message and scaling is not performed. Also current message size @@ -493,7 +493,7 @@ // Image won't be processed if ( ( origSize.iWidth > KImageRichWidth || origSize.iHeight > KImageRichHeight ) && - ( iImageInfo->FileSize() + MsgMonitor::messageSize() ) < iMaxMmsSize ) + ( iImageInfo->FileSize() + MsgUnifiedEditorMonitor::messageSize() ) < iMaxMmsSize ) { // Original image width or height is "non-conformant" and original image would // fit to into the message without any processing. diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -23,8 +23,8 @@ // USER INCLUDES #include "msgunieditorsubject.h" #include "UniEditorGenUtils.h" -#include "msgunifiededitorlineedit.h" -#include "msgmonitor.h" +#include "msgunieditorlineedit.h" +#include "msgunieditormonitor.h" // Localized Constants #define LOC_SUBJECT hbTrId("txt_messaging_formlabel_subject") @@ -115,8 +115,8 @@ { // reject any text input if mms size limit is reached int futureSize = subjectSize() + - MsgMonitor::containerSize() + MsgMonitor::bodySize(); - if(futureSize > MsgMonitor::maxMmsSize()) + MsgUnifiedEditorMonitor::containerSize() + MsgUnifiedEditorMonitor::bodySize(); + if(futureSize > MsgUnifiedEditorMonitor::maxMmsSize()) { // atomic operation disconnect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)), diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditorutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorutils.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,143 @@ +/* + * 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: Utility class for unieditor. + * + */ + +#include "msgunieditorutils.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include + +// USER INCLUDES +#include "msgcontactsutil.h" + +// LOCAL CONSTANTS +#define LOC_TITLE hbTrId("txt_messaging_title_messaging") + +const QString IMAGE_MIMETYPE("image"); +const QString AUDIO_MIMETYPE("audio"); +const QString VCARD_MIMETYPE("text/X-vCard"); + +//--------------------------------------------------------------- +// MsgUnifiedEditorUtils::MsgUnifiedEditorUtils +// @see header file +//--------------------------------------------------------------- +MsgUnifiedEditorUtils::MsgUnifiedEditorUtils(QObject *parent) : +QObject(parent) +{ +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorUtils::~MsgUnifiedEditorUtils +// @see header file +//--------------------------------------------------------------- +MsgUnifiedEditorUtils::~MsgUnifiedEditorUtils() +{ +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorUtils::addAttachmentWidget +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorUtils::launchContentViewer(const QString &mimeType, const QString &filePath) +{ + if (mimeType.contains(IMAGE_MIMETYPE) || mimeType.contains(AUDIO_MIMETYPE)) { + launchViaSharableFile(filePath); + } + else if (mimeType.contains(VCARD_MIMETYPE, Qt::CaseInsensitive)) { + MsgContactsUtil::launchVCardViewer(filePath); + } +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorUtils::handleOk +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorUtils::handleOk(const QVariant& result) +{ + emit requestOk(result); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorUtils::handleError +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorUtils::handleError(int errorCode, const QString& errorMessage) +{ + emit requestError(errorCode, errorMessage); +} + +//--------------------------------------------------------------- +// MsgUnifiedEditorUtils::launchViaSharableFile +// @see header file +//--------------------------------------------------------------- +void MsgUnifiedEditorUtils::launchViaSharableFile(const QString &filePath) +{ + XQSharableFile sf; + XQAiwRequest* request = 0; + + if (!sf.open(filePath)) { + return; + } + + // Get handlers + XQApplicationManager appManager; + QList fileHandlers = appManager.list(sf); + if (fileHandlers.count() > 0) { + XQAiwInterfaceDescriptor d = fileHandlers.first(); + request = appManager.create(sf, d); + + if (!request) { + sf.close(); + return; + } + } + else { + sf.close(); + return; + } + + // Result handlers + connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)), + Qt::UniqueConnection); + connect(request, SIGNAL(requestError(int,const QString&)), this, + SLOT(handleError(int,const QString&)), Qt::UniqueConnection); + + request->setEmbedded(true); + request->setSynchronous(true); + + // Fill args + QList args; + args << qVariantFromValue(sf); + request->setArguments(args); + + // Fill headers + QString key("WindowTitle"); + QVariant value(QString(LOC_TITLE)); + XQRequestInfo info; + info.setInfo(key, value); + request->setInfo(info); + + request->send(); + + // Cleanup + sf.close(); + delete request; +} + +//EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -57,11 +57,11 @@ #include "msgunieditoraddress.h" #include "msgunieditorsubject.h" #include "msgunieditorbody.h" -#include "msgmonitor.h" -#include "msgattachmentcontainer.h" +#include "msgunieditormonitor.h" +#include "msgunieditorattachmentcontainer.h" #include "msgsendutil.h" #include "convergedmessageaddress.h" -#include "unieditorgenutils.h" +#include "UniEditorGenUtils.h" #include "unieditorpluginloader.h" #include "unieditorplugininterface.h" #include "msgsettingsview.h" @@ -122,8 +122,8 @@ const QString POPUP_LIST_FRAME("qtg_fr_popup_list_normal"); //settings confirmation -#define LOC_DIALOG_SMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_sms_settings_incomplete") -#define LOC_DIALOG_MMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_mms_settings_incomplete") +#define LOC_DIALOG_SMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_sms_message_centre_does_not_e") +#define LOC_DIALOG_MMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_mms_access_point_not_defined") // LOCAL FUNCTIONS //--------------------------------------------------------------- @@ -148,6 +148,7 @@ MsgBaseView(parent), mSubjectAction(0), mCcBccAction(0), + mSendAction(0), mMainLayout(0), mSubjectField(0), mToField(0), @@ -201,7 +202,7 @@ mMainLayout->setContentsMargins(0,vTopSpacing,0,0); mMainLayout->setSpacing(vItemSpacing); - mMsgMonitor = new MsgMonitor(this); + mMsgMonitor = new MsgUnifiedEditorMonitor(this); mToField = new MsgUnifiedEditorAddress( LOC_TO, mContentWidget ); @@ -222,6 +223,7 @@ connect(mBody, SIGNAL(contentChanged()),this,SLOT(onContentChanged())); connect(mBody, SIGNAL(contentChanged()), mMsgMonitor, SLOT(handleContentChange())); + connect(mBody, SIGNAL(enableSendButton(bool)), this, SLOT(enableSendButton(bool))); } @@ -297,7 +299,7 @@ if( msg != NULL ) { //Populate the content inside editor - populateContentIntoEditor(*msg); + populateContentIntoEditor(*msg,true); // true as it is draft message delete msg; } @@ -450,7 +452,7 @@ } void MsgUnifiedEditorView::populateContentIntoEditor( - const ConvergedMessage& messageDetails) + const ConvergedMessage& messageDetails,bool draftMessage) { // skip first-time MMS type switch note for draft mMsgMonitor->setSkipNote(true); @@ -519,7 +521,7 @@ { case EMsgMediaImage: { - mBody->setImage(filePath); + mBody->setImage(filePath,draftMessage); break; } case EMsgMediaAudio: @@ -576,7 +578,7 @@ attachExtension->setContentWidget(mTBExtnContentWidget); //Add Action to the toolbar and show toolbar - toolBar->addAction(HbIcon(SEND_ICON),QString(),this,SLOT(send())); + mSendAction = toolBar->addAction(HbIcon(SEND_ICON),QString(),this,SLOT(send())); setToolBar(toolBar); @@ -797,7 +799,7 @@ // converged msg for sending ConvergedMessage msg; - ConvergedMessage::MessageType messageType = MsgMonitor::messageType(); + ConvergedMessage::MessageType messageType = MsgUnifiedEditorMonitor::messageType(); msg.setMessageType(messageType); // we need to remove duplicate addresses @@ -931,7 +933,7 @@ void MsgUnifiedEditorView::packMessage(ConvergedMessage &msg, bool isSave) { - ConvergedMessage::MessageType messageType = MsgMonitor::messageType(); + ConvergedMessage::MessageType messageType = MsgUnifiedEditorMonitor::messageType(); msg.setMessageType(messageType); // If isSave is true (save to draft usecase), then don't remove duplicates // If isSave is false (send usecase), then remove duplicates @@ -1060,7 +1062,7 @@ return; } activateInputBlocker(); - ConvergedMessage::MessageType messageType = MsgMonitor::messageType(); + ConvergedMessage::MessageType messageType = MsgUnifiedEditorMonitor::messageType(); ConvergedMessageAddressList addresses = mToField->addresses(); @@ -1079,8 +1081,8 @@ if(messageType == ConvergedMessage::Sms && addresses.isEmpty() && - MsgMonitor::bodySize() <= 0 && - MsgMonitor::containerSize() <= 0) + MsgUnifiedEditorMonitor::bodySize() <= 0 && + MsgUnifiedEditorMonitor::containerSize() <= 0) { if(mOpenedMessageId.getId() != -1) { @@ -1113,8 +1115,8 @@ ccAddresses.isEmpty() && bccAddresses.isEmpty() && subectSize <= 0 && - MsgMonitor::bodySize() <= 0 && - MsgMonitor::containerSize() <= 0) + MsgUnifiedEditorMonitor::bodySize() <= 0 && + MsgUnifiedEditorMonitor::containerSize() <= 0) { if(mOpenedMessageId.getId() != -1) { @@ -1356,11 +1358,12 @@ //--------------------------------------------------------------- void MsgUnifiedEditorView::fetchImages() { - QString interface("Image"); - QString operation("fetch(QVariantMap,QVariant)"); + QString service("photos"); + QString interface("com.nokia.symbian.IImageFetch"); + QString operation("fetch(void)"); XQAiwRequest* request = NULL; XQApplicationManager appManager; - request = appManager.create(interface, operation, true);//embedded + request = appManager.create(service,interface, operation, true);//embedded request->setSynchronous(true); // synchronous if(!request) { @@ -1373,11 +1376,6 @@ connect(request, SIGNAL(requestError(int,const QString&)), this, SLOT(serviceRequestError(int,const QString&))); - // Set arguments for request - QList args; - args << QVariantMap(); - args << QVariant(); - request->setArguments(args); // Make the request if (!request->send()) { @@ -1482,8 +1480,7 @@ //-------------------------------------------------------------- void MsgUnifiedEditorView::activateInputBlocker() { - this->grabMouse(); - this->grabKeyboard(); + mainWindow()->setInteractive(false); } //--------------------------------------------------------------- @@ -1491,9 +1488,8 @@ // @see header file //-------------------------------------------------------------- void MsgUnifiedEditorView::deactivateInputBlocker() -{ - this->ungrabKeyboard(); - this->ungrabMouse(); +{ + mainWindow()->setInteractive(true); } //--------------------------------------------------------------- @@ -1637,7 +1633,7 @@ } UniEditorPluginInterface* pluginInterface = mPluginLoader->getUniEditorPlugin( - MsgMonitor::messageType()); + MsgUnifiedEditorMonitor::messageType()); pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId()); } @@ -1684,4 +1680,19 @@ } } +//--------------------------------------------------------------- +// MsgUnifiedEditorView::enableSendButton +// @see header file +//-------------------------------------------------------------- +void MsgUnifiedEditorView::enableSendButton(bool enable) + { + if(mSendAction) + { + // enable/disable based on only if its disabled/enabled. + // this check is to avoid unnecessary calls to mSendAction->setEnabled(enable); + if(mSendAction->isEnabled() != enable ) + mSendAction->setEnabled(enable); + } + } + //EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/src/msgunifiededitorlineedit.cpp --- a/messagingapp/msgui/unifiededitor/src/msgunifiededitorlineedit.cpp Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,596 +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 "msgunifiededitorlineedit.h" - -const QRegExp expr("[,;\n]$"); -const QRegExp sepAtEnd("; $"); -const QRegExp sepAtMiddle("; "); - -const QString replacementStr("; "); -const QString labelSeperator(": "); - -const int fadedAlpha(125); -const int solidAlpha(255); - -const int SNAP_DELAY = 350; - -MsgUnifiedEditorLineEdit::MsgUnifiedEditorLineEdit(const QString& label,QGraphicsItem *parent): -HbLineEdit(parent), -mSelectionStart(-1), -mSelectionEnd(-1), -mDefaultBehaviour(false) -{ - QString labelStr = label.trimmed(); - - QTextCursor cursor(this->textCursor()); - QTextCharFormat colorFormat(cursor.charFormat()); - - QColor fgColor = this->palette().color(QPalette::Text); - fgColor.setAlpha(fadedAlpha); - colorFormat.setForeground(fgColor); - cursor.insertText(labelStr , colorFormat); - - fgColor.setAlpha(solidAlpha); - colorFormat.setForeground(fgColor); - - cursor.insertText(" ",colorFormat); - - mLabelExpr.setPattern(QString("^"+labelStr+" $")); - mLabel = labelStr+" "; - - connect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), - this,SLOT(selectionChanged(QTextCursor,QTextCursor))); - connect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); -} - -MsgUnifiedEditorLineEdit::~MsgUnifiedEditorLineEdit() -{ -} - -void MsgUnifiedEditorLineEdit::inputMethodEvent(QInputMethodEvent *event) -{ - //let it go in default way. - if(mDefaultBehaviour) - { - HbAbstractEdit::inputMethodEvent(event); - event->accept(); - return; - } - - if (!event->commitString().isEmpty() || event->replacementLength()) - { - if (event->commitString().contains(expr)) - { - if(this->text().isEmpty() || this->text().contains(sepAtEnd) || this->text().contains(mLabelExpr)) - { - event->accept(); - return; - } - - this->setCursorPosition(this->text().length()); - - QString str = event->commitString(); - str.replace(expr, replacementStr); - - event->setCommitString(str, event->replacementStart(), event->replacementLength()); - } - else if(this->hasSelectedText()) - {// all user inputs get appended at the end - this->setCursorPosition(this->text().length()); - } - - HbAbstractEdit::inputMethodEvent(event); - event->accept(); - } -} - -void MsgUnifiedEditorLineEdit::keyPressEvent(QKeyEvent *event) -{ - QString str = event->text(); - - if(event->key()== Qt::Key_Enter || event->key()== Qt::Key_Return) - { - if(mDefaultBehaviour) - { - HbAbstractEdit::keyReleaseEvent(event); - event->accept(); - return; - } - if(this->text().isEmpty() || this->text().contains(sepAtEnd) || this->text().contains(mLabelExpr)) - { - event->accept(); - return; - } - this->setCursorPosition(this->text().length()); - str = replacementStr; - QKeyEvent eve(event->type(), Qt::Key_Any, event->modifiers(), str); - HbAbstractEdit::keyPressEvent(&eve); - event->accept(); - return; - } - - if(event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete ) - { - int pos = this->cursorPosition(); - bool pbkContact = true; - - if(!this->hasSelectedText()) - { - this->setCursorPosition(pos-2); - pbkContact = this->textCursor().charFormat().fontUnderline(); - this->setCursorPosition(pos); - } - - QString text = this->text(); - text = text.left(pos); - - if(text.contains(mLabelExpr)) - { - event->accept(); - return; - } - - if(pbkContact) - { - //if already selected delete it. - if(this->hasSelectedText()) - { - // deleting phbkContact is an atomic operation - // ensure that the signal is emitted only once - disconnect(this, SIGNAL(contentsChanged()), - this, SLOT(onContentsChanged())); - HbLineEdit::keyPressEvent(event); - event->accept(); - //delete seperator (i.e."; "). - QKeyEvent eve(event->type(), Qt::Key_Delete, Qt::NoModifier); - HbLineEdit::keyPressEvent(&eve); - HbLineEdit::keyPressEvent(&eve); - connect(this, SIGNAL(contentsChanged()), - this, SLOT(onContentsChanged())); - onContentsChanged(); - } - else //make it selected - { - this->setCursorPosition(pos-3); - setHighlight(pos-3); - } - } - else - { - QString str = text.right(2); - if(str == replacementStr) - { - // deleting contact is an atomic operation - // ensure that the signal is emitted only once - disconnect(this, SIGNAL(contentsChanged()), - this, SLOT(onContentsChanged())); - //delete seperator (i.e."; "). - QKeyEvent eve(event->type(), Qt::Key_Backspace, Qt::NoModifier); - HbLineEdit::keyPressEvent(&eve); - HbLineEdit::keyPressEvent(&eve); - connect(this, SIGNAL(contentsChanged()), - this, SLOT(onContentsChanged())); - onContentsChanged(); - } - else - { - HbLineEdit::keyPressEvent(event); - } - event->accept(); - } - - event->accept(); - return; - } - - if (event->key() == Qt::Key_Left ) - { - bool selectedText = this->hasSelectedText(); - - //look ahead left. - int pos = this->cursorPosition(); - - QString text = this->text(); - text = text.left(pos); - - //no text other than label; - if(text.contains(mLabelExpr)) - { - event->accept(); - return; - } - - //look for next seperator while going left. - int newPos = text.lastIndexOf(sepAtMiddle); - - if(newPos < 0 && selectedText) - { - event->accept(); - return; - } - - bool pbkContact = true; - - if(!selectedText) - { - this->setCursorPosition(pos-2); - pbkContact = this->textCursor().charFormat().fontUnderline(); - this->setCursorPosition(pos); - } - else - { - this->setCursorPosition(newPos); - pbkContact = this->textCursor().charFormat().fontUnderline(); - this->setCursorPosition(pos); - } - - - if(pbkContact && newPos >0) - { - - setHighlight(newPos-1); - } - else - { - //move left, char by char. if seperator met jump over it. - if( (newPos > 0 && selectedText) || (pos-2 == newPos)) - { - this->setCursorPosition(newPos+1); - } - - HbLineEdit::keyPressEvent(event); - - } - event->accept(); - return; - } - - if (event->key() == Qt::Key_Right) - { - bool selectedText = this->hasSelectedText(); - - //look ahead. - int pos = this->cursorPosition(); - this->setCursorPosition(pos+3); - bool pbkContact = this->textCursor().charFormat().fontUnderline(); - this->setCursorPosition(pos); - - //look for next seperator. - QString text = this->text(); - int newPos = text.indexOf(sepAtMiddle,pos+2); - - if(pbkContact && newPos >0) - { - this->setCursorPosition(newPos-1); - setHighlight(newPos-1); - } - else - { - int seperatorPos = text.indexOf(sepAtMiddle,pos); - - if(selectedText || seperatorPos == pos) - { - this->setCursorPosition(pos+1); - this->deselect(); - } - HbAbstractEdit::keyPressEvent(event); - } - event->accept(); - return; - } - - if(!str.isEmpty()) - { - if(mDefaultBehaviour) - { - HbAbstractEdit::keyPressEvent(event); - event->accept(); - return; - } - if (str.contains(expr)) - { - if(this->text().isEmpty() || this->text().contains(sepAtEnd) || this->text().contains(mLabelExpr)) - { - event->accept(); - return; - } - - // auto-complete the last incomplete word - int contentLength = this->text().length(); - int pos = this->cursorPosition(); - QString incompleteWord(this->text().right(contentLength-(pos-1))); - if(!incompleteWord.contains(sepAtMiddle)) - { - this->setCursorPosition(this->text().length()); - } - - str.replace(expr, replacementStr); - QKeyEvent eve(event->type(), event->key(), event->modifiers(), str); - HbAbstractEdit::keyPressEvent(&eve); - } - else - { - HbAbstractEdit::keyPressEvent(event); - event->accept(); - return; - } - } -} - -void MsgUnifiedEditorLineEdit::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) -{ - HbAbstractEdit::mouseReleaseEvent(event); - - int currentPos = this->cursorPosition(); - - QString txt = this->text(); - - QString tempTxt = txt.left(currentPos+2); - int seperatorPos = tempTxt.lastIndexOf(sepAtMiddle,currentPos); - - txt = txt.right(txt.length() - currentPos); - int labelPos = txt.indexOf(labelSeperator); - - if(labelPos >= 0 )//pressed on label. - { - this->setCursorPosition(currentPos + labelPos + 2); - } - else if(seperatorPos == currentPos-1 || seperatorPos == currentPos)//pressed just on seperator. - { - this->setCursorPosition(seperatorPos+2); - } - else - { - this->setCursorPosition(currentPos+1); - bool pbkContact = this->textCursor().charFormat().fontUnderline(); - if(pbkContact) - { - setHighlight(currentPos); - } - } - - this->update(); - event->accept(); -} - -void MsgUnifiedEditorLineEdit::setText(const QString& text, bool underlined) -{ - - if(!mDefaultBehaviour) - { - // atomic operation, ensure one signal only at the end - disconnect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); - - //make sure previous text is complete. - if(this->content().length() > 0) - { - QInputMethodEvent e; - e.setCommitString(";"); - this->inputMethodEvent(&e); - } - this->setCursorPosition(this->text().length()); - - QTextCursor cursor(this->textCursor()); - QTextCharFormat colorFormat(cursor.charFormat()); - if(underlined) - { - QColor fgColor = colorFormat.foreground().color(); - fgColor.setAlpha(fadedAlpha); - colorFormat.setUnderlineColor(fgColor); - colorFormat.setFontUnderline(true); - } - cursor.insertText(text , colorFormat); - colorFormat.setFontUnderline(false); - - cursor.insertText(replacementStr,colorFormat); - connect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); - onContentsChanged(); - } - else - { - this->setCursorPosition(this->text().length()); - QTextCursor cursor(this->textCursor()); - cursor.insertText(text); - } -} - -QStringList MsgUnifiedEditorLineEdit::addresses() -{ - QString text = this->content(); - QStringList list = text.split(replacementStr,QString::SkipEmptyParts); - return list; -} - -void MsgUnifiedEditorLineEdit::focusInEvent(QFocusEvent* event) -{ - HbLineEdit::focusInEvent(event); - this->setCursorVisibility(Hb::TextCursorVisible); -} - -void MsgUnifiedEditorLineEdit::focusOutEvent(QFocusEvent* event) -{ - HbLineEdit::focusOutEvent(event); - this->setCursorVisibility(Hb::TextCursorHidden); -} - -void MsgUnifiedEditorLineEdit::setHighlight(int currentPos) -{ - QString txt = this->text(); - - int endPos = qMax(txt.indexOf(sepAtMiddle,currentPos), - txt.indexOf(labelSeperator,currentPos)); - - int startPos = qMax(txt.lastIndexOf(sepAtMiddle,currentPos), - txt.lastIndexOf(labelSeperator,currentPos)); - - disconnect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), - this,SLOT(selectionChanged(QTextCursor,QTextCursor))); - - //highlight if pbk contact. - if(startPos > 0 && endPos > 0 && startPos != endPos) - { - this->setSelection(startPos + 2, endPos - startPos - 2); - this->update(); - } - else - { - this->deselect(); - } - - this->update(); - - connect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), - this,SLOT(selectionChanged(QTextCursor,QTextCursor))); -} - -void MsgUnifiedEditorLineEdit::cut() -{ - HbLineEdit::cut(); - //after cut delete seperator (i.e."; "). - QKeyEvent eve(QEvent::KeyPress, Qt::Key_Delete, Qt::NoModifier); - HbLineEdit::keyPressEvent(&eve); - HbLineEdit::keyPressEvent(&eve); -} - -void MsgUnifiedEditorLineEdit::selectAll() -{ - //don't allow user to select every thing. - //do nothing. -} - -void MsgUnifiedEditorLineEdit::selectionChanged(const QTextCursor &oldCursor, const QTextCursor& newCursor) -{ - - if(mSelectionSnapTimer.isActive()) - { - mSelectionSnapTimer.stop(); - } - - if(newCursor.selectionStart() < mLabel.length()) - { - this->setTextCursor(oldCursor); - return; - } - - if(!mDefaultBehaviour) - { - mSelectionStart = newCursor.selectionStart(); - mSelectionEnd = newCursor.selectionEnd(); - - if(mSelectionStart == mSelectionEnd ) - { - return; - } - - mSelectionSnapTimer.start(SNAP_DELAY,this); - } -} - -void MsgUnifiedEditorLineEdit::timerEvent(QTimerEvent *event) -{ - //passing event to base class. - HbLineEdit::timerEvent(event); - - if (event->timerId() == mSelectionSnapTimer.timerId()) - { - mSelectionSnapTimer.stop(); - - disconnect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), - this,SLOT(selectionChanged(QTextCursor,QTextCursor))); - - QString txt = this->text(); - - int startPos = qMax(txt.lastIndexOf(sepAtMiddle,mSelectionStart), - txt.lastIndexOf(labelSeperator,mSelectionStart)); - - int endPos = qMax(txt.indexOf(sepAtMiddle,mSelectionEnd), - txt.indexOf(labelSeperator,mSelectionEnd)); - - if(endPos < 0 ) - { - endPos = mSelectionEnd; - } - - this->setSelection(startPos + 2, endPos - startPos - 2); - - connect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), - this,SLOT(selectionChanged(QTextCursor,QTextCursor))); - - event->accept(); - } -} - -void MsgUnifiedEditorLineEdit::setDefaultBehaviour(bool defaultBehaviour) -{ - mDefaultBehaviour = defaultBehaviour; -} - -QString MsgUnifiedEditorLineEdit::text() const -{ - return HbLineEdit::text(); -} - -QString MsgUnifiedEditorLineEdit::content() const -{ - QString text = this->text(); - text.remove(mLabel); - return text; -} - -void MsgUnifiedEditorLineEdit::clearContent() -{ - // avoid getting updates during local editing - disconnect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); - - int startPos = mLabel.length(); - this->setSelection(startPos, content().length()); - QKeyEvent eve(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier); - this->keyPressEvent(&eve); - this->deselect(); - - // re-connect signal to start getting updates - connect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged())); -} - -void MsgUnifiedEditorLineEdit::onContentsChanged() -{ - emit contentsChanged(content()); -} - -void MsgUnifiedEditorLineEdit::highlightInvalidString(QString invalidStr) -{ - // for only address editor - if(!mDefaultBehaviour) - { - QString txtContent = this->text(); - int searchStartPos = mLabel.length(); - int startPos = txtContent.indexOf(invalidStr, searchStartPos); - disconnect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), - this,SLOT(selectionChanged(QTextCursor,QTextCursor))); - // if invalidStr found - if(startPos > 0) - { - this->setSelection(startPos, invalidStr.length()); - } - connect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)), - this,SLOT(selectionChanged(QTextCursor,QTextCursor))); - } -} - -// eof diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/unifiededitor.pro --- a/messagingapp/msgui/unifiededitor/unifiededitor.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/unifiededitor.pro Fri Jun 11 13:35:48 2010 +0300 @@ -32,6 +32,7 @@ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE CONFIG += hb +HB += hbfeedback TARGET.EPOCALLOWDLLDATA = 1 TARGET.CAPABILITY = All -TCB @@ -45,31 +46,37 @@ "rom/unifiededitor.iby CORE_APP_LAYER_IBY_EXPORT_PATH(unifiededitor.iby)" # Input -HEADERS += msgmonitor.h \ +HEADERS += msgunieditormonitor.h \ msgunieditoraddress.h \ msgunieditorattachment.h \ msgunieditorbody.h \ msgunieditorsubject.h \ msgunieditorview.h \ - msgunifiededitorlineedit.h \ - msgattachmentcontainer.h \ + msgunieditorlineedit.h \ + msgunieditorattachmentcontainer.h \ msgbaseview.h \ msgunieditorimageprocessor.h \ msgunieditorprocessimageoperation.h \ - msgunifiededitorbasewidget.h + msgunieditorbasewidget.h \ + msgunieditorpixmapwidget.h \ + msgunieditorutils.h \ + msgunieditoraudiowidget.h -SOURCES += msgmonitor.inl \ - msgmonitor.cpp \ +SOURCES += msgunieditormonitor.inl \ + msgunieditormonitor.cpp \ msgunieditoraddress.cpp \ msgunieditorattachment.cpp \ msgunieditorbody.cpp \ msgunieditorsubject.cpp \ msgunieditorview.cpp \ - msgunifiededitorlineedit.cpp \ - msgattachmentcontainer.cpp \ + msgunieditorlineedit.cpp \ + msgunieditorattachmentcontainer.cpp \ msgunieditorimageprocessor.inl \ msgunieditorimageprocessor.cpp \ - msgunieditorprocessimageoperation.cpp + msgunieditorprocessimageoperation.cpp \ + msgunieditorpixmapwidget.cpp \ + msgunieditorutils.cpp \ + msgunieditoraudiowidget.cpp RESOURCES += unifiededitor.qrc diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiededitor/unifiededitor.qrc --- a/messagingapp/msgui/unifiededitor/unifiededitor.qrc Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiededitor/unifiededitor.qrc Fri Jun 11 13:35:48 2010 +0300 @@ -11,5 +11,6 @@ resources/layouts/msgunifiededitorbody.widgetml resources/layouts/msgunifiededitorsubject.css resources/layouts/msgunifiededitorsubject.widgetml + resources/layouts/msgunifiededitorattachment_color.css diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h --- a/messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h Fri Jun 11 13:35:48 2010 +0300 @@ -46,7 +46,9 @@ /** * Constructor */ - UnifiedViewer(const qint32 messageId, QGraphicsItem *parent = 0); + UnifiedViewer(const qint32 messageId, + int canForwardMessage = 0, + QGraphicsItem *parent = 0); /** * Destructor @@ -73,13 +75,7 @@ * @see HbView */ void createToolBar(); - - /** - * Validates if message can be forwarded - * @return true if message can be forwarded - * false if message cant be forwarded - */ - bool validateMsgForForward(); + public slots: @@ -143,6 +139,11 @@ * Message count */ int mMsgCount; + + /** + * Forward status of message + */ + bool mForwardMessage; }; #endif diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/unihighlighter.h --- a/messagingapp/msgui/unifiedviewer/inc/unihighlighter.h Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +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: Enables parsing and change font parameters for email/url - * - */ - -#ifndef UNI_HIGHLIGHTER_H -#define UNI_HIGHLIGHTER_H - -#include -#include -#include - -QT_BEGIN_NAMESPACE -class QTextDocument; -QT_END_NAMESPACE - -/** - * Enables parsing and change font parameters for email/url - */ -class UniHighlighter : public QSyntaxHighlighter -{ -Q_OBJECT - -public: - /* - * Constructor - */ - UniHighlighter(QTextDocument *parent = 0); - -protected: - /* - * highlightBlock - * @see QSyntaxHighlighter - */ - void highlightBlock(const QString &text); - -private: - - struct HighlightingRule - { - QRegExp pattern; - QTextCharFormat format; - }; - QVector highlightingRules; - - QTextCharFormat emailFormat; - QTextCharFormat urlFormat; -}; - -#endif //UNI_HIGHLIGHTER_H -// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univieweraddresscontainer.h --- a/messagingapp/msgui/unifiedviewer/inc/univieweraddresscontainer.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/inc/univieweraddresscontainer.h Fri Jun 11 13:35:48 2010 +0300 @@ -66,6 +66,12 @@ void setCcField(ConvergedMessageAddressList ccRecipients); /** + * Sets Bcc recipients + * @param bccRecipients list of Bcc recipients + */ + void setBccField(ConvergedMessageAddressList bccRecipients); + + /** * Clears the content of the widget */ void clearContent(); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univieweraddresswidget.h --- a/messagingapp/msgui/unifiedviewer/inc/univieweraddresswidget.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/inc/univieweraddresswidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -60,16 +60,10 @@ void clearContent(); protected: - /** - * called when mouse is pressed. + * Gesture event, overridden from base class. */ - void mousePressEvent(QGraphicsSceneMouseEvent *event); - - /** - * called when mouse is released. - */ - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + void gestureEvent(QGestureEvent* event); private: /** @@ -106,14 +100,18 @@ */ void menuClosed(); - //handlers for phone number specific menu items. + /** + * handlers for phone number specific menu items. + */ void openContactInfo(); void call(); void saveToContacts(); void sendMessage(); void copyToClipboard(); - //called after service request is completed. + /** + * called after service request is completed. + */ void onServiceRequestCompleted(); /** diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univiewerattachmentcontainer.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerattachmentcontainer.h Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +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: This holds all the attachments inside convergedmessage -* -*/ - -#ifndef UNIVIEWERATTACHMENTCONTAINER_H -#define UNIVIEWERATTACHMENTCONTAINER_H - -// SYSTEM INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class QGraphicsLinearLayout; -class UniViewerMediaWidget; - -//const int MAX_ATTACHMENT = 10; - -/** - * Container widget for all attachment inside message - */ - -class UniViewerAttachmentContainer: public HbWidget -{ -Q_OBJECT - -public: - - /** - * Constructor - */ - explicit UniViewerAttachmentContainer(QGraphicsItem *parent = 0); - - /** - * Destructor - */ - virtual ~UniViewerAttachmentContainer(); - - /** - * Add one more attachment into the widget - */ - void addAttachmentWidget(QString type, QString fileName); - - /** - * Clears the content of the widget - */ - void clearContent(); - -private: - - /** - * This contains total number of attacmnets added - */ - int mTotalAttachment; - - /** - * Main layout reference. - * Own - */ - QGraphicsLinearLayout *mMainLayout; - - /** - * From widget reference. - * Own - */ - QList mUniViewerMediaWidgetList; - -}; - -#endif // UNIVIEWERATTACHMENTCONTAINER_H -//eof diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univiewerattachmentwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerattachmentwidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,161 @@ +/* + * 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: Widget for displaying attachment media objects. + * + */ + +#ifndef UNI_VIEWER_ATTACHMENT_WIDGET_H +#define UNI_VIEWER_ATTACHMENT_WIDGET_H + +// SYSTEM INCLUDES +#include + +// FORWARD DECLARATIONS +class HbTextItem; +class HbIconItem; +class HbIcon; +class HbFrameItem; +class UniViewerUtils; + +/** + * @class UniViewerAttachmentWidget + * @brief Widget for displaying attachment media objects. + */ +class UniViewerAttachmentWidget: public HbWidget +{ +Q_OBJECT + +public: + + /** + * Constructor + */ + explicit UniViewerAttachmentWidget(QGraphicsItem *parent = 0); + + /** + * Destructor + */ + virtual ~UniViewerAttachmentWidget(); + + /** + * Populates the widget contents. + * @param mimeType Mime type of media. + * @param filePath File path of media. + */ + void populate(const QString &mimeType, const QString &filePath); + +signals: + + /** + * Signal emitted when widget is clicked. + * @param mediaPath File path of the media. + */ + void shortTap(const QString &mediaPath); + + /** + * Signal emitted when widget is long tapped. + * @param position Scene coordinates of tap. + */ + void longTap(const QPointF &position); + +protected: + + /** + * Event handler for gesture events. + * Reimplemented from HbWidgetBase. + * @see HbWidgetBase + */ + virtual void gestureEvent(QGestureEvent *event); + +private slots: + + /** + * Handles opening of media. + */ + void handleOpen(); + + /** + * Handles saving of media. + */ + void handleSave(); + + /** + * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture + * events back to back. + */ + void regrabGesture(); + +private: + + /** + * Handles short tap event. + */ + void handleShortTap(); + + /** + * Handles long tap event. + * @param position Scene coordinates of tap. + */ + void handleLongTap(const QPointF &position); + + /** + * Handles pressed state. + */ + void setPressed(bool pressed); + +private: + + /** + * Media icon item. + * Own + */ + HbIconItem *mMediaIcon; + + /** + * Media name text item. + * Own + */ + HbTextItem *mName; + + /** + * Media information text item. + * Own + */ + HbTextItem *mInfo; + + /** + * Background item of widget. + * Own + */ + HbFrameItem *mFrameItem; + + /** + * UniViewerUtils object. + * Own + */ + UniViewerUtils *mViewerUtils; + + /** + * Media file path. + */ + QString mMediaPath; + + /** + * Mime type of media. + */ + QString mMimeType; +}; + +#endif // UNI_VIEWER_ATTACHMENT_WIDGET_H +// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univieweraudiowidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/inc/univieweraudiowidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,116 @@ +/* + * 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: This widget is used to display audio content in univiewer. + * + */ + +#ifndef UNI_VIEWER_AUDIO_WIDGET_H +#define UNI_VIEWER_AUDIO_WIDGET_H + +// FORWARD DECLARATIONS +class UniViewerUtils; + +#include + +/** + * @class UniViewerAudioWidget + * @brief This widget is used to display audio content in univiewer. + */ +class UniViewerAudioWidget: public HbPushButton +{ +Q_OBJECT + +public: + + /** + * Constructor + */ + explicit UniViewerAudioWidget(QGraphicsItem *parent = 0); + + /** + * Destructor + */ + ~UniViewerAudioWidget(); + + /** + * Populates the widget contents. + * @param mimeType Mime type of media. + * @param filePath File path of media. + */ + void populate(const QString &mimeType, const QString &filePath); + +signals: + + /** + * Signal emitted when widget is clicked. + * @param mediaPath File path of the media. + */ + void shortTap(const QString &mediaPath); + + /** + * Signal emitted when widget is long tapped. + * @param position Scene coordinates of tap. + */ + void longTap(const QPointF &position); + +private slots: + + /** + * Handles short tap event. + */ + void handleShortTap(); + + /** + * Handles long tap event. + * @param position Scene coordinates of tap. + */ + void handleLongTap(const QPointF &position); + + /** + * Handles opening of media. + */ + void handleOpen(); + + /** + * Handles saving of media. + */ + void handleSave(); + + /** + * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture + * events back to back. + */ + void regrabGesture(); + +private: + + /** + * UniViewerUtils object. + * Own + */ + UniViewerUtils *mViewerUtils; + + /** + * Media file path. + */ + QString mMediaPath; + + /** + * Mime type of media. + */ + QString mMimeType; +}; + +#endif //UNI_VIEWER_AUDIO_WIDGET_H +// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -24,13 +24,12 @@ class UniViewerTextItem; class UniViewerPixmapWidget; +class UniViewerAudioWidget; class HbTextItem; -class HbPushButton; -//class HbGestureSceneFilter; -class QSignalMapper; /** - * This widget displays the body of the viewer + * @class UniViewerBodyWidget + * @brief This widget displays the body of the viewer. */ class UniViewerBodyWidget: public HbWidget { @@ -57,25 +56,25 @@ * Called to insert image content in viewer. * @param medialist list of absolute paths of media. */ - void setPixmap(QString pixmapFile); + void setPixmap(const QString &mimeType, const QString &pixmapFile); /** * Called to insert audio content in viewer. * @param medialist list of absolute paths of media. */ - void setAudio(QString audiofile); + void setAudio(const QString &mimeType, const QString &audiofile); /** * Called to insert video content in viewer. * @param medialist list of absolute paths of media. */ - void setVideo(QString videofile); + void setVideo(const QString &mimeType, const QString &videofile); /** * Called to insert text content in viewer. * @param text Body text to be set. */ - void setTextContent(QString text); + void setText(QString text); /** * Sets the slide counter. @@ -127,38 +126,6 @@ */ QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const; -private slots: - - /** - * called on long press on the media objects - */ - void longPressed(QPointF position); - - /** - * called from the media object's item specific menu - */ - void openMedia(); - - /** - * Open a specified media file - */ - void openMedia(const QString& fileName); - - /** - * called from the media object's item specific menu - */ - void saveMedia(); - - /** - * Service launch complete. - */ - void handleOk(const QVariant& result); - - /** - * Service launch errors. - */ - void handleError(int errorCode, const QString& errorMessage); - signals: /** * this signal is emitted when sendMessage is emitted from UniViewerTextItem. @@ -196,17 +163,7 @@ /** * Media widget for embedded audio content. */ - HbPushButton *mAudioItem; - - /** - * To setup longpress gesture on media objects - */ - // HbGestureSceneFilter* gestureFilter; - - /** - * File mapper for opening media - */ - QSignalMapper* mSignalMapper; + UniViewerAudioWidget *mAudioItem; }; #endif //UNIVIEWER_BODY_WIDGET_H diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univiewerfeeder.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerfeeder.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerfeeder.h Fri Jun 11 13:35:48 2010 +0300 @@ -126,15 +126,25 @@ * toAddressList * @return list of to address list */ - ConvergedMessageAddressList toAddressList(); /** * ccAddressList * @return list of cc address list */ + ConvergedMessageAddressList ccAddressList(); - ConvergedMessageAddressList ccAddressList(); + /** + * bccAddressList + * @return list of Bcc address list + */ + ConvergedMessageAddressList bccAddressList(); + + /** + * recipientCount + * @return Total recipient count + */ + int recipientCount(); /** * messageSize diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univiewerfeeder_p.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerfeeder_p.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerfeeder_p.h Fri Jun 11 13:35:48 2010 +0300 @@ -131,11 +131,23 @@ * @return list of cc address list */ ConvergedMessageAddressList ccAddressList(); + + /** + * bccAddressList + * @return list of Bcc address list + */ + ConvergedMessageAddressList bccAddressList(); + + /** + * Finds total recipient count + * @return total recipient count + */ + int recipientCount(); + /** * messageSize * @return int */ - int messageSize(); /** @@ -232,8 +244,13 @@ * owned. */ ConvergedMessageAddressList mCcAddressList; - - + + /** + * CC address list + * owned. + */ + ConvergedMessageAddressList mBccAddressList; + /** * Msv Session. * not Owned. diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univiewerheadercontainer.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerheadercontainer.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerheadercontainer.h Fri Jun 11 13:35:48 2010 +0300 @@ -27,8 +27,8 @@ class HbGroupBox; class HbFrameItem; class UniViewerAddressContainer; -class UniViewerAttachmentContainer; class UniViewerFeeder; +class UniViewerAttachmentWidget; class UniViewerHeaderContainer: public HbWidget { @@ -136,10 +136,9 @@ UniViewerAddressContainer *mAddressContainer; /** - * UniViewerAttachmentContainer object - * owned. + * List of attachment widgets. */ - UniViewerAttachmentContainer *mAttachmentContainer; + QList mUniViewerAttachmentstList; }; #endif /* UNIVIEWER_HEADER_CONTAINER_H */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univiewermediawidget.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewermediawidget.h Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +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 UNIVIEWERMEDIAWIDGET_H -#define UNIVIEWERMEDIAWIDGET_H - -// SYSTEM INCLUDES -#include - -// FORWARD DECLARATIONS -class HbTextItem; -class HbIconItem; -class HbIcon; -class HbPushButton; - -/** - * Widget for displaying inline media objects. - */ -class UniViewerMediaWidget : public HbWidget -{ - Q_OBJECT - -public: - - /** - * Constructor - */ - explicit UniViewerMediaWidget(QGraphicsItem *parent = 0); - - /** - * Destructor - */ - virtual ~UniViewerMediaWidget(); - - /** - * Initialize method - */ - void init(); - - /** - * Populates the widget contents. - * @param icon Media icon name. - * @param name Media file name. - * @param info Media information. - * @param bgFrame Background frame. - */ - void populate(const QString &icon, const QString &name, - const QString &info, const QString &bgFrame); - - /** - * Clears the contents of the widget. - */ - void clearContent(); - -signals: - - /** - * Signal emitted when widget is clicked. - */ - void clicked(); - -private: - - /** - * Media icon item. - * Own - */ - HbIconItem *mMediaIcon; - - /** - * Media name text item. - * Own - */ - HbTextItem *mName; - - /** - * Media information text item. - * Own - */ - HbTextItem *mInfo; - - /** - * Background item of widget. - * Own - */ - HbPushButton *mFrameItem; -}; - -#endif // UNIVIEWERMEDIAWIDGET_H -// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h Fri Jun 11 13:35:48 2010 +0300 @@ -20,6 +20,9 @@ #include +// FORWARD DECLARATIONS +class UniViewerUtils; + /** * This widget displays the pixmap content in viewer. */ @@ -41,17 +44,24 @@ /** * Sets the pixmap content to be displayed. + * @param mimeType Mime type of the pixmap. * @param pixmapPath File path of the pixmap. */ - void setPixmap(const QString &pixmapPath); + void populate(const QString &mimeType, const QString &pixmapPath); signals: /** - * Signal emitted for short tap on pixmap. - * @param pixmapPath File path of the pixmap being clicked. + * Signal emitted when widget is clicked. + * @param mediaPath File path of the media. */ - void shortTap(const QString &pixmapPath); + void shortTap(const QString &mediaPath); + + /** + * Signal emitted when widget is long tapped. + * @param position Scene coordinates of tap. + */ + void longTap(const QPointF &position); protected: @@ -62,12 +72,54 @@ */ virtual void gestureEvent(QGestureEvent *event); +private slots: + + /** + * + */ + void handleOpen(); + + /** + * + */ + void handleSave(); + + /** + * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture + * events back to back. + */ + void regrabGesture(); + private: /** + * Handles short tap event. + */ + void handleShortTap(); + + /** + * Handles long tap event. + * @param position Scene coordinates of tap. + */ + void handleLongTap(const QPointF &position); + +private: + + /** + * UniViewerUtils object. + * Own + */ + UniViewerUtils *mViewerUtils; + + /** + * Mime Type of pixmap. + */ + QString mMimeType; + + /** * Pixmap file path being set. */ - QString mPixmapFile; + QString mPixmapPath; }; #endif /* UNI_VIEWER_PIXMAP_WIDGET_H */ diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h --- a/messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h Fri Jun 11 13:35:48 2010 +0300 @@ -32,8 +32,10 @@ void setText(const QString& text); protected: - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - void mousePressEvent(QGraphicsSceneMouseEvent *event); + /** + * Gesture event, overridden from base class. + */ + void gestureEvent(QGestureEvent* event); private: @@ -75,18 +77,26 @@ void menuClosed(); - //handlers for phone number specific menu items. + /** + * handlers for phone number specific menu items. + */ void call(); void sendMessage(); - //handlers for e-mail specific menu items. + /** + * handlers for e-mail specific menu items. + */ void createEmail(); - //handlers for url specific menu items. + /** + * handlers for url specific menu items. + */ void openLink(); void addToBookmarks(); - //common handlers. + /** + * common handlers. + */ void openContactInfo(); void saveToContacts(); void copyToClipboard(); @@ -105,7 +115,9 @@ */ void handleError(int errorCode, const QString& errorMessage); - //called after service request is completed. + /** + * called after service request is completed. + */ void onServiceRequestCompleted(); signals: diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/inc/univiewerutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/inc/univiewerutils.h Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,90 @@ +/* + * 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: Utility class for univiewer. + * + */ + +#ifndef UNI_VIEWER_UTILS_H +#define UNI_VIEWER_UTILS_H + +// SYSTEM INCLUDES +#include + +// FORWARD DECLARATIONS + +/** + * @class UniViewerUtils + * @brief Utility class for univiewer. Contains common functionality required + * for widgets. + */ + +class UniViewerUtils: public QObject +{ +Q_OBJECT + +public: + + /** + * Constructor + */ + explicit UniViewerUtils(QObject *parent = 0); + + /** + * Destructor + */ + virtual ~UniViewerUtils(); + + /** + * Utility function to launch different content viewers. + * @param mimeType Mime type of the content. + * @param filePath Absolute file path of content. + */ + void launchContentViewer(const QString &mimeType, const QString &filePath); + +signals: + + /** + * Service launch complete. + */ + void requestOk(const QVariant& result); + + /** + * Service launch errors. + */ + void requestError(int errorCode, const QString& errorMessage); + +private slots: + + /** + * Service launch complete. + */ + void handleOk(const QVariant& result); + + /** + * Service launch errors. + */ + void handleError(int errorCode, const QString& errorMessage); + +private: + + /** + * Launch content viewer using XQSharableFile. + * @param filePath Absolute path of content. + */ + void launchViaSharableFile(const QString &filePath); + +}; + +#endif // UNI_VIEWER_UTILS_H +//eof diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/resources/layouts/univiewerattachmentwidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerattachmentwidget.css Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,45 @@ + +UniViewerAttachmentWidget +{ + layout: layout-default; +} + +UniViewerAttachmentWidget::mediaIcon +{ + left:-var(hb-param-margin-gene-left); + top:-var(hb-param-margin-gene-top); + bottom:var(hb-param-margin-gene-bottom) ; + aspect-ratio:ignore; + size-policy:fixed fixed; + pref-width:var(hb-param-graphic-size-primary-small); + pref-height:var(hb-param-graphic-size-primary-small); +} + +UniViewerAttachmentWidget::text-1 +{ + left:-var(hb-param-margin-gene-middle-horizontal); + right:var(hb-param-margin-gene-middle-horizontal); + center-vertical:0un; + text-height:var(hb-param-text-height-secondary); + font-variant:secondary; + text-line-count-min:1; + text-line-count-max:1; +} + +UniViewerAttachmentWidget::text-2 +{ + left:-var(hb-param-margin-gene-middle-horizontal); + right:var(hb-param-margin-gene-right); + center-vertical:0un; + size-policy-horizontal:fixed; + font-variant:secondary; + text-height:var(hb-param-text-height-tiny); + text-line-count-min:1; + text-line-count-max:1; +} + +UniViewerAttachmentWidget::bgFrame +{ + zvalue:-1; +} + diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/resources/layouts/univiewerattachmentwidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerattachmentwidget.widgetml Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/resources/layouts/univiewerattachmentwidget_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerattachmentwidget_color.css Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,20 @@ + +UniViewerAttachmentWidget[state="normal"]::text-1 +{ + color:var(qtc_list_item_title_normal); +} + +UniViewerAttachmentWidget[state="pressed"]::text-1 +{ + color:var(qtc_list_item_pressed); +} + +UniViewerAttachmentWidget[state="normal"]::text-2 +{ + color:var(qtc_list_item_title_normal); +} + +UniViewerAttachmentWidget[state="pressed"]::text-2 +{ + color:var(qtc_list_item_pressed); +} diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget.css --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget.css Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ - -UniViewerMediaWidget -{ - layout: layout-default; -} - -UniViewerMediaWidget::mediaIcon -{ - left:-var(hb-param-margin-gene-left); - top:-var(hb-param-margin-gene-top); - bottom:var(hb-param-margin-gene-bottom) ; - aspect-ratio:ignore; - size-policy:fixed fixed; - pref-width:var(hb-param-graphic-size-primary-small); - pref-height:var(hb-param-graphic-size-primary-small); -} - -UniViewerMediaWidget::text-1 -{ - left:-var(hb-param-margin-gene-middle-horizontal); - right:var(hb-param-margin-gene-middle-horizontal); - center-vertical:0un; - text-height:var(hb-param-text-height-secondary); - font-variant:secondary; - text-line-count-min:1; - text-line-count-max:1; -} - -UniViewerMediaWidget::text-2 -{ - left:-var(hb-param-margin-gene-middle-horizontal); - right:var(hb-param-margin-gene-right); - center-vertical:0un; - size-policy-horizontal:fixed; - font-variant:secondary; - text-height:var(hb-param-text-height-tiny); - text-line-count-min:1; - text-line-count-max:1; -} - -UniViewerMediaWidget::bgFrame -{ - zvalue:-1; -} - diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget.widgetml --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget.widgetml Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget_color.css --- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget_color.css Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - -UniViewerMediaWidget::text-1 -{ - color:var(qtc_list_item_title_normal); -} - -UniViewerMediaWidget::text-2 -{ - color:var(qtc_list_item_title_normal); -} \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp --- a/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -38,8 +38,6 @@ #include "conversationsengine.h" #include "debugtraces.h" #include "nativemessageconsts.h" -#include "mmsconformancecheck.h" -#include "UniEditorGenUtils.h" // This is needed for KDefaultMaxSize // LOCAL CONSTANTS const QString REPLY_ICON("qtg_mono_reply"); @@ -57,8 +55,10 @@ // UnifiedViewer::UnifiedViewer // constructor //---------------------------------------------------------------------------- -UnifiedViewer::UnifiedViewer(const qint32 messageId, QGraphicsItem *parent) : - MsgBaseView(parent) +UnifiedViewer::UnifiedViewer(const qint32 messageId, + int canForwardMessage, + QGraphicsItem *parent) : + MsgBaseView(parent), mForwardMessage(false) { QDEBUG_WRITE("UnifiedViewer contruction start"); @@ -70,6 +70,8 @@ mMessageId = messageId; mViewFeeder = new UniViewerFeeder(mMessageId, this); + if (canForwardMessage > 0) mForwardMessage = true; + mScrollArea = new UniScrollArea(this); this->setWidget(mScrollArea); @@ -115,10 +117,14 @@ else { toolbar->addAction(HbIcon(REPLY_ICON), ""); - toolbar->addAction(HbIcon(REPLY_ALL_ICON), ""); + + if (mViewFeeder->recipientCount() > 1) + { + toolbar->addAction(HbIcon(REPLY_ALL_ICON), ""); + } } - if (validateMsgForForward()) + if (mForwardMessage) { toolbar->addAction(HbIcon(FORWARD_ICON), "", this, SLOT(handleFwdAction())); } @@ -265,27 +271,6 @@ } //--------------------------------------------------------------- -// UnifiedViewer::validateMsgForForward -// @see header file -//--------------------------------------------------------------- -bool UnifiedViewer::validateMsgForForward() -{ - if (mViewFeeder->msgType() == KSenduiMtmMmsUidValue) - { - bool retValue = false; - - //Validate if the mms msg can be forwarded or not - MmsConformanceCheck* mmsConformanceCheck = new MmsConformanceCheck; - retValue = mmsConformanceCheck->validateMsgForForward(mMessageId); - - delete mmsConformanceCheck; - return retValue; - } - - return true; -} - -//--------------------------------------------------------------- // UnifiedViewer::onDialogDeleteMsg // @see header file //--------------------------------------------------------------- diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/unihighlighter.cpp --- a/messagingapp/msgui/unifiedviewer/src/unihighlighter.cpp Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +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: Enables parsing and change font parameters for email/url - * - */ -#include "unihighlighter.h" - -#include - -//--------------------------------------------------------------- -//UniHighlighter :: UniHighlighter -// @see header file -//--------------------------------------------------------------- -UniHighlighter::UniHighlighter(QTextDocument *parent) : - QSyntaxHighlighter(parent) -{ - HighlightingRule rule; - - emailFormat.setFontWeight(QFont::Bold); - rule.pattern = QRegExp( - "\\b[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}\\b"); - rule.format = emailFormat; - highlightingRules.append(rule); - - urlFormat.setAnchor(true); - urlFormat.setFontUnderline(true); - rule.pattern - = QRegExp( - "\\b((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\\w\\d:#@%/;$()~_?\\+-=\\\\.&]*)\\b"); - rule.format = urlFormat; - highlightingRules.append(rule); -} - -//--------------------------------------------------------------- -//UniHighlighter :: highlightBlock -// @see header file -//--------------------------------------------------------------- -void UniHighlighter::highlightBlock(const QString &text) -{ - foreach (const HighlightingRule &rule, highlightingRules) - { - QRegExp expression(rule.pattern); - int index = text.indexOf(expression); - while (index >= 0) - { - int length = expression.matchedLength(); - setFormat(index, length, rule.format); - index = text.indexOf(expression, index + length); - } - } -} - -// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univieweraddresscontainer.cpp --- a/messagingapp/msgui/unifiedviewer/src/univieweraddresscontainer.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/src/univieweraddresscontainer.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -99,4 +99,20 @@ ccWidget->populate(LOC_CC, ccRecipients); } +//--------------------------------------------------------------- +// UniViewerAddressContainer :: setBccField +// @see header file +//--------------------------------------------------------------- +void UniViewerAddressContainer::setBccField(ConvergedMessageAddressList bccRecipients) +{ + UniViewerAddressWidget* bccWidget = new UniViewerAddressWidget(); + + connect(bccWidget, SIGNAL(sendMessage(const QString&,const QString&)), this, + SIGNAL(sendMessage(const QString&,const QString&))); + + mMainLayout->addItem(bccWidget); + + bccWidget->populate(LOC_BCC, bccRecipients); +} + // EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -20,26 +20,22 @@ // SYSTEM INCLUDES #include -#include -#include -#include -#include #include #include -#include +#include + +#include +#include +#include + #include - #include #include #include -#include +#include #include #include "msgcontacthandler.h" - - - - // LOCAL CONSTANTS const QString ADDRESS_SEPARATOR("; "); const QString ADDRESS_OPEN(" ("); @@ -63,11 +59,11 @@ HbTextEdit(parent), mCursorPos(-1) { - this->setReadOnly(true); - this->setCursorVisibility(Hb::TextCursorHidden); + this->setReadOnly(true); this->setScrollable(false); - HbFrameItem *noBackground = new HbFrameItem(this); - this->setBackgroundItem(noBackground); + this->setFlag(QGraphicsItem::ItemIsFocusable,false); + this->setCursorVisibility(Hb::TextCursorHidden); + this->setBackgroundItem(0); HbFontSpec fontSpec(HbFontSpec::Secondary); QFont font = fontSpec.font(); @@ -92,37 +88,71 @@ } //--------------------------------------------------------------- -//UniViewerAddressWidget :: mousePressEvent +//UniViewerAddressWidget :: gestureEvent // @see header file //--------------------------------------------------------------- -void UniViewerAddressWidget::mousePressEvent(QGraphicsSceneMouseEvent *event) +void UniViewerAddressWidget::gestureEvent(QGestureEvent* event) { - HbTextEdit::mousePressEvent(event); - - QTextDocument* doc = this->document(); - - mCursorPos = doc->documentLayout()->hitTest(event->pos(), Qt::ExactHit); - - highlightText(true); + //handle gesture to highlight and dehighlight find item. + + if(HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) + { + //capturing gesture position, and map to local co-ordinates. + QPointF pos = mapFromScene(tap->scenePosition()); + + switch (tap->state()) + { + case Qt::GestureStarted: + { + //highlight find item. + QTextDocument* doc = this->document(); + mCursorPos = doc->documentLayout()->hitTest(pos, Qt::ExactHit); + highlightText(true); + break; + } + + case Qt::GestureFinished: + { + if (HbTapGesture::Tap == tap->tapStyleHint()) + { + //gesture is finshed dehighlight text. + highlightText(false); + + QString anchor = this->anchorAt(pos); + + //do short tap action. + if (!anchor.isEmpty() && !this->textCursor().hasSelection()) + { + shortTapAction(anchor); + } + } + break; + } + + case Qt::GestureCanceled: + { + //gesture is canceled due to pan or swipe, dehighlight text. + if (HbTapGesture::Tap == tap->tapStyleHint()) + { + highlightText(false); + break; + } + } + default: + break; + } + + event->accept(); + } + else + { + event->ignore(); + } + + //passing gesture event to base class. + HbTextEdit::gestureEvent(event); } -//--------------------------------------------------------------- -//UniViewerAddressWidget :: mouseReleaseEvent -// @see header file -//--------------------------------------------------------------- -void UniViewerAddressWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - HbTextEdit::mouseReleaseEvent(event); - - highlightText(false); - - QString anchor = this->anchorAt(event->pos()); - - if(!anchor.isEmpty() && !this->textCursor().hasSelection()) - { - shortTapAction(anchor); - } -} //---------------------------------------------------------------------------- // UniViewerAddressWidget::populate @@ -372,7 +402,7 @@ QString phoneNumber = action->data().toString(); //invoke dialer service and pass phoneNumber. - QString serviceName("com.nokia.services.telephony"); + QString serviceName("com.nokia.symbian.ICallDial"); QString operation("dial(QString)"); XQServiceRequest* serviceRequest = new XQServiceRequest(serviceName,operation,false); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewerattachmentcontainer.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerattachmentcontainer.cpp Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +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 "univiewerattachmentcontainer.h" - -// SYSTEM INCLUDES -#include -#include - -// USER INCLUDES -#include "univiewermediawidget.h" -#include "debugtraces.h" - -// LOCAL CONSTANTS -const QString ATTACHMENT_FRAME("qtg_fr_groupbox"); -const QString ATTACHMENT_ICON("qtg_small_attachment.svg"); - -const int KILOBYTE = 1024; - -//--------------------------------------------------------------- -// UniViewerAttachmentContainer :: UniViewerAttachmentContainer -// @see header file -//--------------------------------------------------------------- -UniViewerAttachmentContainer::UniViewerAttachmentContainer(QGraphicsItem *parent) : - HbWidget(parent), mTotalAttachment(0), mMainLayout(NULL) -{ - QDEBUG_WRITE("AttachmentContainer Initialized.."); - mMainLayout = new QGraphicsLinearLayout(Qt::Vertical); - mMainLayout->setContentsMargins(0, 0, 0, 0); - mMainLayout->setSpacing(0); - setLayout(mMainLayout); -} - -//--------------------------------------------------------------- -// UniViewerAttachmentContainer :: ~UniViewerAttachmentContainer -// @see header file -//--------------------------------------------------------------- -UniViewerAttachmentContainer::~UniViewerAttachmentContainer() -{ - -} - -//--------------------------------------------------------------- -// UniViewerAttachmentContainer :: addAttachmentWidget -// @see header file -//--------------------------------------------------------------- -void UniViewerAttachmentContainer::addAttachmentWidget(QString type, QString fileName) -{ - Q_UNUSED(type) - - UniViewerMediaWidget *attachmentWidget = new UniViewerMediaWidget(this); - mUniViewerMediaWidgetList.append(attachmentWidget); - QFileInfo fileInfo(fileName); - - int fileSize = fileInfo.size(); - QString sizeString('B'); - if (fileSize > KILOBYTE) { - // Convert to Kilobytes. - fileSize /= KILOBYTE; - sizeString = "Kb"; - } - - QString fileDetails = "(" + QString::number(fileSize) + sizeString + ")"; - - attachmentWidget->populate(ATTACHMENT_ICON, fileInfo.fileName(), fileDetails, ATTACHMENT_FRAME); - - mMainLayout->addItem(attachmentWidget); - - mTotalAttachment++; -} - -//--------------------------------------------------------------- -// UniViewerAttachmentContainer :: clearContent -// @see header file -//--------------------------------------------------------------- -void UniViewerAttachmentContainer::clearContent() -{ - for (int i = 0; i < mUniViewerMediaWidgetList.count(); ++i) { - --mTotalAttachment; - mMainLayout->removeItem(mUniViewerMediaWidgetList[i]); - mUniViewerMediaWidgetList[i]->setParent(NULL); - delete mUniViewerMediaWidgetList[i]; - mUniViewerMediaWidgetList[i] = NULL; - } - mUniViewerMediaWidgetList.clear(); - resize(rect().width(), -1); -} - -//eof diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewerattachmentwidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerattachmentwidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,247 @@ +/* + * 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: Widget for displaying attachment media objects. + * + */ + +#include "univiewerattachmentwidget.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +// USER INCLUDES +#include "univiewerutils.h" + +// LOCAL CONSTANTS +#define LOC_OPEN hbTrId("txt_common_menu_open") +#define LOC_SAVE hbTrId("txt_common_menu_save") +#define LOC_SAVE_TO_CONTACTS hbTrId("txt_messaging_menu_save_to_contacts") + +const QString BG_FRAME_NORMAL("qtg_fr_list_normal"); +const QString BG_FRAME_PRESSED("qtg_fr_list_pressed"); +const QString ATTACHMENT_ICON("qtg_small_attachment"); +const QString VCARD_MIMETYPE("text/X-vCard"); + +const int KILOBYTE = 1024; + +//---------------------------------------------------------------------------- +// UniViewerAttachmentWidget::UniViewerAttachmentWidget +// @see header file +//---------------------------------------------------------------------------- +UniViewerAttachmentWidget::UniViewerAttachmentWidget(QGraphicsItem *parent) : + HbWidget(parent), mMediaIcon(0), mName(0), mInfo(0), mFrameItem(0), mViewerUtils(0) +{ + this->grabGesture(Qt::TapGesture); + + setProperty("state", "normal"); + + mMediaIcon = new HbIconItem(this); + HbStyle::setItemName(mMediaIcon, "mediaIcon"); + + mName = new HbTextItem(this); + HbStyle::setItemName(mName, "text-1"); + + mInfo = new HbTextItem(this); + HbStyle::setItemName(mInfo, "text-2"); + + mFrameItem = new HbFrameItem(BG_FRAME_NORMAL, HbFrameDrawer::NinePieces, this); + HbStyle::setItemName(mFrameItem, "bgFrame"); + + HbEffect::add("attachmentWidget", "listviewitem_press", "pressed"); + HbEffect::add("attachmentWidget", "listviewitem_release", "released"); +} + +//---------------------------------------------------------------------------- +// UniViewerAttachmentWidget::~UniViewerAttachmentWidget +// @see header file +//---------------------------------------------------------------------------- +UniViewerAttachmentWidget::~UniViewerAttachmentWidget() +{ +} + +//---------------------------------------------------------------------------- +// UniViewerAttachmentWidget::populate +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAttachmentWidget::populate(const QString &mimeType, const QString &filePath) +{ + mMimeType = mimeType; + mMediaPath = filePath; + + mMediaIcon->setIconName(ATTACHMENT_ICON); + + QFileInfo fileInfo(filePath); + mName->setText(fileInfo.fileName()); + + QString sizeString('B'); + int fileSize = fileInfo.size(); + if (fileSize > KILOBYTE) { + // Convert to Kilobytes. + fileSize /= KILOBYTE; + sizeString = "Kb"; + } + QString fileDetails = "(" + QString::number(fileSize) + sizeString + ")"; + mInfo->setText(fileDetails); +} + +//---------------------------------------------------------------------------- +// UniViewerAttachmentWidget::resizeEvent +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAttachmentWidget::gestureEvent(QGestureEvent *event) +{ + HbTapGesture *tapGesture = qobject_cast (event->gesture(Qt::TapGesture)); + if (tapGesture) { + switch (tapGesture->state()) { + case Qt::GestureStarted: + { + // Trigger haptic feedback. + HbInstantFeedback::play(HbFeedback::Basic); + setPressed(true); + break; + } + case Qt::GestureUpdated: + { + if (HbTapGesture::TapAndHold == tapGesture->tapStyleHint()) { + // Handle longtap. + setPressed(false); + handleLongTap(tapGesture->scenePosition()); + } + break; + } + case Qt::GestureFinished: + { + HbInstantFeedback::play(HbFeedback::Basic); + if (HbTapGesture::Tap == tapGesture->tapStyleHint()) { + // Handle short tap. + setPressed(false); + handleShortTap(); + } + break; + } + case Qt::GestureCanceled: + { + HbInstantFeedback::play(HbFeedback::Basic); + setPressed(false); + break; + } + } + } + else { + HbWidget::gestureEvent(event); + } +} + +//---------------------------------------------------------------------------- +// UniViewerAttachmentWidget::handleOpen +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAttachmentWidget::handleOpen() +{ + this->ungrabGesture(Qt::TapGesture); + + if (!mViewerUtils) { + mViewerUtils = new UniViewerUtils(this); + } + mViewerUtils->launchContentViewer(mMimeType, mMediaPath); + + //fire timer to regrab gesture after some delay. + QTimer::singleShot(300,this,SLOT(regrabGesture())); +} + +//---------------------------------------------------------------------------- +// UniViewerAttachmentWidget::handleSave +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAttachmentWidget::handleSave() +{ + +} + +//---------------------------------------------------------------------------- +// UniViewerAttachmentWidget::handleShortTap +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAttachmentWidget::handleShortTap() +{ + emit shortTap(mMediaPath); + + // Open the media. + handleOpen(); +} + +//---------------------------------------------------------------------------- +// UniViewerAttachmentWidget::handleLongTap +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAttachmentWidget::handleLongTap(const QPointF &position) +{ + emit longTap(position); + + // Display context sensitive menu. + HbMenu* menu = new HbMenu; + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->setPreferredPos(position); + + if (mMimeType.contains(VCARD_MIMETYPE, Qt::CaseInsensitive)) { + // For vcard opening & saving is same. + menu->addAction(LOC_SAVE_TO_CONTACTS, this, SLOT(handleOpen())); + } + else { + menu->addAction(LOC_OPEN, this, SLOT(handleOpen())); + menu->addAction(LOC_SAVE, this, SLOT(handleSave())); + } + + menu->show(); +} + +//---------------------------------------------------------------------------- +// UniViewerAttachmentWidget::setPressed +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAttachmentWidget::setPressed(bool pressed) +{ + if (pressed) { + setProperty("state", "pressed"); + mFrameItem->frameDrawer().setFrameGraphicsName(BG_FRAME_PRESSED); + HbEffect::cancel(mFrameItem, "released"); + HbEffect::start(mFrameItem, "attachmentWidget", "pressed"); + + } + else { + setProperty("state", "normal"); + mFrameItem->frameDrawer().setFrameGraphicsName(BG_FRAME_NORMAL); + HbEffect::cancel(mFrameItem, "pressed"); + HbEffect::start(mFrameItem, "attachmentWidget", "released"); + } +} + +//--------------------------------------------------------------- +// UniViewerAttachmentWidget::regrabGesture +// @see header file +//--------------------------------------------------------------- +void UniViewerAttachmentWidget::regrabGesture() +{ + this->grabGesture(Qt::TapGesture); +} +// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univieweraudiowidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/src/univieweraudiowidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,133 @@ +/* + * 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: This widget is used to display audio content in univiewer. + * + */ +#include "univieweraudiowidget.h" + +// SYSTEM INCLUDES +#include +#include +#include + +// USER INCLUDES +#include "msgmediautil.h" +#include "univiewerutils.h" + +// LOCAL CONSTANTS +#define LOC_OPEN hbTrId("txt_common_menu_open") +#define LOC_SAVE hbTrId("txt_common_menu_save") + +const QString AUDIO_ICON("qtg_mono_audio"); + +//---------------------------------------------------------------------------- +// UniViewerAudioWidget::UniViewerAudioWidget +// @see header file +//---------------------------------------------------------------------------- +UniViewerAudioWidget::UniViewerAudioWidget(QGraphicsItem *parent) : + HbPushButton(parent), mViewerUtils(0) +{ + connect(this, SIGNAL(clicked()), this, SLOT(handleShortTap())); + connect(this, SIGNAL(longPress(QPointF)), this, SLOT(handleLongTap(QPointF))); +} + +//---------------------------------------------------------------------------- +// UniViewerAudioWidget::~UniViewerAudioWidget +// @see header file +//---------------------------------------------------------------------------- +UniViewerAudioWidget::~UniViewerAudioWidget() +{ +} + +//---------------------------------------------------------------------------- +// UniViewerAudioWidget::~UniViewerAudioWidget +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAudioWidget::populate(const QString &mimeType, const QString &filePath) +{ + mMimeType = mimeType; + mMediaPath = filePath; + + this->setIcon(HbIcon(AUDIO_ICON)); + QFileInfo fileInfo(mMediaPath); + this->setText(fileInfo.baseName()); + this->setTextAlignment(Qt::AlignLeft); + MsgMediaUtil mediaUtil; + this->setAdditionalText(mediaUtil.mediaDuration(mMediaPath)); +} + +//---------------------------------------------------------------------------- +// UniViewerAudioWidget::handleShortTap +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAudioWidget::handleShortTap() +{ + emit shortTap(mMediaPath); + + // Open the media. + handleOpen(); +} + +//---------------------------------------------------------------------------- +// UniViewerAudioWidget::handleLongTap +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAudioWidget::handleLongTap(const QPointF &position) +{ + emit longTap(position); + + // Display context sensitive menu. + HbMenu* menu = new HbMenu; + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->addAction(LOC_OPEN, this, SLOT(handleOpen())); + menu->addAction(LOC_SAVE, this, SLOT(handleSave())); + menu->setPreferredPos(position); + menu->show(); +} + +//---------------------------------------------------------------------------- +// UniViewerAudioWidget::handleOpen +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAudioWidget::handleOpen() +{ + this->ungrabGesture(Qt::TapGesture); + + if (!mViewerUtils) { + mViewerUtils = new UniViewerUtils(this); + } + mViewerUtils->launchContentViewer(mMimeType, mMediaPath); + + //fire timer to regrab gesture after some delay. + QTimer::singleShot(300,this,SLOT(regrabGesture())); +} + +//---------------------------------------------------------------------------- +// UniViewerAudioWidget::handleSave +// @see header file +//---------------------------------------------------------------------------- +void UniViewerAudioWidget::handleSave() +{ + +} + +//--------------------------------------------------------------- +// UniViewerAudioWidget::regrabGesture +// @see header file +//--------------------------------------------------------------- +void UniViewerAudioWidget::regrabGesture() +{ + this->grabGesture(Qt::TapGesture); +} +// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -17,30 +17,21 @@ #include "univiewerbodywidget.h" +// SYSTEM INCLUDES #include -#include -#include -#include - #include -#include -#include #include -#include -#include -#include - +// USER INCLUDES #include "univiewertextitem.h" #include "univiewerpixmapwidget.h" -#include "msgmediautil.h" -// LOCAL CONSTANTS -const QString AUDIO_ICON("qtg_mono_audio"); +#include "univieweraudiowidget.h" -// Localization -#define LOC_TITLE hbTrId("txt_messaging_title_messaging") -#define LOC_OPEN hbTrId("txt_common_menu_open") -#define LOC_SAVE hbTrId("txt_common_menu_save") +// LOCAL CONSTANTS +const QString IMAGE_MIMETYPE("image"); +const QString AUDIO_MIMETYPE("audio"); +const QString VIDEO_MIMETYPE("video"); +const QString TEXT_MIMETYPE("text"); //--------------------------------------------------------------- //UniViewerBodyWidget::UniViewerBodyWidget @@ -50,10 +41,7 @@ HbWidget(parent), mHasText(false), mHasPixmap(false), mTextItem(0), mSlideCounter(0), mPixmapItem(0), mAudioItem(0) { - this->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed); - // Signal mapper for opening media files - mSignalMapper = new QSignalMapper(this); - connect(mSignalMapper, SIGNAL(mapped(const QString &)), this, SLOT(openMedia(const QString &))); + this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); } //--------------------------------------------------------------- @@ -68,18 +56,16 @@ //UniViewerBodyWidget::setImage // @see header file //--------------------------------------------------------------- -void UniViewerBodyWidget::setPixmap(QString pixmapFile) +void UniViewerBodyWidget::setPixmap(const QString &mimeType, const QString &pixmapFile) { setHasPixmap(true); //create image item instance if (!mPixmapItem) { mPixmapItem = new UniViewerPixmapWidget(this); HbStyle::setItemName(mPixmapItem, "pixmap"); - connect(mPixmapItem, SIGNAL(shortTap(QString)), this, SLOT(openMedia(QString))); } - mPixmapItem->hide(); - mPixmapItem->setPixmap(pixmapFile); + mPixmapItem->populate(mimeType, pixmapFile); this->repolish(); } @@ -88,23 +74,14 @@ //UniViewerBodyWidget::setAudio // @see header file //--------------------------------------------------------------- -void UniViewerBodyWidget::setAudio(QString audiofile) +void UniViewerBodyWidget::setAudio(const QString &mimeType, const QString &audiofile) { if (!mAudioItem) { - mAudioItem = new HbPushButton(this); + mAudioItem = new UniViewerAudioWidget(this); HbStyle::setItemName(mAudioItem, "audioItem"); } mAudioItem->hide(); - QFileInfo fileInfo(audiofile); - mAudioItem->setIcon(HbIcon(AUDIO_ICON)); - mAudioItem->setText(fileInfo.baseName()); - MsgMediaUtil mediaUtil; - mAudioItem->setAdditionalText(mediaUtil.mediaDuration(audiofile)); - mAudioItem->setTextAlignment(Qt::AlignLeft); - - // Connect to signal mapper with file name - mSignalMapper->setMapping(mAudioItem, audiofile); - connect(mAudioItem, SIGNAL(clicked()), mSignalMapper, SLOT(map())); + mAudioItem->populate(mimeType, audiofile); this->repolish(); } @@ -113,16 +90,17 @@ //UniViewerBodyWidget::setVideo // @see header file //--------------------------------------------------------------- -void UniViewerBodyWidget::setVideo(QString videofile) +void UniViewerBodyWidget::setVideo(const QString &mimeType, const QString &videofile) { + Q_UNUSED(mimeType) Q_UNUSED(videofile) } //--------------------------------------------------------------- -//UniViewerBodyWidget::setTextContent +//UniViewerBodyWidget::setText // @see header file //--------------------------------------------------------------- -void UniViewerBodyWidget::setTextContent(QString text) +void UniViewerBodyWidget::setText(QString text) { setHasText(true); @@ -140,7 +118,7 @@ } //--------------------------------------------------------------- -//UniViewerBodyWidget::setTextContent +// UniViewerBodyWidget::setSlideCounter // @see header file //--------------------------------------------------------------- void UniViewerBodyWidget::setSlideCounter(QString &slideCounter) @@ -204,23 +182,23 @@ int count = objList.count(); for (int a = 0; a < count; ++a) { UniMessageInfo* info = objList.at(a); - QString type = info->mimetype(); + QString mimeType = info->mimetype(); - if (type.contains("text")) { + if (mimeType.contains(TEXT_MIMETYPE)) { QFile file(info->path()); if (file.open(QIODevice::ReadOnly)) { QString textContent(file.readAll()); - setTextContent(textContent); + setText(textContent); } } - else if (type.contains("video")) { - setVideo(info->path()); + else if (mimeType.contains(VIDEO_MIMETYPE)) { + setVideo(mimeType, info->path()); } - else if (type.contains("audio")) { - setAudio(info->path()); + else if (mimeType.contains(AUDIO_MIMETYPE)) { + setAudio(mimeType, info->path()); } - else if (type.contains("image")) { - setPixmap(info->path()); + else if (mimeType.contains(IMAGE_MIMETYPE)) { + setPixmap(mimeType, info->path()); } delete info; @@ -403,110 +381,4 @@ return szHint; } -//--------------------------------------------------------------- -//UniViewerBodyWidget::longPressed -// @see header file -//--------------------------------------------------------------- -void UniViewerBodyWidget::longPressed(QPointF position) -{ - - HbMenu* menu = new HbMenu; - menu->setAttribute(Qt::WA_DeleteOnClose); - menu->addAction(LOC_OPEN, this, SLOT(openMedia())); - menu->addAction(LOC_SAVE, this, SLOT(saveMedia())); - menu->setPreferredPos(position); - menu->show(); -} - -//--------------------------------------------------------------- -//UniViewerBodyWidget::openMedia -// @see header file -//--------------------------------------------------------------- -void UniViewerBodyWidget::openMedia() -{ -} - -//--------------------------------------------------------------- -//UniViewerBodyWidget::openMedia -// @see header file -//--------------------------------------------------------------- -void UniViewerBodyWidget::openMedia(const QString& fileName) -{ - XQSharableFile sf; - XQAiwRequest* request = 0; - - if (!sf.open(fileName)) { - return; - } - - // Get handlers - XQApplicationManager appManager; - QList fileHandlers = appManager.list(sf); - if (fileHandlers.count() > 0) { - XQAiwInterfaceDescriptor d = fileHandlers.first(); - request = appManager.create(sf, d); - - if (!request) { - sf.close(); - return; - } - } - else { - sf.close(); - return; - } - - // Result handlers - connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&))); - connect(request, SIGNAL(requestError(const QVariant&)), this, - SLOT(handleError(const QVariant&))); - - request->setEmbedded(true); - request->setSynchronous(true); - - // Fill args - QList args; - args << qVariantFromValue(sf); - request->setArguments(args); - - // Fill headers - QString key("WindowTitle"); - QVariant value(QString(LOC_TITLE)); - XQRequestInfo info; - info.setInfo(key, value); - request->setInfo(info); - - request->send(); - - // Cleanup - sf.close(); - delete request; -} - -//--------------------------------------------------------------- -//UniViewerBodyWidget::saveMedia -// @see header file -//--------------------------------------------------------------- -void UniViewerBodyWidget::saveMedia() -{ -} - -//--------------------------------------------------------------- -// UniViewerBodyWidget :: handleOk -// @see header file -//--------------------------------------------------------------- -void UniViewerBodyWidget::handleOk(const QVariant& result) -{ - Q_UNUSED(result) -} - -//--------------------------------------------------------------- -// UniViewerBodyWidget :: handleError -// @see header file -//--------------------------------------------------------------- -void UniViewerBodyWidget::handleError(int errorCode, const QString& errorMessage) -{ - Q_UNUSED(errorMessage) - Q_UNUSED(errorCode) -} // EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewerfeeder.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerfeeder.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerfeeder.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -167,6 +167,24 @@ } // --------------------------------------------------------------------------- +// UniViewerFeeder::bccAddressList +// @see header file +// --------------------------------------------------------------------------- +ConvergedMessageAddressList UniViewerFeeder::bccAddressList() +{ + return d_ptr->bccAddressList(); +} + +// --------------------------------------------------------------------------- +// UniViewerFeeder::recipientCount +// @see header file +// --------------------------------------------------------------------------- +int UniViewerFeeder::recipientCount() +{ + return d_ptr->recipientCount(); +} + +// --------------------------------------------------------------------------- // UniViewerFeeder::messageSize // @see header file // --------------------------------------------------------------------------- diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -27,6 +27,7 @@ #include "unidatamodelloader.h" #include "msgcontacthandler.h" #include "debugtraces.h" +#include "msgbiouids.h" // --------------------------------------------------------------------------- // UniViewerFeederPrivate::UniViewerFeederPrivate @@ -156,8 +157,8 @@ void UniViewerFeederPrivate::fetchDetailsL() { QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS start"); - if (msgType() == KSenduiMtmSmsUidValue) - { + if (msgType() == KSenduiMtmSmsUidValue || (msgType() == KSenduiMtmBioUidValue + && mEntry.iBioType == KMsgBioNokiaServiceMessage.iUid)) { QString body; mPluginInterface->body(body); q_ptr->emitMsgBody(body); @@ -248,14 +249,21 @@ mPluginInterface->setMessageId(msgId); } - if (msgType() == KSenduiMtmMmsUidValue) - { + else if (msgType() == KSenduiMtmMmsUidValue) { mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Mms); mPluginInterface->setMessageId(msgId); mSlideCount = mPluginInterface->slideCount(); + } + else if (msgType() == KSenduiMtmBioUidValue && mEntry.iBioType + == KMsgBioNokiaServiceMessage.iUid) { + mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg); + mPluginInterface->setMessageId(msgId); + } + mPluginInterface->toRecipientList(mToAddressList); mPluginInterface->ccRecipientList(mCcAddressList); + mPluginInterface->bccRecipientList(mBccAddressList); } // --------------------------------------------------------------------------- @@ -265,12 +273,10 @@ ConvergedMessageAddressList UniViewerFeederPrivate::toAddressList() { QString alias = QString(); - for (int i = 0; i < mToAddressList.count(); ++i) - { + int count; + for (int i = 0; i < mToAddressList.count(); ++i) { MsgContactHandler::resolveContactDisplayName( - mToAddressList.at(i)->address(), - alias, - 0); + mToAddressList.at(i)->address(), alias, count); mToAddressList.at(i)->setAlias(alias); alias.clear(); } @@ -284,12 +290,10 @@ ConvergedMessageAddressList UniViewerFeederPrivate::ccAddressList() { QString alias = QString(); - for (int i = 0; i < mCcAddressList.count(); ++i) - { + int count; + for (int i = 0; i < mCcAddressList.count(); ++i) { MsgContactHandler::resolveContactDisplayName( - mToAddressList.at(i)->address(), - alias, - 0); + mToAddressList.at(i)->address(), alias, count); mCcAddressList.at(i)->setAlias(alias); alias.clear(); @@ -298,6 +302,35 @@ } // --------------------------------------------------------------------------- +// UniViewerFeederPrivate::bccAddressList +// @see header file +// --------------------------------------------------------------------------- +ConvergedMessageAddressList UniViewerFeederPrivate::bccAddressList() +{ + QString alias = QString(); + int count; + for (int i = 0; i < mBccAddressList.count(); ++i) + { + MsgContactHandler::resolveContactDisplayName( + mBccAddressList.at(i)->address(), + alias, + count); + mBccAddressList.at(i)->setAlias(alias); + alias.clear(); + } + return mBccAddressList; +} + +// --------------------------------------------------------------------------- +// UniViewerFeederPrivate::recipientCount +// @see header file +// --------------------------------------------------------------------------- +int UniViewerFeederPrivate::recipientCount() +{ + return mToAddressList.count() + mCcAddressList.count() + mBccAddressList.count(); +} + +// --------------------------------------------------------------------------- // UniViewerFeederPrivate::messageSize // @see header file // --------------------------------------------------------------------------- @@ -313,10 +346,8 @@ void UniViewerFeederPrivate::fromAddressAndAlias(QString& from, QString& alias) { mPluginInterface->fromAddress(from); - MsgContactHandler::resolveContactDisplayName( - from, - alias, - 0); + int count; + MsgContactHandler::resolveContactDisplayName(from, alias, count); } // --------------------------------------------------------------------------- @@ -335,8 +366,13 @@ { delete mCcAddressList.at(i); } + mCcAddressList.clear(); - mCcAddressList.clear(); + for (int i = 0; i < mBccAddressList.count(); ++i) + { + delete mBccAddressList.at(i); + } + mBccAddressList.clear(); } // EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -24,9 +24,9 @@ // USER INCLUDES #include "univieweraddresscontainer.h" -#include "univiewerattachmentcontainer.h" #include "univiewerdetailswidget.h" #include "univiewerfeeder.h" +#include "univiewerattachmentwidget.h" #include "nativemessageconsts.h" @@ -44,12 +44,12 @@ //--------------------------------------------------------------- UniViewerHeaderContainer::UniViewerHeaderContainer(UniViewerFeeder* feeder, QGraphicsItem *parent) : HbWidget(parent), mViewFeeder(feeder), mViewerDetails(0), mHeaderGroupBox(0), mSeparator(0), - mAddressContainer(0), mAttachmentContainer(0) + mAddressContainer(0) { this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); HbFrameItem *bgItem = new HbFrameItem(BG_FRAME_GRAPHICS, HbFrameDrawer::NinePieces, this); - this->setBackgroundItem(bgItem); + this->setBackgroundItem(bgItem, -2.0); mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, this); mMainLayout->setSpacing(0); @@ -132,9 +132,17 @@ if (mViewerDetails) { mViewerDetails->clearContent(); } - if (mAttachmentContainer) { - mAttachmentContainer->clearContent(); + + // Clear the attachments. + for (int i = 0; i < mUniViewerAttachmentstList.count(); ++i) { + mMainLayout->removeItem(mUniViewerAttachmentstList[i]); + mUniViewerAttachmentstList[i]->setParent(NULL); + delete mUniViewerAttachmentstList[i]; + mUniViewerAttachmentstList[i] = NULL; } + mUniViewerAttachmentstList.clear(); + + resize(rect().width(), -1); } //--------------------------------------------------------------- @@ -167,17 +175,14 @@ //--------------------------------------------------------------- void UniViewerHeaderContainer::populateAttachments() { - if (!mAttachmentContainer) { - // Attachment Container - mAttachmentContainer = new UniViewerAttachmentContainer(this); - mMainLayout->addItem(mAttachmentContainer); - } - UniMessageInfoList attachList = mViewFeeder->attachmentsList(); for (int a = 0; a < attachList.count(); ++a) { UniMessageInfo* info = attachList.at(a); - mAttachmentContainer->addAttachmentWidget(info->mimetype(), info->path()); + UniViewerAttachmentWidget *attachmentWidget = new UniViewerAttachmentWidget(this); + mUniViewerAttachmentstList.append(attachmentWidget); + attachmentWidget->populate(info->mimetype(), info->path()); delete info; + mMainLayout->addItem(attachmentWidget); } } @@ -209,6 +214,10 @@ if (!ccList.isEmpty()) { mAddressContainer->setCcField(ccList); } + ConvergedMessageAddressList bccList = mViewFeeder->bccAddressList(); + if (!bccList.isEmpty()) { + mAddressContainer->setBccField(bccList); + } } } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewermediawidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewermediawidget.cpp Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +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 "univiewermediawidget.h" - -// SYSTEM INCLUDES -#include -#include -#include -#include - -// USER INCLUDES -#include "debugtraces.h" - -// LOCAL CONSTANTS - -//---------------------------------------------------------------------------- -// UniViewerMediaWidget::UniViewerMediaWidget -// @see header file -//---------------------------------------------------------------------------- -UniViewerMediaWidget::UniViewerMediaWidget(QGraphicsItem *parent): - HbWidget(parent), mMediaIcon(0), mName(0), mInfo(0), mFrameItem(0) -{ - init(); -} - -//---------------------------------------------------------------------------- -// UniViewerMediaWidget::~UniViewerMediaWidget -// @see header file -//---------------------------------------------------------------------------- -UniViewerMediaWidget::~UniViewerMediaWidget() -{ -} - -//---------------------------------------------------------------------------- -// UniViewerMediaWidget::init -// @see header file -//---------------------------------------------------------------------------- -void UniViewerMediaWidget::init() -{ - mMediaIcon = new HbIconItem(this); - HbStyle::setItemName(mMediaIcon, "mediaIcon"); - - mName = new HbTextItem(this); - HbStyle::setItemName(mName, "text-1"); - - mInfo = new HbTextItem(this); - HbStyle::setItemName(mInfo, "text-2"); - - mFrameItem = new HbPushButton(this); - HbStyle::setItemName(mFrameItem, "bgFrame"); - - connect(mFrameItem, SIGNAL(clicked(bool)), this, SIGNAL(clicked())); -} - -//---------------------------------------------------------------------------- -// UniViewerMediaWidget::populate -// @see header file -//---------------------------------------------------------------------------- -void UniViewerMediaWidget::populate(const QString &icon, const QString &name, - const QString &info, const QString &bgFrame) -{ - HbFrameDrawer *fd = new HbFrameDrawer(bgFrame, - HbFrameDrawer::NinePieces); - mFrameItem->setFrameBackground(fd); - - mMediaIcon->setIconName(icon); - mName->setText(name); - mInfo->setText(info); - -} - -//---------------------------------------------------------------------------- -// UniViewerMediaWidget::clearContent -// @see header file -//---------------------------------------------------------------------------- -void UniViewerMediaWidget::clearContent() -{ - mMediaIcon->setIconName(""); - mName->setText(""); - mInfo->setText(""); -} - -// EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -17,19 +17,28 @@ #include "univiewerpixmapwidget.h" +// SYSTEM INCLUDES #include #include #include +#include #include +#include + +// USER INCLUDES +#include "univiewerutils.h" + +// LOCAL CONSTANTS +#define LOC_OPEN hbTrId("txt_common_menu_open") +#define LOC_SAVE hbTrId("txt_common_menu_save") //--------------------------------------------------------------- // UniViewerPixmapWidget::UniViewerPixmapWidget // @see header file //--------------------------------------------------------------- UniViewerPixmapWidget::UniViewerPixmapWidget(QGraphicsItem *parent) : - HbIconItem(parent) + HbIconItem(parent), mViewerUtils(0) { - mPixmapFile = QString(""); this->grabGesture(Qt::TapGesture); } @@ -45,10 +54,11 @@ // UniViewerPixmapWidget::setPixmap // @see header file //--------------------------------------------------------------- -void UniViewerPixmapWidget::setPixmap(const QString &pixmapPath) +void UniViewerPixmapWidget::populate(const QString &mimeType, const QString &pixmapPath) { - mPixmapFile = pixmapPath; - QPixmap pixmap(pixmapPath); + mMimeType = mimeType; + mPixmapPath = pixmapPath; + QPixmap pixmap(mPixmapPath); this->setIcon(HbIcon(pixmap)); } @@ -70,24 +80,91 @@ case Qt::GestureUpdated: { if (HbTapGesture::TapAndHold == tapGesture->tapStyleHint()) { - // emit longtap + // Handle longtap. + handleLongTap(tapGesture->scenePosition()); } break; } case Qt::GestureFinished: { + HbInstantFeedback::play(HbFeedback::Basic); if (HbTapGesture::Tap == tapGesture->tapStyleHint()) { - // Emit short tap - emit shortTap(mPixmapFile); + // Handle short tap + handleShortTap(); } break; } case Qt::GestureCanceled: { + HbInstantFeedback::play(HbFeedback::Basic); break; } } } + else { + HbIconItem::gestureEvent(event); + } +} + +//--------------------------------------------------------------- +// UniViewerPixmapWidget::handleOpen +// @see header file +//--------------------------------------------------------------- +void UniViewerPixmapWidget::handleOpen() +{ + this->ungrabGesture(Qt::TapGesture); + + if (!mViewerUtils) { + mViewerUtils = new UniViewerUtils(this); + } + mViewerUtils->launchContentViewer(mMimeType, mPixmapPath); + + //fire timer to regrab gesture after some delay. + QTimer::singleShot(300,this,SLOT(regrabGesture())); +} + +//--------------------------------------------------------------- +// UniViewerPixmapWidget::handleSave +// @see header file +//--------------------------------------------------------------- +void UniViewerPixmapWidget::handleSave() +{ } +//---------------------------------------------------------------------------- +// UniViewerPixmapWidget::handleShortTap +// @see header file +//---------------------------------------------------------------------------- +void UniViewerPixmapWidget::handleShortTap() +{ + emit shortTap(mPixmapPath); + + // Open the media. + handleOpen(); +} + +//--------------------------------------------------------------- +// UniViewerPixmapWidget::handleLongTap +// @see header file +//--------------------------------------------------------------- +void UniViewerPixmapWidget::handleLongTap(const QPointF &position) +{ + emit longTap(position); + + HbMenu* menu = new HbMenu; + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->addAction(LOC_OPEN, this, SLOT(handleOpen())); + menu->addAction(LOC_SAVE, this, SLOT(handleSave())); + menu->setPreferredPos(position); + menu->show(); +} + +//--------------------------------------------------------------- +// UniViewerPixmapWidget::regrabGesture +// @see header file +//--------------------------------------------------------------- +void UniViewerPixmapWidget::regrabGesture() +{ + this->grabGesture(Qt::TapGesture); +} // EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -21,16 +21,15 @@ #include "msgcontacthandler.h" #include -#include #include #include #include +#include #include #include -#include #include -#include +#include #include #include @@ -67,10 +66,11 @@ { this->setReadOnly(true); this->setScrollable(false); + this->setSmileysEnabled(true); this->setCursorVisibility(Hb::TextCursorHidden); + this->setFlag(QGraphicsItem::ItemIsFocusable,false); this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - HbFrameItem *noBackground = new HbFrameItem(this); - this->setBackgroundItem(noBackground); + this->setBackgroundItem(0); //inserting rules and patterns to map. mRules.insert(NUMBER_RULE,NUMBER_PATTERN); @@ -117,6 +117,7 @@ QString ruleName = i.key(); QString rule = i.value(); QRegExp ruleExp(rule); + ruleExp.setCaseSensitivity(Qt::CaseInsensitive); QTextCursor cursor = this->document()->find(ruleExp); @@ -177,30 +178,65 @@ } - -void UniViewerTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +void UniViewerTextItem::gestureEvent(QGestureEvent* event) { - HbTextEdit::mouseReleaseEvent(event); - - highlightText(false); - - QString anchor = this->anchorAt(event->pos()); - - if(!anchor.isEmpty() && !this->textCursor().hasSelection()) + //handle gesture to highlight and dehighlight find item. + + if(HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { - shortTapAction(anchor); + //capturing gesture position, and map to local co-ordinates. + QPointF pos = mapFromScene(tap->scenePosition()); + + switch (tap->state()) + { + case Qt::GestureStarted: + { + //highlight find item. + QTextDocument* doc = this->document(); + mCursorPos = doc->documentLayout()->hitTest(pos, Qt::ExactHit); + highlightText(true); + break; + } + + case Qt::GestureFinished: + { + if (HbTapGesture::Tap == tap->tapStyleHint()) + { + //gesture is finshed dehighlight text. + highlightText(false); + + QString anchor = this->anchorAt(pos); + + //do short tap action. + if (!anchor.isEmpty() && !this->textCursor().hasSelection()) + { + shortTapAction(anchor); + } + } + break; + } + + case Qt::GestureCanceled: + { + //gesture is canceled due to pan or swipe, dehighlight text. + if (HbTapGesture::Tap == tap->tapStyleHint()) + { + highlightText(false); + break; + } + } + default: + break; + } + event->accept(); } -} - -void UniViewerTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - HbTextEdit::mousePressEvent(event); - - QTextDocument* doc = this->document(); - - mCursorPos = doc->documentLayout()->hitTest(event->pos(), Qt::ExactHit); - - highlightText(true); + else + { + event->ignore(); + } + + //passing gesture event to base class. + HbTextEdit::gestureEvent(event); } void UniViewerTextItem::addNumberMenu(HbMenu* contextMenu,const QString& data) @@ -308,7 +344,7 @@ phoneNumber.remove(NUMBER_RULE); //invoke dialer service and pass phoneNumber. - QString serviceName("com.nokia.services.telephony"); + QString serviceName("com.nokia.symbian.ICallDial"); QString operation("dial(QString)"); XQServiceRequest* serviceRequest = new XQServiceRequest(serviceName,operation,false); @@ -348,11 +384,10 @@ emailId.remove(EMAIL_RULE); // Launch email editor - QString serviceName("com.nokia.services.commonemail"); - QString interfaceName("imessage.send"); + QString interfaceName("com.nokia.symbian.IEmailMessageSend"); QString operation("send(QVariant)"); XQApplicationManager appManager; - XQAiwRequest* request = appManager.create(serviceName, interfaceName, + XQAiwRequest* request = appManager.create(interfaceName, operation, true); if ( request == NULL ) { diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewerutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/unifiedviewer/src/univiewerutils.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -0,0 +1,143 @@ +/* + * 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: Utility class for univiewer. + * + */ + +#include "univiewerutils.h" + +// SYSTEM INCLUDES +#include +#include +#include +#include + +// USER INCLUDES +#include "msgcontactsutil.h" + +// LOCAL CONSTANTS +#define LOC_TITLE hbTrId("txt_messaging_title_messaging") + +const QString IMAGE_MIMETYPE("image"); +const QString AUDIO_MIMETYPE("audio"); +const QString VCARD_MIMETYPE("text/X-vCard"); + +//--------------------------------------------------------------- +// UniViewerUtils::UniViewerUtils +// @see header file +//--------------------------------------------------------------- +UniViewerUtils::UniViewerUtils(QObject *parent) : + QObject(parent) +{ +} + +//--------------------------------------------------------------- +// UniViewerUtils::~UniViewerUtils +// @see header file +//--------------------------------------------------------------- +UniViewerUtils::~UniViewerUtils() +{ +} + +//--------------------------------------------------------------- +// UniViewerUtils::addAttachmentWidget +// @see header file +//--------------------------------------------------------------- +void UniViewerUtils::launchContentViewer(const QString &mimeType, const QString &filePath) +{ + if (mimeType.contains(IMAGE_MIMETYPE) || mimeType.contains(AUDIO_MIMETYPE)) { + launchViaSharableFile(filePath); + } + else if (mimeType.contains(VCARD_MIMETYPE, Qt::CaseInsensitive)) { + MsgContactsUtil::launchVCardViewer(filePath); + } +} + +//--------------------------------------------------------------- +// UniViewerUtils::handleOk +// @see header file +//--------------------------------------------------------------- +void UniViewerUtils::handleOk(const QVariant& result) +{ + emit requestOk(result); +} + +//--------------------------------------------------------------- +// UniViewerUtils::handleError +// @see header file +//--------------------------------------------------------------- +void UniViewerUtils::handleError(int errorCode, const QString& errorMessage) +{ + emit requestError(errorCode, errorMessage); +} + +//--------------------------------------------------------------- +// UniViewerUtils::launchViaSharableFile +// @see header file +//--------------------------------------------------------------- +void UniViewerUtils::launchViaSharableFile(const QString &filePath) +{ + XQSharableFile sf; + XQAiwRequest* request = 0; + + if (!sf.open(filePath)) { + return; + } + + // Get handlers + XQApplicationManager appManager; + QList fileHandlers = appManager.list(sf); + if (fileHandlers.count() > 0) { + XQAiwInterfaceDescriptor d = fileHandlers.first(); + request = appManager.create(sf, d); + + if (!request) { + sf.close(); + return; + } + } + else { + sf.close(); + return; + } + + // Result handlers + connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)), + Qt::UniqueConnection); + connect(request, SIGNAL(requestError(int,const QString&)), this, + SLOT(handleError(int,const QString&)), Qt::UniqueConnection); + + request->setEmbedded(true); + request->setSynchronous(true); + + // Fill args + QList args; + args << qVariantFromValue(sf); + request->setArguments(args); + + // Fill headers + QString key("WindowTitle"); + QVariant value(QString(LOC_TITLE)); + XQRequestInfo info; + info.setInfo(key, value); + request->setInfo(info); + + request->send(); + + // Cleanup + sf.close(); + delete request; +} + +//EOF diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/src/univiewslidewidget.cpp --- a/messagingapp/msgui/unifiedviewer/src/univiewslidewidget.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/src/univiewslidewidget.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -53,7 +53,7 @@ mHeaderContainer = new UniViewerHeaderContainer(mViewFeeder, this); // Always connect to populate sms content - connect(mViewFeeder, SIGNAL(msgBody(QString)), mBody, SLOT(setTextContent(QString))); + connect(mViewFeeder, SIGNAL(msgBody(QString)), mBody, SLOT(setText(QString))); connect(mHeaderContainer,SIGNAL(sendMessage(const QString&,const QString&)), this, SIGNAL(sendMessage(const QString&,const QString&))); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/unifiedviewer.pro --- a/messagingapp/msgui/unifiedviewer/unifiedviewer.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/unifiedviewer.pro Fri Jun 11 13:35:48 2010 +0300 @@ -52,38 +52,38 @@ # Input HEADERS += inc/unifiedviewer.h \ inc/unicontentswidget.h \ -# inc/unihighlighter.h \ inc/univiewerfeeder.h \ inc/univiewerfeeder_p.h \ inc/univiewslidewidget.h \ inc/uniscrollarea.h \ ../inc/msgbaseview.h \ + inc/univiewerutils.h \ inc/univiewerbodywidget.h \ inc/univiewerdetailswidget.h \ inc/univieweraddresswidget.h \ inc/univieweraddresscontainer.h \ - inc/univiewermediawidget.h \ - inc/univiewerattachmentcontainer.h \ + inc/univiewerattachmentwidget.h \ inc/univiewertextitem.h \ inc/univiewerheadercontainer.h \ - inc/univiewerpixmapwidget.h + inc/univiewerpixmapwidget.h \ + inc/univieweraudiowidget.h SOURCES += src/unifiedviewer.cpp \ src/unicontentswidget.cpp \ -# src/unihighlighter.cpp \ src/univiewerfeeder.cpp \ src/univiewerfeeder_p.cpp \ src/univiewslidewidget.cpp \ src/uniscrollarea.cpp \ + src/univiewerutils.cpp \ src/univiewerbodywidget.cpp \ src/univiewerdetailswidget.cpp \ src/univieweraddresswidget.cpp \ src/univieweraddresscontainer.cpp \ - src/univiewermediawidget.cpp \ - src/univiewerattachmentcontainer.cpp \ + src/univiewerattachmentwidget.cpp \ src/univiewertextitem.cpp \ src/univiewerheadercontainer.cpp \ - src/univiewerpixmapwidget.cpp + src/univiewerpixmapwidget.cpp \ + src/univieweraudiowidget.cpp RESOURCES += unifiedviewer.qrc diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgui/unifiedviewer/unifiedviewer.qrc --- a/messagingapp/msgui/unifiedviewer/unifiedviewer.qrc Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgui/unifiedviewer/unifiedviewer.qrc Fri Jun 11 13:35:48 2010 +0300 @@ -6,8 +6,8 @@ resources/layouts/univiewerdetailswidget.css resources/layouts/univiewerdetailswidget_color.css resources/layouts/univiewerdetailswidget.widgetml - resources/layouts/univiewermediawidget.css - resources/layouts/univiewermediawidget_color.css - resources/layouts/univiewermediawidget.widgetml + resources/layouts/univiewerattachmentwidget.css + resources/layouts/univiewerattachmentwidget_color.css + resources/layouts/univiewerattachmentwidget.widgetml diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/rom/unibiomessagedataplugin.iby --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/rom/unibiomessagedataplugin.iby Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/rom/unibiomessagedataplugin.iby Fri Jun 11 13:35:48 2010 +0300 @@ -18,7 +18,6 @@ #define __UNI_BIO_MESSAGE_DATA_PLUGIN_IBY__ -# this is the plugin stub for QT plugin file=ABI_DIR\UREL\unibiomessagedataplugin.dll SHARED_LIB_DIR\unibiomessagedataplugin.dll data=\epoc32\data\z\resource\qt\plugins\messaging\datamodel\unibiomessagedataplugin.qtplugin \resource\qt\plugins\messaging\datamodel\unibiomessagedataplugin.qtplugin diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin.cpp --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -122,6 +122,12 @@ { RFile file = d_ptr->attachmentL(); + if(attachmentCount() == 0) + { + file.Close(); + return QList (); + } + UniMessageInfoList attlist; QString path; @@ -170,7 +176,11 @@ //--------------------------------------------------------------- bool UniBioMessageDataPlugin::hasAttachment() { - return true; + if(attachmentCount() > 0) + return true; + else + return false; + } // UniBioMessageDataPlugin::objectCount() diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -32,7 +32,7 @@ #include #include #include - +#include #include "convergedmessage.h" #include "convergedmessageaddress.h" #include "unibiomessagedataplugin_p.h" @@ -49,8 +49,17 @@ UniBioMessageDataPluginPrivate::~UniBioMessageDataPluginPrivate() { q_ptr = NULL; - if (iMsvEntry) + + if(attachmentProcessed == EFalse && iAttachmentCount == 1) { + CMsvStore* store = iMsvEntry->EditStoreL(); + CleanupStack::PushL(store); + MMsvAttachmentManagerSync& attachMan = store->AttachmentManagerExtensionsL(); + attachMan.RemoveAttachmentL(0); + CleanupStack::PopAndDestroy(); + } + + if (iMsvEntry) { delete iMsvEntry; } @@ -233,8 +242,7 @@ //--------------------------------------------------------------- RFile UniBioMessageDataPluginPrivate::attachmentL() { - if (attachmentProcessed) - { + if (attachmentProcessed) { CMsvStore* store1 = iMsvEntry->ReadStoreL(); CleanupStack::PushL(store1); @@ -244,33 +252,54 @@ return file; } - CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection; - CleanupStack::PushL(selection); + RFile file; + + if (iMsvEntry->Entry().SendingState() != KMsvSendStateNotApplicable + || iMsvEntry->Entry().SendingState() != KMsvSendStateUnknown) { - selection->AppendL(iMessageId); + CMsvStore* store = iMsvEntry->ReadStoreL(); + CleanupStack::PushL(store); + MMsvAttachmentManager& attachMan = store->AttachmentManagerL(); + + iAttachmentCount = attachMan.AttachmentCount(); - TBuf8<1> aParameter; - CMsvOperationActiveSchedulerWait* wait = CMsvOperationActiveSchedulerWait::NewLC(); - - CMsvOperation* operation = - iBioClientMtm->InvokeAsyncFunctionL(KBiosMtmParse, - *selection, - aParameter, - wait->iStatus); + if (iAttachmentCount > 0) { + file = attachMan.GetAttachmentFileL(0); + } + CleanupStack::PopAndDestroy(store); + + } + + if (iAttachmentCount == 0) { + CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection; + CleanupStack::PushL(selection); + + selection->AppendL(iMessageId); - wait->Start(); + TBuf8<1> aParameter; + CMsvOperationActiveSchedulerWait* wait = CMsvOperationActiveSchedulerWait::NewLC(); + + CMsvOperation* operation = iBioClientMtm->InvokeAsyncFunctionL(KBiosMtmParse, *selection, + aParameter, wait->iStatus); - CMsvStore* store = iMsvEntry->ReadStoreL(); - CleanupStack::PushL(store); - MMsvAttachmentManager& attachMan = store->AttachmentManagerL(); + wait->Start(); + + CMsvStore* store = iMsvEntry->ReadStoreL(); + CleanupStack::PushL(store); + MMsvAttachmentManager& attachMan = store->AttachmentManagerL(); - iAttachmentCount = attachMan.AttachmentCount(); - - RFile file = attachMan.GetAttachmentFileL(0); + iAttachmentCount = attachMan.AttachmentCount(); + + RFile file ; + + if(iAttachmentCount) { + file = attachMan.GetAttachmentFileL(0); + } - delete operation; - CleanupStack::PopAndDestroy(3,selection); - attachmentProcessed = ETrue; + delete operation; + CleanupStack::PopAndDestroy(3, selection); + attachmentProcessed = ETrue; + } return file; } @@ -282,8 +311,7 @@ int UniBioMessageDataPluginPrivate::attachmentCount() { - if (!attachmentProcessed) - { + if (!attachmentProcessed) { RFile file = attachmentL(); file.Close(); } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/rom/unimmsdataplugin.iby --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/rom/unimmsdataplugin.iby Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/rom/unimmsdataplugin.iby Fri Jun 11 13:35:48 2010 +0300 @@ -19,7 +19,6 @@ #define __UNI_MMS_DATA_PLUGIN_IBY__ -# this is the plugin stub for QT plugin file=ABI_DIR\UREL\unimmsdataplugin.dll SHARED_LIB_DIR\unimmsdataplugin.dll data=\epoc32\data\z\resource\qt\plugins\messaging\datamodel\unimmsdataplugin.qtplugin \resource\qt\plugins\messaging\datamodel\unimmsdataplugin.qtplugin diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/rom/unismsdataplugin.iby --- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/rom/unismsdataplugin.iby Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/rom/unismsdataplugin.iby Fri Jun 11 13:35:48 2010 +0300 @@ -18,7 +18,7 @@ #define __UNI_SMS_DATA_PLUGIN_IBY__ -# this is the plugin stub for QT plugin + file=ABI_DIR\UREL\unismsdataplugin.dll SHARED_LIB_DIR\unismsdataplugin.dll data=\epoc32\data\z\resource\qt\plugins\messaging\datamodel\unismsdataplugin.qtplugin \resource\qt\plugins\messaging\datamodel\unismsdataplugin.qtplugin diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h Fri Jun 11 13:35:48 2010 +0300 @@ -218,6 +218,9 @@ CMmsClientMtm* iMmsMtm; CMmsHeaders* iMmsHeader; + // Flag for forwarded messages + TBool iMessageForwarded; + // owned UniDataModelLoader* iDataModelPluginLoader; //Not owned diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/rom/unieditormmsplugin.iby --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/rom/unieditormmsplugin.iby Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/rom/unieditormmsplugin.iby Fri Jun 11 13:35:48 2010 +0300 @@ -19,7 +19,6 @@ #define __UNI_EDITOR_MMS_PLUGIN_IBY__ -# this is the plugin stub for QT plugin file=ABI_DIR\UREL\unieditormmsplugin.dll SHARED_LIB_DIR\unieditormmsplugin.dll data=\epoc32\data\z\resource\qt\plugins\messaging\editorplugins\unieditormmsplugin.qtplugin \resource\qt\plugins\messaging\editorplugins\unieditormmsplugin.qtplugin diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -204,12 +204,20 @@ ConvergedMessage &aMessage) { QDEBUG_WRITE("Enter convertFromForwardHandlerL"); - - TMsvEntry entry =MmsMtmL()->Entry().Entry(); + iMessageForwarded = EFalse; + TMsvEntry entry = MmsMtmL()->Entry().Entry(); //populate convergedmessage with the subject prepended with FW: - QString subject = LOC_FWD + S60QConversions::s60DescToQString( - MmsMtmL()->SubjectL()); + QString subject = + S60QConversions::s60DescToQString(MmsMtmL()->SubjectL()); + + if (!(entry.Forwarded() || subject.startsWith(LOC_FWD, + Qt::CaseInsensitive))) + { + subject.insert(0, LOC_FWD); + iMessageForwarded = ETrue; + } + aMessage.setSubject(subject); // Priority @@ -382,6 +390,12 @@ //There is no size check inside plugin as it assumes //we get proper data from editor + entry = MmsMtmL()->Entry().Entry(); + if (iMessageForwarded) + { + entry.SetForwarded(ETrue); + iMessageForwarded = EFalse; + } HBufC* sub = S60QConversions::qStringToS60Desc(aMessage->subject()); if( sub ) { @@ -507,8 +521,8 @@ //Saving the changes MmsMtmL()->SaveMessageL(); + entry = MmsMtmL()->Entry().Entry(); - TBuf detailsBuf; MakeDetailsL( detailsBuf ); entry.iDetails.Set( detailsBuf ); diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/rom/unieditorsmsplugin.iby --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/rom/unieditorsmsplugin.iby Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/rom/unieditorsmsplugin.iby Fri Jun 11 13:35:48 2010 +0300 @@ -17,7 +17,7 @@ #ifndef __UNI_EDITOR_SMS_PLUGIN_IBY__ #define __UNI_EDITOR_SMS_PLUGIN_IBY__ -# this is the plugin stub for QT plugin + file=ABI_DIR\UREL\unieditorsmsplugin.dll SHARED_LIB_DIR\unieditorsmsplugin.dll data=\epoc32\data\z\resource\qt\plugins\messaging\editorplugins\unieditorsmsplugin.qtplugin \resource\qt\plugins\messaging\editorplugins\unieditorsmsplugin.qtplugin diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp --- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -505,8 +505,8 @@ CMsvEntry& entry = SmsMtmL()->Entry(); TMsvEntry msvEntry( entry.Entry() ); msvEntry.iDetails.Set( idetailsBuf ); + entry.ChangeL( msvEntry ); SmsMtmL()->SaveMessageL(); - entry.ChangeL( msvEntry ); } // set subject @@ -890,8 +890,7 @@ { CreateVCardSMSL(filehandle); CleanupStack::Pop(&filehandle); - filehandle.Close(); - managerSync.RemoveAttachmentL(0); + filehandle.Close(); } else if (mimetype.CompareF(KMsgMimeVCal) == 0 || mimetype.CompareF(KMsgMimeICal) == 0) diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/shareui/shareui.pro --- a/messagingapp/shareui/shareui.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/shareui/shareui.pro Fri Jun 11 13:35:48 2010 +0300 @@ -17,7 +17,7 @@ TEMPLATE = lib TARGET = shareui DEFINES += BUILD_SHAREUI_DLL -#DEFINES += __SHAREUI_MIME_HANDLING__ +DEFINES += __SHAREUI_MIME_HANDLING__ DEPENDPATH += inc src INCLUDEPATH += inc diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/shareui/src/shareuiprivate.cpp --- a/messagingapp/shareui/src/shareuiprivate.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/shareui/src/shareuiprivate.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -82,11 +82,6 @@ mIndexActionMap.clear(); mAiwRequestList.clear(); - if ( mSharePopup ) - { - delete mSharePopup; - mSharePopup = 0; - } } /** @@ -99,7 +94,7 @@ bool ShareUiPrivate::init(QStringList& fileList, bool embedded) { reset(); - + mIsEmbedded = embedded; // No input files if ( fileList.count() == 0 ) { @@ -280,6 +275,7 @@ QList args; QVariant fileList(mFileList); args << fileList; + request->setEmbedded(mIsEmbedded); request->setArguments(args); } } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/smartmessaging/ringbc/inc/ringbctoneconverter.h --- a/messagingapp/smartmessaging/ringbc/inc/ringbctoneconverter.h Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/smartmessaging/ringbc/inc/ringbctoneconverter.h Fri Jun 11 13:35:48 2010 +0300 @@ -23,7 +23,7 @@ // INCLUDES #include -#include "NsmRingTone.h" +#include "nsmringtone.h" // FORWARD DECLARATIONS NONSHARABLE_STRUCT( TInstruction ) diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/smartmessaging/ringbc/src/ringbc_p.cpp --- a/messagingapp/smartmessaging/ringbc/src/ringbc_p.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/smartmessaging/ringbc/src/ringbc_p.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -142,7 +142,6 @@ HBufC8* dataBuf = HBufC8::NewLC(size); TPtr8 data(dataBuf->Des()); User::LeaveIfError(file.Read(data, size)); - CleanupStack::PopAndDestroy(&file); TBool valid = mConverter->IsRingToneMimeTypeL(data); @@ -166,9 +165,9 @@ } CleanupStack::PopAndDestroy(); // dataBuf + CleanupStack::PopAndDestroy(); //file CleanupStack::PopAndDestroy(); //fsSession - QDEBUG_WRITE("RingBcPrivate::saveToneL : Exit") } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/smartmessaging/ringbc/src/ringbctoneconverter.cpp --- a/messagingapp/smartmessaging/ringbc/src/ringbctoneconverter.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingapp/smartmessaging/ringbc/src/ringbctoneconverter.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -24,7 +24,7 @@ // USER INCLUDES #include "ringbctoneconverter.h" -#include "NsmRingTone.h" +#include "nsmringtone.h" #include "debugtraces.h" diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/tsrc/msgapptestsuite/msgapptestsuite.cfg --- a/messagingapp/tsrc/msgapptestsuite/msgapptestsuite.cfg Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -TConversationEngine \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/tsrc/msgapptestsuite/msgapptestsuite.pro --- a/messagingapp/tsrc/msgapptestsuite/msgapptestsuite.pro Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +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 - -CONFIG += symbian_test - -TEMPLATE = app -TARGET = MsgAppTestSuite -TARGET.CAPABILITY = All -TCB -DRM -DEPENDPATH += . -INCLUDEPATH += . -INCLUDEPATH += ../../msgui/appengine/tsrc -INCLUDEPATH += ../../msgui/appengine/tsrc/testconversationengine/inc - - -# Input -SOURCES += src/main.cpp - -SYMBIAN_PLATFORMS = WINSCW ARMV5 -symbian { - TARGET.UID3 = 0x2001FE76 - TARGET.EPOCSTACKSIZE = 0x8000 - TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000 - BLD_INF_RULES.prj_testexports += "msgapptestsuite.cfg c:/msgapptestsuite.cfg" - BLD_INF_RULES.prj_testexports += "msgapptestsuitreport.pl c:/msgapptestsuitreport.pl" - - testdll.sources = testconversationengine.dll - testdll.path = /sys/bin - DEPLOYMENT += testdll - } - -LIBS += \ - -ltestconversationengine \ \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/tsrc/msgapptestsuite/msgapptestsuitreport.pl --- a/messagingapp/tsrc/msgapptestsuite/msgapptestsuitreport.pl Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +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: -# -#!/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 "

Messaging 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 ebfee66fde93 -r 84197e66a4bd messagingapp/tsrc/msgapptestsuite/src/main.cpp --- a/messagingapp/tsrc/msgapptestsuite/src/main.cpp Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +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: main class for msgapptestsuite. - */ - -#include -#include "testconversationengine.h" - -//out put directory for test results. -QString OUTPUTDIRECTORY = "c:/logs/messagingtestsuite"; -//o/p directory for data to be written on temp file. -QString TEMPDIR = "c:/logs/messagingtestsuite/testdata"; -//test result O/P file name. -QString RESULTFILE = "c:/logs/messagingtestsuite/result_%1.txt"; -// folder named UID3 of msgapptestsuite inside private folder. -const QString PRIVATE_DIR("C:/private/2001fe76"); - -//factory method to create objects. -QObject* getObject(QString className) -{ - if(className == "TConversationEngine" ) - { - return new TConversationEngine(); - } - 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:/msgapptestsuite.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; - } diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/tsrc/testapp.bat --- a/messagingapp/tsrc/testapp.bat Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -@ECHO off -CLS -ECHO ...Running Test cases -CALL /epoc32/RELEASE/WINSCW/udeb/MsgAppTestSuite.exe -dtextshell -- -ECHO ... - -ECHO ...Generating Report. -CALL perl /epoc32/winscw/c/msgapptestsuitreport.pl -ECHO ...Done - -CALL /epoc32/winscw/c/logs/messagingtestsuite/report.html \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd messagingapp/tsrc/tsrc.pro --- a/messagingapp/tsrc/tsrc.pro Fri Jun 04 10:25:39 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +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: -# - -TEMPLATE = subdirs - -CONFIG += symbian_test - -SUBDIRS += ../msgui/appengine/tsrc/testconversationengine/testconversationengine.pro -SUBDIRS += msgapptestsuite/msgapptestsuite.pro - -CONFIG += ordered \ No newline at end of file diff -r ebfee66fde93 -r 84197e66a4bd messagingappbase/obexmtms/Rom/obex.hby --- a/messagingappbase/obexmtms/Rom/obex.hby Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingappbase/obexmtms/Rom/obex.hby Fri Jun 11 13:35:48 2010 +0300 @@ -20,17 +20,17 @@ REM Messaging OBEX MTM is not included in this ROM, because it depends on excluded OBEX #else -#ifdef SYMBIAN_EXCLUDE_INFRARED +#ifndef __IRDA REM Infrared watcher is not included in this ROM, because it depends on excluded INFRARED #else data=MULTI_LINGUIFY(RSC ZSYSTEM\Data\irwatcher System\Data\irwatcher) -#endif // SYMBIAN_EXCLUDE_INFRARED +#endif // __IRDA -#ifdef SYMBIAN_EXCLUDE_BLUETOOTH +#ifndef __BT REM Bluetooth watcher is not included in this ROM, because it depends on excluded BLUETOOTH #else REM data=MULTI_LINGUIFY(RSC ZSYSTEM\Data\btwatcher System\Data\btwatcher) -#endif // SYMBIAN_EXCLUDE_BLUETOOTH +#endif // __BT #endif // SYMBIAN_EXCLUDE_OBEX diff -r ebfee66fde93 -r 84197e66a4bd messagingappbase/obexmtms/Rom/obex.iby --- a/messagingappbase/obexmtms/Rom/obex.iby Fri Jun 04 10:25:39 2010 +0100 +++ b/messagingappbase/obexmtms/Rom/obex.iby Fri Jun 11 13:35:48 2010 +0300 @@ -30,7 +30,7 @@ //file=ABI_DIR\BUILD_DIR\msgth.dll System\libs\msgth.dll -#ifdef SYMBIAN_EXCLUDE_INFRARED +#ifndef __IRDA REM Messaging infrared MTM is not included in this ROM, because it depends on excluded INFRARED #else //IR MTM Client @@ -41,10 +41,10 @@ //IR MTM Resources data=DATAZ_\resource\messaging\mtm\irmtm.rsc resource\messaging\mtm\irmtm.rsc -#endif // SYMBIAN_EXCLUDE_INFRARED +#endif // __IRDA -#ifdef SYMBIAN_EXCLUDE_BLUETOOTH +#ifndef __BT REM Messaging Bluetooth MTM is not included in this ROM, because it depends on excluded BLUETOOTH #else //BT MTM Client @@ -55,7 +55,7 @@ //BT MTM Resources data=DATAZ_\resource\messaging\mtm\btmtm.rsc resource\messaging\mtm\btmtm.rsc -#endif // SYMBIAN_EXCLUDE_BLUETOOTH +#endif // __BT //Test Harness Executable diff -r ebfee66fde93 -r 84197e66a4bd mmsengine/mmsengine.pro --- a/mmsengine/mmsengine.pro Fri Jun 04 10:25:39 2010 +0100 +++ b/mmsengine/mmsengine.pro Fri Jun 11 13:35:48 2010 +0300 @@ -44,12 +44,12 @@ #### xml files containing backup_registration #### "./group/backup_registration.xml /epoc32/data/z/private/100058DB/backup_registration.xml" \ #### loc file needed for rsc generation - "./loc/mmsui.loc APP_LAYER_LOC_EXPORT_PATH(mmsui.loc)" \ + "./loc/MmsUi.loc APP_LAYER_LOC_EXPORT_PATH(mmsui.loc)" \ #### Export confml and crml files #### "./conf/mmsengine.confml APP_LAYER_CONFML(mmsengine.confml)" \ - "./conf/mmsengine_100058db.crml APP_LAYER_CRML(mmsengine_100058db.crml)" \ - "./conf/mmsengine_101fb0d5.crml APP_LAYER_CRML(mmsengine_101fb0d5.crml)" \ - "./conf/mmsengine_101fb0d9.crml APP_LAYER_CRML(mmsengine_101fb0d9.crml)" + "./conf/mmsengine_100058DB.crml APP_LAYER_CRML(mmsengine_100058db.crml)" \ + "./conf/mmsengine_101FB0D5.crml APP_LAYER_CRML(mmsengine_101fb0d5.crml)" \ + "./conf/mmsengine_101FB0D5.crml APP_LAYER_CRML(mmsengine_101fb0d9.crml)" } symbian { @@ -65,4 +65,4 @@ "./mmspushhandler/bld/mmspushhandler.mmp" \ "./applicationadapter/bld/mmsapplicationadapter.mmp" \ "./mmscodecclient/bld/mmscodecclient.mmp" -} \ No newline at end of file +} diff -r ebfee66fde93 -r 84197e66a4bd mobilemessaging/smsmtm/clientmtm/group/smcm.mmp --- a/mobilemessaging/smsmtm/clientmtm/group/smcm.mmp Fri Jun 04 10:25:39 2010 +0100 +++ b/mobilemessaging/smsmtm/clientmtm/group/smcm.mmp Fri Jun 11 13:35:48 2010 +0300 @@ -45,7 +45,7 @@ APP_LAYER_SYSTEMINCLUDE_SYMBIAN LIBRARY euser.lib estor.lib bafl.lib etext.lib -LIBRARY gsmu.lib msgs.lib cntmodel.lib biodb.lib efsrv.lib +LIBRARY gsmu.lib msgs.lib biodb.lib efsrv.lib LIBRARY commsdat.lib LIBRARY etelmm.lib diff -r ebfee66fde93 -r 84197e66a4bd mobilemessaging/smsmtm/clientmtm/inc/smut.h --- a/mobilemessaging/smsmtm/clientmtm/inc/smut.h Fri Jun 04 10:25:39 2010 +0100 +++ b/mobilemessaging/smsmtm/clientmtm/inc/smut.h Fri Jun 11 13:35:48 2010 +0300 @@ -130,8 +130,6 @@ private: static void CompareEntryL(const TMsvEntry& aEntry, TUid aMtm, TMsvId& aFirstId, CMsvEntrySelection* aServiceIds); - static void GetName(CContactItemField& aField, TUid aFieldType, TDes& aName); - static void DoGetDetailsL(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength); static void Replace(const TDesC& aOld, const TDesC& aNew, TDes& aString); static TBool DoGetDescriptionL(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength); diff -r ebfee66fde93 -r 84197e66a4bd mobilemessaging/smsmtm/clientmtm/src/smut.cpp --- a/mobilemessaging/smsmtm/clientmtm/src/smut.cpp Fri Jun 04 10:25:39 2010 +0100 +++ b/mobilemessaging/smsmtm/clientmtm/src/smut.cpp Fri Jun 11 13:35:48 2010 +0300 @@ -373,7 +373,7 @@ KErrAlreadyExists if more than one contact entry found. KErrNone if details is obtained successfully. */ -EXPORT_C TInt TSmsUtilities::GetDetails(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength) +EXPORT_C TInt TSmsUtilities::GetDetails(RFs& /*aFs*/, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength) { __ASSERT_DEBUG( aMaxLength <= aDetails.MaxLength(), User::Invariant() ); @@ -382,9 +382,7 @@ aMaxLength = aDetails.MaxLength(); } - TRAPD(err, DoGetDetailsL(aFs, aFromAddress, aDetails, aMaxLength)); - - if ( (err != KErrNone) || (aDetails.Length() == 0) ) + if ( (aDetails.Length() == 0) ) { if (aFromAddress.Length() <= aMaxLength) { @@ -524,130 +522,6 @@ } } -void TSmsUtilities::DoGetDetailsL(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength) - { - __UHEAP_MARK; - - // Check that aFromAddress is a valid GSM telephone number - if (!ValidGsmNumber(aFromAddress)) - User::Leave(KErrArgument); - - aDetails.Zero(); - - CContactDatabase* db = CContactDatabase::OpenL(); - CleanupStack::PushL(db); - - // Lookup the telephone number (aFromAddress) in the contact database - CContactIdArray* contactId = db->MatchPhoneNumberL(aFromAddress, KLowerSevenDigits); - CleanupStack::PushL(contactId); - - // Add the name if there is one and only one match in contacts. If there's more than - // one then wouldn't know which one to choose - if (contactId->Count() <= 0) - { - //The telephone number (aFromAddress) was not found in the contact database. - User::Leave(KErrNotFound); - } - else if (contactId->Count() > 1) - { - //There's more than one telephone number match in contacts. - User::Leave(KErrAlreadyExists); - } - - CContactItem* newContact = db->ReadMinimalContactL((*contactId)[0]); - CleanupStack::PushL(newContact); - - CContactItemFieldSet& fieldSet = newContact->CardFields(); - - TInt count = fieldSet.Count(); - - HBufC* family = HBufC::NewLC(aMaxLength); - HBufC* given = HBufC::NewLC(aMaxLength); - TPtr familyPtr(family->Des()); - TPtr givenPtr(given->Des()); - - // Find the Given and First Name of the contact - // Order important - for (TInt curField = 0; curField < count && !(familyPtr.Length() && givenPtr.Length()); curField++) - { - CContactItemField& field = fieldSet[curField]; - - if (!familyPtr.Length()) - GetName(field, KUidContactFieldFamilyName, familyPtr); - - if (!givenPtr.Length()) - GetName(field, KUidContactFieldGivenName, givenPtr); - } - - familyPtr.Trim(); - givenPtr.Trim(); - - TInt familyLen = familyPtr.Length(); - TInt givenLen = givenPtr.Length(); - - if (!familyLen && !givenLen) - { - //Leave if no family nor given name found - User::Leave(KErrNotFound); - } - else if (givenLen == 0) - { - // The maximum length of familyPtr may be greater than - // aMaxLength, so need to check its length before copying. - if (familyPtr.Length() > aMaxLength) - { - familyPtr.Set(familyPtr.LeftTPtr(aMaxLength)); - } - - aDetails = familyPtr; - } - else if (familyLen == 0) - { - // The maximum length of givenPtr may be greater than - // aMaxLength, so need to check its length before copying. - if (givenPtr.Length() > aMaxLength) - { - givenPtr.Set(givenPtr.LeftTPtr(aMaxLength)); - } - - aDetails = givenPtr; - } - else - { - RResourceFile resFile = OpenResourceFileL(aFs); - CleanupClosePushL(resFile); - ReadResourceStringL(resFile, R_SENDER_NAME_FORMAT, aDetails); - CleanupStack::PopAndDestroy(&resFile); - - TBuf<8> givenPlaceHolder = L_SMS_GIVEN_NAME; - TBuf<8> familyPlaceHolder = L_SMS_FAMILY_NAME; - TInt minLength = aDetails.Length() - givenPlaceHolder.Length() - familyPlaceHolder.Length(); - - if ((familyLen + givenLen + minLength) > aMaxLength) - { - // The maximum length of familyPtr may be greater than - // aMaxLength, so need to check its length before copying. - if (familyPtr.Length() > aMaxLength) - { - familyPtr.Set(familyPtr.LeftTPtr(aMaxLength)); - } - aDetails = familyPtr; - } - else - { - Replace(givenPlaceHolder, givenPtr, aDetails); - Replace(familyPlaceHolder, familyPtr, aDetails); - } - } - - //Remove leading and trailing spaces - aDetails.Trim(); - - CleanupStack::PopAndDestroy(5, db); - - __UHEAP_MARKEND; - } - TBool TSmsUtilities::ValidGsmNumber(const TDesC& aTelephone) { // Returns ETrue if @@ -705,17 +579,6 @@ return validTel && validCharsFound >= KSmsValidGsmNumberMinLength; } -void TSmsUtilities::GetName(CContactItemField& aField, TUid aFieldType, TDes& aName) - { - __UHEAP_MARK; - if (aField.ContentType().ContainsFieldType(aFieldType)) - { - TPtrC name = aField.TextStorage()->Text(); - aName = name.Left(Min(aName.MaxLength(), name.Length())); - } - __UHEAP_MARKEND; - } - TBool TSmsUtilities::DoGetDescriptionL(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength) // this function returns EFalse if aMessage has no special message indication data and is not an SMS_STATUS_REPORT, // i.e. more needs to be done to extract the description from the message diff -r ebfee66fde93 -r 84197e66a4bd msg_plat/conversation_services_utilities_api/inc/ccsdefs.h --- a/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h Fri Jun 04 10:25:39 2010 +0100 +++ b/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h Fri Jun 11 13:35:48 2010 +0300 @@ -194,6 +194,7 @@ ECsProvisioning, ECsBioMsg_VCard, ECsBioMsg_VCal, +ECsBioMgs_NokiaService, ECsUnknown }; @@ -289,11 +290,22 @@ enum { - EPreviewNone = 0x00, - EPreviewImage = 0x01, - EPreviewAudio = 0x02, - EPreviewVideo = 0x04, - EPreviewAttachment = 0x08 + EPreviewNone = 0x0000, + EPreviewImage = 0x0001, + EPreviewAudio = 0x0002, + EPreviewVideo = 0x0004, + EPreviewAttachment = 0x0008, + EPreviewForward = 0x0010 +}; + +/** + * @typedef TCsPreviewMsgProcessingState + */ +enum +{ + EPreviewMsgNotProcessed = 0, + EPreviewMsgProcessing = 1, + EPreviewMsgProcessed = 2 }; typedef TUint8 TCsMsgPreviewProperty; diff -r ebfee66fde93 -r 84197e66a4bd msg_plat/messaging_media_resolver_api/inc/MsgAudioInfo.h --- a/msg_plat/messaging_media_resolver_api/inc/MsgAudioInfo.h Fri Jun 04 10:25:39 2010 +0100 +++ b/msg_plat/messaging_media_resolver_api/inc/MsgAudioInfo.h Fri Jun 11 13:35:48 2010 +0300 @@ -25,7 +25,7 @@ #include -#include // MMdaAudioPlayerCallback & CMdaAudioPlayerUtility +#include // MMdaAudioPlayerCallback & CMdaAudioPlayerUtility #include // CONSTANTS diff -r ebfee66fde93 -r 84197e66a4bd msg_plat/messaging_media_resolver_api/inc/MsgVideoInfo.h --- a/msg_plat/messaging_media_resolver_api/inc/MsgVideoInfo.h Fri Jun 04 10:25:39 2010 +0100 +++ b/msg_plat/messaging_media_resolver_api/inc/MsgVideoInfo.h Fri Jun 11 13:35:48 2010 +0300 @@ -27,7 +27,7 @@ #include // VideoPlayerUtility API -#include +#include // Base Class #include