# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286968275 -10800 # Node ID 726fba06891ac42b05d694f47b1af2e909c1fac6 # Parent c8382f7b54efafaf77ac8fa4916348a06d15bf0c Revision: 201039 Kit: 201041 diff -r c8382f7b54ef -r 726fba06891a emailcontacts/contactactionservice/inc/cfscactionutils.h --- a/emailcontacts/contactactionservice/inc/cfscactionutils.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailcontacts/contactactionservice/inc/cfscactionutils.h Wed Oct 13 14:11:15 2010 +0300 @@ -20,7 +20,9 @@ #define C_FSCACTIONUTILS_H #include +// #include "mfscactionutils.h" +// #include // FORWARD DECLARATIONS @@ -236,6 +238,7 @@ */ TPtrC GetFileDirL( const TDesC& aFilePath ); + // Fix for EMZG-7M23KX /** * Find and add resource file to the list maintained by CCoeEnv. * Resource file must be deleted (remove from the list) after usage. @@ -243,26 +246,6 @@ */ TInt FindAndAddResourceFileL(); - /** - * Helper method that appends a specific field to a buffer of contact - * data. - * The method assumes that fsactionutils.rsc resource file has been - * already added to CCoeEnv before being called. - * - * @param aContact Buffer to which the field data is appended. - * @param aFieldResourceId Id of the field data (which is being added to - * contact buffer. - * @param aStoreContact Reference to the contact in Phonebook store - * from which the field data that is added to - * contact buffer is fetched. - * @param aAddSpace Whether to add a whitespace before appending - * the field data to contact buffer. - */ - void AppendFieldToContactL( TDes& aContact, - TInt aFieldResourceId, - MVPbkStoreContact& aStoreContact, - TBool aAddSpace = EFalse ); - private: // Private members diff -r c8382f7b54ef -r 726fba06891a emailcontacts/contactactionservice/src/cfscactionutils.cpp --- a/emailcontacts/contactactionservice/src/cfscactionutils.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailcontacts/contactactionservice/src/cfscactionutils.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -31,7 +31,9 @@ #include #include #include +// Header neither in Cmail nor in the platform #include +// #include #include #include @@ -40,8 +42,10 @@ #include #include #include +// #include "fscactionplugincrkeys.h" #include "fsccontactactionservicedefines.h" +// #include #include #include @@ -52,8 +56,11 @@ #include #include #include -#include +#include // Fix for EMZG-7M23KX +// hardcoded paths removal #include +// + #include "cfscactionutils.h" #include "cfsccontactaction.h" #include "mfscreasoncallback.h" @@ -80,11 +87,15 @@ const TUint32 KPoCDefaultSettings = 0x199; const TInt KMaxLengthOfNumber = 100; -const TInt KMaxLengthOfAddrData = 255; -const TInt KMaxLengthOfName = 256; // same as max addr len + extra whitespace + +//Fix for: ECWG-7QYAVS +const TInt KMaxLengthOfName = 100; +//end for fix _LIT( KSpace, " " ); +// hard coded path removed _LIT( KFscRscFileName, "fscactionutils.rsc" ); +// // ======== MEMBER FUNCTIONS ======== @@ -124,7 +135,9 @@ delete iRep; if ( iRCSEProfileRegistry != NULL ) { + // delete iRCSEProfileRegistry; + // } } @@ -147,6 +160,7 @@ FUNC_LOG; HBufC* noteText = NULL; + // Fix for EMZG-7M23KX TInt offset = FindAndAddResourceFileL(); if ( aContactName ) @@ -175,6 +189,7 @@ FUNC_LOG; HBufC* noteText = NULL; + // Fix for EMZG-7M23KX TInt offset = FindAndAddResourceFileL(); noteText = StringLoader::LoadL( aNote, aCounter ); @@ -195,6 +210,7 @@ { FUNC_LOG; + // Fix for EMZG-7M23KX TInt offset = FindAndAddResourceFileL(); HBufC* noteText = NULL; @@ -253,38 +269,102 @@ HBufC* CFscActionUtils::GetContactNameL( MVPbkStoreContact& aStoreContact ) { FUNC_LOG; - - TBuf contactName; + HBufC* contactName = HBufC::NewLC( KMaxLengthOfName + 1 ); // one ' ' char + // Search for the contact name + // Fix for EMZG-7M23KX TInt offset = FindAndAddResourceFileL(); - TInt err( KErrNone ); - TRAP( err, AppendFieldToContactL( - contactName, R_FSC_FIRST_NAME_SELECTOR, aStoreContact ) ); - if ( err == KErrNone ) + TResourceReader selectorReader; + CCoeEnv::Static()->CreateResourceReaderLC( selectorReader, + R_FSC_FIRST_NAME_SELECTOR ); + + CVPbkFieldTypeSelector* fieldTypeSelector = CVPbkFieldTypeSelector::NewL( + selectorReader, iContactManager.FieldTypes() ); + CleanupStack::PopAndDestroy(); // selectorReader + + CVPbkFieldFilter::TConfig config( + const_cast ( + aStoreContact.Fields() ), fieldTypeSelector, NULL ); + + CVPbkFieldFilter* fieldFilter = CVPbkFieldFilter::NewL( config ); + TInt fieldCount = fieldFilter->FieldCount(); + const MVPbkStoreContactField* field = NULL; + if ( fieldCount == 1 ) { - TRAP( err, AppendFieldToContactL( - contactName, R_FSC_LAST_NAME_SELECTOR, aStoreContact, - ETrue ) ); - } - if ( err == KErrNone && contactName.Length() <= 0 ) - { - // If no first or last name was found, try to append company name - TRAP_IGNORE( AppendFieldToContactL( - contactName, R_FSC_COMPANY_NAME_SELECTOR, aStoreContact ) ); + field = fieldFilter->FieldAtLC(0); + contactName->Des().Append( + MVPbkContactFieldTextData::Cast( + field->FieldData() ).Text() ); + CleanupStack::PopAndDestroy();//field } - // If there was an error or the contact name is zero length, use - // pre-defined unnamed string instead.. - if ( err != KErrNone || contactName.Length() <= 0 ) + delete fieldFilter; + delete fieldTypeSelector; + + // Search for the contact second name + CCoeEnv::Static()->CreateResourceReaderLC( selectorReader, + R_FSC_LAST_NAME_SELECTOR ); + fieldTypeSelector = CVPbkFieldTypeSelector::NewL( selectorReader, + iContactManager.FieldTypes() ); + CleanupStack::PopAndDestroy();//selectorReader + config.iFieldSelector = fieldTypeSelector; + + fieldFilter = CVPbkFieldFilter::NewL( config ); + fieldCount = fieldFilter->FieldCount(); + if ( fieldCount == 1 ) { + field = fieldFilter->FieldAtLC(0); + if ( contactName->Des().Length() > 0 ) + { + contactName->Des().Append( KSpace ); + } + contactName->Des().Append( + MVPbkContactFieldTextData::Cast( + field->FieldData() ).Text() ); + CleanupStack::PopAndDestroy();//field + } + + // If first or second name hasn't been found -> find company name + if ( contactName->Des().Length() <= 0 ) + { + delete fieldFilter; + delete fieldTypeSelector; + + CCoeEnv::Static()->CreateResourceReaderLC( selectorReader, + R_FSC_COMPANY_NAME_SELECTOR ); + fieldTypeSelector = CVPbkFieldTypeSelector::NewL( selectorReader, + iContactManager.FieldTypes() ); + CleanupStack::PopAndDestroy();//selectorReader + config.iFieldSelector = fieldTypeSelector; + + fieldFilter = CVPbkFieldFilter::NewL( config ); + fieldCount = fieldFilter->FieldCount(); + if ( fieldCount == 1 ) + { + field = fieldFilter->FieldAtLC(0); + contactName->Des().Append( + MVPbkContactFieldTextData::Cast( + field->FieldData() ).Text() ); + CleanupStack::PopAndDestroy();//field + } + } + // no first or second name, nor company name -> return "unnamed" string + if ( contactName->Des().Length() <= 0 ) + { + //append (Unnamed) HBufC* unnamed = StringLoader::LoadL( R_QTN_FS_UNNAMED ); - contactName.Zero(); - contactName.Append( *unnamed ); + contactName->Des().Append( *unnamed ); delete unnamed; } + + delete fieldFilter; + delete fieldTypeSelector; + CleanupStack::Pop( contactName ); + CCoeEnv::Static()->DeleteResourceFile( offset ); - return contactName.AllocL(); + + return contactName; } // --------------------------------------------------------------------------- @@ -308,6 +388,7 @@ CFscFieldPropertyArray* fieldProperties = CFscFieldPropertyArray::NewL( iContactManager.FieldTypes() ); + // Fix for EMZG-7M23KX TInt offset = FindAndAddResourceFileL(); // Create resource reader for new resource @@ -359,6 +440,7 @@ { defaultPrioritiesArray.Append( EVPbkDefaultTypeSms ); defaultPrioritiesArray.Append( EVPbkDefaultTypeMms ); + // Fix for ELWG-7SPH5H params.SetUseDefaultDirectly( ETrue ); break; } @@ -436,8 +518,10 @@ } // Format phone number + //Fix for: MHOA-7SQF6T CommonPhoneParser::ParsePhoneNumber( aNumber, CommonPhoneParser::EPlainPhoneNumber ); + //end for fix } // Destroy objects @@ -485,8 +569,10 @@ } // Format phone number + //Fix for: MHOA-7SQF6T CommonPhoneParser::ParsePhoneNumber( aNumber, CommonPhoneParser::EPlainPhoneNumber ); + //end for fix } // Destroy objects @@ -538,8 +624,10 @@ } // Format phone number + //Fix for: MHOA-7SQF6T CommonPhoneParser::ParsePhoneNumber( aVoipAddress, CommonPhoneParser::EPlainPhoneNumber ); + //end for fix // Destroy objects delete selectedField; @@ -567,6 +655,7 @@ TInt ret = KErrNone; // Search for conference number + // Fix for EMZG-7M23KX TInt offset = FindAndAddResourceFileL(); TResourceReader selectorReader; CCoeEnv::Static()->CreateResourceReaderLC( selectorReader, @@ -736,7 +825,7 @@ } // --------------------------------------------------------------------------- -// CFscActionUtils::GetMessageAddressL +// CFscActionUtils::GetEmailAddressL // --------------------------------------------------------------------------- // TInt CFscActionUtils::GetMessageAddressL( MVPbkStoreContact& aStoreContact, @@ -769,8 +858,7 @@ TPtrC msgAddress = MVPbkContactFieldTextData::Cast( selectedField->FieldData() ).Text(); - if ( msgAddress.Length() && - msgAddress.Length() <= KMaxLengthOfAddrData ) + if ( msgAddress.Length() ) { aMsgAddress.Copy( msgAddress ); } @@ -819,8 +907,7 @@ TPtrC emailAddress = MVPbkContactFieldTextData::Cast( selectedField->FieldData() ).Text(); - if ( emailAddress.Length() && - emailAddress.Length() <= KMaxLengthOfAddrData ) + if ( emailAddress.Length() ) { aEmailAddress.Copy( emailAddress ); } @@ -866,11 +953,13 @@ TBool available( EFalse ); // Search for the contact name + // Fix for EMZG-7M23KX TInt offset = FindAndAddResourceFileL(); TResourceReader selectorReader; CVPbkFieldTypeSelector* fieldTypeSelector = NULL; CVPbkFieldFilter* fieldFilter = NULL; + TInt fieldCount = 0; TInt selector = 0; switch ( aContactNumberType ) @@ -936,16 +1025,15 @@ fieldTypeSelector = CVPbkFieldTypeSelector::NewL( selectorReader, iContactManager.FieldTypes() ); CleanupStack::PopAndDestroy(); // selectorReader - CleanupStack::PushL( fieldTypeSelector ); - + CVPbkFieldFilter::TConfig config( const_cast ( aStoreContact.Fields() ), fieldTypeSelector, NULL); fieldFilter = CVPbkFieldFilter::NewL( config ); - CleanupStack::PushL( fieldFilter ); + fieldCount = fieldFilter->FieldCount(); - if ( fieldFilter->FieldCount() ) + if ( fieldCount ) { if ( selector == R_FSC_CONF_NUMBER_SELECTOR ) { @@ -954,7 +1042,7 @@ field = fieldFilter->FieldAtLC(0); confNum.Append( MVPbkContactFieldTextData::Cast( field->FieldData() ).Text() ); - CleanupStack::PopAndDestroy(); // field + CleanupStack::PopAndDestroy();//field if ( CommonPhoneParser::IsValidPhoneNumber( confNum, CommonPhoneParser::EContactCardNumber ) ) @@ -967,7 +1055,9 @@ available = ETrue; } } - CleanupStack::PopAndDestroy( 2 ); // fieldFilter, fieldTypeSelector + + delete fieldFilter; + delete fieldTypeSelector; } CCoeEnv::Static()->DeleteResourceFile( offset ); @@ -1043,7 +1133,7 @@ TInt err = cenRep->Get( KPoCDefaultSettings, settingsId ); if ( err == KErrNone ) { - result = ( settingsId != KErrNotFound ); + result = (settingsId != KErrNotFound ); } delete cenRep; } @@ -1064,7 +1154,9 @@ { RArray ids; CleanupClosePushL( ids ); + // iRCSEProfileRegistry->GetAllIdsL( ids ); + // configured = ids.Count() > 0; CleanupStack::PopAndDestroy( &ids ); } @@ -1159,8 +1251,15 @@ if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) ) { + // TRAP_IGNORE( iRCSEProfileRegistry = CRCSEProfileRegistry::NewL() ); + // } + + // + //iRCSEProfileRegistry = NULL; + // + } // --------------------------------------------------------------------------- @@ -1192,6 +1291,7 @@ return fileName; } +// Fix for EMZG-7M23KX // --------------------------------------------------------------------------- // CFscActionUtils::FindAndAddResourceFileL // --------------------------------------------------------------------------- @@ -1199,10 +1299,14 @@ TInt CFscActionUtils::FindAndAddResourceFileL() { FUNC_LOG; + // hardcoded removed TFileName resourceFileName( KDC_RESOURCE_FILES_DIR ); - resourceFileName.Append( KFscRscFileName ); + resourceFileName.Append(KFscRscFileName); + // BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resourceFileName ); - return CCoeEnv::Static()->AddResourceFileL( resourceFileName ); + TInt offset = CCoeEnv::Static()->AddResourceFileL( resourceFileName ); + + return offset; } // --------------------------------------------------------------------------- // CFscActionUtils::CloseSelectDialogL @@ -1217,58 +1321,6 @@ } } -// --------------------------------------------------------------------------- -// CFscActionUtils::AppendFieldToContactL -// --------------------------------------------------------------------------- -// -void CFscActionUtils::AppendFieldToContactL( TDes& aContact, - TInt aFieldResourceId, - MVPbkStoreContact& aStoreContact, - TBool aAddSpace ) - { - FUNC_LOG; - - TResourceReader selectorReader; - CCoeEnv::Static()->CreateResourceReaderLC( selectorReader, - aFieldResourceId ); - - CVPbkFieldTypeSelector* fieldTypeSelector = CVPbkFieldTypeSelector::NewL( - selectorReader, iContactManager.FieldTypes() ); - CleanupStack::PopAndDestroy(); // selectorReader - CleanupStack::PushL( fieldTypeSelector ); - - CVPbkFieldFilter::TConfig config( - const_cast ( - aStoreContact.Fields() ), fieldTypeSelector, NULL ); - - CVPbkFieldFilter* fieldFilter = CVPbkFieldFilter::NewL( config ); - CleanupStack::PushL( fieldFilter ); - if ( fieldFilter->FieldCount() == 1 ) - { - if ( aAddSpace && aContact.Length() > 0 ) - { - if ( aContact.Length() < KMaxLengthOfName ) - { - aContact.Append( KSpace ); - } - else - { - User::Leave( KErrOverflow ); - } - } - MVPbkStoreContactField* field = fieldFilter->FieldAtLC( 0 ); - TPtrC castFieldText = MVPbkContactFieldTextData::Cast( - field->FieldData() ).Text(); +// ======== GLOBAL FUNCTIONS ======== - if ( ( aContact.Length() + castFieldText.Length() ) > KMaxLengthOfName ) - { - User::Leave( KErrOverflow ); - } - - aContact.Append( castFieldText ); - CleanupStack::PopAndDestroy( field ); - } - CleanupStack::PopAndDestroy( 2 ); // fieldFilter, fieldTypeSelector - } - diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/commonlib/inc/mmrinfoobject.h --- a/emailservices/emailframework/commonlib/inc/mmrinfoobject.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailframework/commonlib/inc/mmrinfoobject.h Wed Oct 13 14:11:15 2010 +0300 @@ -78,8 +78,6 @@ EESMRInfoFieldRecurrence, /** Priority field */ EESMRInfoFieldPriority, - /** Privacy field */ - EESMRInfoFieldPrivacy }; /** Definition for meeting request method */ @@ -93,21 +91,12 @@ EMRMethodResponse }; - enum TResponse - { - EMrCmdResponseAccept, - EMrCmdResponseTentative, - EMrCmdResponseDecline - }; - - /** MFE Client Protocol indicates the sensitivity for a meeting request. */ - enum TCalSensitivity - { - EMRSensitivityNormal, - EMRSensitivityPersonal, - EMRSensitivityPrivate, - EMRSensitivityConfidential - }; + enum TResponse + { + EMrCmdResponseAccept, + EMrCmdResponseTentative, + EMrCmdResponseDecline + }; public: // Destruction @@ -335,20 +324,6 @@ * @exception KErrNotFound, if field cannot be fetched. */ virtual TUint PriorityL() const = 0; - - /** - * Sets MR privacy. - * @param aPrivacy MR privacy. - * @exception System wide error code. - */ - virtual void SetPrivacyL( TCalSensitivity aPrivacy ) = 0; - - /** - * Fetches MR privacy. - * @return MR privacy. - * @exception KErrNotFound, if field cannot be fetched. - */ - virtual TCalSensitivity PrivacyL() const = 0; /** * Fetches meeting request attachments. diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/commonlib/src/CFSMailMessagePart.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailMessagePart.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailframework/commonlib/src/CFSMailMessagePart.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -985,88 +985,99 @@ // ----------------------------------------------------------------------------- // CFSMailMessagePart::FindBodyPartL // ----------------------------------------------------------------------------- -EXPORT_C CFSMailMessagePart* CFSMailMessagePart::FindBodyPartL(const TDesC& aContentType) -{ +EXPORT_C CFSMailMessagePart* CFSMailMessagePart::FindBodyPartL( + const TDesC& aContentType ) + { FUNC_LOG; - TBuf ptr; - if ( iContentType ) - { - ptr.Copy(iContentType->Des()); - TInt length = ptr.Locate(';'); - if(length >= 0) - { - ptr.SetLength(length); - } - - if( !ptr.CompareF(aContentType) ) + TBuf ptr; + if ( iContentType ) + { + ptr.Copy( iContentType->Des() ); + TInt length = ptr.Locate(';'); + if( length >= 0 ) + { + ptr.SetLength( length ); + } + if( !ptr.CompareF( aContentType ) ) + { + return this; + } + } + + CFSMailMessagePart* messagePart = NULL; + CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetMessageId() ); + if( plugin ) { - return this; - } - } - - CFSMailMessagePart* messagePart = NULL; - - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId())) - { - if(iReadMessageParts) - { - plugin->ChildPartsL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),iMessageParts); - iReadMessageParts = EFalse; - } - if(iMessageParts.Count()) - { - if( !ptr.CompareF(KFSMailContentTypeMultipartAlternative) ) + if( iReadMessageParts ) { - // multipart / alternative - for(TInt i=0;iGetContentType()); - TInt length = ptr.Locate(';'); - if(length >= 0) - { - ptr.SetLength(length); - } - if(!ptr.CompareF(aContentType) ) - { - messagePart = iMessageParts[i]; - // remove part from table - iMessageParts.Remove(i); - break; - } - else if(!ptr.CompareF(KFSMailContentTypeMultipartRelated) || - !ptr.CompareF(KFSMailContentTypeMultipartMixed) || - !ptr.CompareF(KFSMailContentTypeMultipartAlternative) || - !ptr.CompareF(KFSMailContentTypeMultipartDigest) || - !ptr.CompareF(KFSMailContentTypeMultipartParallel)) - { - // multipart, check child parts - messagePart = iMessageParts[i]; - // remove part from table - messagePart = messagePart->FindBodyPartL(aContentType); - if(messagePart && messagePart->GetPartId() == iMessageParts[0]->GetPartId()) - { - iMessageParts.Remove(i); - } - break; - } - } + plugin->ChildPartsL( GetMailBoxId(), + GetFolderId(), + GetMessageId(), + GetPartId(), + iMessageParts ); + iReadMessageParts = EFalse; } - else - { - // all other cases - messagePart = iMessageParts[0]; - // remove part from table - messagePart = messagePart->FindBodyPartL(aContentType); - if(messagePart && messagePart->GetPartId() == iMessageParts[0]->GetPartId()) - { - iMessageParts.Remove(0); - } - } + if( iMessageParts.Count() ) + { + if( !ptr.CompareF( KFSMailContentTypeMultipartAlternative ) ) + { + // multipart / alternative + for( TInt i=0; iGetContentType() ); + TInt length = ptr.Locate(';'); + if( length >= 0 ) + { + ptr.SetLength( length ); + } + if( !ptr.CompareF( aContentType ) ) + { + messagePart = iMessageParts[i]; + // remove part from table + iMessageParts.Remove( i ); + break; + } + else if( !ptr.CompareF( KFSMailContentTypeMultipartRelated ) || + !ptr.CompareF( KFSMailContentTypeMultipartMixed ) || + !ptr.CompareF( KFSMailContentTypeMultipartAlternative ) || + !ptr.CompareF( KFSMailContentTypeMultipartDigest ) || + !ptr.CompareF( KFSMailContentTypeMultipartParallel ) ) + { + // multipart, check child parts + messagePart = iMessageParts[i]; + // remove part from table + messagePart = + messagePart->FindBodyPartL( aContentType ); + if( messagePart && messagePart->GetPartId() == + iMessageParts[i]->GetPartId() ) + { + iMessageParts.Remove( i ); + } + break; + } + } + } + else + { + // all other cases + const TInt count = iMessageParts.Count(); + for ( TInt i = 0; i < count && !messagePart; i++ ) + { + messagePart = iMessageParts[i]; + // remove part from table + messagePart = messagePart->FindBodyPartL( aContentType ); + if( messagePart && messagePart->GetPartId() == + iMessageParts[i]->GetPartId() ) + { + iMessageParts.Remove( i ); + } + } + } + } } - } return messagePart; -} + } // ----------------------------------------------------------------------------- diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/data/126.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/data/126.svg Wed Oct 13 14:11:15 2010 +0300 @@ -0,0 +1,961 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/data/163.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/data/163.svg Wed Oct 13 14:11:15 2010 +0300 @@ -0,0 +1,965 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/data/QQ.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/data/QQ.svg Wed Oct 13 14:11:15 2010 +0300 @@ -0,0 +1,963 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/data/Sina.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/data/Sina.svg Wed Oct 13 14:11:15 2010 +0300 @@ -0,0 +1,998 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/data/fsmailbrandmanager.rss --- a/emailservices/emailframework/data/fsmailbrandmanager.rss Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailframework/data/fsmailbrandmanager.rss Wed Oct 13 14:11:15 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2001 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2001 - 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" @@ -25,6 +25,11 @@ #include #include #include +#include <163_brand_graphics.mbg> +#include +#include +#include <126_brand_graphics.mbg> +#include #include "mailbrandmanager.hrh" #include "mailbrandmanager.rh" @@ -284,6 +289,8 @@ BRAND_MATCH_STRING { text = "hotmail.nl"; }, BRAND_MATCH_STRING { text = "*.hotmail.es"; }, BRAND_MATCH_STRING { text = "hotmail.es"; }, + BRAND_MATCH_STRING { text = "*.hotmail.com.hk"; }, + BRAND_MATCH_STRING { text = "hotmail.com.hk"; }, BRAND_MATCH_STRING { text = "*.live.com"; }, BRAND_MATCH_STRING { text = "live.com"; }, BRAND_MATCH_STRING { text = "*.live.at"; }, @@ -424,6 +431,151 @@ { BRANDABLE_COLOR { id = EFSMailboxNameColor; red = 0xff; green = 0x30; blue = 0x20; alpha = 0xff; } }; + }, + + BRAND { + // definition of 163 brand + graphics_file_path = APP_BITMAP_DIR"\\163_brand_graphics.mif"; + + brand_id_match_strings = + { + BRAND_MATCH_STRING { text = "widget_setup_chn_163"; }, + BRAND_MATCH_STRING { text = "*.163.com"; }, + BRAND_MATCH_STRING { text = "163.com"; } + }; + + graphics = + { + BRANDABLE_GRAPHIC { id = EFSMailboxIcon; + icon_id = EMbm163_brand_graphics163; + mask_id = EMbm163_brand_graphics163_mask; } + }; + + texts = + { + BRANDABLE_TEXT { id = EFSMailboxName; text = "163"; } + }; + + colors = + { + BRANDABLE_COLOR { id = EFSMailboxNameColor; red = 0xff; green = 0x30; blue = 0x20; alpha = 0xff; } + }; + }, + + BRAND { + // definition of QQ brand + graphics_file_path = APP_BITMAP_DIR"\\qq_brand_graphics.mif"; + + brand_id_match_strings = + { + BRAND_MATCH_STRING { text = "widget_setup_chn_qq"; }, + BRAND_MATCH_STRING { text = "*.qq.com"; }, + BRAND_MATCH_STRING { text = "qq.com"; } + }; + + graphics = + { + BRANDABLE_GRAPHIC { id = EFSMailboxIcon; + icon_id = EMbmQq_brand_graphicsQq; + mask_id = EMbmQq_brand_graphicsQq_mask; } + }; + + texts = + { + BRANDABLE_TEXT { id = EFSMailboxName; text = "QQ"; } + }; + + colors = + { + BRANDABLE_COLOR { id = EFSMailboxNameColor; red = 0xff; green = 0x30; blue = 0x20; alpha = 0xff; } + }; + }, + + BRAND { + // definition of Sina brand + graphics_file_path = APP_BITMAP_DIR"\\sina_brand_graphics.mif"; + + brand_id_match_strings = + { + BRAND_MATCH_STRING { text = "widget_setup_chn_sina"; }, + BRAND_MATCH_STRING { text = "*.sina.com"; }, + BRAND_MATCH_STRING { text = "sina.com"; } + }; + + graphics = + { + BRANDABLE_GRAPHIC { id = EFSMailboxIcon; + icon_id = EMbmSina_brand_graphicsSina; + mask_id = EMbmSina_brand_graphicsSina_mask; } + }; + + texts = + { + BRANDABLE_TEXT { id = EFSMailboxName; text = "Sina"; } + }; + + colors = + { + BRANDABLE_COLOR { id = EFSMailboxNameColor; red = 0xff; green = 0x30; blue = 0x20; alpha = 0xff; } + }; + }, + + BRAND { + // definition of 126 brand + graphics_file_path = APP_BITMAP_DIR"\\126_brand_graphics.mif"; + + brand_id_match_strings = + { + BRAND_MATCH_STRING { text = "widget_setup_chn_126"; }, + BRAND_MATCH_STRING { text = "*.126.com"; }, + BRAND_MATCH_STRING { text = "126.com"; } + }; + + graphics = + { + BRANDABLE_GRAPHIC { id = EFSMailboxIcon; + icon_id = EMbm126_brand_graphics126; + mask_id = EMbm126_brand_graphics126_mask; } + }; + + texts = + { + BRANDABLE_TEXT { id = EFSMailboxName; text = "126"; } + }; + + colors = + { + BRANDABLE_COLOR { id = EFSMailboxNameColor; red = 0xff; green = 0x30; blue = 0x20; alpha = 0xff; } + }; + }, + + BRAND { + // definition of Sohu brand + graphics_file_path = APP_BITMAP_DIR"\\sohu_brand_graphics.mif"; + + brand_id_match_strings = + { + BRAND_MATCH_STRING { text = "widget_setup_chn_sohu"; }, + BRAND_MATCH_STRING { text = "*.sohu.com"; }, + BRAND_MATCH_STRING { text = "sohu.com"; } + }; + + graphics = + { + BRANDABLE_GRAPHIC { id = EFSMailboxIcon; + icon_id = EMbmSohu_brand_graphicsSohu; + mask_id = EMbmSohu_brand_graphicsSohu_mask; } + }; + + texts = + { + BRANDABLE_TEXT { id = EFSMailboxName; text = "Sohu"; } + }; + + colors = + { + BRANDABLE_COLOR { id = EFSMailboxNameColor; red = 0xff; green = 0x30; blue = 0x20; alpha = 0xff; } + }; } }; } diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/data/sohu.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/data/sohu.svg Wed Oct 13 14:11:15 2010 +0300 @@ -0,0 +1,1258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/group/126_brand_graphics.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/group/126_brand_graphics.mk Wed Oct 13 14:11:15 2010 +0300 @@ -0,0 +1,54 @@ +# +# 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: Make file email branding icons. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\RESOURCE\APPS +HEADERDIR=\epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\126_brand_graphics.mif +HEADERFILENAME=$(HEADERDIR)\126_brand_graphics.MBG +SOURCEDIR=..\data + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +RESOURCE : + mifconv $(ICONTARGETFILENAME) /H$(HEADERFILENAME) \ + /c16,8 $(SOURCEDIR)\126.svg + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing \ No newline at end of file diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/group/163_brand_graphics.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/group/163_brand_graphics.mk Wed Oct 13 14:11:15 2010 +0300 @@ -0,0 +1,54 @@ +# +# 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: Make file email branding icons. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\RESOURCE\APPS +HEADERDIR=\epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\163_brand_graphics.mif +HEADERFILENAME=$(HEADERDIR)\163_brand_graphics.MBG +SOURCEDIR=..\data + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +RESOURCE : + mifconv $(ICONTARGETFILENAME) /H$(HEADERFILENAME) \ + /c16,8 $(SOURCEDIR)\163.svg + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing \ No newline at end of file diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/group/bld.inf --- a/emailservices/emailframework/group/bld.inf Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailframework/group/bld.inf Wed Oct 13 14:11:15 2010 +0300 @@ -85,3 +85,38 @@ OPTION SOURCEDIR ../data OPTION SOURCES -c16,8 mail_for_exchange.svg END + +START EXTENSION s60/mifconv +OPTION TARGETFILE 163_brand_graphics.mif +OPTION HEADERFILE 163_brand_graphics.mbg +OPTION SOURCEDIR ../data +OPTION SOURCES -c16,8 163.svg +END + +START EXTENSION s60/mifconv +OPTION TARGETFILE qq_brand_graphics.mif +OPTION HEADERFILE qq_brand_graphics.mbg +OPTION SOURCEDIR ../data +OPTION SOURCES -c16,8 qq.svg +END + +START EXTENSION s60/mifconv +OPTION TARGETFILE sina_brand_graphics.mif +OPTION HEADERFILE sina_brand_graphics.mbg +OPTION SOURCEDIR ../data +OPTION SOURCES -c16,8 sina.svg +END + +START EXTENSION s60/mifconv +OPTION TARGETFILE 126_brand_graphics.mif +OPTION HEADERFILE 126_brand_graphics.mbg +OPTION SOURCEDIR ../data +OPTION SOURCES -c16,8 126.svg +END + +START EXTENSION s60/mifconv +OPTION TARGETFILE sohu_brand_graphics.mif +OPTION HEADERFILE sohu_brand_graphics.mbg +OPTION SOURCEDIR ../data +OPTION SOURCES -c16,8 sohu.svg +END diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/group/qq_brand_graphics.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/group/qq_brand_graphics.mk Wed Oct 13 14:11:15 2010 +0300 @@ -0,0 +1,54 @@ +# +# 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: Make file email branding icons. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\RESOURCE\APPS +HEADERDIR=\epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\qq_brand_graphics.mif +HEADERFILENAME=$(HEADERDIR)\qq_brand_graphics.MBG +SOURCEDIR=..\data + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +RESOURCE : + mifconv $(ICONTARGETFILENAME) /H$(HEADERFILENAME) \ + /c16,8 $(SOURCEDIR)\qq.svg + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing \ No newline at end of file diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/group/sina_brand_graphics.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/group/sina_brand_graphics.mk Wed Oct 13 14:11:15 2010 +0300 @@ -0,0 +1,54 @@ +# +# 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: Make file email branding icons. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\RESOURCE\APPS +HEADERDIR=\epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\sina_brand_graphics.mif +HEADERFILENAME=$(HEADERDIR)\sina_brand_graphics.MBG +SOURCEDIR=..\data + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +RESOURCE : + mifconv $(ICONTARGETFILENAME) /H$(HEADERFILENAME) \ + /c16,8 $(SOURCEDIR)\sina.svg + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing \ No newline at end of file diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/group/sohu_brand_graphics.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/group/sohu_brand_graphics.mk Wed Oct 13 14:11:15 2010 +0300 @@ -0,0 +1,54 @@ +# +# 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: Make file email branding icons. +# + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z +else +ZDIR=\epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\RESOURCE\APPS +HEADERDIR=\epoc32\include +ICONTARGETFILENAME=$(TARGETDIR)\sohu_brand_graphics.mif +HEADERFILENAME=$(HEADERDIR)\sohu_brand_graphics.MBG +SOURCEDIR=..\data + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : do_nothing + +LIB : do_nothing + +CLEANLIB : do_nothing + +RESOURCE : + mifconv $(ICONTARGETFILENAME) /H$(HEADERFILENAME) \ + /c16,8 $(SOURCEDIR)\sohu.svg + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(HEADERFILENAME)&& \ + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing \ No newline at end of file diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/inc/emailversionnumbers.hrh --- a/emailservices/emailframework/inc/emailversionnumbers.hrh Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailframework/inc/emailversionnumbers.hrh Wed Oct 13 14:11:15 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description : Common email version number definitions -* Version : %version: 10.1.7.1.1 % +* Version : %version: 10.1.9 % * */ diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/rom/FSEmailFramework.iby --- a/emailservices/emailframework/rom/FSEmailFramework.iby Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailframework/rom/FSEmailFramework.iby Wed Oct 13 14:11:15 2010 +0300 @@ -41,6 +41,11 @@ data=DATAZ_\RESOURCE\APPS\aol_brand_graphics.mif APP_BITMAP_DIR\aol_brand_graphics.mif data=DATAZ_\RESOURCE\APPS\microsoft_brand_graphics.mif APP_BITMAP_DIR\microsoft_brand_graphics.mif data=DATAZ_\RESOURCE\APPS\mail_for_exchange_brand_graphics.mif APP_BITMAP_DIR\mail_for_exchange_brand_graphics.mif +data=DATAZ_\RESOURCE\APPS\163_brand_graphics.mif APP_BITMAP_DIR\163_brand_graphics.mif +data=DATAZ_\RESOURCE\APPS\qq_brand_graphics.mif APP_BITMAP_DIR\qq_brand_graphics.mif +data=DATAZ_\RESOURCE\APPS\sina_brand_graphics.mif APP_BITMAP_DIR\sina_brand_graphics.mif +data=DATAZ_\RESOURCE\APPS\126_brand_graphics.mif APP_BITMAP_DIR\126_brand_graphics.mif +data=DATAZ_\RESOURCE\APPS\sohu_brand_graphics.mif APP_BITMAP_DIR\sohu_brand_graphics.mif // ECOM_PLUGIN( CFSMailMockupPlugin.dll, CFSMailMockupPlugin.rsc) diff -r c8382f7b54ef -r 726fba06891a emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp --- a/emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -409,7 +409,7 @@ CFSMailBrand* CFSMailBrandManagerImpl::FindMatchingBrandL( const TDesC& aBrandId ) { FUNC_LOG; - if( ( NULL != &aBrandId ) && aBrandId.Length() ) + if( aBrandId.Length() ) { TInt brandCount( iBrands->Count() ); for ( TInt i( 0 ); i < brandCount; i++ ) diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h Wed Oct 13 14:11:15 2010 +0300 @@ -186,6 +186,11 @@ */ TInt GetUnreadCountL( TFSMailMsgId aMailbox); + /** + * + */ + TInt GetWidgetSetupBrandIconVariant(); + protected: /** * From CFSNotificationHandlerBase diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsifconsts.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsifconsts.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsifconsts.h Wed Oct 13 14:11:15 2010 +0300 @@ -71,11 +71,19 @@ _LIT8(KKeySetupBrandIcon3, "key_setup_brand_icon_3"); _LIT(KContTypeSetupBrandIcon4, "ct_setup_brand_icon_4"); _LIT8(KKeySetupBrandIcon4, "key_setup_brand_icon_4"); +_LIT(KContTypeSetupBrandIcon5, "ct_setup_brand_icon_5"); +_LIT8(KKeySetupBrandIcon5, "key_setup_brand_icon_5"); -_LIT(KSetupBrand1, "ovi.com"); -_LIT(KSetupBrand2, "yahoo.com"); -_LIT(KSetupBrand3, "hotmail.com"); -_LIT(KSetupBrand4, "gmail.com"); +_LIT(KSetupBrand2, "ovi.com"); +_LIT(KSetupBrand3, "yahoo.com"); +_LIT(KSetupBrand4, "hotmail.com"); +_LIT(KSetupBrand5, "gmail.com"); + +_LIT(KSetupBrandChn1, "widget_setup_chn_163"); +_LIT(KSetupBrandChn2, "widget_setup_chn_qq"); +_LIT(KSetupBrandChn3, "widget_setup_chn_sina"); +_LIT(KSetupBrandChn4, "widget_setup_chn_126"); +_LIT(KSetupBrandChn5, "widget_setup_chn_sohu"); _LIT(KContTypeBodyText, "ct_body_text_"); _LIT(KKeyBodyText, "key_body_text_"); diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/cmailhandlerplugin/inc/cmailcpssettings.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpssettings.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpssettings.h Wed Oct 13 14:11:15 2010 +0300 @@ -210,7 +210,12 @@ * */ TBool BackupOrRestoreMode(); - + + /** + * + */ + TInt GetWidgetSetupBrandIconVariant(); + protected: /** * From CActive diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h Wed Oct 13 14:11:15 2010 +0300 @@ -48,4 +48,10 @@ // Key to store mailboxes where is new messages. Format: ... const TUint32 KCMailMailboxesWithNewMail = 0x10000003; +// Key to variate widget setup brand icons +const TUint32 KCMailWidgetSetupVariant = 0x10000004; +const TInt KWidgetSetupBrandNone = 0; +const TInt KWidgetSetupBrandDefault = 1; +const TInt KWidgetSetupBrandChina = 2; + #endif // CMAILWIDGETCENREPKEYS_H diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -43,8 +43,6 @@ #include "cmailpluginproxy.h" #include "cmailhandlerpluginpanic.h" -#include "fsemailserverpskeys.h" - using namespace EmailInterface; // --------------------------------------------------------- @@ -100,18 +98,6 @@ InitializeExternalAccountsL(); iSettings->StartObservingL( this ); - - TInt err = RProperty::Define( KPSUidEmailServerCategory, - KIntMailboxCount, - RProperty::EInt ); - if ( err != KErrAlreadyExists && err != KErrNone ) - { - User::LeaveIfError( err ); - } - - // set mailbox initial count - TInt intCount = TotalIntMailboxCount(); - User::LeaveIfError( RProperty::Set( KPSUidEmailServerCategory, KIntMailboxCount, intCount ) ); } // --------------------------------------------------------- @@ -484,7 +470,7 @@ // Use localisation format when displaying also unread messages // Arrays must be used when loc string contains indexed parameters - CDesCArrayFlat* strings = new( ELeave) CDesCArrayFlat( 1 ); + CDesCArrayFlat* strings = new CDesCArrayFlat( 1 ); CleanupStack::PushL( strings ); strings->AppendL( accountName ); // replace "%0U" with mailbox name @@ -945,10 +931,6 @@ { iLiwIf->AddWidgetToHomescreenL( aMailbox ); } - - // update total mailbox count. - TInt intCount = TotalIntMailboxCount(); - User::LeaveIfError( RProperty::Set( KPSUidEmailServerCategory, KIntMailboxCount, intCount ) ); } // --------------------------------------------------------- @@ -998,9 +980,6 @@ break; } } - // update total mailbox count. - TInt intCount = TotalIntMailboxCount(); - User::LeaveIfError( RProperty::Set( KPSUidEmailServerCategory, KIntMailboxCount, intCount ) ); } @@ -1824,6 +1803,17 @@ } // ---------------------------------------------------------------------------- +// CMailCpsHandler::GetWidgetSetupBrandIconVariant() +// Get widget setup brand icon variant +// ---------------------------------------------------------------------------- +// +TInt CMailCpsHandler::GetWidgetSetupBrandIconVariant() + { + FUNC_LOG; + return iSettings->GetWidgetSetupBrandIconVariant(); + } + +// ---------------------------------------------------------------------------- // class CMailCpsUpdateHelper : public CTimer // Used to limit the rate of updates to Homescreen widget // ---------------------------------------------------------------------------- diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -207,16 +207,11 @@ EMbmCmailhandlerpluginQgn_prop_cmail_new_mailbox_mask, mailBoxId, KNullDes); - - PublishImageL( - iInstIdList[aInstance].iCid, - KContTypeSetupBrandIcon1, - KKeySetupBrandIcon1, - EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, - EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, - mailBoxId, - KSetupBrand1); + + TInt widgetSetupVariant = iMailCpsHandler->GetWidgetSetupBrandIconVariant(); + if ( widgetSetupVariant == KWidgetSetupBrandDefault ) + { PublishImageL( iInstIdList[aInstance].iCid, KContTypeSetupBrandIcon2, @@ -243,6 +238,64 @@ EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, mailBoxId, KSetupBrand4); + + PublishImageL( + iInstIdList[aInstance].iCid, + KContTypeSetupBrandIcon5, + KKeySetupBrandIcon5, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, + mailBoxId, + KSetupBrand5); + } + else if ( widgetSetupVariant == KWidgetSetupBrandChina ) + { + PublishImageL( + iInstIdList[aInstance].iCid, + KContTypeSetupBrandIcon1, + KKeySetupBrandIcon1, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, + mailBoxId, + KSetupBrandChn1); + + PublishImageL( + iInstIdList[aInstance].iCid, + KContTypeSetupBrandIcon2, + KKeySetupBrandIcon2, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, + mailBoxId, + KSetupBrandChn2); + + PublishImageL( + iInstIdList[aInstance].iCid, + KContTypeSetupBrandIcon3, + KKeySetupBrandIcon3, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, + mailBoxId, + KSetupBrandChn3); + + PublishImageL( + iInstIdList[aInstance].iCid, + KContTypeSetupBrandIcon4, + KKeySetupBrandIcon4, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, + mailBoxId, + KSetupBrandChn4); + + PublishImageL( + iInstIdList[aInstance].iCid, + KContTypeSetupBrandIcon5, + KKeySetupBrandIcon5, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account, + EMbmCmailhandlerpluginQgn_indi_cmail_drop_email_account_mask, + mailBoxId, + KSetupBrandChn5); + } + iInstIdList[aInstance].iWizardPublished = ETrue; CleanupStack::PopAndDestroy(setupEmail); } diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -965,7 +965,7 @@ } // ---------------------------------------------------------------------------- -// CMailCpsHandler::BackupOrRestoreMode() +// CMailCpsSettings::BackupOrRestoreMode() // Check if phone is in backup/restore mode // ---------------------------------------------------------------------------- // @@ -981,3 +981,18 @@ } return backupOrRestore; } + +// ---------------------------------------------------------------------------- +// CMailCpsSettings::GetWidgetSetupBrandIconVariant() +// Get widget setup brand icon variant +// ---------------------------------------------------------------------------- +// +TInt CMailCpsSettings::GetWidgetSetupBrandIconVariant() + { + FUNC_LOG; + + TInt ret(KWidgetSetupBrandDefault); + iCenRep->Get( KCMailWidgetSetupVariant, ret ); + + return ret; + } \ No newline at end of file diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -104,7 +104,11 @@ CFSMailFolder* parentFolder( MailClient().GetFolderByUidL( aMailboxId, aParentFolderId ) ); - User::LeaveIfNull( parentFolder ); + if ( !parentFolder ) + { + // by some reason the folder could not be found.. + return EFalse; + } CleanupStack::PushL( parentFolder ); CFSMailMessage* newestMsg( NULL ); @@ -144,19 +148,20 @@ aParentFolderId, aMsgIdList[index], EFSMsgDataEnvelope ) ); - User::LeaveIfNull( currentMessage ); - const TTime dateOfCurrentMsg( currentMessage->GetDate() ); - - - const TBool msgIsUnread( MsgIsUnread( *currentMessage ) ); - delete currentMessage; - currentMessage = NULL; - - if ( msgIsUnread && - ( dateOfCurrentMsg >= dateOfNewest ) ) + if ( currentMessage ) { - // At least one of the messages is unread and newest. - return ETrue; + const TTime dateOfCurrentMsg( currentMessage->GetDate() ); + + const TBool msgIsUnread( MsgIsUnread( *currentMessage ) ); + delete currentMessage; + currentMessage = NULL; + + if ( msgIsUnread && + ( dateOfCurrentMsg >= dateOfNewest ) ) + { + // At least one of the messages is unread and newest. + return ETrue; + } } --index; @@ -182,7 +187,7 @@ if ( aEvent != TFSEventMailboxDeleted ) { CFSMailBox* mailBox( MailClient().GetMailBoxByUidL( aMailbox ) ); - if ( mailBox == NULL ) + if ( !mailBox ) { User::Leave( KErrArgument ); } @@ -219,7 +224,7 @@ // in aParam2 TFSMailMsgId* parentFolderId( NULL ); parentFolderId = static_cast< TFSMailMsgId* >( aParam2 ); - if ( parentFolderId == NULL ) + if ( !parentFolderId ) { User::Leave( KErrArgument ); } @@ -263,6 +268,8 @@ { // process collected insert requests RArray msgIds; + CleanupClosePushL( msgIds ); + TFSMailMsgId mailBoxId; TFSMailMsgId parentFolderId; for ( TInt i = 0; i< iNewInboxEntries.Count(); i++ ) @@ -299,6 +306,7 @@ } // clear processed entries msgIds.Reset(); + CleanupStack::PopAndDestroy( &msgIds ); iNewInboxEntries.Reset(); } @@ -323,7 +331,7 @@ // Resetting array of sort criteria already here because // the iterator does not need it anymore. - CleanupStack::PopAndDestroy(); // sorting + CleanupStack::PopAndDestroy( &sorting ); // CleanupStack::PushL doesn't work for M-class CleanupDeletePushL( iterator ); @@ -342,7 +350,7 @@ CFSMailMessage* outcome = messages[0]; messages.Remove( 0 ); // remove from array to prevent destruction of element messages.ResetAndDestroy(); - CleanupStack::PopAndDestroy(); // messages + CleanupStack::PopAndDestroy( &messages ); CleanupStack::PopAndDestroy( iterator ); return outcome; } @@ -392,6 +400,15 @@ iObserver.TimerExpiredL(); } +TInt CNewMailNotificationTimer::RunError(TInt aError) + { + if( aError ) + { + INFO_1( "CNewMailNotificationTimer::RunError( aError: %d )", aError ); + } + + return KErrNone; + } void Panic( TCmailhandlerPanic aPanic ) { diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/group/bld.inf --- a/emailservices/emailserver/group/bld.inf Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/group/bld.inf Wed Oct 13 14:11:15 2010 +0300 @@ -29,10 +29,9 @@ PRJ_EXPORTS ../inc/fsmailserverconst.hrh |../../../inc/fsmailserverconst.hrh -../inc/fsmailserverconst.h |../../../inc/fsmailserverconst.h -../inc/fsemailserverpskeys.h |../../../inc/fsemailserverpskeys.h +../inc/fsmailserverconst.h |../../../inc/fsmailserverconst.h// -../cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h |../../../inc/cmailwidgetcenrepkeys.h +../cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h |../../../inc/cmailwidgetcenrepkeys.h// ../rom/fsmailserver.iby CORE_APP_LAYER_IBY_EXPORT_PATH(fsmailserver.iby) ../rom/fsmailserverresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(fsmailserverresources.iby) ../loc/fsmailserver.loc APP_LAYER_LOC_EXPORT_PATH(fsmailserver.loc) diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/inc/fsemailserverpskeys.h --- a/emailservices/emailserver/inc/fsemailserverpskeys.h Wed Sep 15 11:52:37 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* 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: Domain Publish & Subscribe keys for emailserver - * - * -*/ - - -#ifndef FSEMAILSERVERPSKEYS_H -#define FSEMAILSERVERPSKEYS_H - -const TUid KPSUidEmailServerCategory = { 0x2001F40A }; // see KFSMailServerUid - -/** - * Keeps amount of mailboxes that is registered in Email application - */ -const TUint KIntMailboxCount = 0x00000001; - - -#endif // FSEMAILSERVERPSKEYS_H diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/inc/fsnotificationhandlerbase.h --- a/emailservices/emailserver/inc/fsnotificationhandlerbase.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/inc/fsnotificationhandlerbase.h Wed Oct 13 14:11:15 2010 +0300 @@ -87,6 +87,7 @@ // from base class CActive virtual void DoCancel(); virtual void RunL(); + virtual TInt RunError( TInt aError ); private: diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/inc/fsnotificationhandlermgrimpl.h --- a/emailservices/emailserver/inc/fsnotificationhandlermgrimpl.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/inc/fsnotificationhandlermgrimpl.h Wed Oct 13 14:11:15 2010 +0300 @@ -54,6 +54,23 @@ public MFSMailEventObserver { public: + + enum TState + { + EPrepareInitialization, + EInitializeMailIconHandler, + EInitializeLedHandler, +#ifndef __WINS__ + ESoundHandler, +#endif + EInitializeMtmHandler, + EInitializeOutofMemoryHandler, + EInitializeAuthenticationHandler, + EInitializeMessageQueryHandlerUid, + EWaitForPluginsReady, + EInitializeCMailCpsHandlerUid, + EFinish + }; // aAppUi parameter no longer necessary static CFSNotificationHandlerMgr* NewL( CFsEmailGlobalDialogsAppUi* aAppUi = NULL ); @@ -217,6 +234,10 @@ TFSMailMsgId iPreviousMailbox; TFSMailMsgId iPreviousParentFolderId; TFSFolderType iPreviousParentFolderType; + + RTimer iTimer; + + TState iState; }; #endif // C_FSNOTIFICATIONHANDLERMGRIMPL_H diff -r c8382f7b54ef -r 726fba06891a emailservices/emailserver/src/fsnotificationhandlermgrimpl.cpp --- a/emailservices/emailserver/src/fsnotificationhandlermgrimpl.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailserver/src/fsnotificationhandlermgrimpl.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -38,6 +38,10 @@ static const TInt64 KMegaByte = 1048576; +_LIT( KFSMailServerPanic, "FS mail server" ); +const TInt KUndefinedState = 1; +const TTimeIntervalMicroSeconds32 KDelay = 5000000; // 5 seconds + // ======== MEMBER FUNCTIONS ======== @@ -64,9 +68,11 @@ FUNC_LOG; // Performs the time consuming initialization asynchronously in RunL, in order // to let the process startup finish quicker + iTimer.CreateLocal(); + SetActive(); + iState = EPrepareInitialization; TRequestStatus* status = &iStatus; - User::RequestComplete(status, KErrNone); - SetActive(); + User::RequestComplete( status, KErrNone ); } // --------------------------------------------------------------------------- @@ -76,48 +82,98 @@ void CFSNotificationHandlerMgr::RunL() { FUNC_LOG; - // Create mail client - iMailClient = CFSMailClient::NewL(); - if ( iMailClient == NULL ) + + TBool goToNextState = ETrue; + + switch( iState ) { - User::Leave( KErrNoMemory ); + case EPrepareInitialization: + { + // Create mail client + iMailClient = CFSMailClient::NewL(); + if ( iMailClient == NULL ) + { + User::Leave( KErrNoMemory ); + } + // Once mail client is created ok, disk space needs to be checked + // and cleaned if necessary + CleanTempFilesIfNeededL(); + break; + } + case EInitializeMailIconHandler: + { + CreateAndStoreHandlerL( KMailIconHandlerUid ); + break; + } + case EInitializeLedHandler: + { + CreateAndStoreHandlerL( KLedHandlerUid ); + break; + } +#ifndef __WINS__ + case ESoundHandler: + { + // Earlier RefreshData() was called for the soundhandler + // object after creation, but as it does not do anything + // it is not called anymore. + CreateAndStoreHandlerL( KSoundHandlerUid ); + break; + } +#endif + case EInitializeMtmHandler: + { + CreateAndStoreHandlerL( KMtmHandlerUid ); + break; + } + case EInitializeOutofMemoryHandler: + { + CreateAndStoreHandlerL( KOutofMemoryHandlerUid ); + break; + } + case EInitializeAuthenticationHandler: + { + CreateAndStoreHandlerL( KAuthenticationHandlerUid ); + break; + } + case EInitializeMessageQueryHandlerUid: + { + CreateAndStoreHandlerL( KMessageQueryHandlerUid ); + break; + } + case EWaitForPluginsReady: + { + if ( !iMailClient->AreAllPluginsLoaded() ) + { + goToNextState = EFalse; + SetActive(); + iTimer.After( iStatus, KDelay ); + } + break; + } + case EInitializeCMailCpsHandlerUid: + { + CreateAndStoreHandlerL( KCMailCpsHandlerUid ); + break; + } + case EFinish: + { + StartObservingL(); + goToNextState = EFalse; + break; + } + default: + { + User::Panic( KFSMailServerPanic, KUndefinedState ); + break; + } } - - // Once mail client is created ok, disk space needs to be checked - // and cleaned if necessary - CleanTempFilesIfNeededL(); - - // - // Notification handlers are created next. - // Notice that if a handler cannot be created it does not mean - // that the construction of the manager would be stopped. This - // approach is chosen so that if something goes wrong with - // construction of a handler it can safely leave and get - // destroyed but does not interfere other handlers. - - CreateAndStoreHandlerL( KMailIconHandlerUid ); - - CreateAndStoreHandlerL( KLedHandlerUid ); - -#ifndef __WINS__ - CreateAndStoreHandlerL( KSoundHandlerUid ); - // Earlier RefreshData() was called for the soundhandler - // object after creation, but as it does not do anything - // it is not called anymore. -#endif - - CreateAndStoreHandlerL( KMtmHandlerUid ); - - CreateAndStoreHandlerL( KOutofMemoryHandlerUid ); - - CreateAndStoreHandlerL( KAuthenticationHandlerUid ); - - CreateAndStoreHandlerL( KMessageQueryHandlerUid ); - - CreateAndStoreHandlerL( KCMailCpsHandlerUid ); - // - - StartObservingL(); + if ( goToNextState ) + { + iState = TState( iState + 1 ); + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } } // --------------------------------------------------------------------------- @@ -196,6 +252,8 @@ } iAppUi = NULL; + + iTimer.Close(); // Finished using ECom // ECom used at least in CFSMailHSUpdateHandler diff -r c8382f7b54ef -r 726fba06891a emailservices/emailstore/base_plugin/BWINS/basepluginU.DEF --- a/emailservices/emailstore/base_plugin/BWINS/basepluginU.DEF Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailstore/base_plugin/BWINS/basepluginU.DEF Wed Oct 13 14:11:15 2010 +0300 @@ -195,6 +195,4 @@ ?CalendarFileName@CBasePlugin@@MBEABVTDesC16@@XZ @ 194 NONAME ; class TDesC16 const & CBasePlugin::CalendarFileName(void) const ?StartOp@CDelayedOp@@QAEXXZ @ 195 NONAME ; void CDelayedOp::StartOp(void) ?DeleteDelayedOpsManager@CBasePlugin@@QAEXXZ @ 196 NONAME ; void CBasePlugin::DeleteDelayedOpsManager(void) - ?PrivacyL@CBaseMrInfoObject@@UBE?AW4TCalSensitivity@MMRInfoObject@@XZ @ 197 NONAME ; enum MMRInfoObject::TCalSensitivity CBaseMrInfoObject::PrivacyL(void) const - ?SetPrivacyL@CBaseMrInfoObject@@UAEXW4TCalSensitivity@MMRInfoObject@@@Z @ 198 NONAME ; void CBaseMrInfoObject::SetPrivacyL(enum MMRInfoObject::TCalSensitivity) diff -r c8382f7b54ef -r 726fba06891a emailservices/emailstore/base_plugin/EABI/basepluginU.DEF --- a/emailservices/emailstore/base_plugin/EABI/basepluginU.DEF Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailstore/base_plugin/EABI/basepluginU.DEF Wed Oct 13 14:11:15 2010 +0300 @@ -299,8 +299,4 @@ _ZNK11CBasePlugin16CalendarFileNameEv @ 298 NONAME _ZN10CDelayedOp7StartOpEv @ 299 NONAME _ZN11CBasePlugin23DeleteDelayedOpsManagerEv @ 300 NONAME - _ZN17CBaseMrInfoObject11SetPrivacyLEN13MMRInfoObject15TCalSensitivityE @ 301 NONAME - _ZNK17CBaseMrInfoObject8PrivacyLEv @ 302 NONAME - _ZThn4_N17CBaseMrInfoObject11SetPrivacyLEN13MMRInfoObject15TCalSensitivityE @ 303 NONAME - _ZThn4_NK17CBaseMrInfoObject8PrivacyLEv @ 304 NONAME diff -r c8382f7b54ef -r 726fba06891a emailservices/emailstore/base_plugin/inc/BaseMrInfoObject.h --- a/emailservices/emailstore/base_plugin/inc/BaseMrInfoObject.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailstore/base_plugin/inc/BaseMrInfoObject.h Wed Oct 13 14:11:15 2010 +0300 @@ -303,11 +303,6 @@ TTime aRecId ); IMPORT_C TTime MRRecurrenceId() const; - - IMPORT_C void SetPrivacyL( - TCalSensitivity aPrivacyL ); - - IMPORT_C TCalSensitivity PrivacyL() const; protected: @@ -319,7 +314,7 @@ HBufC* iUid; HBufC* iLocation; HBufC* iSubject; - HBufC* iDescription; + HBufC* iDescription; TTime iCreationTime; TTime iStartTime; TTime iEndTime; @@ -327,7 +322,6 @@ TTime iRecurrenceId; TInt iSequenceNumber; TUint iPriority; - TCalSensitivity iPrivacy; TMRMethod iMethod; TResponse iResponse; }; diff -r c8382f7b54ef -r 726fba06891a emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp --- a/emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -82,7 +82,6 @@ iSequenceNumber = aMrInfo.MRSequenceNumberL(); iPriority = aMrInfo.PriorityL(); - iPrivacy = aMrInfo.PrivacyL(); iOrganizer = CBaseMrAttendee::NewL( aMrInfo.MROrganizerL() ); @@ -1134,20 +1133,3 @@ } } //ReplyToMeetingRequestL. - -/** - * - */ -EXPORT_C void CBaseMrInfoObject::SetPrivacyL( MMRInfoObject::TCalSensitivity aPrivacyL ) - { - iPrivacy = aPrivacyL; - } - - -/** - * - */ -EXPORT_C MMRInfoObject::TCalSensitivity CBaseMrInfoObject::PrivacyL() const - { - return iPrivacy; - } diff -r c8382f7b54ef -r 726fba06891a emailservices/emailstore/base_plugin/src/basepluginmisc.cpp --- a/emailservices/emailstore/base_plugin/src/basepluginmisc.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailstore/base_plugin/src/basepluginmisc.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -204,9 +204,6 @@ criteria.AddResultPropertyL( KMsgStorePropertySize ); criteria.AddResultPropertyL( KMsgStorePropertyFrom ); criteria.AddResultPropertyL( KMsgStorePropertySubject ); - criteria.AddResultPropertyL( KMsgStorePropertyTo ); - criteria.AddResultPropertyL( KMsgStorePropertyCc ); - criteria.AddResultPropertyL( KMsgStorePropertyBcc ); /**@ figure the lifecycle mgmnt of the handler.*/ CSearchHandler* searchHandler = new (ELeave) CSearchHandler( aSearchObserver, *this, aMailBoxId ); diff -r c8382f7b54ef -r 726fba06891a emailservices/emailstore/base_plugin/src/baseplugintranslator.cpp --- a/emailservices/emailstore/base_plugin/src/baseplugintranslator.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailservices/emailstore/base_plugin/src/baseplugintranslator.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -496,14 +496,13 @@ TUint32 priority = aCalendar.PropertyValueUint32L( idx ); mmrInfo->SetPriorityL( priority ); } - - //privacy/sensitivity - idx = 0; + + /**@ privacy/sensitivity missing ? */ + /*idx = 0; if ( aCalendar.FindProperty( KMsgStorePropertyMrPrivate, idx ) ) { - TUint32 privacy = aCalendar.PropertyValueUint32L( idx ); - mmrInfo->SetPrivacyL( static_cast( privacy ) ); - } + TBool private = aCalendar.PropertyValueBoolL( idx ); + }*/ //method. idx = 0; @@ -1026,9 +1025,12 @@ calendar->AddOrUpdatePropertyL( KMsgStorePropertyMrPriority, static_cast( aSrc.PriorityL() ) ); - //privacy/sensitivity - calendar->AddOrUpdatePropertyL( - KMsgStorePropertyMrPrivate, static_cast( aSrc.PrivacyL() ) ); + /**@ privacy/sensitivity missing ? */ + /*idx = 0; + if ( aCalendar.FindProperty( KMsgStorePropertyMrPrivate, idx ) ) + { + TBool private = aCalendar.PropertyValueBoolL( idx ); + }*/ //recurrent count. calendar->AddOrUpdatePropertyL( diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/conf/freestyleemailui.confml Binary file emailuis/emailui/conf/freestyleemailui.confml has changed diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/conf/freestyleemailui_2001E277.crml Binary file emailuis/emailui/conf/freestyleemailui_2001E277.crml has changed diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/data/FreestyleEmailUi.rss --- a/emailuis/emailui/data/FreestyleEmailUi.rss Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/data/FreestyleEmailUi.rss Wed Oct 13 14:11:15 2010 +0300 @@ -979,7 +979,7 @@ RESOURCE AVKON_VIEW r_fsemailui_mail_search_view { menubar = r_fsemailui_searchlist_menubar; - cba = r_freestyle_emauil_ui_sk_options_back; + cba = r_freestyle_emauil_ui_sk_options_back__open; } RESOURCE AVKON_VIEW r_fsemailui_html_view @@ -1210,7 +1210,7 @@ RESOURCE TBUF r_freestyle_email_ui_griditem_weather { buf=qtn_fsemail_griditem_weather; } RESOURCE TBUF r_freestyle_email_ui_griditem_settings { buf=qtn_fse_launcher_settings; } RESOURCE TBUF r_freestyle_email_ui_griditem_add_new_mailbox { buf=qtn_fse_launcher_add_new_mailbox; } -RESOURCE TBUF r_freestyle_email_ui_griditem_help { buf=qtn_options_help; } +RESOURCE TBUF r_freestyle_email_ui_griditem_help { buf=qtn_fse_launcher_help; } // ITEM IN MAIL VIEWER RESOURCE TBUF r_freestyle_email_ui_viewer_from { buf=qtn_fse_viewer_header_from; } @@ -1580,7 +1580,6 @@ MENU_ITEM { command = EFsEmailUiCmdActionsForward; txt = qtn_fse_message_list_options_forward; }, MENU_ITEM { command = EFsEmailUiCmdMailActions; txt = qtn_cmail_message_list_options_actions; cascade=r_fsemailui_maillist_submenu_mail_actions;}, MENU_ITEM { command = EFsEmailUiCmdSync; txt = qtn_cmail_message_list_options_send_receive; }, - MENU_ITEM { command = EFsEmailUiCmdCancelSync; txt = qtn_fse_launcher_options_cancel_sync; }, MENU_ITEM { command = EFsEmailUiCmdMarkingMode; txt = qtn_fse_message_list_options_mark; }, MENU_ITEM { command = EFsEmailUiCmdSettings; txt = qtn_fse_message_list_options_settings; }, MENU_ITEM { command = EFsEmailUiCmdHelp; txt = qtn_options_help; }, diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/data/iconlist.txt --- a/emailuis/emailui/data/iconlist.txt Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/data/iconlist.txt Wed Oct 13 14:11:15 2010 +0300 @@ -195,5 +195,4 @@ -c16,8 qgn_indi_tb_show_bcc.svg -c16,8 qgn_indi_tb_hide_bcc.svg -c16,8 qgn_indi_tb_extension.svg --c16,8 qgn_prop_checkbox_on.svg --c16,8 qgn_prop_checkbox_off.svg +-c16,8 cmail_marking_mode_bg.svg diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/group/FreestyleEmailUi.mmp --- a/emailuis/emailui/group/FreestyleEmailUi.mmp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/group/FreestyleEmailUi.mmp Wed Oct 13 14:11:15 2010 +0300 @@ -124,12 +124,6 @@ USERINCLUDE ../../../inc USERINCLUDE ../../../ipsservices/inc -// 9.11.2009: Temporary flagging SYMBIAN_ENABLE_SPLIT_HEADERS -// Can be removed when header structure change is complete -#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS -SYSTEMINCLUDE /epoc32/include/uikon -#endif // SYMBIAN_ENABLE_SPLIT_HEADERS - START RESOURCE ../data/FreestyleEmailUi.rss HEADER TARGETPATH APP_RESOURCE_DIR diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailCenRepKeys.h --- a/emailuis/emailui/inc/FreestyleEmailCenRepKeys.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailCenRepKeys.h Wed Oct 13 14:11:15 2010 +0300 @@ -90,11 +90,6 @@ // Values: 1 = hide, 0 = show. const TUint32 KEmailHideFS205UIFeature = {0x0000FFFF}; const TUint32 KEmailHideFSHiLightUIFeature = {0x0000FFFF}; -// PS2 variation -// one centrep key for every feature, 0 means disabled -const TUint32 KEmailFeatureSplitScreen = {0x00001001}; -const TUint32 KMfEFeatureCertificateBasedAuthentication = {0x00001003}; -const TUint32 KMfEFeatureAdvancedSecurity = {0x00001004}; // // TP Wizard repository in the central repository diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiAppui.h --- a/emailuis/emailui/inc/FreestyleEmailUiAppui.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiAppui.h Wed Oct 13 14:11:15 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 - 2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -502,9 +502,6 @@ // wouldn't have any visible effect. void RunFakeSyncAnimL(); - // Sets text to navi pane - void SetNaviPaneTextL( const TDesC& aText ); - public: //from MFSMailEventObserver /** * Framework event message. @@ -541,6 +538,14 @@ */ void StopEndKeyCapture(); + /** + * Accessor for navipane decorator object. + * @param aViewId: Caller identify itself by giving the view Id (see FreestyleEmailUiConstants.h) + * This is used for choosing correct decorator. + * @return instance of correct navidecorator. NULL if aView doesn't match. + */ + CAknNavigationDecorator* NaviDecoratorL( const TUid aViewId ); + public: /** @@ -609,6 +614,12 @@ // Send self to background. void SendToBackground(); + /* + * Called from ConstructL during start of application. + * Constructs navipane(s) that are used by different views. + */ + void ConstructNaviPaneL(); + // Create custom status pane indicators. (priority and followup) void CreateStatusPaneIndicatorsL(); // Delete custom status pane indicators @@ -785,7 +796,8 @@ CEUiExitGuardian* iExitGuardian; // navipane decorator - CAknNavigationDecorator* iNaviDecorator; + // (used at least in mail viewer) + CAknNavigationDecorator* iNaviDecorator2MailViewer; // Resource file offset for message editor external resources TInt iMsgEditorResourceOffset; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiCLSListsHandler.h --- a/emailuis/emailui/inc/FreestyleEmailUiCLSListsHandler.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiCLSListsHandler.h Wed Oct 13 14:11:15 2010 +0300 @@ -162,8 +162,8 @@ */ TBool ReadCLSInfoFromMRUListIndexL( MDesCArray& aTextArray, CFSEmailUiClsItem& aClsItem, - TInt aCurrentMatchIndex, - TInt aPreviousMatchIndex ); + const TInt aCurrentMatchIndex, + const TInt aPreviousMatchIndex ); /** * Searches given cls item from the given list. If duplicate is found, it is returned. diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiContactHandler.h --- a/emailuis/emailui/inc/FreestyleEmailUiContactHandler.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiContactHandler.h Wed Oct 13 14:11:15 2010 +0300 @@ -259,13 +259,15 @@ * @param aObserver = observer to collect results */ void GetAddressesFromPhonebookL( MFSEmailUiContactHandlerObserver* aObserver ); - + + // video call /** * Enables/disables video call. * * @param aState ETrue for 'enable', EFalse for 'disable' */ void SetVideoCall( TBool aState ); + // // from base class MFSEmailUiClsListsObserver @@ -275,14 +277,18 @@ // from base class MVPbkSingleContactOperationObserver void VPbkSingleContactOperationCompleteL( - MVPbkContactOperationBase& aOperation, MVPbkStoreContact* aContact ); - void VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& aOperation, MVPbkStoreContact* aContact ); - - void VPbkSingleContactOperationFailedL( - MVPbkContactOperationBase& aOperation, TInt aError ); - void VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& aOperation, TInt aError ); + MVPbkContactOperationBase& aOperation, + MVPbkStoreContact* aContact ); + + + void VPbkSingleContactOperationComplete( + MVPbkContactOperationBase& aOperation, + MVPbkStoreContact* aContact ); + + void VPbkSingleContactOperationFailedL( + MVPbkContactOperationBase& aOperation, TInt aError ); + void VPbkSingleContactOperationFailed( + MVPbkContactOperationBase& aOperation, TInt aError ); // from base class MVPbkContactStoreListObserver @@ -340,12 +346,6 @@ // from MCCAObserver void CCASimpleNotifyL( TNotifyType aType, TInt aReason ); - TUid GetDetailsViewUid(); - TUid GetDetailsAppUid(); - TBool WasDetailsClosed(); - void CloseContactDetailsL(); - void ReopenContactDetailsL(RWsSession&); - private: CFSEmailUiContactHandler( RFs& aSession ); @@ -354,21 +354,18 @@ // call observer's MFSEmailUiContactHandlerObserver::OperationErrorL( TContactHandlerCmd aCmd, TInt aError ) void ObserverOperationErrorL( TContactHandlerCmd aCmd, TInt aErrorCode ); + private: - - TInt SelectBetweenCsAndVoip() const; + + TInt SelectBetweenCsAndVoip() const; void HandleCallL( const RPointerArray& aMatchingItems ); - - void CreateMessageL( const RPointerArray& aMatchingItems ); - void SendMessageL( CAiwGenericParamList& aEventParamList, TInt aServiceType ); - void GetSmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink ); - void GetMmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink, - TBool aIsVoiceMessage = EFalse ); - - // Starts retrieving addresses from contact stores. - void RetrieveContactsL(); - + + void CreateMessageL( const RPointerArray& aMatchingItems ); + void SendMessageL( CAiwGenericParamList& aEventParamList, TInt aServiceType ); + void GetSmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink ); + void GetMmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink, TBool aIsVoiceMessage = EFalse ); + TBool IsRemoteLookupSupported(); void GetContactFieldsL( RArray& aFieldIds, RPointerArray& aNumbers, @@ -459,9 +456,6 @@ // Flag for making video call TBool iVideoCall; - // flag to check if it was remotely closed (using CloseContactDetailsL method) - TBool iContactDetailsClosed; - // connection to CCMA launcher MCCAConnection* iConnection; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h --- a/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h Wed Oct 13 14:11:15 2010 +0300 @@ -197,12 +197,14 @@ void LoadContentFromFileL( RFile& aFile ); void LoadContentFromUrlL( const TDesC& aUrl ); void LoadContentFromMailMessageL( CFSMailMessage* aMailMessage, TBool aResetScrollPos=ETrue ); - void ResetContent( TBool aDisconnect = EFalse, TBool aClearFlags = ETrue ); + void ResetContent(const TBool aDisconnect = EFalse); void CancelFetch(); void ClearCacheAndLoadEmptyContent(); + // void PrepareForExit(); void PrepareForMessageNavigation(); - + // + // from base class CCoeControl CCoeControl* ComponentControl( TInt aIndex ) const; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h --- a/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h Wed Oct 13 14:11:15 2010 +0300 @@ -71,6 +71,7 @@ */ TUid Id() const; + void HandleStatusPaneSizeChange(); void HandleViewRectChange(); diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiLayoutHandler.h --- a/emailuis/emailui/inc/FreestyleEmailUiLayoutHandler.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiLayoutHandler.h Wed Oct 13 14:11:15 2010 +0300 @@ -239,7 +239,6 @@ //To retrieve respecitve Icon Sizes TInt ListTextureNodeExpandedSize() const; TInt SearchLookingGlassIconSize() const; - TInt SearchMarkIconSize() const; TSize statusPaneIconSize() const; TInt ListControlBarMailboxDefaultIconSize() const; TInt EMailListBarBgIconSize() const; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiMailListModel.h --- a/emailuis/emailui/inc/FreestyleEmailUiMailListModel.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiMailListModel.h Wed Oct 13 14:11:15 2010 +0300 @@ -89,6 +89,7 @@ MFSListModelItem* Item(TInt aIndex); const MFSListModelItem* Item(TInt aIndex) const; TInt Count() const; + TBool ContainsItem(const CFSMailMessage& aMessage) const; public: // new methods diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h Wed Oct 13 14:11:15 2010 +0300 @@ -573,7 +573,7 @@ // Control bar functions void CreateControlBarLayoutL(); void ScaleControlBarL(); - void SetSortButtonIconL(); + void SetSortButtonTextAndIconL(); HBufC* GetSortButtonTextLC(); void HandleControlBarEvent( TFsControlBarEvent aEvent, TInt aData ); @@ -647,12 +647,12 @@ /** * Display marking mode title text */ - void DisplayMarkingModeTextOnButtonsL(); + void DisplayMarkingModeTitleTextL(); /** * Remove marking mode title text */ - void RemoveMarkingModeTextOnButtonsL(); + void RemoveMarkingModeTitleTextL(); /** * Displays or remove marking mode background @@ -805,6 +805,11 @@ void FocusVisibilityChange( TBool aVisible ); /** + * Update texts in command area buttons + */ + void UpdateButtonTextsL(); + + /** * Tests whether a point is inside the control. * * @param aControl Control that is tested. @@ -837,9 +842,7 @@ */ TBool HandleArrowEventInLandscapeL( const TInt aScancode, const TAlfEvent& aEvent, const TBool aShiftState ); - - void UpdateFolderAndMarkingModeTextsL(); - + private: // data types diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h Wed Oct 13 14:11:15 2010 +0300 @@ -252,6 +252,8 @@ void UpdatePreviewPaneTextForItemL( CFsTreePlainTwoLineItemData* aItemData, CFSMailMessage* aMsgPtr ); void FilterPreviewPaneTextL( TDes& aText ) const; + void SetMskL(); + void DoFirstStartL(); void SetHeaderAttributesL(); diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiTextureManager.h --- a/emailuis/emailui/inc/FreestyleEmailUiTextureManager.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiTextureManager.h Wed Oct 13 14:11:15 2010 +0300 @@ -56,8 +56,7 @@ EBackgroundTextureBar, EBackgroundTextureThumb, EBackgroundTextureMailList, - EListControlMarkOnIcon, - EListControlMarkOffIcon, + EListControlMarkIcon, EListControlMenuIcon, EMailListBarBgIcon, ESearchLookingGlassIcon, @@ -225,6 +224,8 @@ EAttachmentsSaveAll, EAttachmentsCancelAll, EAttachmentsViewAll, + + EMarkingModeBackgroundIcon, // TEXTURE COUNT ETextureCount, @@ -286,6 +287,9 @@ // Get new mail list separator brush // Ownership IS transferred to caller. CAlfFrameBrush* NewMailListSeparatorBgBrushLC(); + // Get marking mode background brush + // Ownership IS transferred to caller. + CAlfImageBrush* NewMailListMarkingModeBgBrushLC(); // Get new mail list separator brush // Ownership IS transferred to caller. CAlfImageBrush* NewControlBarListBgBrushLC(); diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleEmailUiUtilities.h --- a/emailuis/emailui/inc/FreestyleEmailUiUtilities.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiUtilities.h Wed Oct 13 14:11:15 2010 +0300 @@ -19,7 +19,7 @@ #ifndef __FREESTYLEMAILUI_UTILITIES_H_ #define __FREESTYLEMAILUI_UTILITIES_H_ -#include // CTimer +#include // CTimer #include #include #include @@ -70,12 +70,12 @@ enum TFollowUpNewState - { - EFollowUp = 0, // don't change, as these are the in the order they are in popup selection list - EFollowUpComplete = 1, // don't change - EFollowUpClear = 2, // don't change - EFollowUpNoChanges = 3 - }; + { + EFollowUp = 0, // don't change, as these are the in the order they are in popup selection list + EFollowUpComplete = 1, // don't change + EFollowUpClear = 2, // don't change + EFollowUpNoChanges = 3 + }; enum TMessageSizeClass { @@ -100,7 +100,7 @@ static CFSMailBox* GetMailboxForMtmIdL( CFSMailClient& aClient, CMsvSession& aMsvSession, TMsvId aMtmId ); static TBool IsRemoteLookupSupported( CFSMailBox& aMailBox ); - + static void CopyToClipboardL( const TDesC& aBuf ); static TInt ShowConfirmationQueryL( TInt aResourceStringId, const TDesC& aResourceParameter = KNullDesC ); @@ -108,7 +108,7 @@ static void ShowErrorNoteL( TInt aResourceStringId, TBool aWaitingDialog = EFalse ); static void ShowInfoNoteL( TInt aResourceStringId, TBool aWaitingDialog = EFalse ); - + static void ShowGlobalErrorNoteL( TInt aResourceStringId ); static void ShowGlobalInfoNoteL( TInt aResourceStringId ); static void ShowDiscreetInfoNoteL( TInt aResourceStringId ); @@ -149,11 +149,11 @@ * @param aFilePath Path to where the file is to be saved * @param aAttachmentPart Message part of the attachment to be saved * @return ETrue if OK to save the file to a given path, EFalse if not - */ - static TBool OkToSaveFileL( const TDesC& aFilePath, CFSMailMessagePart& aAttachmentPart ); + */ + static TBool OkToSaveFileL( const TDesC& aFilePath, CFSMailMessagePart& aAttachmentPart ); - static void ShowFilesSavedToFolderNoteL( TInt aCount ); - + static void ShowFilesSavedToFolderNoteL( TInt aCount ); + static void ShowCreateMessageQueryL( const TDesC& aAddressData, TBool aSendingToEmail = EFalse ); static TInt CountRecepients( CFSMailMessage* aMsgPtr ); @@ -205,35 +205,35 @@ * @param aShowFlagCompleted Whether to show the completed flag. * When false we are in the editor view. */ - static TFollowUpNewState SetMessageFollowupFlagL( CFSMailMessage& aMsg, TBool aShowFlagCompleted = ETrue ); + static TFollowUpNewState SetMessageFollowupFlagL( CFSMailMessage& aMsg, TBool aShowFlagCompleted = ETrue ); static void SetMessageFollowupStateL( CFSMailMessage& aMsg, TFollowUpNewState aNewFollowUpState ); static TBool RunFollowUpListDialogL( TFollowUpNewState& aSelectedOption, TBool aShowFlagCompleted = ETrue ); - - static TFileType GetFileType( const TDesC& aFileName, const TDesC& aMimeType ); - - static CAlfTexture& GetAttachmentIcon( TFileType aAttachmentType, CFreestyleEmailUiTextureManager& aTextureManager ); - static TFSEmailUiTextures GetAttachmentIconTextureId( TFileType aAttachmentType ); - + + static TFileType GetFileType( const TDesC& aFileName, const TDesC& aMimeType ); + + static CAlfTexture& GetAttachmentIcon( TFileType aAttachmentType, CFreestyleEmailUiTextureManager& aTextureManager ); + static TFSEmailUiTextures GetAttachmentIconTextureId( TFileType aAttachmentType ); + static CAlfTexture& GetMsgIcon( CFSMailMessage* aMsgPtr, CFreestyleEmailUiTextureManager& aTextureManager ); static TFSEmailUiTextures GetMsgIconTextureId( CFSMailMessage* aMsgPtr ); - + static void MoveMessageToDraftsL( CFSMailBox& aMailBox, CFSMailMessage& aMsg ); - + static TBool IsMessagePartFullyFetched( const CFSMailMessagePart& aPart ); static TBool IsMessageStructureKnown( const CFSMailMessagePart& aPart ); - + static void CreatePlainTextPartL( CFSMailMessage& aMsg, CFSMailMessagePart*& aPart ); - + static TBool IsCompleteOrCancelEvent( TFSProgress aEvent ); - + static TBool HasUnfetchedAttachmentsL( CFSMailMessage& aMsg ); - + static TBool IsFollowUpSupported( const CFSMailBox& aMailBox ); - + // Set new email message icon on/off static void ToggleEmailIconL( TBool aIconOn ); - static void ToggleEmailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox ); + static void ToggleEmailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox ); static HBufC* DateTextFromMsgLC( const CFSMailMessage* aMessage, TBool aAddYearNumer = ETrue ); static HBufC* TimeTextFromMsgLC( const CFSMailMessage* aMessage ); @@ -249,16 +249,17 @@ static HBufC* CreateSubjectTextLC( const CFSMailMessage* aMessage ); static HBufC* CreateBodyTextLC( const CFSMailMessage* aMessage ); static void FilterListItemTextL( TDes& aText ); + static void FilterListItemText2L( TDes& aText ); static TMessageSizeClass MessageSizeClass( const CFSMailMessage& aMessage ); static HBufC* ConvertHtmlToTxtL( const TDesC& aHtml ); - + static void DisplayMsgsMovedNoteL( TInt aMsgCount, const TFSMailMsgId aDestinationFolderId, TBool aIsWaitingNote ); static TBool IsOfflineModeL(); - + /** * Shows mailbox creation query: * "No e-mail mailboxes defined. Create a mailbox?" @@ -267,14 +268,14 @@ */ static TBool DisplayCreateMailboxQueryL(); -// static CAlfTexture& GetAttachmentIconL( TFileType aAttachmentType, CFreestyleEmailUiTextureManager& aTextureManager ); -// static TFSEmailUiTextures GetAttachmentIconTextureIdL( TFileType aAttachmentType ); +// static CAlfTexture& GetAttachmentIconL( TFileType aAttachmentType, CFreestyleEmailUiTextureManager& aTextureManager ); +// static TFSEmailUiTextures GetAttachmentIconTextureIdL( TFileType aAttachmentType ); // Brings Freestyle Email UI application to foreground if it's not already static void BringFsEmailToForeground(); // Formats display name - static void StripDisplayName( HBufC& aDisplayName ); + static void StripDisplayName( HBufC& aDisplayName ); // Creates a displayname of firstname and lastname components static HBufC* CreateDisplayNameLC( const TDesC& aFirstname, const TDesC& aLastname, TBool aSwitchOrder = EFalse ); @@ -287,11 +288,6 @@ */ static TBool IsChineseWord( const TDesC& aWord ); - /** - * Determines if the descriptor is a Korean word - */ - static TBool IsKoreanWord( const TDesC& aWord ); - // Get the icon file name including the drive letter and full path static void GetFullIconFileNameL( TDes& aFileName ); @@ -369,7 +365,7 @@ */ class CFSEmailUiActionMenu : public CBase { - friend class CFreestyleEmailUiAppUi; + friend class CFreestyleEmailUiAppUi; public: /** * Get pointer to the action menu, can be used if built-in methods are @@ -378,19 +374,19 @@ * @return Action menu pointer */ static CFscContactActionMenu* GetActionMenu(); - + /** * Remove all items from action menu */ static void RemoveAllL(); - + /** * Add one email specific custom item by id * * @param aItemId Item id of the item to be added */ static void AddCustomItemL( TActionMenuCustomItemId aItemId ); - + /** * Add several email specific custom items by list of ids * @@ -398,7 +394,7 @@ */ static void AddCustomItemsL( RFsEActionMenuIdList aItemList ); - // + // /** * Execute previously constructed action menu * @@ -421,7 +417,7 @@ static TActionMenuCustomItemId ExecuteL( RFsEActionMenuIdList aItemList, TFscContactActionMenuPosition aPosition = EFscCenter, TInt aIndex = 0, MFsActionMenuPositionGiver* aPositionGiver = 0 ); - + /** * Dismiss menu * Menu gets closed if it was visible when the method was called. @@ -430,9 +426,9 @@ * @param aSlide If ETrue menu slides away from the screen. * Otherwise it disappears instantly */ - static void Dismiss( TBool aSlide ); + static void Dismiss( TBool aSlide ); // - + /** * Create icon by bitmap and mask * @@ -459,7 +455,7 @@ static TFileName iIconFilePath; static RPointerArray iIconArray; CFreestyleEmailUiAppUi* iAppUi; - }; + }; /** * Generic timer's callback @@ -540,7 +536,7 @@ */ CFSEmailUiGenericTimer( MFSEmailUiGenericTimerCallback* aCallback, const TInt aPriority ); - + private: /** * 2nd phase constructor. diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/FreestyleMessageHeaderURLEventHandler.h --- a/emailuis/emailui/inc/FreestyleMessageHeaderURLEventHandler.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleMessageHeaderURLEventHandler.h Wed Oct 13 14:11:15 2010 +0300 @@ -93,7 +93,6 @@ CFSHtmlReloadAO* iHTMLReloadAO; }; - /****************************************************************************** * class TPopupMenuItem ******************************************************************************/ @@ -136,6 +135,4 @@ RArray iItemList; }; - - #endif //__CFREESTYLE_MESSAGE_HEADER_EVENTHANDLER_URL_H__ diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/ncsaddressinputfield.h --- a/emailuis/emailui/inc/ncsaddressinputfield.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/ncsaddressinputfield.h Wed Oct 13 14:11:15 2010 +0300 @@ -126,7 +126,7 @@ const RPointerArray& GetAddressesL( TBool aParseNow=ETrue ); - void GetLineRect( TRect& aLineRect ) const; + void GetLineRectL( TRect& aLineRect ) const; void SetMaxLabelLength( TInt aMaxLength ); diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/ncsaifeditor.h --- a/emailuis/emailui/inc/ncsaifeditor.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/ncsaifeditor.h Wed Oct 13 14:11:15 2010 +0300 @@ -137,7 +137,6 @@ RPointerArray& aEntries, TBool aDisplayList = ETrue ) const; - TInt RepositionEntries( const CNcsAifEntry* aEntry ); void RepositionEntriesL( const CNcsAifEntry* aEntry ); void CheckAndRemoveInvalidEntriesL(); @@ -169,25 +168,13 @@ * @return ETrue if terminated recipient entry was found and added to array. */ TBool HandleTextUpdateL( const TCursorSelection& aSelection ); - // Moves inputted non-entry text to separate rows apart from entries. - void MoveNonEntryTextToDedicatedRowsL( TUint aPosition ); - // Prepares for text input to given cursor position. - void PrepareForTextInputL( TUint aPosition ); void HandleNavigationEventL(); - - // Gets non-entry text at given document position. TCursorSelection NonEntryTextAtPos( TUint aPosition ) const; - // Gets non-entry text including surrounding whitespace at given position. - TCursorSelection NonEntryTextAndSpaceAtPos( TUint aPosition ) const; - // Gets non-enty text right before given document position. TCursorSelection NonEntryTextBeforePos( TUint aPosition ) const; - TBool IsSentinel( TChar aCharacter ) const; - TBool IsDelimiter( TChar aCharacter ) const; TBool IsWhitespace( TChar aCharacter ) const; TBool IsNavigationKey( const TKeyEvent& aKeyEvent ) const; TBool IsCharacterKey( const TKeyEvent& aKeyEvent ) const; - void GetMatchingEntryCountsL( const CNcsAifEntry* aEntry, TInt& aNrOfMatchesInText, diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/ncsattachmentfield.h --- a/emailuis/emailui/inc/ncsattachmentfield.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/ncsattachmentfield.h Wed Oct 13 14:11:15 2010 +0300 @@ -27,6 +27,25 @@ class MNcsFieldSizeObserver; class CNcsHeaderContainer; +/** + * Interface for the attachment field observer + */ +class MNcsAttachmentFieldObserver + { +public: + /** + * AttachmentOpenL + * Informs observer that focused attachment should be opened + */ + virtual void AttachmentOpenL() = 0; + + /** + * AttachmentRemoveL + * Informs observer that focused attachment should be removed + */ + virtual void AttachmentRemoveL() = 0; + }; + /** * CNcsAttachmentField @@ -40,6 +59,7 @@ static CNcsAttachmentField* NewL( TInt aLabelTextId, MNcsFieldSizeObserver* aSizeObserver, + MNcsAttachmentFieldObserver* aObserver, CNcsHeaderContainer* aParentControl ); virtual ~CNcsAttachmentField(); @@ -55,8 +75,10 @@ void SetTextsLD( CDesCArray* aAttachmentNames, CDesCArray* aAttachmentSizes ); - TInt FocusedAttachmentLabelIndex(); - + TInt FocusedAttachmentLabelIndex() const; + + void SetFocusedAttachmentLabelIndex( TInt aIndex ); + public: // from MNcsControl TInt LineCount() const; @@ -85,18 +107,21 @@ void SetContainerWindowL( const CCoeControl& aContainer ); - void FocusChanged( TDrawNow aDrawNow ); + void FocusChanged( TDrawNow aDrawNow ); void HandleResourceChange( TInt aType ); void HandlePointerEventL( const TPointerEvent& aPointerEvent ); - + + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType ); + private: // methods - + CNcsAttachmentField( TInt aLabelTextId, MNcsFieldSizeObserver* aSizeObserver, + MNcsAttachmentFieldObserver* aObserver, CNcsHeaderContainer* aParentControl ); - + void ConstructL(); void UpdateColors(); @@ -124,9 +149,12 @@ void UpdateSingleAttachmentLabelTextL( CNcsLabel* aLabel, TInt aIndex ); private: // data - + CNcsHeaderContainer* iParentControl; // not owned - + + // attachment field observer + MNcsAttachmentFieldObserver* iObserver; + // attachment labels (within the array) owned RPointerArray iAttachmentLabels; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/ncscomposeview.h --- a/emailuis/emailui/inc/ncscomposeview.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/ncscomposeview.h Wed Oct 13 14:11:15 2010 +0300 @@ -80,16 +80,6 @@ // This is final commit, no more incoming changes EFinal }; - - // can't close view if ChildDoActivateL() - enum TChildActivationState - { - EChildActivationDeactivated, - EChildActivationStarted, - EChildActivationError, // error during activation - EChildActivationExitRequired, // activation ended, exit the view - EChildActivationProcessed - }; public: // constructors and destructor @@ -168,10 +158,6 @@ */ void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ); - /** - * to hide or show CAlfVisuals ( used for activation or deactivation ) - */ - virtual void FadeOut( TBool aDirectionOut ); public: // from MAlfActionObserver @@ -536,7 +522,6 @@ // Gets button from toolbar extension. CAknButton* Button( TInt aCmdId, CAknToolbarExtension* aExtension = NULL ); - TBool WLANConnectionActive(); private: // Constructors and destructor @@ -734,8 +719,6 @@ * Flag indicating that adding attachment dialog is opened. */ TBool iAddingAttachmentDialogOpened; - - TChildActivationState iChildActivationState; }; /** diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/ncscomposeviewcontainer.h --- a/emailuis/emailui/inc/ncscomposeviewcontainer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/ncscomposeviewcontainer.h Wed Oct 13 14:11:15 2010 +0300 @@ -100,12 +100,6 @@ void UpdateScrollBar(); /** - * Updates scroll visibility. - * @param aVisible Whether or not to set scroll bar visible. - */ - void UpdateScrollBarVisibility( TBool aVisible ); - - /** * GetToFieldAddressesL * Get addresses in TO-field. * @return Array of address objects. @@ -478,8 +472,14 @@ * HandleAttachmentsOpenCommand * */ - void HandleAttachmentsOpenCommandL(); - + void HandleAttachmentOpenCommandL(); + + /** + * HandleAttachmentRemoveCommandL + * Handles removing of currently focused attachment + */ + void HandleAttachmentRemoveCommandL(); + /** * LaunchStylusPopupMenu * @@ -497,10 +497,8 @@ void HandleLayoutChangeL(); void HandleSkinChangeL(); - + TInt ContentTotalHeight(); - TInt VisibleAreaHeight(); - /** * CommitL * Commits changes to message @@ -531,7 +529,7 @@ * Called when text formatting was cancelled. */ void FormatAllTextCancelled(); - + /** * Called when text formatting is complete. */ @@ -642,13 +640,13 @@ * @return Indicates whether the key event was used by this control. */ TKeyResponse ChangeFocusL( const TKeyEvent& aKeyEvent ); - + /** - * UpdateScreenPosition + * UpdateScreenPositionL * @param aKeyCode Needed to recognize presses of the enter key * in moving of display. */ - void UpdateScreenPosition( const TUint& aKeyCode = EKeyNull ); + void UpdateScreenPositionL( const TUint& aKeyCode = EKeyNull ); /** * CalculateSeparatorLineSecondaryColor @@ -780,18 +778,17 @@ * Currently processed field - needed by async text formatting. */ CNcsEditor* iProcessedField; - + /** * Async text formatter. * Own. */ CFSAsyncTextFormatter* iAsyncTextFormatter; - - // Cmail pane rect, calculated during SizeChanged. + + /** + * Pane rect calculated during ChangeSize. + */ TRect iCmailPaneRect; - // Header origin, calculated during SizeChanged. - TPoint iHeaderPos; - }; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/ncseditor.h --- a/emailuis/emailui/inc/ncseditor.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/ncseditor.h Wed Oct 13 14:11:15 2010 +0300 @@ -54,7 +54,7 @@ void OpenVirtualKeyBoardL(); - void GetLineRect( TRect& aLineRect ) const; + void GetLineRectL( TRect& aLineRect ) const; virtual TInt ScrollableLines() const; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/ncsheadercontainer.h --- a/emailuis/emailui/inc/ncsheadercontainer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/ncsheadercontainer.h Wed Oct 13 14:11:15 2010 +0300 @@ -27,19 +27,21 @@ #include "ncsaddressinputfield.h" #include "ncsfieldsizeobserver.h" #include "ncsconstants.h" -#include "ncspopuplistbox.h" + +#include "ncsattachmentfield.h" class CFSMailBox; -class CNcsAttachmentField; class CNcsEmailAddressObject; +class CNcsPopupListBox; class CNcsSubjectField; class CAknPhysics; /** * CNcsHeaderContainer */ -class CNcsHeaderContainer : public CCoeControl, public MNcsAddressPopupList, - public MNcsPopupListBoxObserver +class CNcsHeaderContainer : public CCoeControl, + public MNcsAddressPopupList, + public MNcsAttachmentFieldObserver { public: @@ -73,37 +75,27 @@ private: // constructor/destructor /** - * CNcsHeaderContainer - * C++ constructor. - * @param aParent Parent control. - * @param aMailBox reference to current mailbox item - */ - CNcsHeaderContainer( CCoeControl& aParent, CFSMailBox& aMailBox, CAknPhysics* aPhysics ); - - /** - * ConstructL - * 2nd phase constructor. - */ - void ConstructL( TInt aFlags ); + * CNcsHeaderContainer + * C++ constructor. + * @param aParent Parent control. + * @param aMailBox reference to current mailbox item + */ + CNcsHeaderContainer( CCoeControl& aParent, CFSMailBox& aMailBox, CAknPhysics* aPhysics ); + + /** + * ConstructL + * 2nd phase constructor. + */ + void ConstructL( TInt aFlags ); public: // function members - - /** - * From MNcsPopupListBoxObserver. - */ - TBool PopupVisibilityChangingL( TBool aVisible ); - - /** - * From MNcsPopupListBoxObserver. - */ - void PopupItemSelectedL(); - - /** - * GetToFieldAddressesL - * Get addresses in TO-field. - * @return Array of addresses. - */ - const RPointerArray& GetToFieldAddressesL( + + /** + * GetToFieldAddressesL + * Get addresses in TO-field. + * @return Array of addresses. + */ + const RPointerArray& GetToFieldAddressesL( TBool aParseNow = ETrue ); /** @@ -233,7 +225,7 @@ void SetAttachmentLabelTextsLD( CDesCArray* aAttachmentNames, CDesCArray* aAttachmentSizes ); - TInt FocusedAttachmentLabelIndex(); + TInt FocusedAttachmentLabelIndex() const; void ShowAttachmentLabelL(); void HideAttachmentLabel(); @@ -316,10 +308,12 @@ void SelectAllBccFieldTextL(); void SelectAllSubjectFieldTextL(); - - void FocusToField(); + + void FocusToField(); - void FocusAttachmentField(); + void FocusAttachmentField(); + + void SetFocusToBottom( TDrawNow aDrawNow = ENoDrawNow ); void SetPriority( TMsgPriority aPriority ); @@ -357,17 +351,18 @@ TBool IsAddressInputField( const CCoeControl* aControl ) const; TBool IsRemoteSearchInprogress() const; + + /** + * Shows/hides cursor. + * + * @param aShow ETrue - shows, EFalse - hides cursor. + */ + void ShowCursor( TBool aShow, TDrawNow aDrawNow = ENoDrawNow ); void DoScroll(); - void DoScrollFocusToTop(); - + void SetPhysicsEmulationOngoing( TBool aPhysOngoing ); - virtual void HandleResourceChange( TInt aType ); - - // Set origin for header's top position. - void SetOrigin( TPoint& aPoint ); - private: // Function members void FocusChanged(TDrawNow aDrawNow); @@ -378,8 +373,6 @@ void Draw( const TRect& aRect ) const; - void DrawAttachmentFocusNow(); - TKeyResponse ChangeFocusL( const TKeyEvent& aKeyEvent ); void SizeChanged(); @@ -412,6 +405,18 @@ void CommitFieldL( CCoeControl* aField ); +private: //From MNcsAttachmentFieldObserver + /** + * AttachmentOpenL + * Handles attachment open event from iAttachmentField + */ + void AttachmentOpenL(); + + /** + * AttachmentRemoveL + * Handles attachment remove event from iAttachmentField + */ + void AttachmentRemoveL(); private: //From MAknLongTapDetectorCallBack void HandleLongTapEventL( const TPoint& aPenEventLocation, @@ -419,47 +424,47 @@ private: // Data members - // Parent window. + /* + * Parent window + * Not Own + */ CCoeControl& iParent; MNcsFieldSizeObserver& iFieldSizeObserver; CAknLongTapDetector* iLongTapDetector; - + CEikButtonGroupContainer* iMenuBar; + + CNcsAddressInputField* iToField; - CNcsAddressInputField* iToField; CNcsAddressInputField* iCcField; + CNcsAddressInputField* iBccField; CNcsSubjectField* iSubjectField; CNcsAttachmentField* iAttachmentField; - // The attachments count + // The attachments count TInt iAttachmentCount; - // Popup for resently used email addressses. Own. - CNcsPopupListBox* iAacListBox; + // Address popup data members + CNcsPopupListBox* iAacListBox; - CFSMailBox& iMailBox; - + CFSMailBox& iMailBox; + //flag which disables changes of MSK label if any popup dialog is open TBool iSwitchChangeMskOff; TBool iLongTapEventConsumed; TBool iRALInProgress; - + // Currently focused control CCoeControl* iFocused; // panning related CAknPhysics* iPhysics; - - // Header containers default top left position. - TPoint iOrigin; - - TBool iSplitScreenVKBEnabled; }; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/ncspopuplistbox.h --- a/emailuis/emailui/inc/ncspopuplistbox.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/ncspopuplistbox.h Wed Oct 13 14:11:15 2010 +0300 @@ -30,66 +30,40 @@ class CAknsFrameBackgroundControlContext; class CFSEmailUiContactHandler; class CFSMailBox; +class CNcsHeaderContainer; class CFSEmailUiLayoutHandler; -class CFreestyleEmailUiAppUi; +class CFreestyleEmailUiAppUi; // // CLASS DECLARATION /** - * Observer interface to notify observer of item selection events and changes - * in popup's visibility. - */ -class MNcsPopupListBoxObserver - { -public: - - /** - * Visibility of component is changing. - * @param aVisible ETrue, if popup is coming visible. - * @return Observer should return ETrue, if visiblity change is allowed. - */ - virtual TBool PopupVisibilityChangingL( TBool aVisible ) = 0; - - /** - * Popup item is selected. - */ - virtual void PopupItemSelectedL() = 0; - - }; - - -/** * CNcsPopupListBox */ class CNcsPopupListBox : public CEikTextListBox, public MEikListBoxObserver, public MFSEmailUiContactHandlerObserver { -public: +public: // Constructors and destructor + + /* + * @param aMailBox reference to current mailbox item + */ + static CNcsPopupListBox* NewL( const CCoeControl* aParent, CFSMailBox& aMailBox, + CNcsHeaderContainer& aHeaderContainer, + TBool aRemoteLookupSupported ); /* - * @param aMailBox reference to current mailbox item - */ - static CNcsPopupListBox* NewL( const CCoeControl* aParent, - CFSMailBox& aMailBox, MNcsPopupListBoxObserver& aObserver, - TBool aRemoteLookupSupported ); - - /* - * @param aMailBox reference to current mailbox item - */ + * @param aMailBox reference to current mailbox item + */ void ConstructL( const CCoeControl* aParent ); /* - * Initialises popup and begins the search. - * @param aText Search text. - */ + * + * + * @param aText + */ void InitAndSearchL( const TDesC& aText, TInt aMode = -1 ); - - /** - * Hides the popup window. - */ - void ClosePopupL(); - + // Destructor virtual ~CNcsPopupListBox(); @@ -175,7 +149,7 @@ void SetScrollBarVisibilityL(); - void SetRemoteLookupItemToTheListL( TInt aIndex ); + void SetRemoteLookupItemFirstToTheListL(); enum TRemoteLookupItemMoveDirection { @@ -189,14 +163,13 @@ private: - CNcsPopupListBox( CFSMailBox& aMailbox, - MNcsPopupListBoxObserver& aObserver, - TBool aRemoteLookupSupported ); + CNcsPopupListBox( CNcsHeaderContainer& aHeaderContainer, + TBool aRemoteLookupSupported, CFSMailBox& aMailbox ); virtual void CreateItemDrawerL(); void UpdateListL(); - void UpdateVisibilityL( TBool aVisible ); + void UpdateTextColors(); // From CCoeControl. @@ -204,28 +177,25 @@ private: // data - // Background control context. Own. + CNcsHeaderContainer& iHeaderContainer; + CAknsFrameBackgroundControlContext* iBackgroundContext; - // Items matching the current searh string. Own. - RPointerArray iMatchingItems; + + RPointerArray iMatchingItems; + + CFSEmailUiContactHandler* iContactHandler; // Owned + CFSMailBox& iMailBox; - // Contact handler. - CFSEmailUiContactHandler* iContactHandler; - CFSMailBox& iMailBox; - // Observer for popup visibility changes. - MNcsPopupListBoxObserver& iObserver; - TRect iPopupMaxRect; - - CDesCArray* iItemTextsArray; - // Current search text. Own. - HBufC* iCurrentSearchText; - TInt iRemoteLookupItemPos; - - TBool iRemoteLookupSupported; - TBool iCachingInProgress; - - CFreestyleEmailUiAppUi* iAppUi; // not owned - + TRect iPopupMaxRect; + + CDesCArray* iItemTextsArray; + HBufC* iCurrentSearchText; + TInt iRemoteLookupItemPos; + + TBool iRemoteLookupSupported; + TBool iCachingInProgress; + + CFreestyleEmailUiAppUi* iAppUi; // not owned }; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/inc/ncssubjectfield.h --- a/emailuis/emailui/inc/ncssubjectfield.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/inc/ncssubjectfield.h Wed Oct 13 14:11:15 2010 +0300 @@ -29,7 +29,6 @@ class CEikImage; -class CAknButton; class MNcsFieldSizeObserver; class CNcsHeaderContainer; class CAknPhysics; @@ -80,9 +79,11 @@ const TDesC& GetLabelText() const; + // Platform layout change TInt LayoutLineCount() const; + // Platform layout change - void GetLineRect( TRect& aLineRect ) const; + void GetLineRectL( TRect& aLineRect ) const; void SetMaxLabelLength( TInt aMaxLength ); @@ -143,25 +144,23 @@ void UpdateFontSize(); + // void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + // private: // data CNcsHeaderContainer* iParentControl; // not owned /* - * label + * text field * Own */ CNcsLabel* iLabel; - - /** - * button - * Own - */ - CAknButton* iButton; - + +// Platform layout changes const CFont* iFont; // not owned, needs to be released in the end +// Platform layout changes /* * text field @@ -172,10 +171,16 @@ TInt iEditorMinimumHeight; TInt iMaximumLabelLength; + + TRgb iBorderColor; + + TRgb iBgColor; TBool iDrawAfterFocusChange; +// Platform layout changes TInt iEditorLineCount; +// Platform layout changes }; #endif // CNCSSUBJECTFIELD_H diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/loc/freestyleemailui.loc --- a/emailuis/emailui/loc/freestyleemailui.loc Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/loc/freestyleemailui.loc Wed Oct 13 14:11:15 2010 +0300 @@ -49,7 +49,7 @@ // l:cell_cmail_l_pane_t1 // r:TB9.1 // -#define qtn_fse_launcher_directory "Contact search" +#define qtn_fse_launcher_directory "Directory" // d:About item in launcher grid // l:cell_cmail_l_pane_t1 diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiAppui.cpp --- a/emailuis/emailui/src/FreestyleEmailUiAppui.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiAppui.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 - 2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -89,10 +89,6 @@ #include "cfsccontactactionmenu.h" // #include // for Layout_Meta_Data -#include -#include -#include "freestyleemailcenrepkeys.h" -#include // INTERNAL INCLUDE FILES #include "FreestyleEmailUiContactHandler.h" @@ -158,7 +154,6 @@ const TUint KConnectionStatusIconRotationInterval = 100; const TUint KFakeSyncAnimStopTimerInterval = 3000; // 3 secs const TInt KConnectionStatusIconRotationAmount = 18; -const TInt KFullCircleInDegrees = 360; // Length of the drive letter descriptor (e.g. "c:") const TInt KDriveDescLength = 2; @@ -749,7 +744,7 @@ // Destruction must be done here as other Tls data depends on it. CFSEmailDownloadInfoMediator::Destroy(); - delete iNaviDecorator; + delete iNaviDecorator2MailViewer; delete iConnectionStatusIconAnimTimer; delete iFakeSyncAnimStopTimer; @@ -892,19 +887,12 @@ return; } - if( aViewId == MailListId ) - { - // notify Eik that SplitInput was disabled when entering the list form homescreen - CEikAppUi::HandleResourceChangeL( KAknSplitInputDisabled ); - } - // Do nothing if the externally activated view was already active if ( iCurrentActiveView->Id() != aViewId ) { // this function removes setting view from view stack so // it cannot be active any more iSettingsViewActive = EFalse; - iPreviousActiveView = iCurrentActiveView; // Check if the view is in the history stack. In that case, we don't @@ -1359,6 +1347,7 @@ { iLastWsEventType = EEventKey; } + TInt key = aEvent.Key()->iScanCode; // // to disable voice commands during creating new mail message @@ -1504,15 +1493,6 @@ // CAknAppUi::HandleResourceChangeL( aType ); - if ( aType == KAknSplitInputEnabled || aType == KAknSplitInputDisabled ) - { - StatusPane()->MakeVisible( aType == KAknSplitInputDisabled ); - if ( iCurrentActiveView != NULL ) - { - iCurrentActiveView->HandleStatusPaneSizeChange(); - } - } - // Refresh mode is changed to manual to avoid any flickering during // resource change handling in list views. Trap any leaves so that we set // the automatic refresh mode back on even in case of error. @@ -1542,8 +1522,7 @@ // CAlfEnv::Static()->NotifySkinChangedL(); // } - if( aType == KEikDynamicLayoutVariantSwitch - || aType == KAknSplitInputEnabled || aType == KAknSplitInputDisabled ) + if ( aType == KEikDynamicLayoutVariantSwitch ) { // Changing layout for status pane (just in case it is not switched // correctly), fix for HMNN-82BAGR error @@ -1570,7 +1549,7 @@ { TRect screenRect; - screenRect = ClientRect(); + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); StatusPane()->DrawNow(); if(iEnv) { @@ -1588,8 +1567,6 @@ case KAknsMessageSkinChange: type = CFsEmailUiViewBase::ESkinChanged; break; - case KAknSplitInputEnabled: // fall though - case KAknSplitInputDisabled: // fall though case KEikDynamicLayoutVariantSwitch: type = CFsEmailUiViewBase::EScreenLayoutChanged; break; @@ -1608,7 +1585,8 @@ { iPendingLayoutSwitch = ETrue; } - if ( iCurrentActiveView && !iSettingsViewActive && !iMRViewer ) + + if ( iCurrentActiveView && !iSettingsViewActive ) { iCurrentActiveView->HandleDynamicVariantSwitchL( type ); } @@ -2592,7 +2570,7 @@ if ( iConnectionIconBitmap ) { TSize iconSize = LayoutHandler()->statusPaneIconSize(); - AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); + AknIconUtils::SetSize( iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved ); } titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconBitmap && iConnectionIconMask); } @@ -2702,7 +2680,7 @@ if ( iConnectionIconBitmap ) { TSize iconSize( LayoutHandler()->statusPaneIconSize() ); - AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); + AknIconUtils::SetSize( iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved ); } titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconMask && iConnectionIconBitmap ); if (startTimer) @@ -3034,6 +3012,7 @@ { return iLastWsEventType; } + // CFreestyleEmailUiAppUi::RunFakeSyncAnimL // ----------------------------------------------------------------------------- void CFreestyleEmailUiAppUi::RunFakeSyncAnimL() @@ -3063,15 +3042,13 @@ iConnectionIconMask ); if ( iConnectionIconBitmap && iConnectionIconMask ) { - AknIconUtils::SetSizeAndRotation( - iConnectionIconBitmap, - LayoutHandler()->statusPaneIconSize(), - EAspectRatioNotPreserved, - iConnectionStatusIconAngle ); - - titlePane->SetSmallPicture( - iConnectionIconBitmap, - iConnectionIconMask, + AknIconUtils::SetSize( + iConnectionIconBitmap, + LayoutHandler()->statusPaneIconSize(), + EAspectRatioNotPreserved ); + titlePane->SetSmallPicture( + iConnectionIconBitmap, + iConnectionIconMask, ETrue ); iConnectionStatusIconAnimTimer->Start( KConnectionStatusIconRotationInterval ); @@ -3085,6 +3062,60 @@ } } +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +void CFreestyleEmailUiAppUi::ConstructNaviPaneL() + { + FUNC_LOG; + + CAknNavigationControlContainer* naviPaneContainer = + static_cast( + StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); + + // Following navipane is for mailviewer view + if ( !iNaviDecorator2MailViewer ) + { + // Constructing a decorator with own decorated control, + // which is (currently an empty) container. + CFreestyleEmailUiNaviPaneControlContainer2MailViewer* c = + CFreestyleEmailUiNaviPaneControlContainer2MailViewer::NewL(); + c->SetContainerWindowL( *naviPaneContainer ); + iNaviDecorator2MailViewer = CAknNavigationDecorator::NewL( + naviPaneContainer, + c, + CAknNavigationDecorator::ENotSpecified ); + + // In order to get navi arrows visible, they must be set visible AND not dimmed... + iNaviDecorator2MailViewer->SetContainerWindowL( *naviPaneContainer ); + iNaviDecorator2MailViewer->MakeScrollButtonVisible( ETrue ); + iNaviDecorator2MailViewer->SetScrollButtonDimmed( CAknNavigationDecorator::ELeftButton, EFalse ); + iNaviDecorator2MailViewer->SetScrollButtonDimmed( CAknNavigationDecorator::ERightButton, EFalse ); + + iNaviDecorator2MailViewer->SetComponentsToInheritVisibility( ETrue ); + naviPaneContainer->PushL( *iNaviDecorator2MailViewer ); + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +CAknNavigationDecorator* CFreestyleEmailUiAppUi::NaviDecoratorL( const TUid aViewId ) + { + FUNC_LOG; + CAknNavigationDecorator* decorator( NULL ); + // Depending on who's asking, return proper navipane instance + if ( aViewId.iUid == MailViewerId.iUid ) + { + if ( !iNaviDecorator2MailViewer ) + { + ConstructNaviPaneL(); + } + decorator = iNaviDecorator2MailViewer; + } + return decorator; + } + void CFreestyleEmailUiAppUi::TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer ) { if ( aTriggeredTimer == iConnectionStatusIconAnimTimer ) @@ -3103,7 +3134,6 @@ TSize iconSize = LayoutHandler()->statusPaneIconSize(); iConnectionStatusIconAngle += KConnectionStatusIconRotationAmount; - iConnectionStatusIconAngle %= KFullCircleInDegrees; AknIconUtils::SetSizeAndRotation(iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved, iConnectionStatusIconAngle); titlePane->DrawNow(); iConnectionStatusIconAnimTimer->Start(KConnectionStatusIconRotationInterval); @@ -3175,35 +3205,7 @@ } } -void CFreestyleEmailUiAppUi::SetNaviPaneTextL( const TDesC& aText ) - { - if (aText.Length()) - { - CAknNavigationControlContainer* np = - static_cast( - StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - - if (!iNaviDecorator) - { - iNaviDecorator = np->CreateNavigationLabelL( KNullDesC() ); - np->PushL( *iNaviDecorator ); - } - CAknNaviLabel* naviLabel = static_cast( iNaviDecorator->DecoratedControl() ); - if( naviLabel ) - { - naviLabel->SetTextL( aText ); - iNaviDecorator->DrawDeferred(); - } - } - else - { - if (iNaviDecorator) - { - delete iNaviDecorator; - iNaviDecorator = NULL; - } - } - } + //////////////////////////////////////////////////////////////////////////////// // diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp --- a/emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -16,17 +16,19 @@ */ #include "emailtrace.h" -#include -#include -#include -#include "cfsmailbox.h" +#include // CEikonEnv +#include // CRepository +#include // KCRUidAknFep +// +#include "cfsmailbox.h" // cfsmailbox +// #include #include #include -#include "FreestyleEmailUiCLSListsHandler.h" -#include "FreestyleEMailUiCLSMatchObserverInterface.h" -#include "FreestyleEmailUiInputModeObserver.h" +#include "FreestyleEmailUiCLSListsHandler.h" // CFSEmailUiClsListsHandler +#include "FreestyleEMailUiCLSMatchObserverInterface.h"// CFSEmailUiClsContactMatchObserver +#include "FreestyleEmailUiInputModeObserver.h" // CFSEmailUiInputModeObserver #include "FreestyleEmailUiUtilities.h" #include "FreestyleEmailUiCLSItem.h" @@ -35,7 +37,7 @@ // CFSEmailUiClsListsHandler::NewL // ----------------------------------------------------------------------------- CFSEmailUiClsListsHandler* CFSEmailUiClsListsHandler::NewL( RFs& aFs, - CVPbkContactManager* aContactManager ) + CVPbkContactManager* aContactManager ) { FUNC_LOG; CFSEmailUiClsListsHandler* object = @@ -47,12 +49,10 @@ // ----------------------------------------------------------------------------- // CFSEmailUiClsListsHandler::NewLC // ----------------------------------------------------------------------------- -CFSEmailUiClsListsHandler* CFSEmailUiClsListsHandler::NewLC( - RFs& aFs, CVPbkContactManager* aContactManager ) +CFSEmailUiClsListsHandler* CFSEmailUiClsListsHandler::NewLC( RFs& aFs, CVPbkContactManager* aContactManager ) { FUNC_LOG; - CFSEmailUiClsListsHandler* object = - new (ELeave) CFSEmailUiClsListsHandler( aFs, aContactManager ); + CFSEmailUiClsListsHandler* object = new (ELeave) CFSEmailUiClsListsHandler( aFs, aContactManager ); CleanupStack::PushL( object ); object->ConstructL(); return object; @@ -85,55 +85,52 @@ const RPointerArray& aMatches ) { FUNC_LOG; - - TInt matchCount = aMatches.Count(); - for( TInt i = 0 ; i < matchCount ; ++i ) + for( TInt i = 0 ; i < aMatches.Count() ; ++i ) { - if( aMatches[i]->IsMruItem() ) - { - // MRU items are added to iMatchingMRUContacts and any already - // added duplicate is removed from iMatchingCompleteContacts - iMatchingMRUContacts.AppendL( aMatches[i] ); - TInt itemIndex = FindDuplicate( *aMatches[i], - iMatchingCompleteContacts ); - if ( KErrNotFound != itemIndex ) - { - iMatchingCompleteContacts.Remove( itemIndex ); - } - } - else if( aMatches[i]->EmailAddress().Length() > 0 ) - { - // For Phonebook items, it is checked that it there doesn't - // already exist a duplicate in iMatchingMRUContacts - if( KErrNotFound == - FindDuplicate( *aMatches[i], iMatchingMRUContacts ) ) - { - // No duplicate in iMatchingMRUContacts, - // this can be appended to iMatchingCompleteContacts - iMatchingCompleteContacts.AppendL( aMatches[i] ); - } - } - else - { - // No email, add always to the end of the list - iMatchingMissingEmailContacts.AppendL( aMatches[i] ); - } - } - - RPointerArray allMatches = - ConstructOneListL( iMatchingCompleteContacts, - iMatchingMRUContacts, - iMatchingMissingEmailContacts ); + if( aMatches[i]->IsMruItem() ) + { + // If this is MRU item, we need to check that it doesn't + // already exist in iMatchingCompleteContacts + TInt itemIndex = FindDuplicate( *aMatches[i], iMatchingCompleteContacts ); + if( itemIndex == KErrNotFound ) + { + iMatchingMRUContacts.AppendL( aMatches[i] ); + } + + } + else if( aMatches[i]->EmailAddress().Length() > 0 ) + { + // If this is Phonebook item, we need to check that it doesn't + // already exist in iMatchingMRUContacts + TInt itemIndex = FindDuplicate( *aMatches[i], iMatchingMRUContacts ); + if( itemIndex != KErrNotFound ) + { + // Found, this needs to be removed from the MRU list + iMatchingMRUContacts.Remove( itemIndex ); + } + + // Phonebook items are always added to the top of the list + iMatchingCompleteContacts.AppendL( aMatches[i] ); + } + else + { + // No email, nothing to compare, so add this always to the end of the list + iMatchingMissingEmailContacts.AppendL( aMatches[i] ); + } + } + + RPointerArray allMatches = ConstructOneListL( iMatchingCompleteContacts, + iMatchingMRUContacts, + iMatchingMissingEmailContacts ); CleanupResetAndDestroyClosePushL( allMatches ); // Ownership is taken iClsListObserver->ArrayUpdatedL( allMatches ); - CleanupStack::PopAndDestroy( &allMatches ); + CleanupStack::PopAndDestroy(&allMatches ); // Array is released, destructors are called } // ----------------------------------------------------------------------------- // CFSEmailUiClsListsHandler::InputModeChangedL // ----------------------------------------------------------------------------- -void CFSEmailUiClsListsHandler::InputModeChangedL( - TKeyboardModes aNewInputMode ) +void CFSEmailUiClsListsHandler::InputModeChangedL( TKeyboardModes aNewInputMode ) { FUNC_LOG; iPcsMatchObserver->SetInputMode( aNewInputMode ); @@ -171,8 +168,7 @@ // ----------------------------------------------------------------------------- // CFSEmailUiClsListsHandler::CFSEmailUiClsListsHandler // ----------------------------------------------------------------------------- -CFSEmailUiClsListsHandler::CFSEmailUiClsListsHandler( - RFs& aFs, CVPbkContactManager* aContactManager ) : +CFSEmailUiClsListsHandler::CFSEmailUiClsListsHandler( RFs& aFs, CVPbkContactManager* aContactManager ) : iContactManager( aContactManager ), iClsListObserver( NULL ), iFs( aFs ), @@ -189,19 +185,20 @@ void CFSEmailUiClsListsHandler::ConstructL() { FUNC_LOG; - iRequestHandler = CPSRequestHandler::NewL(); + iRequestHandler = CPSRequestHandler::NewL(); + iAknFepCenRep = CRepository::NewL( KCRUidAknFep ); - iPcsMatchObserver = CFSEmailUiClsMatchObserver::NewL( - *iAknFepCenRep, *this, *iRequestHandler, iContactManager ); + + iPcsMatchObserver = CFSEmailUiClsMatchObserver::NewL( *iAknFepCenRep, *this, *iRequestHandler, iContactManager ); SetSearchSettingsForPcsMatchObserverL(); // Monitors inputMode changes (predictive vs. non-predictive iInputObserver = CFSEmailUiInputModeObserver::NewL( *iAknFepCenRep, *this ); if( !iSearchedText ) - { iSearchedText = KNullDesC().AllocL(); - } + + //iRemoteLookupSupported = TFsEmailUiUtility::IsRemoteLookupSupported( *iMailBox ); } // ----------------------------------------------------------------------------- @@ -218,24 +215,19 @@ // ----------------------------------------------------------------------------- // CFSEmailUiClsListsHandler::ReadCLSInfoFromMRUListIndexL // ----------------------------------------------------------------------------- -TBool CFSEmailUiClsListsHandler::ReadCLSInfoFromMRUListIndexL( - MDesCArray& aTextArray, - CFSEmailUiClsItem& aClsItem, - TInt aCurrentMatchIndex, - TInt aPreviousMatchIndex ) +TBool CFSEmailUiClsListsHandler::ReadCLSInfoFromMRUListIndexL( MDesCArray& aTextArray, + CFSEmailUiClsItem& aClsItem, + const TInt aCurrentMatchIndex, const TInt aPreviousMatchIndex ) { FUNC_LOG; TBool retVal = EFalse; // This should be even number - TInt currentRealItemIndex = - aCurrentMatchIndex - ( aCurrentMatchIndex % 2 ); + TInt currentRealItemIndex = aCurrentMatchIndex - ( aCurrentMatchIndex % 2 ); // Here we need to check if match is found both from the display name and email address if( currentRealItemIndex != aPreviousMatchIndex ) { - aClsItem.SetDisplayNameL( - aTextArray.MdcaPoint( currentRealItemIndex ) ); - aClsItem.SetEmailAddressL( - aTextArray.MdcaPoint( currentRealItemIndex + 1 ) ); + aClsItem.SetDisplayNameL( aTextArray.MdcaPoint( currentRealItemIndex ) ); + aClsItem.SetEmailAddressL( aTextArray.MdcaPoint( currentRealItemIndex + 1 ) ); retVal = ETrue; } return retVal; @@ -245,9 +237,8 @@ // ----------------------------------------------------------------------------- // CFSEmailUiClsListsHandler::FindAndDestroyDuplicate // ----------------------------------------------------------------------------- -TInt CFSEmailUiClsListsHandler::FindDuplicate( - const CFSEmailUiClsItem& aClsItem, - RPointerArray& aContacts ) +TInt CFSEmailUiClsListsHandler::FindDuplicate( const CFSEmailUiClsItem& aClsItem, + RPointerArray& aContacts ) { FUNC_LOG; // find duplicate email addresses from aContacts @@ -270,38 +261,35 @@ // CFSEmailUiClsListsHandler::ConstructOneListL // ----------------------------------------------------------------------------- RPointerArray CFSEmailUiClsListsHandler::ConstructOneListL( - const RPointerArray& aContactMatchesWithEmail, - const RPointerArray& aMRUMatches, - const RPointerArray& aContactMatchesWithoutEmail ) + const RPointerArray& aContactMatchesWithEmail, + const RPointerArray& aMRUMatches, + const RPointerArray& aContactMatchesWithoutEmail ) { FUNC_LOG; RPointerArray allMatches; CleanupResetAndDestroyClosePushL( allMatches ); // Copy all the objects from three other lists to the all matches list - TInt matchingMRUItemsCount = aMRUMatches.Count(); - for ( TInt i = 0 ; i < matchingMRUItemsCount ; i++ ) - { - CFSEmailUiClsItem* newClsItem = CopyClsItemLC( *aMRUMatches[i] ); - allMatches.AppendL( newClsItem ); - CleanupStack::Pop( newClsItem ); - } - TInt matchingComleteItemsCount = aContactMatchesWithEmail.Count(); for( TInt i = 0 ; i < matchingComleteItemsCount; i++ ) { - CFSEmailUiClsItem* newClsItem = - CopyClsItemLC( *aContactMatchesWithEmail[i] ); + CFSEmailUiClsItem* newClsItem = CopyClsItemLC( *aContactMatchesWithEmail[i] ); allMatches.AppendL( newClsItem ); CleanupStack::Pop( newClsItem ); } - TInt mathingContactItemsWithoutEmailCount = - aContactMatchesWithoutEmail.Count(); + TInt matchingMRUItemsCount = aMRUMatches.Count(); + for ( TInt i = 0 ; i < matchingMRUItemsCount ; i++ ) + { + CFSEmailUiClsItem* newClsItem = CopyClsItemLC( *aMRUMatches[i] ); + allMatches.AppendL( newClsItem ); + CleanupStack::Pop( newClsItem ); + } + + TInt mathingContactItemsWithoutEmailCount = aContactMatchesWithoutEmail.Count(); for( TInt i = 0 ; i < mathingContactItemsWithoutEmailCount ; i++ ) { - CFSEmailUiClsItem* newClsItem = - CopyClsItemLC( *aContactMatchesWithoutEmail[i] ); + CFSEmailUiClsItem* newClsItem = CopyClsItemLC( *aContactMatchesWithoutEmail[i] ); allMatches.AppendL( newClsItem ); CleanupStack::Pop( newClsItem ); } @@ -318,15 +306,15 @@ FUNC_LOG; // Create predictive search settings CPsSettings* searchSettings = CPsSettings::NewL(); - CleanupStack::PushL( searchSettings ); + CleanupStack::PushL(searchSettings); RPointerArray databases; - CleanupClosePushL( databases ); + CleanupClosePushL(databases); - HBufC* store1 = HBufC::NewLC( 50 ); - store1->Des().Copy( KVPbkDefaultCntDbURI ); // Phone contacts store + HBufC* store1 = HBufC::NewLC(50); + store1->Des().Copy( KVPbkDefaultCntDbURI ); // To specify phone contacts store - databases.AppendL( store1 ); + databases.AppendL(store1); HBufC* store2 = NULL; if ( iMailBox ) { @@ -334,7 +322,7 @@ GetMruDatastoreUriFromMailbox( *iMailBox, *store2 ); databases.AppendL( store2 ); } - searchSettings->SetSearchUrisL( databases ); + searchSettings->SetSearchUrisL(databases); // Set displayfields according to sort order RArray sortOrder; @@ -342,8 +330,7 @@ iRequestHandler->GetSortOrderL( *store1, sortOrder ); if ( sortOrder.Count() ) { - iUseLastNameFirstOrder = - ( sortOrder[0] == R_VPBK_FIELD_TYPE_LASTNAME ); + iUseLastNameFirstOrder = ( sortOrder[0] == R_VPBK_FIELD_TYPE_LASTNAME ); } else { @@ -351,14 +338,8 @@ } RArray displayFields( 6 ); CleanupClosePushL( displayFields ); - if ( sortOrder.Count() ) - { - displayFields.AppendL( sortOrder[0] ); - } - if ( sortOrder.Count() >= 1 ) - { - displayFields.AppendL( sortOrder[1] ); - } + displayFields.AppendL( sortOrder[0] ); + if ( sortOrder.Count() >= 1 ) displayFields.AppendL( sortOrder[1] ); displayFields.AppendL( R_VPBK_FIELD_TYPE_EMAILGEN ); displayFields.AppendL( R_VPBK_FIELD_TYPE_EMAILHOME ); displayFields.AppendL( R_VPBK_FIELD_TYPE_EMAILWORK ); @@ -368,22 +349,26 @@ displayFields.Close(); sortOrder.Close(); + // Set maximum for search results + //How many results is shown on the screen?? + //searchSettings->SetMaxResults(const TInt aMaxResults); + // Set the new search settings - iRequestHandler->SetSearchSettingsL( *searchSettings ); + iRequestHandler->SetSearchSettingsL(*searchSettings); if ( store2 ) { - CleanupStack::PopAndDestroy( store2 ); + CleanupStack::PopAndDestroy(store2); } - CleanupStack::PopAndDestroy( store1 ); - CleanupStack::Pop( &databases ); + CleanupStack::PopAndDestroy(store1); + CleanupStack::Pop(&databases); databases.Close(); - CleanupStack::PopAndDestroy( searchSettings ); + CleanupStack::PopAndDestroy(searchSettings); } // ----------------------------------------------------------------------------- -// CFSEmailUiClsListsHandler::IsLanguageSupported() +// CFSEmailUiClsListsHandler::isLanguageSupported() // ----------------------------------------------------------------------------- TBool CFSEmailUiClsListsHandler::IsLanguageSupportedL() { @@ -392,14 +377,10 @@ TLanguage lang = User::Language(); // Check for language support - return iRequestHandler->IsLanguageSupportedL( lang ); + return iRequestHandler->IsLanguageSupportedL(lang); } -// ----------------------------------------------------------------------------- -// CFSEmailUiClsListsHandler::GetMruDatastoreUriFromMailbox() -// ----------------------------------------------------------------------------- -void CFSEmailUiClsListsHandler::GetMruDatastoreUriFromMailbox( - CFSMailBox& aMailbox, HBufC& aUri ) +void CFSEmailUiClsListsHandler::GetMruDatastoreUriFromMailbox( CFSMailBox& aMailbox, HBufC& aUri ) { FUNC_LOG; aUri.Des().Copy( KDefaultMailBoxURI ); @@ -408,19 +389,12 @@ aUri.Des().AppendNum( aMailbox.GetId().Id() ); } -// ----------------------------------------------------------------------------- -// CFSEmailUiClsListsHandler::SetObserver() -// ----------------------------------------------------------------------------- -void CFSEmailUiClsListsHandler::SetObserver( - MFSEmailUiClsListsObserver* aClsListObserver ) +void CFSEmailUiClsListsHandler::SetObserver( MFSEmailUiClsListsObserver* aClsListObserver ) { FUNC_LOG; iClsListObserver = aClsListObserver; } -// ----------------------------------------------------------------------------- -// CFSEmailUiClsListsHandler::SetCurrentMailboxL() -// ----------------------------------------------------------------------------- void CFSEmailUiClsListsHandler::SetCurrentMailboxL( CFSMailBox* aMailBox ) { FUNC_LOG; @@ -443,18 +417,12 @@ } } -// ----------------------------------------------------------------------------- -// CFSEmailUiClsListsHandler::OperationErrorL() -// ----------------------------------------------------------------------------- void CFSEmailUiClsListsHandler::OperationErrorL( TInt aErrorCode ) { FUNC_LOG; iClsListObserver->OperationErrorL( aErrorCode ); } -// ----------------------------------------------------------------------------- -// CFSEmailUiClsListsHandler::UseLastNameFirstOrder() -// ----------------------------------------------------------------------------- TBool CFSEmailUiClsListsHandler::UseLastNameFirstOrder() { FUNC_LOG; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp --- a/emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -83,14 +83,7 @@ //Constants const TInt KInternetCallPreferred = 1; -/** UID of the CCA details view plugin implementation - * ( from ccappdetailsviewpluginuids.hrh ) */ -const TInt KCCADetailsViewPluginImplmentationUid = 0x200159E7; -/** CCA Application - * ( from ccauids.h )*/ -const TInt KCCAAppUID = 0x2000B609; -/** Phonebook2 App UID */ -const TInt KPbkUID3 = 0x101f4cce; + CFSEmailUiContactHandler* CFSEmailUiContactHandler::NewL( RFs& aSession ) { @@ -343,11 +336,13 @@ { dialData->SetCallType( CAiwDialData::EAIWVoiP ); } + // video call else if ( iVideoCall ) { iVideoCall = EFalse; dialData->SetCallType( CAiwDialData::EAIWForcedVideo ); } + // else { dialData->SetCallType( CAiwDialData::EAIWVoice ); @@ -359,11 +354,13 @@ { dialData->SetCallType( CAiwDialData::EAIWVoiP ); } + // video call else if ( iVideoCall ) { iVideoCall = EFalse; dialData->SetCallType( CAiwDialData::EAIWForcedVideo ); } + // else { dialData->SetCallType( CAiwDialData::EAIWVoice ); @@ -504,22 +501,22 @@ } } +// video call // --------------------------------------------------------------------------- // Enables/disables video call. // --------------------------------------------------------------------------- // void CFSEmailUiContactHandler::SetVideoCall( TBool aState ) { - FUNC_LOG; iVideoCall = aState; } +// -// --------------------------------------------------------------------------- +///////////////////////////////////////////////////////////////////////////// // CFSEmailUiContactHandler::GetSmsAddressFromPhonebookAndSendL -// --------------------------------------------------------------------------- // -void CFSEmailUiContactHandler::GetSmsAddressFromPhonebookAndSendL( - MVPbkContactLink* aContactLink ) +///////////////////////////////////////////////////////////////////////////// +void CFSEmailUiContactHandler::GetSmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink ) { FUNC_LOG; if ( iState == EContactHandlerIdle ) @@ -553,12 +550,12 @@ } } -// --------------------------------------------------------------------------- +///////////////////////////////////////////////////////////////////////////// // CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL -// --------------------------------------------------------------------------- // -void CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL( - MVPbkContactLink* aContactLink, TBool aIsVoiceMessage ) +///////////////////////////////////////////////////////////////////////////// +void CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink, + TBool aIsVoiceMessage ) { FUNC_LOG; if ( iState == EContactHandlerIdle ) @@ -599,35 +596,10 @@ } } -// --------------------------------------------------------------------------- -// Retrieves the first contact in contact link set. -// --------------------------------------------------------------------------- +///////////////////////////////////////////////////////////////////////////// +// CFSEmailUiContactHandler::ArrayUpdatedL // -void CFSEmailUiContactHandler::RetrieveContactsL() - { - FUNC_LOG; - if ( iLinksSet->Count() ) - { - delete iCurrentLink; - iCurrentLink = NULL; - - iCurrentLink = iLinksSet->At(0).CloneLC(); - CleanupStack::Pop(); - - delete iLinkOperationFetch; - iLinkOperationFetch = NULL; - - //Async operation, callback VPbkSingleContactOperationCompleteL - //Error situations: VPbkSingleContactOperationFailed - iLinkOperationFetch = iContactManager->RetrieveContactL( - *iCurrentLink, *this ); - } - } - -// --------------------------------------------------------------------------- -// CFSEmailUiContactHandler::ArrayUpdatedL -// --------------------------------------------------------------------------- -// +///////////////////////////////////////////////////////////////////////////// void CFSEmailUiContactHandler::ArrayUpdatedL( const RPointerArray& aMatchingItems ) { @@ -656,7 +628,7 @@ { if ( !iSearchMatch ) { - iSearchMatch = CFSEmailUiClsItem::NewL(); + iSearchMatch = CFSEmailUiClsItem::NewL(); } iSearchMatch->SetDisplayNameL( aMatchingItems[0]->DisplayName() ); iSearchMatch->SetEmailAddressL( aMatchingItems[0]->EmailAddress() ); @@ -699,9 +671,9 @@ { iCachingInProgressError = EFalse; iState = EContactHandlerIdle; - iHandlerObserver->OperationErrorL( ESearchContacts, aErrorCode ); - } - } + iHandlerObserver->OperationErrorL( ESearchContacts, aErrorCode ); + } + } else { iState = EContactHandlerIdle; @@ -720,12 +692,14 @@ MVPbkStoreContact* aContact ) { FUNC_LOG; - //inform also client in case of error to enable client's actions (i.e. return search priority) +//inform also client in case of error to enable client's actions (i.e. return search priority) +// TRAP_IGNORE( VPbkSingleContactOperationCompleteL( aOperation, aContact) ); TRAPD(error, VPbkSingleContactOperationCompleteL( aOperation, aContact) ); if ( error != KErrNone ) { TRAP_IGNORE(ObserverOperationErrorL( CurrentCommand(), error )); } +// } void CFSEmailUiContactHandler::VPbkSingleContactOperationCompleteL( @@ -746,28 +720,23 @@ CleanupResetAndDestroyClosePushL( emailAddresses ); GetContactFieldsL( iFirstnameFields, firstname, aContact ); GetContactFieldsL( iLastnameFields, lastname, aContact ); - + // Create display name, this will be used in UI. TInt dispNameLength = 1; if ( firstname.Count() ) dispNameLength += firstname[0]->Length(); if ( lastname.Count() ) dispNameLength += lastname[0]->Length(); HBufC* displayname = HBufC::NewLC( dispNameLength ); - TPtr displaynamePtr = displayname->Des(); - if ( firstname.Count() && firstname[0]->Length() ) + + if ( firstname.Count() ) { - displaynamePtr.Copy( *firstname[0] ); - - // Append space only when both firstname and lastname are present. - if ( lastname.Count() && lastname[0]->Length() ) - { - displaynamePtr.Append( KSpace ); - } + displayname->Des().Copy( *firstname[0] ); + displayname->Des().Append( KSpace ); } if ( lastname.Count() ) { - displaynamePtr.Append( *lastname[0] ); + displayname->Des().Append( *lastname[0] ); } - + // retrieve selected email address MVPbkStoreContactFieldCollection& fields = aContact->Fields(); MVPbkBaseContactField* selectedField = fields.RetrieveField( *iCurrentLink ); @@ -792,6 +761,7 @@ CleanupStack::PopAndDestroy( selectedEmailAddress ); selectedEmailAddress = NULL; + CleanupStack::PopAndDestroy( displayname ); CleanupStack::PopAndDestroy( &emailAddresses ); CleanupStack::PopAndDestroy( &lastname ); @@ -800,17 +770,12 @@ // Get index of Next ContactLink if there's no LinkSet // or iCurrenLink index is set to 0 - TInt index = ( iLinksSet && iCurrentLink ? - iLinksSet->Find( *iCurrentLink ) + 1 : 0 ); - - if ( iLinksSet && index < iLinksSet->Count() ) + TInt index = (iLinksSet && iCurrentLink ? iLinksSet->Find + (*iCurrentLink) + 1 : 0); + + if (iLinksSet && index < iLinksSet->Count()) { - delete iCurrentLink; - iCurrentLink = NULL; - - iCurrentLink = iLinksSet->At(index).CloneLC(); - CleanupStack::Pop(); - + iCurrentLink = &iLinksSet->At(index); delete iLinkOperationFetch; iLinkOperationFetch = NULL; @@ -824,9 +789,7 @@ delete iLinkOperationFetch; iLinkOperationFetch = NULL; - delete iCurrentLink; iCurrentLink = NULL; - iState = EContactHandlerIdle; delete iLinksSet; iLinksSet = NULL; @@ -841,7 +804,7 @@ } else if ( (iLinkOperationFetch == &aOperation) && (iState == EContactHandlerCallToContactByEmail ) ) - { + { CleanupDeletePushL( aContact ); RPointerArray phonenumbers; @@ -871,7 +834,7 @@ } else { - TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); + TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); //no phone number found - inform client to enable its actions (i.e. return search priority) ObserverOperationErrorL( EFindAndCallToContactByEmailL, KErrNotFound ); } @@ -879,12 +842,10 @@ } CleanupStack::PopAndDestroy( aContact ); - } + } // Addition to get contact for message creation. - else if ( (iLinkOperationFetch == &aOperation) && - ( iMsgCreationHelperState == EContactHandlerGetSmsAddressFromPhonebook || - iMsgCreationHelperState == EContactHandlerGetMmsAddressFromPhonebook || - iMsgCreationHelperState == EContactHandlerGetVoiceMsgAddressFromPhonebook ) ) + else if ( (iLinkOperationFetch == &aOperation) && ( iMsgCreationHelperState == EContactHandlerGetSmsAddressFromPhonebook || + iMsgCreationHelperState == EContactHandlerGetMmsAddressFromPhonebook || iMsgCreationHelperState == EContactHandlerGetVoiceMsgAddressFromPhonebook ) ) { if ( iContactForMsgCreation ) { @@ -899,7 +860,7 @@ // Store contact iContactForMsgCreation = aContact; // Create clonelink for address selection - MVPbkContactLink* cloneLink = iCurrentLink->CloneLC(); + MVPbkContactLink* cloneLink = iCurrentLink->CloneLC(); CleanupStack::Pop(); switch ( iMsgCreationHelperState ) { @@ -949,11 +910,7 @@ } } -// --------------------------------------------------------------------------- -// From MVPbkContactStoreListObserver. -// Called when the opening process is complete. -// --------------------------------------------------------------------------- -// + void CFSEmailUiContactHandler::OpenComplete() { FUNC_LOG; @@ -961,12 +918,6 @@ { iOpenComplete = ETrue; } - - if ( iState == EContactHandlerGetAddressesFromPhonebook ) - { - // Start retrieving contacts when stores are opened. - TRAP_IGNORE( RetrieveContactsL() ); - } } void CFSEmailUiContactHandler::StoreReady(MVPbkContactStore& /*aContactStore*/) @@ -1011,23 +962,32 @@ emptyItems.Close(); iHandlerObserver = NULL; } + } else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetAddressesFromPhonebook) && (aEventId == KAiwEventCompleted)) { + TInt index = 0; const TAiwGenericParam* param = - aEventParamList.FindFirst( index, EGenericParamContactLinkArray ); - if ( param ) + aEventParamList.FindFirst(index, EGenericParamContactLinkArray); + if (param) { TPtrC8 contactLinks = param->Value().AsData(); - iLinksSet = iContactManager->CreateLinksLC( contactLinks ); - CleanupStack::Pop(); - // Open all stores before retrieving contact details. - // Async operation, calls OpenComplete when all stores are opened. + iLinksSet = iContactManager->CreateLinksLC(contactLinks); + CleanupStack::Pop(); + if ( iLinksSet->Count() ) + { + iCurrentLink = &iLinksSet->At(0); + //Async operation, callback VPbkSingleContactOperationCompleteL + //Error situations: VPbkSingleContactOperationFailed + iLinkOperationFetch = iContactManager->RetrieveContactL( iLinksSet->At(0), *this ); + } + iContactManager->ContactStoresL().OpenAllL( *this ); } + } else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetSmsAddressFromPhonebook) && (aEventId == KAiwEventCompleted)) @@ -1095,7 +1055,9 @@ iUseSenderText(EFalse), iFs( aSession ), iCachingInProgressError(EFalse), + // video call iVideoCall( EFalse ) + // { FUNC_LOG; } @@ -1139,11 +1101,13 @@ } else { - TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); + TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); } + // video call flag needs to be cleared iVideoCall = EFalse; + // iState = EContactHandlerIdle; - } + } else if ( aMatchingItems.Count() > 0 ) // Call to one directly { // Create contact item in which to copy number or address, async operation. @@ -1157,11 +1121,12 @@ delete iLinkOperationFetch; iLinkOperationFetch = NULL; } - + //Async operation, callback VPbkSingleContactOperationCompleteL //Error situations: VPbkSingleContactOperationFailed - iLinkOperationFetch = iContactManager->RetrieveContactL( - *iCurrentLink, *this ); + iLinkOperationFetch = iContactManager->RetrieveContactL + (*iCurrentLink, *this); + } } @@ -1273,8 +1238,8 @@ //Async operation, callback VPbkSingleContactOperationCompleteL //Error situations: VPbkSingleContactOperationFailed - iLinkOperationFetch = iContactManager->RetrieveContactL( - *iCurrentLink, *this); + iLinkOperationFetch = iContactManager->RetrieveContactL + (*iCurrentLink, *this); } } } @@ -1437,8 +1402,8 @@ param->SetContactDataL( link16->Des() ); // switch to details view - const TUid uid = TUid::Uid( KCCADetailsViewPluginImplmentationUid ); - param->SetLaunchedViewUid( uid ); + const TUid uid = TUid::Uid( 0x200159E7 ); + param->SetLaunchedViewUid( uid); // Launching the CCA application iConnection->LaunchAppL( *param, this ); @@ -1457,70 +1422,6 @@ } // --------------------------------------------------------------------------- -// Return contact details view Id -// --------------------------------------------------------------------------- -// -TUid CFSEmailUiContactHandler::GetDetailsViewUid() - { - return TUid::Uid( KCCADetailsViewPluginImplmentationUid ); - } - -// --------------------------------------------------------------------------- -// Return contact detail App Id (CCAPP) -// --------------------------------------------------------------------------- -// -TUid CFSEmailUiContactHandler::GetDetailsAppUid() - { - return TUid::Uid( KCCAAppUID ); - } - -// --------------------------------------------------------------------------- -// Close Details view using CCApplication -// --------------------------------------------------------------------------- -// -void CFSEmailUiContactHandler::CloseContactDetailsL() - { - CCASimpleNotifyL( MCCAObserver::EExitEvent,0 ); - iContactDetailsClosed = ETrue; - } - -// --------------------------------------------------------------------------- -// Check if Contact Details view was closed using CloseContactDetailsL method -// --------------------------------------------------------------------------- -// -TBool CFSEmailUiContactHandler::WasDetailsClosed() - { - return iContactDetailsClosed; - } - -// --------------------------------------------------------------------------- -// Reopen Details view for last addres or bring contacts app to foreground -// --------------------------------------------------------------------------- -// -void CFSEmailUiContactHandler::ReopenContactDetailsL(RWsSession& session ) - { - if( iPreviousEmailAddress ) - { - HBufC* emailAddress = iPreviousEmailAddress->AllocLC(); - ShowContactDetailsL( *emailAddress, EContactUpdateEmail, NULL ); - CleanupStack::PopAndDestroy( emailAddress ); - iContactDetailsClosed = EFalse; - } - else // if contact wasn't open from email - { - // Try to bring calling external app into foreground if found - TApaTaskList taskList( session ); - TApaTask contAppTask = taskList.FindApp( TUid::Uid( KPbkUID3 ) ); - if ( contAppTask.Exists() ) - { - contAppTask.BringToForeground(); - iContactDetailsClosed = EFalse; - } - } - } - - -// --------------------------------------------------------------------------- // CFSEmailUiContactHandler::FindContactLinkL // Searches contacts matching with the given email address // --------------------------------------------------------------------------- @@ -1543,16 +1444,17 @@ iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN ); iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILWORK ); iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILHOME ); - + iFirstnameFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME ); iLastnameFields.Append( R_VPBK_FIELD_TYPE_LASTNAME ); - + iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEHOME ); iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEWORK ); iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEHOME ); iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEWORK ); iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEGEN ); iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEGEN ); + } void CFSEmailUiContactHandler::ResetFieldIds() @@ -1566,7 +1468,7 @@ // ----------------------------------------------------------------------------- -// CFSEmailUiContactHandler::GetNameAndEmailFromRemoteLookupL +// CFSEmailUiContactHandler::LaunchRemoteLookupL // ----------------------------------------------------------------------------- TBool CFSEmailUiContactHandler::GetNameAndEmailFromRemoteLookupL( CFSMailBox& aMailBox, const TDesC& aQueryString, TDes& aDisplayname, TDes& aEmailAddress ) @@ -1581,7 +1483,6 @@ CPbkxRemoteContactLookupServiceUiContext::TResult::EExitContactSelected ) { GetNameAndEmail( aDisplayname, aEmailAddress, *(result.iSelectedContactItem) ); - delete result.iSelectedContactItem; return ETrue; } @@ -1602,7 +1503,7 @@ } // ----------------------------------------------------------------------------- -// CFSEmailUiContactHandler::GetNameAndNumberFromRemoteLookupL +// CFSEmailUiContactHandler::LaunchRemoteLookupL // ----------------------------------------------------------------------------- HBufC* CFSEmailUiContactHandler::GetNameAndNumberFromRemoteLookupL( CFSMailBox& aMailBox, const TDesC& aQuery, RBuf& aPhoneNumber ) @@ -1653,8 +1554,6 @@ FUNC_LOG; iContactObjects.ResetAndDestroy(); iState = EContactHandlerIdle; - delete iCurrentLink; - iCurrentLink = NULL; delete iLinksSet; iLinksSet = NULL; delete iLinkOperation; @@ -1967,7 +1866,7 @@ iHandlerObserver = NULL; } -// Call observer's MFSEmailUiContactHandlerObserver::OperationErrorL( TContactHandlerCmd aCmd, TInt aError ) +// call observer's MFSEmailUiContactHandlerObserver::OperationErrorL( TContactHandlerCmd aCmd, TInt aError ) void CFSEmailUiContactHandler::ObserverOperationErrorL( TContactHandlerCmd aCmd, TInt aErrorCode ) { if( ( iHandlerObserver ) && ( KErrNone != aErrorCode ) ) diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -1794,7 +1794,7 @@ iCurrentSortCriteria.iOrder == EFSMailAscending ? iSortIconArray[ ESortListSenderDescIcon ] : iSortIconArray[ ESortListSenderAscIcon ] : - iSortIconArray[ ESortListSenderAscIcon ]; + iSortIconArray[ ESortListSenderDescIcon ]; itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_RECIPIENT, KFsTreeRootID, icon, EFalse ); iModel->AppendL( itemId, EFSMailSortByRecipient ); } @@ -1806,7 +1806,7 @@ iCurrentSortCriteria.iOrder == EFSMailAscending ? iSortIconArray[ ESortListSenderDescIcon ] : iSortIconArray[ ESortListSenderAscIcon ] : - iSortIconArray[ ESortListSenderAscIcon ]; + iSortIconArray[ ESortListSenderDescIcon ]; itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_SENDER, KFsTreeRootID, icon, EFalse ); iModel->AppendL( itemId, EFSMailSortBySender ); } @@ -1817,7 +1817,7 @@ iCurrentSortCriteria.iOrder == EFSMailAscending ? iSortIconArray[ ESortListSubjectDescIcon ] : iSortIconArray[ ESortListSubjectAscIcon ] : - iSortIconArray[ ESortListSubjectAscIcon ]; + iSortIconArray[ ESortListSubjectDescIcon ]; itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_SUBJECT, KFsTreeRootID, icon, EFalse ); iModel->AppendL( itemId, EFSMailSortBySubject ); @@ -1851,7 +1851,7 @@ iCurrentSortCriteria.iOrder == EFSMailAscending ? iSortIconArray[ ESortListUnreadDescIcon ] : iSortIconArray[ ESortListUnreadAscIcon ] : - iSortIconArray[ ESortListUnreadAscIcon ]; + iSortIconArray[ ESortListUnreadDescIcon ]; itemId = AppendItemToListFromResourceL( R_FREESTYLE_EMAIL_UI_SORT_BY_UNREAD, KFsTreeRootID, icon, EFalse ); iModel->AppendL( itemId, EFSMailSortByUnread ); diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp --- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -176,9 +176,9 @@ CEUiHtmlViewerSettings* CEUiHtmlViewerSettings::NewL( MObserver& aObserver ) { CEUiHtmlViewerSettings* self = new (ELeave) CEUiHtmlViewerSettings(aObserver); - CleanupStack::PushL( self ); + CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop( self ); + CleanupStack::Pop(); // self return self; } @@ -216,12 +216,11 @@ // void CEUiHtmlViewerSettings::AddKeyListenerL( TUint32 aKey ) { - CEUiHtmlViewerSettingsKeyListener* listener = - new (ELeave) CEUiHtmlViewerSettingsKeyListener( *this, aKey ); - CleanupStack::PushL( listener ); - iKeyListeners.AppendL( listener ); - CleanupStack::Pop( listener ); - UpdateValue( aKey ); + CEUiHtmlViewerSettingsKeyListener* listener = new (ELeave) CEUiHtmlViewerSettingsKeyListener(*this, aKey); + CleanupStack::PushL(listener); + iKeyListeners.AppendL(listener); + CleanupStack::Pop(); // listener + UpdateValue(aKey); } // --------------------------------------------------------------------------- @@ -447,9 +446,8 @@ if ( iBrCtlInterface ) { - SetZoomLevelL(100); - iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsAutoLoadImages, iViewerSettings->AutoLoadImages() ); - return; + delete iBrCtlInterface; + iBrCtlInterface = NULL; } TUint brCtlCapabilities = TBrCtlDefs::ECapabilityClientResolveEmbeddedURL | @@ -504,6 +502,9 @@ #endif + SetRect( iView.ContainerRect() ); + CreateBrowserControlInterfaceL(); + iEventHandler = CFreestyleMessageHeaderURLEventHandler::NewL( iAppUi, iView ); TRect nextButtonRect = OverlayButtonRect( EFalse ); @@ -521,9 +522,6 @@ iTouchFeedBack = MTouchFeedback::Instance(); iTouchFeedBack->EnableFeedbackForControl(this, ETrue); - CreateBrowserControlInterfaceL(); - SetRect( iView.ContainerRect() ); - ActivateL(); } @@ -701,8 +699,7 @@ // Reset content // --------------------------------------------------------------------------- // -void CFsEmailUiHtmlViewerContainer::ResetContent( TBool aDisconnect, - TBool aClearFlags ) +void CFsEmailUiHtmlViewerContainer::ResetContent(const TBool aDisconnect) { FUNC_LOG; if ( iBrCtlInterface ) @@ -721,10 +718,7 @@ iLinkContents.Reset(); iMessageParts.Reset(); iMessage = NULL; - if ( aClearFlags ) - { - iFlags.ClearAll(); - } + iFlags.ClearAll(); iScrollPosition = 0; } @@ -1868,6 +1862,7 @@ if ( iStatusIndicator ) { iStatusIndicator->MakeVisible( EFalse ); + iStatusIndicator->HideIndicator(); } } diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp --- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -38,8 +38,6 @@ #include #include #include // for clipboard copy -#include -#include #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS #include @@ -74,8 +72,7 @@ CAlfControlGroup& aControlGroup ) { FUNC_LOG; - CFsEmailUiHtmlViewerView* self = new ( ELeave ) CFsEmailUiHtmlViewerView( - aEnv, aAppUi, aControlGroup ); + CFsEmailUiHtmlViewerView* self = new ( ELeave ) CFsEmailUiHtmlViewerView( aEnv, aAppUi, aControlGroup ); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -351,18 +348,7 @@ break; case EFsEmailUiCmdActionsMoveMessage: { - TBool asyncFetchStatus = GetAsyncFetchStatus(); - if ( asyncFetchStatus ) - { - HBufC* noteText = StringLoader::LoadLC( R_FS_MSERVER_TEXT_SERVER_CURRENTLY_BUSY_TRY_AGAIN ); - CAknInformationNote* note = new (ELeave) CAknInformationNote(); - note->ExecuteLD( *noteText ); - CleanupStack::PopAndDestroy( noteText ); - } - else - { - OpenFolderListForMessageMovingL(); - } + OpenFolderListForMessageMovingL(); } break; case EFsEmailUiCmdActionsFlag: @@ -471,18 +457,10 @@ // --------------------------------------------------------------------------- // hide or show Container ( used for activation of the view ) // -void CFsEmailUiHtmlViewerView::FadeOut( TBool aDirectionOut ) +void CFsEmailUiHtmlViewerView::FadeOut(TBool aDirectionOut ) { FUNC_LOG; - if ( !iContainer ) - { - TFsEmailUiUtility::ShowErrorNoteL( - R_FREESTYLE_EMAIL_ERROR_GENERAL_UNABLE_TO_COMPLETE, ETrue ); - } - else - { - iContainer->MakeVisible( !aDirectionOut ); - } + iContainer->MakeVisible(!aDirectionOut); } @@ -656,10 +634,6 @@ iMessage = iOpenMessages->Head(); iCreateNewMsgFromEmbeddedMsg = EFalse; - if (iMessage && !iMailBox) - { - iMailBox = iAppUi.GetMailClient()->GetMailBoxByUidL( iMessage->GetMailBoxId() ); - } delete iAttachmentsListModel; iAttachmentsListModel = NULL; iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this ); @@ -1072,6 +1046,12 @@ } } +void CFsEmailUiHtmlViewerView::HandleStatusPaneSizeChange() + { + CFsEmailUiViewBase::HandleStatusPaneSizeChange(); + + HandleViewRectChange(); + } void CFsEmailUiHtmlViewerView::HandleViewRectChange() { @@ -2214,29 +2194,30 @@ } } } - - if ( iContainer ) + if(iContainer) { iContainer->HideDownloadStatus(); } - if ( reloadContent ) { - if ( iContainer ) + + if ( iContainer ) { - iContainer->ResetContent( EFalse, EFalse ); - if ( iMessage ) + iContainer->ResetContent(); + if( iMessage ) { - LoadContentFromMailMessageL( iMessage , EFalse ); + LoadContentFromMailMessageL( iMessage , EFalse); SetMskL(); } } } - if ( iAsyncProcessComplete && iWaitDialog && iDialogNotDismissed ) + + if(iAsyncProcessComplete && iWaitDialog && iDialogNotDismissed) { iWaitDialog->ProcessFinishedL(); // deletes the dialog } + } // ----------------------------------------------------------------------------- diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -295,12 +295,12 @@ void CFSEmailUiLauncherGridVisualiser::ResizeItemIcon( TBool aReduce ) { TInt selectedItem( iCurrentLevel.iSelected ); + TInt count = iCurrentLevel.iItemVisualData.Count(); if ( selectedItem < 0 || selectedItem >= count ) { return; // incorrect index } - if( selectedItem >= 0 ) { TReal transition( KScaleNotSelected ); @@ -1233,7 +1233,6 @@ { // Hide focus always when dragging. HandleButtonReleaseEvent(); - iIsDragging = ETrue; iPhysics->RegisterPanningPosition( delta ); @@ -2785,6 +2784,7 @@ { return; // incorrect index } + // Get the ID of the mailbox in case the user wants to delete it. iMailboxToDelete = iCurrentLevel.iItems[aItemId].iMailBoxId; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiLayoutHandler.cpp --- a/emailuis/emailui/src/FreestyleEmailUiLayoutHandler.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiLayoutHandler.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -1101,27 +1101,6 @@ } // ----------------------------------------------------------------------------- -// CFSEmailUiLayoutHandler::SearchMarkIconSize -// ----------------------------------------------------------------------------- -TInt CFSEmailUiLayoutHandler::SearchMarkIconSize() const - { - FUNC_LOG; - TRect rect; - TRect iconRowParent(0,0,0,0); - TInt size; - - CFsLayoutManager::LayoutMetricsRect( - iconRowParent, - CFsLayoutManager::EFsLmListSingleDycRowPaneG1, - rect, - 2); - - size = rect.iBr.iY - rect.iTl.iY; - - return size; - } - -// ----------------------------------------------------------------------------- // CFSEmailUiLayoutHandler::statusPaneIconSize // ----------------------------------------------------------------------------- TSize CFSEmailUiLayoutHandler::statusPaneIconSize() const diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiMailListModel.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailListModel.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiMailListModel.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -593,3 +593,19 @@ } } } +TBool CFSEmailUiMailListModel::ContainsItem( const CFSMailMessage& aMessage ) const + { + FUNC_LOG; + + TBool found( EFalse ); + for (TInt i = iItems.Count() - 1; i >= 0; i--) + { + if (aMessage.GetMessageId() == iItems[i]->MessagePtr().GetMessageId()) + { + found = ETrue; + break; + } + } + return found; + } + diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -574,8 +574,7 @@ iNewEmailText = StringLoader::LoadL( R_COMMAND_AREA_NEW_EMAIL ); // Set menu, mark and background icons - iMailTreeListVisualizer->SetMarkOnIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkOnIcon ) ); - iMailTreeListVisualizer->SetMarkOffIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkOffIcon ) ); + iMailTreeListVisualizer->SetMarkIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkIcon ) ); iMailTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) ); iMailList->AddObserverL( *this ); iMailList->AddObserverL( *iTouchManager ); @@ -758,10 +757,27 @@ void CFSEmailUiMailListVisualiser::UpdateProgressL(TFsTreeItemId& aParentId, RPointerArray& aMessages) { FUNC_LOG; - const TInt itemsInModel(iModel->Count()); - CreateModelItemsL(aMessages); - RefreshListItemsL(aParentId, itemsInModel, iModel->Count()); + + // cleanup items that are already found in model + for (TInt i = 0; i < aMessages.Count(); ) + { + if ( iModel->ContainsItem( *aMessages[i] ) ) + { + delete aMessages[i]; + aMessages.Remove(i); + } + else + { + i++; + } + } + + if (aMessages.Count() > 0) + { + CreateModelItemsL(aMessages); + RefreshListItemsL(aParentId, itemsInModel, iModel->Count()); + } } // --------------------------------------------------------------------------- @@ -777,7 +793,7 @@ sorting = ETrue; } DeleteSortWaitNote(); - + if ( !iModel->Count() ) { iFocusedControl = EControlBarComponent; @@ -833,7 +849,7 @@ void CFSEmailUiMailListVisualiser::SortMailListModelAsyncL() { FUNC_LOG; - + DeleteSortWaitNote(); TBool ret = UpdateMailListModelAsyncL( KCMsgBlockSort ); @@ -1278,10 +1294,10 @@ case ESortRequested: { if( !iNewMailTimer->IsActive() && iNewMailTimer->iStatus != KErrInUse ) - { + { // Size sorting does not use nodes, so disable those, otherwise check from CR iNodesInUse = iAppUi.GetCRHandler()->TitleDividers(); - SetSortButtonIconL(); + SetSortButtonTextAndIconL(); iFocusedControl = EControlBarComponent; iMailList->SetFocusedL( EFalse ); @@ -1328,7 +1344,7 @@ case ESortCompleted: { if( !iNewMailTimer->IsActive() ) - { + { // refresh the whole mail list if list was sorted if(iSortState != ESortStartError ) { @@ -1361,12 +1377,6 @@ if( aTriggeredTimer == iNewMailTimer ) { - if ( ! iThisViewActive ) // don't proceed if view is not active - { - iNewMailTimer->Stop(); - return; - } - TInt count = Min( KNewMailMaxBatch, iNewMailIds.Count() ); CFSMailClient* mailClient = iAppUi.GetMailClient(); @@ -1387,18 +1397,12 @@ return; // leave method } - CFSMailMessage* msgPtr(NULL); - TRAPD( err, msgPtr = mailClient->GetMessageByUidL( iAppUi.GetActiveMailboxId(), + CFSMailMessage* msgPtr = mailClient->GetMessageByUidL( iAppUi.GetActiveMailboxId(), iMailFolder->GetFolderId(), iNewMailIds[ 0 ], - EFSMsgDataEnvelope ) ); - if ( KErrNone != err ) - { - iNewMailTimer->iStatus = KErrNone; - User::Leave(err); - } + EFSMsgDataEnvelope ); if ( msgPtr != NULL ) - { + { __ASSERT_DEBUG( FolderId() == msgPtr->GetFolderId(), User::Invariant() ); CleanupStack::PushL( msgPtr ); //first item - show scrollbar @@ -1432,6 +1436,14 @@ void CFSEmailUiMailListVisualiser::InsertNewMessageL( CFSMailMessage* aNewMessage, const TBool aAllowRefresh ) { FUNC_LOG; + + // If item is already in model, just delete the pointer and return + if ( iModel->ContainsItem( *aNewMessage ) ) + { + delete aNewMessage; + return; + } + // Use simple heuristic rule: if the first item is highlighted before the new // item is added, the highlight is forced to remain on the (possibly new) first // item. Otherwise the highligh stays on the same item as before. @@ -1656,24 +1668,21 @@ } iShowReplyAll = EFalse; - TBool bDoFirstStartCalled( EFalse ); - if ( !iFirstStartCompleted ) - { - DoFirstStartL(); - bDoFirstStartCalled = ETrue; - } + + if ( !iFirstStartCompleted ) + { + DoFirstStartL(); + } // set when editor was called so reset is needed i.e. here (Called by DoActivate) - iMailOpened = EFalse; + iMailOpened = EFalse; // Make sure that pending popup is not displayd - if ( iAppUi.FolderList().IsPopupShown() ) + if ( iAppUi.FolderList().IsPopupShown() ) { iAppUi.FolderList().HidePopupL(); } DisableMailList( EFalse ); - UpdateFolderAndMarkingModeTextsL(); - // inform baseView if view entered with forward navigation TBool forwardNavigation = EFalse; if ( aCustomMessageId != KStartListReturnToPreviousFolder && @@ -1694,20 +1703,18 @@ SetMailListLayoutAnchors(); //if the view is already active don't update the icons so they won't "blink" //when the view is activated. - if( !iThisViewActive && !iMarkingMode ) + if(!iThisViewActive) { - ScaleControlBarL(); - if ( !bDoFirstStartCalled ) // Don't set the icon if set by DoFirstStart() - { - // Set icons on toolbar - iAppUi.FsTextureManager()->ClearTextureByIndex( EListControlBarMailboxDefaultIcon ); - iFolderListButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListControlBarMailboxDefaultIcon ) ); - iAppUi.FsTextureManager()->ClearTextureByIndex( EListTextureCreateNewMessageIcon ); - iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureCreateNewMessageIcon ) ); - iAppUi.FsTextureManager()->ClearTextureByIndex( GetSortButtonTextureIndex() ); - iSortButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( GetSortButtonTextureIndex() ) ); - } + + // Set icons on toolbar + iAppUi.FsTextureManager()->ClearTextureByIndex( EListControlBarMailboxDefaultIcon ); + iFolderListButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListControlBarMailboxDefaultIcon ) ); + iAppUi.FsTextureManager()->ClearTextureByIndex( EListTextureCreateNewMessageIcon ); + iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureCreateNewMessageIcon ) ); + iAppUi.FsTextureManager()->ClearTextureByIndex( GetSortButtonTextureIndex() ); + iSortButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( GetSortButtonTextureIndex() ) ); + SetListAndCtrlBarFocusL(); } @@ -1876,7 +1883,7 @@ // Set initial sort criteria when folder is changed iCurrentSortCriteria.iField = EFSMailSortByDate; iCurrentSortCriteria.iOrder = EFSMailDescending; - SetSortButtonIconL(); + SetSortButtonTextAndIconL(); SafeDelete(iMailFolder); TRAP_IGNORE( iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( @@ -1891,6 +1898,9 @@ TFSMailMsgId inboxId = iAppUi.GetActiveMailbox()->GetStandardFolderId( EFSInbox ); iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( activationData.iMailBoxId, inboxId ); } + HBufC* newFolderName = CreateFolderNameLC( iMailFolder ); + iFolderListButton->SetTextL( *newFolderName ); + CleanupStack::PopAndDestroy( newFolderName ); iMailList->SetFocusedItemL( KFsTreeNoneID ); refreshState = EFullRefreshNeeded; } @@ -1991,17 +2001,11 @@ SetControlBarFocusedL(); iControlBarControl->MakeSelectorVisible( iAppUi.IsFocusShown() ); } + UpdateButtonTextsL(); FocusVisibilityChange( iAppUi.IsFocusShown() ); iAppUi.ShowTitlePaneConnectionStatus(); - - // if timer stoped when quitting view then restart if more messages available - if ( iNewMailIds.Count() && ( ! iNewMailTimer->IsActive() ) && iSortState == ESortNone ) - { - iNewMailTimer->Start( KNewMailTimerDelay ); - } - TIMESTAMP( "Message list view opened" ); - } // CFSEmailUiMailListVisualiser::ChildDoActivateL + } // --------------------------------------------------------------------------- // Sets status bar layout @@ -2043,7 +2047,6 @@ iMailList->SetFocusedL( EFalse ); } ); iMailTreeListVisualizer->NotifyControlVisibilityChange( EFalse ); - TRAP_IGNORE( UpdateFolderAndMarkingModeTextsL() ); } iThisViewActive = EFalse; } @@ -2220,21 +2223,7 @@ { aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsEmptyDeleted, ETrue ); } - - CConnectionStatusQueryExtension::TConnectionStatus connetionStatus; - iAppUi.GetConnectionStatusL( connetionStatus ); - if ( connetionStatus == CConnectionStatusQueryExtension::ESynchronizing ) - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, EFalse ); - } - else - { - aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, EFalse ); - aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue ); - } - } - + } // MAIN MENU *************************************************************************** @@ -2540,11 +2529,10 @@ // void CFSEmailUiMailListVisualiser::ExitMarkingModeL() { - FUNC_LOG; - iMarkingMode = EFalse; + FUNC_LOG; // Hide marking mode text on the place of drop down menus - UpdateFolderAndMarkingModeTextsL(); - iMailList->SetMarkingModeL( EFalse ); + RemoveMarkingModeTitleTextL(); + iMarkingMode = EFalse; UnmarkAllItemsL(); // Change softkeys back to normal SetViewSoftkeysL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_BACK ); @@ -2552,16 +2540,14 @@ CEikMenuBar* menu = iAppUi.CurrentActiveView()->MenuBar(); menu->StopDisplayingMenuBar(); menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR); + // Change background back to normal + DisplayMarkingModeBgL( EFalse ); // Display drop down menu buttons iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() ); iNewEmailButton->SetDimmed( EFalse ); iFolderListButton->SetDimmed( EFalse ); iSortButton->SetDimmed( EFalse ); ScaleControlBarL(); - - iMailTreeListVisualizer->HideList(); - SetMailListLayoutAnchors(); - iMailTreeListVisualizer->ShowListL(); } // --------------------------------------------------------------------------- @@ -2573,7 +2559,6 @@ { FUNC_LOG; iMarkingMode = ETrue; - iMailList->SetMarkingModeL( ETrue ); iListMarkItemsState = ETrue; // shift-scrolling does marking after one item is marked HandleCommandL( EFsEmailUiCmdActionsExpandAll ); // Change softkeys for marking mode @@ -2582,17 +2567,19 @@ CEikMenuBar* menu = iAppUi.CurrentActiveView()->MenuBar(); menu->StopDisplayingMenuBar(); menu->SetMenuTitleResourceId(R_FSEMAILUI_MAILLIST_MENUBAR_MARKING_MODE); + // Change background to marking mode + DisplayMarkingModeBgL( ETrue ); // Hide drop down menu buttons iNewEmailButton->SetDimmed(); iFolderListButton->SetDimmed(); iSortButton->SetDimmed(); - TRect rect(0,0,0,0); - iControlBarControl->SetRectL( rect ); - UpdateFolderAndMarkingModeTextsL(); - - iMailTreeListVisualizer->HideList(); - SetMailListLayoutAnchors(); - iMailTreeListVisualizer->ShowListL(); + if( !Layout_Meta_Data::IsLandscapeOrientation() ) + { + TRect rect(0,0,0,0); + iControlBarControl->SetRectL( rect ); + // Display marking mode text on the place of drop down menus + DisplayMarkingModeTitleTextL(); + } } // --------------------------------------------------------------------------- @@ -2606,21 +2593,29 @@ if ( iMarkingMode ) { // Hide drop down menu buttons - TRect rect(0,0,0,0); - iControlBarControl->SetRectL( rect ); - iNewEmailButton->SetDimmed(); - iFolderListButton->SetDimmed(); - iSortButton->SetDimmed(); - UpdateFolderAndMarkingModeTextsL(); - } - } - -// --------------------------------------------------------------------------- -// -// -// --------------------------------------------------------------------------- -// -void CFSEmailUiMailListVisualiser::DisplayMarkingModeTextOnButtonsL() + if( !Layout_Meta_Data::IsLandscapeOrientation() ) + { + TRect rect(0,0,0,0); + iControlBarControl->SetRectL( rect ); + DisplayMarkingModeTitleTextL(); + } + else + { + iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() ); + iNewEmailButton->SetDimmed(); + iFolderListButton->SetDimmed(); + iSortButton->SetDimmed(); + RemoveMarkingModeTitleTextL(); + } + } + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +void CFSEmailUiMailListVisualiser::DisplayMarkingModeTitleTextL() { FUNC_LOG; if (!iMarkingModeTextVisual) @@ -2658,15 +2653,15 @@ { iMarkingModeTextVisual->SetTextL( KNullDesC ); } - } - } - -// --------------------------------------------------------------------------- -// -// -// --------------------------------------------------------------------------- -// -void CFSEmailUiMailListVisualiser::RemoveMarkingModeTextOnButtonsL() + } + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +void CFSEmailUiMailListVisualiser::RemoveMarkingModeTitleTextL() { FUNC_LOG; if (iMarkingModeTextVisual) @@ -2686,6 +2681,26 @@ // // --------------------------------------------------------------------------- // +void CFSEmailUiMailListVisualiser::DisplayMarkingModeBgL( TBool aDisplay ) + { + FUNC_LOG; + if (aDisplay) + { + CAlfBrush* brush = iAppUi.FsTextureManager()->NewMailListMarkingModeBgBrushLC(); + iMailTreeListVisualizer->SetBackgroundBrushL( brush ); + CleanupStack::Pop( brush ); + } + else + { + iMailTreeListVisualizer->ClearBackground(); + } + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// void CFSEmailUiMailListVisualiser::RefreshL( TFSMailMsgId* aFocusToMessage ) { FUNC_LOG; @@ -3353,6 +3368,7 @@ if ( aType == EScreenLayoutChanged ) { SetStatusBarLayout(); + UpdateButtonTextsL(); } if ( aType == ESkinChanged ) @@ -3389,8 +3405,7 @@ if (iMarkingMode) { RefreshMarkingModeL(); - } - UpdateFolderAndMarkingModeTextsL(); + } } // --------------------------------------------------------------------------- @@ -3407,6 +3422,36 @@ { UpdateThemeL(); } + else if ( aType == EScreenLayoutChanged ) + { + UpdateButtonTextsL(); + } + } + +// --------------------------------------------------------------------------- +// Update texts for command area buttons +// --------------------------------------------------------------------------- +// +void CFSEmailUiMailListVisualiser::UpdateButtonTextsL() + { + if ( !Layout_Meta_Data::IsLandscapeOrientation() ) + { + // No texts in portrait mode + iNewEmailButton->SetTextL( KNullDesC() ); + iSortButton->SetTextL( KNullDesC() ); + } + else + { + // Set button text if necessary + HBufC* buttonText = GetSortButtonTextLC(); + if ( buttonText ) + { + iSortButton->SetTextL( *buttonText ); + CleanupStack::PopAndDestroy( buttonText ); + } + + iNewEmailButton->SetTextL( *iNewEmailText ); + } } // --------------------------------------------------------------------------- @@ -3917,8 +3962,7 @@ aCommand == EFsEmailUiCmdActionsMoveMessage || aCommand == EFsEmailUiCmdMarkingModeFromPopUp || aCommand == EFsEmailUiCmdActionsCollapseAll || - aCommand == EFsEmailUiCmdActionsExpandAll || - aCommand == EFsEmailUiCmdActionsFlag ) ) + aCommand == EFsEmailUiCmdActionsExpandAll ) ) { // We end up here if the user selects an option from the pop up menu // or exits the menu by tapping outside of it's area. @@ -4384,14 +4428,6 @@ } } break; - case EFsEmailUiCmdCancelSync: - { - if ( GetLatestSyncState() ) - { - iAppUi.StopActiveMailBoxSyncL(); - } - } - break; case EFsEmailUiCmdGoOffline: { iAppUi.GetActiveMailbox()->GoOfflineL(); @@ -4615,6 +4651,7 @@ if ( aDestinationFolderId.IsNullId() ) { // Activate folder selection view and handle moving after callback gets destination + RemoveMarkingModeTitleTextL(); iMoveToFolderOngoing = ETrue; TFolderListActivationData folderListData; folderListData.iCallback = this; @@ -5887,10 +5924,11 @@ { horizontalAlign = EAlfAlignHRight; } + // Icons and sort button text iFolderListButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListControlBarMailboxDefaultIcon ) ); iNewEmailButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( EListTextureCreateNewMessageIcon ) ); - SetSortButtonIconL(); + SetSortButtonTextAndIconL(); iNewEmailButton->SetElemAlignL( ECBElemIconA, @@ -5911,14 +5949,10 @@ EAlfAlignVCenter ); // Show the buttons - if( iThisViewActive || iMarkingMode ) - { - iNewEmailButton->ShowButtonL(); - iFolderListButton->ShowButtonL(); - iSortButton->ShowButtonL(); - } - // else buttons shown later in ChildDoActivete() by ScaleControlBarL() - } + iNewEmailButton->ShowButtonL(); + iFolderListButton->ShowButtonL(); + iSortButton->ShowButtonL(); + } // --------------------------------------------------------------------------- // @@ -5980,9 +6014,27 @@ // // --------------------------------------------------------------------------- // -void CFSEmailUiMailListVisualiser::SetSortButtonIconL() +void CFSEmailUiMailListVisualiser::SetSortButtonTextAndIconL() { FUNC_LOG; + + // Set button text if necessary + HBufC* buttonText = GetSortButtonTextLC(); + + if ( !Layout_Meta_Data::IsLandscapeOrientation() ) + { + if ( buttonText ) + { + buttonText->Des().Zero(); + } + } + + if ( buttonText ) + { + iSortButton->SetTextL( *buttonText ); + } + CleanupStack::PopAndDestroy( buttonText ); + iSortButton->SetIconL( iAppUi.FsTextureManager()->TextureByIndex( GetSortButtonTextureIndex() ), ECBElemIconA ); @@ -6000,52 +6052,59 @@ TFSEmailUiTextures textureIndex( ETextureFirst ); switch ( iCurrentSortCriteria.iField ) - { - case EFSMailSortBySubject: - { - textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? - ESortListSubjectAscTexture : ESortListSubjectDescTexture; - } - break; - case EFSMailSortByAttachment: - { - textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? - ESortListAttachmentAscTexture : ESortListAttachmentDescTexture; - } - break; - case EFSMailSortByFlagStatus: - { - textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? - ESortListFollowAscTexture : ESortListFollowDescTexture; - } - break; - case EFSMailSortByRecipient: - case EFSMailSortBySender: - { - textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? - ESortListSenderAscTexture : ESortListSenderDescTexture; - } - break; - case EFSMailSortByPriority: - { - textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? - ESortListPriorityAscTexture : ESortListPriorityDescTexture; - } - break; - case EFSMailSortByUnread: - { - textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? - ESortListUnreadAscTexture : ESortListUnreadDescTexture; - } - break; - case EFSMailSortByDate: - default: - { - textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? - ESortListDateAscTexture : ESortListDateDescTexture; - } - break; - } + { + case EFSMailSortBySubject: + { + textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? + ESortListSubjectDescTexture : + ESortListSubjectAscTexture; + } + break; + case EFSMailSortByAttachment: + { + textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? + ESortListAttachmentDescTexture : + ESortListAttachmentAscTexture; + } + break; + case EFSMailSortByFlagStatus: + { + textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? + ESortListFollowDescTexture : + ESortListFollowAscTexture; + } + break; + case EFSMailSortByRecipient: + case EFSMailSortBySender: + { + textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? + ESortListSenderDescTexture : + ESortListSenderAscTexture; + } + break; + case EFSMailSortByPriority: + { + textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? + ESortListPriorityDescTexture : + ESortListPriorityAscTexture; + } + break; + case EFSMailSortByUnread: + { + textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? + ESortListUnreadDescTexture : + ESortListUnreadAscTexture; + } + break; + case EFSMailSortByDate: + default: + { + textureIndex = iCurrentSortCriteria.iOrder == EFSMailAscending ? + ESortListDateDescTexture : + ESortListDateAscTexture; + } + break; + } return textureIndex; } @@ -6137,6 +6196,7 @@ EAlfAnchorMetricRelativeToSize, EAlfAnchorMetricAbsolute, TAlfTimedPoint(1, iAppUi.LayoutHandler()->ControlBarHeight() )); + // Platform layout changes TRect listRect = iAppUi.LayoutHandler()->GetListRect(); // Set anchors so that list leaves space for control bar if( Layout_Meta_Data::IsMirrored() ) @@ -6151,23 +6211,15 @@ EAlfAnchorOriginLeft, EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, TAlfTimedPoint(listRect.iTl.iX, listRect.iTl.iY)); - - if (iMarkingMode && Layout_Meta_Data::IsLandscapeOrientation()) - { - iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 1, - EAlfAnchorOriginLeft, EAlfAnchorOriginTop, - EAlfAnchorMetricRelativeToSize, EAlfAnchorMetricAbsolute, - TAlfTimedPoint(1, listRect.iBr.iY)); - } - else - { - iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 1, - EAlfAnchorOriginLeft, EAlfAnchorOriginTop, - EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, - TAlfTimedPoint(listRect.iBr.iX, listRect.iBr.iY)); - } + iScreenAnchorLayout->SetAnchor(EAlfAnchorBottomRight, 1, + EAlfAnchorOriginLeft, EAlfAnchorOriginTop, + EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, + TAlfTimedPoint(listRect.iBr.iX, listRect.iBr.iY)); + // Platform layout changes // Set anchors for connection icon + + // Platform layout changes TRect connectionIconRect( iAppUi.LayoutHandler()->GetControlBarConnectionIconRect() ); const TPoint& tl( connectionIconRect.iTl ); iScreenAnchorLayout->SetAnchor(EAlfAnchorTopLeft, 2, @@ -6179,6 +6231,7 @@ EAlfAnchorOriginLeft, EAlfAnchorOriginTop, EAlfAnchorMetricAbsolute, EAlfAnchorMetricAbsolute, TAlfTimedPoint( br.iX, br.iY )); + // Platform layout changes iScreenAnchorLayout->UpdateChildrenLayout(); } @@ -6317,7 +6370,7 @@ modelItem->MessagePtr().GetMessageId() , EFSMsgDataEnvelope ) ); if( aIndex < iTreeItemArray.Count() ) - { + { if ( confirmedMsgPtr ) { const SMailListItem& item = iTreeItemArray[aIndex]; @@ -6700,21 +6753,13 @@ TFSMailMsgId mailBox = iAppUi.GetActiveMailboxId(); RArray msgIds; CleanupClosePushL( msgIds ); - for ( TInt i = aEntries.Count() - 1; i >= 0; i-- ) + for ( TInt i = 0; i < aEntries.Count(); i++ ) { msgIds.AppendL( MsgIdFromListId( aEntries[i] ) ); } - - // Clear the focused item to avoid repeated selection of a new focused - // item, unnecessary scrolling of the viewport, etc. - iMailTreeListVisualizer->SetFocusedItemL( KFsTreeNoneID ); - - iMailList->BeginUpdate(); iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, folderId, msgIds ); // Remove from mail list if not already removed by mailbox events RemoveMsgItemsFromListIfFoundL( msgIds ); - iMailList->EndUpdateL(); - CleanupStack::PopAndDestroy(); // msgIds.Close() } @@ -7080,6 +7125,10 @@ switch ( aResponse ) { case EFSEmailUiCtrlBarResponseCancel: + if ( iMarkingMode ) + { + DisplayMarkingModeTitleTextL(); + } iMarkingModeWaitingToExit = EFalse; SetMskL(); return; @@ -7123,13 +7172,17 @@ case EFSEmailUiCtrlBarResponseCancel: iMarkingModeWaitingToExit = EFalse; SetMskL(); + // Touch //Set touchmanager back to active DisableMailList(EFalse); + // return; case EFSEmailUiCtrlBarResponseSelect: SetMskL(); + // Touch //Set touchmanager back to active DisableMailList(EFalse); + // default: break; } @@ -7148,14 +7201,17 @@ return; } - UpdateFolderAndMarkingModeTextsL(); + // Set new text to folder button in control bar + HBufC* newFolderName = CreateFolderNameLC( iMailFolder ); + iFolderListButton->SetTextL( *newFolderName ); + CleanupStack::PopAndDestroy( newFolderName ); // Set initial sort criteria when folder has changed iCurrentSortCriteria.iField = EFSMailSortByDate; iCurrentSortCriteria.iOrder = EFSMailDescending; // reload node state because in file sort mode this is disabled even when globally enabled iNodesInUse = iAppUi.GetCRHandler()->TitleDividers(); - SetSortButtonIconL(); + SetSortButtonTextAndIconL(); // Update the mail list contents UpdateMailListModelL(); @@ -7189,10 +7245,12 @@ iCurrentSortCriteria.iOrder = EFSMailDescending; // reload node state because in file sort mode this is disabled even when globally enabled iNodesInUse = iAppUi.GetCRHandler()->TitleDividers(); - SetSortButtonIconL(); + SetSortButtonTextAndIconL(); // Set folder name to the control bar button - UpdateFolderAndMarkingModeTextsL(); + HBufC* newFolderName = CreateFolderNameLC( iMailFolder ); + iFolderListButton->SetTextL( *newFolderName ); + CleanupStack::PopAndDestroy( newFolderName ); // Set mailbox name and icons SetMailboxNameToStatusPaneL(); @@ -7288,7 +7346,7 @@ iCurrentSortCriteria.iField = aSortField; iModel->SetSortCriteria(iCurrentSortCriteria); - // rest of the code moved to TimerEventL ( iSortTimer part ) + // rest of the code moved to TimerEventL ( iSortTimer part ) // used also in DoHandleControlBarOpenL to prevent SortList reopening iSortState = ESortRequested; iSortTimer->Start( KSortTimerDelay ); @@ -7688,7 +7746,9 @@ iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( aMailboxId, inboxId ); UpdateMailListModelL(); RefreshL(); - UpdateFolderAndMarkingModeTextsL(); + HBufC* newFolderName = CreateFolderNameLC( iMailFolder ); + iFolderListButton->SetTextL( *newFolderName ); + CleanupStack::PopAndDestroy( newFolderName ); } else { @@ -7743,7 +7803,9 @@ // Check that mailfolder fetching succeeded if ( iMailFolder ) { - UpdateFolderAndMarkingModeTextsL(); + HBufC* newFolderName = CreateFolderNameLC( iMailFolder ); + iFolderListButton->SetTextL( *newFolderName ); + CleanupStack::PopAndDestroy( newFolderName ); } } } @@ -8413,49 +8475,6 @@ return manualSync; } - -void CFSEmailUiMailListVisualiser::UpdateFolderAndMarkingModeTextsL() - { - if ( iAppUi.CurrentActiveView()->Id() == MailListId ) - { - HBufC* folder = CreateFolderNameLC( iMailFolder ); - if( Layout_Meta_Data::IsLandscapeOrientation() ) - { - iFolderListButton->SetTextL( KNullDesC ); - if (iMarkingMode) - { - RemoveMarkingModeTextOnButtonsL(); - HBufC* txt = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_MARKINGMODE ); - iAppUi.SetNaviPaneTextL( *txt ); - CleanupStack::PopAndDestroy( txt ); - } - else - { - iAppUi.SetNaviPaneTextL( *folder ); - } - } - else // Portrait orientation - { - iAppUi.SetNaviPaneTextL( KNullDesC ); - if (iMarkingMode) - { - DisplayMarkingModeTextOnButtonsL(); - } - else - { - RemoveMarkingModeTextOnButtonsL(); - iFolderListButton->SetTextL( *folder ); - } - } - CleanupStack::PopAndDestroy( folder ); - } - else - { - iAppUi.SetNaviPaneTextL( KNullDesC ); - RemoveMarkingModeTextOnButtonsL(); - } - } - ////////////////////////////////////////////////////////////////// // Class implementation CMailListUpdater /////////////////////////////////////////////////////////////////// diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -213,7 +213,7 @@ // Set mark type and icon iSearchList->SetMarkTypeL( CFsTreeList::EFsTreeListMultiMarkable ); - iSearchTreeListVisualizer->SetMarkOnIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkOnIcon ) ); + iSearchTreeListVisualizer->SetMarkIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMarkIcon ) ); iSearchTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) ); iSearchTreeListVisualizer->SetFlipState( iKeyboardFlipOpen ); iSearchTreeListVisualizer->SetFocusVisibility( iFocusVisible ); @@ -443,6 +443,8 @@ iAppUi.SetActiveMailboxNameToStatusPaneL(); } CAknEnv::Static()->GetCurrentGlobalUiZoom( iCurrentZoomLevel ); + // Set msk always empty when view is activated. + SetMskL(); // ReScaleUiL(); // In case that Landscape/Portrait has changed. // @@ -1694,6 +1696,8 @@ sortCriteria.iField = EFSMailSortByDate; sortCriteria.iOrder = EFSMailDescending; iSearchOngoing = ETrue; + // Model and list is set to be empty, set also MSK to empty + SetMskL(); // Initialisr TextSearcher // Start search. @@ -1909,6 +1913,9 @@ // Set the extendedability and extended size iSearchTreeListVisualizer->SetItemsAlwaysExtendedL( EFalse ); } + + // Set msk to "Open when first is found". + SetMskL(); } } @@ -2460,6 +2467,11 @@ LaunchStylusPopupMenuL( aPoint ); } break; + case MFsTreeListObserver::EFsTreeListItemWillGetFocused: + { + SetMskL(); + break; + } case MFsTreeListObserver::EFsFocusVisibilityChange: { iAppUi.SetFocusVisibility( EFalse ); @@ -2552,6 +2564,27 @@ return EFalse; //no calling key up will execute Call app } + +// --------------------------------------------------------------------------- +// Logic for changing msk +// --------------------------------------------------------------------------- +// +void CFSEmailUiSearchListVisualiser::SetMskL() + { + FUNC_LOG; + if ( iFirstStartCompleted ) + { + if ( iSearchList && iSearchList->Count() ) + { + ChangeMskCommandL( R_FSE_QTN_MSK_OPEN ); + } + else + { + ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); + } + } + } + // // --------------------------------------------------------------------------- // CFSEmailUiSearchListVisualiser::SetHeaderTextAttributesL() diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiTextureManager.cpp --- a/emailuis/emailui/src/FreestyleEmailUiTextureManager.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiTextureManager.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007 - 2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -18,16 +18,24 @@ // SYSTEM INCLUDES +// SF #include "emailtrace.h" #include +// #include #include +// #include +// #include +// #include +// #include #include +// S60 Skin support #include +// // INTERNAL INCLUDES #include "FreestyleEmailUi.hrh" @@ -84,10 +92,12 @@ delete iFrameBrush; iFrameBrush = NULL; + // delete iNewFrameBrush; iNewFrameBrush = NULL; delete iTitleDividerBgBrush; + // } @@ -229,6 +239,7 @@ return frameBrush; } +// // ----------------------------------------------------------------------------- // CFreestyleEmailUiTextureManager::NewListSelectorBrushL // NOTE: Gen UI list gets the ownership of the selector brush and deletes it @@ -258,6 +269,7 @@ return iNewFrameBrush; } +// // ----------------------------------------------------------------------------- @@ -347,6 +359,20 @@ } // ----------------------------------------------------------------------------- +// CFreestyleEmailUiTextureManager::NewMailListMarkingModeBgBrushLC +// ----------------------------------------------------------------------------- +// +CAlfImageBrush* CFreestyleEmailUiTextureManager::NewMailListMarkingModeBgBrushLC() + { + FUNC_LOG; + CAlfTexture& circle = TextureByIndex( EMarkingModeBackgroundIcon ); + CAlfImageBrush* bgBrush = CAlfImageBrush::NewLC( *iEnv, TAlfImage(circle) ); + bgBrush->SetLayer( EAlfBrushLayerBackground ); + bgBrush->SetScaleMode( CAlfImageVisual::EScaleNormal ); + return bgBrush; + } + +// ----------------------------------------------------------------------------- // CFreestyleEmailUiTextureManager::NewControlBarListBgBrushLC // ----------------------------------------------------------------------------- // @@ -506,7 +532,11 @@ } else if ( aId >= ETextureGridFirst ) // GRID ICONS { +// Platform layout change + //TInt gridIconSize = iAppUi->LayoutHandler()->GridIconSize(); + //iconSize.SetSize( gridIconSize, gridIconSize ); iconSize = iAppUi->LayoutHandler()->GridIconSize(); +// } else if ( aId >= ETextureMessageFirst /*&& aId < ETextureCalendarFirst*/ ) // MESSAGE ICONS { @@ -521,6 +551,7 @@ CFbsBitmap* mask(0); TScaleMode scalemode = EAspectRatioPreserved; +// icons changed switch ( aId ) { // LIST TEXTURE READING STARTS HERE @@ -594,27 +625,26 @@ EMbmFreestyleemailuiQgn_graf_cmail_list_selector_mask); } break; - case EListControlMarkOnIcon: + case EListControlMarkIcon: { - AknsUtils::CreateIconL( AknsUtils::SkinInstance(), - KAknsIIDQgnFsHscrActionArrowRight, bitmap, mask, iconFileName, - EMbmFreestyleemailuiQgn_prop_checkbox_on, - EMbmFreestyleemailuiQgn_prop_checkbox_on_mask ); - TInt tempsize = iAppUi->LayoutHandler()->SearchMarkIconSize(); + // Platform layout change + // Get mark icon from the skin, otherwise use default + AknsUtils::CreateColorIconL( + AknsUtils::SkinInstance(), + KAknsIIDQgnFsListItemSelected, + KAknsIIDQsnIconColors, + EAknsCIQsnIconColorsCG13, + bitmap, + mask, + //KAvkonBitmapFile, + iconFileName, + EMbmFreestyleemailuiQgn_indi_marked_add, + EMbmFreestyleemailuiQgn_indi_marked_add_mask, + KRgbBlack ); + TInt tempsize = iAppUi->LayoutHandler()->SearchLookingGlassIconSize(); iconSize.SetSize( tempsize, tempsize ); scalemode = EAspectRatioNotPreserved; - } - break; - case EListControlMarkOffIcon: - { - AknsUtils::CreateIconL( AknsUtils::SkinInstance(), - KAknsIIDQgnFsHscrActionArrowRight, bitmap, mask, iconFileName, - EMbmFreestyleemailuiQgn_prop_checkbox_off, - EMbmFreestyleemailuiQgn_prop_checkbox_off_mask ); - - TInt tempsize = iAppUi->LayoutHandler()->SearchMarkIconSize(); - iconSize.SetSize( tempsize, tempsize ); - scalemode = EAspectRatioNotPreserved; + // Platform layout change } break; case EListControlMenuIcon: @@ -1856,6 +1886,22 @@ KRgbBlack ); } break; + case EMarkingModeBackgroundIcon: + { + TRect mailListRect(iAppUi->LayoutHandler()->GetListRect()); + if ( mailListRect.Width() > mailListRect.Height() ) + { + iconSize.SetSize( mailListRect.Width(), mailListRect.Width() ); + } + else + { + iconSize.SetSize( mailListRect.Height(), mailListRect.Height() ); + } + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiCmail_marking_mode_bg, + EMbmFreestyleemailuiCmail_marking_mode_bg); + } + break; case EGridAboutTexture: default: // Branded mailbox icon @@ -2062,14 +2108,9 @@ iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EBackgroundTextureMailList, this, EAlfTextureFlagSkinContent); } break; - case EListControlMarkOnIcon: + case EListControlMarkIcon: { - iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EListControlMarkOnIcon, this, EAlfTextureFlagSkinContent); - break; - } - case EListControlMarkOffIcon: - { - iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EListControlMarkOffIcon, this, EAlfTextureFlagSkinContent); + iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EListControlMarkIcon, this, EAlfTextureFlagSkinContent); break; } case EListControlMenuIcon: @@ -2103,6 +2144,11 @@ iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EControlBarDescendingArrowTexture, this, EAlfTextureFlagSkinContent); } break; + case EMarkingModeBackgroundIcon: + { + iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EMarkingModeBackgroundIcon, this, EAlfTextureFlagRetainResolution); + } + break; // MESSAGE TEXTURES case EMessageReadIcon: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EMessageReadIcon, this, EAlfTextureFlagDefault); break; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiUtilities.cpp --- a/emailuis/emailui/src/FreestyleEmailUiUtilities.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiUtilities.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -799,29 +799,19 @@ { FUNC_LOG; CFreestyleEmailUiAppUi* appUi = (CFreestyleEmailUiAppUi*)CCoeEnv::Static()->AppUi(); - CFSMailMessage* message = appUi->GetMailClient()->GetMessageByUidL( + CFSMailMessage* mailMessage = appUi->GetMailClient()->GetMessageByUidL( aAttachmentPart.iMailBoxId, aAttachmentPart.iFolderId, aAttachmentPart.iMessageId, EFSMsgDataStructure ); - CleanupStack::PushL( message ); - CFSMailMessagePart* messagePart = NULL; - if ( message ) - { - messagePart = message->ChildPartL( aAttachmentPart.iMessagePartId ); - } + CleanupStack::PushL( mailMessage ); + CFSMailMessagePart* messagePart = mailMessage->ChildPartL( + aAttachmentPart.iMessagePartId ); CleanupStack::PushL( messagePart ); - if ( messagePart ) - { - OpenAttachmentL( *messagePart ); - } - else - { - User::Leave( KErrNotFound ); - } + OpenAttachmentL( *messagePart ); CleanupStack::PopAndDestroy( messagePart ); - CleanupStack::PopAndDestroy( message ); + CleanupStack::PopAndDestroy( mailMessage ); } // ----------------------------------------------------------------------------- @@ -832,8 +822,8 @@ { FUNC_LOG; const TDesC& attName = aAttachmentPart.AttachmentNameL(); - const TDesC& mimeType16 = aAttachmentPart.GetContentType(); - TFileType fileType = GetFileType( attName, mimeType16 ); + const TDesC* mimeType16 = &aAttachmentPart.GetContentType(); + TFileType fileType = GetFileType( attName, *mimeType16 ); // Check if attachment is actually an embedded message object. In that case we try to // open it using mail viewer. @@ -3125,63 +3115,6 @@ return isChineseSearchStr; } -// --------------------------------------------------------- -// Find if text is including Korean word -// --------------------------------------------------------- -// -TBool TFsEmailUiUtility::IsKoreanWord( const TDesC& aWord ) - { - TBool isKoreanSearchStr = EFalse; - const TInt len = aWord.Length(); - - const TUint KKoreanUnicodeHangulJamoBegin = 0x1100; - const TUint KKoreanUnicodeHangulJamoEnd = 0x11FF; - - for ( TInt ii = 0; ii < len; ii++ ) - { - if ( (TInt) aWord[ii] >= KKoreanUnicodeHangulJamoBegin - && (TInt) aWord[ii] <= KKoreanUnicodeHangulJamoEnd ) - { - isKoreanSearchStr = ETrue; - break; - } - } - - const TUint KKoreanUnicodeHangulCompatibilityJamoBegin = 0x3130; - const TUint KKoreanUnicodeHangulCompatibilityJamoEnd = 0x322F; - - if ( !isKoreanSearchStr ) - { - for ( TInt ii = 0; ii < len; ii++ ) - { - if ( (TInt) aWord[ii] >= KKoreanUnicodeHangulCompatibilityJamoBegin - && (TInt) aWord[ii] <= KKoreanUnicodeHangulCompatibilityJamoEnd ) - { - isKoreanSearchStr = ETrue; - break; - } - } - } - - const TUint KKoreanUnicodeSpanBegin = 0xAC00; - const TUint KKoreanUnicodeSpanEnd = 0xD7A3; - - if ( !isKoreanSearchStr ) - { - for ( TInt ii = 0; ii < len; ii++ ) - { - if ( (TInt) aWord[ii] >= KKoreanUnicodeSpanBegin - && (TInt) aWord[ii] <= KKoreanUnicodeSpanEnd ) - { - isKoreanSearchStr = ETrue; - break; - } - } - } - - return isKoreanSearchStr; - } - // ----------------------------------------------------------------------------- // TFsEmailUiUtility::GetFullIconFileNameL diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleEmailUiViewBase.cpp --- a/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -153,22 +153,6 @@ DeactivateControlGroup(); NavigateBackL(); } - - if( MailEditorId != Id() )// not for editor (when sending contact via mail) - { - //Reopen Contact details view if it was closed before - CFSEmailUiContactHandler* contactHandler = NULL; // not owned - CFsDelayedLoader* delLoader = CFsDelayedLoader::InstanceL(); // not owned - if( delLoader ) - { - contactHandler = delLoader->GetContactHandlerL(); - - if( contactHandler && contactHandler->WasDetailsClosed()) - { - contactHandler->ReopenContactDetailsL(iEikonEnv->WsSession()); - } - } - } } // --------------------------------------------------------------------------- @@ -646,23 +630,10 @@ if ( iPreviousAppUid != KFSEmailUiUid && iPreviousAppUid != KNullUid ) { - //don't send to background when back from Contact Details (CCAApp) - CFSEmailUiContactHandler* contactHandler(NULL); // not owned - CFsDelayedLoader* delLoader = CFsDelayedLoader::InstanceL(); // not owned - if( delLoader ) - { - contactHandler = delLoader->GetContactHandlerL(); - } - // for Contact Details, after contact was sent via mail, app shouldn't be sent to background - if( contactHandler && iPreviousAppUid == contactHandler->GetDetailsAppUid() ) - { - iSendToBackgroundOnDeactivation = EFalse; - iAppUi.SetSwitchingToBackground( EFalse ); - } // Email app should be hidden once the view gets deactivated. Note that hiding // should not happen before control group switching is over because that // may cause views of other Alfred apps to get distorted. - else if( !iAppUi.EmbeddedAppIsPreviousApp() ) // if previous app is embedded app, + if( !iAppUi.EmbeddedAppIsPreviousApp() ) // if previous app is embedded app, //do not need hide FSEmail app when previous app view gets deactivated. { iSendToBackgroundOnDeactivation = ETrue; diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp --- a/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -141,6 +141,14 @@ void CFreestyleMessageHeaderHTML::ConstructL() { iMailMessage.AttachmentListL( iAttachments ); + // Remove attachments with no name + for ( TInt i = iAttachments.Count() - 1; i >= 0; i-- ) + { + if ( !iAttachments[i]->AttachmentNameL().Length() ) + { + iAttachments.Remove( i ); + } + } } EXPORT_C void CFreestyleMessageHeaderHTML::ExportL() const diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp --- a/emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -31,11 +31,11 @@ #include #include #include -#include +#include #include -EXPORT_C CFreestyleMessageHeaderURLEventHandler* CFreestyleMessageHeaderURLEventHandler::NewL( - CFreestyleEmailUiAppUi& aAppUi, +EXPORT_C CFreestyleMessageHeaderURLEventHandler* CFreestyleMessageHeaderURLEventHandler::NewL( + CFreestyleEmailUiAppUi& aAppUi, CFsEmailUiHtmlViewerView& aView ) { CFreestyleMessageHeaderURLEventHandler* obj = new (ELeave) CFreestyleMessageHeaderURLEventHandler( aAppUi, aView ); @@ -45,54 +45,54 @@ return obj; } -CFreestyleMessageHeaderURLEventHandler::CFreestyleMessageHeaderURLEventHandler( - CFreestyleEmailUiAppUi& aAppUi, +CFreestyleMessageHeaderURLEventHandler::CFreestyleMessageHeaderURLEventHandler( + CFreestyleEmailUiAppUi& aAppUi, CFsEmailUiHtmlViewerView& aView ) - : iAppUi( aAppUi ), - iView( aView ), - iMailMessage( NULL ), + : iAppUi( aAppUi ), + iView( aView ), + iMailMessage( NULL ), iAttachmentsListModel( NULL ) { } void CFreestyleMessageHeaderURLEventHandler::ConstructL() { - iMessageHeaderURL = CFreestyleMessageHeaderURL::NewL(); + iMessageHeaderURL = CFreestyleMessageHeaderURL::NewL(); iHTMLReloadAO = CFSHtmlReloadAO::NewL(iView); - + } CFreestyleMessageHeaderURLEventHandler::~CFreestyleMessageHeaderURLEventHandler () { delete iMessageHeaderURL; - delete iHTMLReloadAO; + delete iHTMLReloadAO; if( iEmailAddressStylusPopup ) { - delete iEmailAddressStylusPopup; + delete iEmailAddressStylusPopup; } - + if( iAttachmentStylusPopup ) { - delete iAttachmentStylusPopup; + delete iAttachmentStylusPopup; } - + if( iWebAddressStylusPopup ) { - delete iWebAddressStylusPopup; - } - + delete iWebAddressStylusPopup; + } + delete iUrl; } EXPORT_C TBool CFreestyleMessageHeaderURLEventHandler::HandleEventL( const TDesC& aUri ) { - iMailMessage = iView.CurrentMessage(); + iMailMessage = iView.CurrentMessage(); iAttachmentsListModel = iView.CurrentAttachmentsListModel(); - + if ( ! CFreestyleMessageHeaderURL::IsMessageHeaderURL( aUri ) ) { //Handle http and https links - if( ( aUri.FindF( KURLHttpPrefix ) ) == 0 + if( ( aUri.FindF( KURLHttpPrefix ) ) == 0 ||( aUri.FindF( KURLHttpsPrefix ) ) == 0 ) { if ( iUrl ) @@ -101,9 +101,9 @@ iUrl = NULL; } iUrl = aUri.AllocL(); - iView.HandleWebAddressCommandL( EFsEmailUiCmdActionsOpenWeb, *iUrl ); + LaunchWebAddressMenuL( ); return ETrue; - } + } //Link wasn't handled return EFalse; } @@ -153,7 +153,7 @@ return; } - //Change the creation of the stylus menu here to avoid crash when calling SetItemDimmed(ETrue) multiple times + //Change the creation of the stylus menu here to avoid crash when calling SetItemDimmed(ETrue) multiple times //on same instance of the menu (if created only once in constructor). //Creating the menu everytime the user clicks on the link avoids this crash however performance is affected. if( iEmailAddressStylusPopup) @@ -161,22 +161,20 @@ delete iEmailAddressStylusPopup; iEmailAddressStylusPopup = NULL; } - + TPoint point( 0, 0 ); iEmailAddressStylusPopup = CAknStylusPopUpMenu::NewL( this , point ); TResourceReader reader; CCoeEnv::Static()->CreateResourceReaderLC( reader, R_STYLUS_POPUP_MENU_HTML_VIEW_EMAIL_ADDRESS ); iEmailAddressStylusPopup->ConstructFromResourceL( reader ); CleanupStack::PopAndDestroy(); //resource reader - - iEmailAddressStylusPopup->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, - !iView.IsRemoteLookupSupportedL() ); - iEmailAddressStylusPopup->SetPosition( iAppUi.LastSeenPointerPosition(), + + iEmailAddressStylusPopup->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, + !iView.IsRemoteLookupSupportedL() ); + iEmailAddressStylusPopup->SetPosition( iAppUi.ClientRect().Center(), CAknStylusPopUpMenu::EPositionTypeRightBottom ); iEmailAddressStylusPopup->ShowMenu(); } - - TBool CFreestyleMessageHeaderURLEventHandler::LaunchEmailAddressMenuHWKeyL() { TInt wsEventType = iAppUi.LastSeenWsEventType(); @@ -203,11 +201,10 @@ return ETrue; } - //From MEikMenuObserver void CFreestyleMessageHeaderURLEventHandler::ProcessCommandL( TInt aCommand ) { - + switch ( aCommand ) { case EFsEmailUiCmdActionsReply: @@ -219,37 +216,37 @@ iView.HandleEmailAddressCommandL( aCommand, *iMessageHeaderURL->ItemId() ); break; } - + case EFsEmailUiCmdCancelDownload: { iView.CancelAttachmentL( FindAttachmentL( *iMessageHeaderURL ) ); break; } - + case EFsEmailUiCmdCancelAllDownloads: { iView.CancelAllAttachmentsL(); break; } - + case EFsEmailUiCmdOpenAttachment: { iView.OpenAttachmentL( FindAttachmentL( *iMessageHeaderURL ) ); break; } - + case EFsEmailUiCmdSave: { iView.SaveAttachmentL( FindAttachmentL( *iMessageHeaderURL ) ); break; } - + case EFsEmailUiCmdSaveAll: { iView.SaveAllAttachmentsL( ); - break; + break; } - + case EFsEmailUiCmdActionsOpenWeb: case EFsEmailUiCmdActionsAddBookmark: case EFsEmailUiCmdActionsCopyWWWAddressToClipboard: @@ -257,18 +254,18 @@ iView.HandleWebAddressCommandL( aCommand, *iUrl ); break; } - + } } -const TAttachmentData& CFreestyleMessageHeaderURLEventHandler::FindAttachmentL( +const TAttachmentData& CFreestyleMessageHeaderURLEventHandler::FindAttachmentL( const CFreestyleMessageHeaderURL& aAttachmentUrl ) { User::LeaveIfNull( iAttachmentsListModel ); TUint id; TLex parser( *aAttachmentUrl.ItemId() ); parser.Val( id ); - + TInt found = KErrNotFound; for (TInt i=0; iGetModel().Count(); i++) { @@ -278,10 +275,10 @@ break; } } - + if ( found == KErrNotFound ) { - // Probably, only the headers were downloaded. Check if attachments + // Probably, only the headers were downloaded. Check if attachments // were downloaded later. if( iMailMessage ) { @@ -301,11 +298,11 @@ User::Leave( KErrNotFound ); } } - + return iAttachmentsListModel->GetModel()[found]; } -void CFreestyleMessageHeaderURLEventHandler::LaunchAttachmentMenuL( +void CFreestyleMessageHeaderURLEventHandler::LaunchAttachmentMenuL( const TAttachmentData& aAttachment ) { ASSERT( iAppUi.DownloadInfoMediator() ); @@ -314,8 +311,6 @@ { return; } - - //Change the creation of the stylus menu here to avoid crash when calling SetItemDimmed(ETrue) multiple times //on same instance of the menu (if created only once in constructor). //Creating the menu everytime the user clicks on the link avoids this crash however performance is affected. @@ -330,38 +325,38 @@ CCoeEnv::Static()->CreateResourceReaderLC( reader, R_STYLUS_POPUP_MENU_HTML_VIEW_ATTACHMENT ); iAttachmentStylusPopup->ConstructFromResourceL( reader ); CleanupStack::PopAndDestroy(); //resource reader - - + + //Dim all item by default iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdOpenAttachment, ETrue ); iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, ETrue ); iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, ETrue ); - iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelDownload, ETrue ); + iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelDownload, ETrue ); iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelAllDownloads, ETrue ); const TBool isMessage( iAttachmentsListModel->IsMessage( aAttachment ) ); - + if ( iAppUi.DownloadInfoMediator()->IsDownloading( aAttachment.partData.iMessagePartId ) ) - { - iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelDownload, EFalse ); + { + iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelDownload, EFalse ); } else if ( aAttachment.downloadProgress == KComplete ) { iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdOpenAttachment, EFalse ); - + // block saving of embedded messages if needed. if ( iView.IsEmbeddedMsgView() ) { if ( iView.IsEmbeddedMsgSavingAllowed() || !isMessage ) { - iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, EFalse ); - } + iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, EFalse ); + } } else { iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, isMessage && !iView.IsEmbeddedMsgSavingAllowed() ); } - + if ( iAttachmentsListModel->GetModel().Count() > 1 ) { // Save all cannot be shown if there is one message attachment and saving is not supported @@ -371,33 +366,32 @@ // are any message type attachments. This is due to limitations of Activesync plugin. if( !(iView.IsEmbeddedMsgView() && iAttachmentsListModel->IsThereAnyMessageAttachments()) ) { - iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, EFalse ); + iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, EFalse ); } } - } + } } else { iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdOpenAttachment, EFalse ); - iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, isMessage ); + iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSave, isMessage ); if ( iAttachmentsListModel->GetModel().Count() > 1 ) { iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdSaveAll, iAttachmentsListModel->IsThereAnyMessageAttachments() && !iView.IsEmbeddedMsgSavingAllowed() ); - } + } } if ( iAttachmentsListModel->IsMultiplyDownloadsOngoing() ) { iAttachmentStylusPopup->SetItemDimmed( EFsEmailUiCmdCancelAllDownloads, EFalse ); } - - iAttachmentStylusPopup->SetPosition( iAppUi.LastSeenPointerPosition(), - CAknStylusPopUpMenu::EPositionTypeRightBottom ); + + iAttachmentStylusPopup->SetPosition( iAppUi.LastSeenPointerPosition(), + CAknStylusPopUpMenu::EPositionTypeLeftTop ); iAttachmentStylusPopup->ShowMenu(); } - TBool CFreestyleMessageHeaderURLEventHandler::LaunchAttachmentMenuHWKeyL( const TAttachmentData& aAttachment ) { @@ -483,7 +477,6 @@ return ETrue; } - //Open the Avkon stylus popup when a web address link was pressed void CFreestyleMessageHeaderURLEventHandler::LaunchWebAddressMenuL() { @@ -491,8 +484,8 @@ { return; } - - //Change the creation of the stylus menu here to avoid crash when calling SetItemDimmed(ETrue) multiple times + + //Change the creation of the stylus menu here to avoid crash when calling SetItemDimmed(ETrue) multiple times //on same instance of the menu (if created only once in constructor). //Creating the menu everytime the user clicks on the link avoids this crash however performance is affected. if( iWebAddressStylusPopup ) @@ -500,20 +493,19 @@ delete iWebAddressStylusPopup; iWebAddressStylusPopup = NULL; } - + TPoint point( 0, 0 ); iWebAddressStylusPopup = CAknStylusPopUpMenu::NewL( this , point ); TResourceReader reader; CCoeEnv::Static()->CreateResourceReaderLC( reader, R_STYLUS_POPUP_MENU_HTML_VIEW_WEB_ADDRESS ); iWebAddressStylusPopup->ConstructFromResourceL( reader ); CleanupStack::PopAndDestroy(); //resource reader - - iWebAddressStylusPopup->SetPosition( iAppUi.LastSeenPointerPosition(), + + iWebAddressStylusPopup->SetPosition( iAppUi.ClientRect().Center(), CAknStylusPopUpMenu::EPositionTypeRightBottom ); iWebAddressStylusPopup->ShowMenu(); } - TBool CFreestyleMessageHeaderURLEventHandler::LaunchWebAddressMenuHWKeyL() { TInt wsEventType = iAppUi.LastSeenWsEventType(); diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/OverlayControl.cpp --- a/emailuis/emailui/src/OverlayControl.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/OverlayControl.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -73,7 +73,7 @@ if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) { // Give feedback to user (vibration) - iTouchFeedBack->InstantFeedback( this, ETouchFeedbackBasic ); + iTouchFeedBack->InstantFeedback( this, ETouchFeedbackBasicButton ); SetPointerCapture( ETrue ); } CCoeControl::HandlePointerEventL( aPointerEvent ); diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/ncsaddressinputfield.cpp --- a/emailuis/emailui/src/ncsaddressinputfield.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/ncsaddressinputfield.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -33,7 +33,6 @@ #include #include #include -#include #include "FreestyleEmailUiAppui.h" #include "FreestyleEmailUiLayoutData.h" @@ -45,7 +44,6 @@ #include "ncsutility.h" #include "ncsheadercontainer.h" #include "txtrich.h" -#include "freestyleemailcenrepkeys.h" // --------------------------------------------------------------------------- // constructor @@ -92,22 +90,23 @@ // ----------------------------------------------------------------------------- // void CNcsAddressInputField::ConstructL( TInt aLabelTextId ) - { + { FUNC_LOG; - // Create label - //Load the label string - HBufC* aTextBuf = StringLoader::LoadLC( aLabelTextId ); + // Create label + //Load the label string + HBufC* aTextBuf = StringLoader::LoadLC( aLabelTextId ); - TPtrC captionText = aTextBuf ? aTextBuf->Des() : TPtrC(); - CreateControlsL( captionText ); - - iTextEditor = new ( ELeave ) CNcsAifEditor( iSizeObserver, captionText ); + TPtrC captionText = aTextBuf ? aTextBuf->Des() : TPtrC(); + CreateControlsL( captionText ); + + iTextEditor = new ( ELeave ) CNcsAifEditor( iSizeObserver, + captionText ); // iTextEditor is not completely constructed until in SetContainerWindowL() - iTextEditor->SetPopupList(iAddressPopupList); + iTextEditor->SetPopupList(iAddressPopupList); - CleanupStack::PopAndDestroy( aTextBuf ); - } + CleanupStack::PopAndDestroy( aTextBuf ); + } // --------------------------------------------------------------------------- // Destructor @@ -119,8 +118,15 @@ delete iTextEditor; delete iButton; delete iLabel; +// Platform layout change + /*if ( iFont ) + { + ControlEnv()->ScreenDevice()->ReleaseFont( iFont ); + iFont = NULL; + }*/ } +// // ----------------------------------------------------------------------------- // CNcsHeaderContainer::CreateControlsL() // ----------------------------------------------------------------------------- @@ -148,6 +154,7 @@ iLabel->SetBrushStyle(CWindowGc::ENullBrush); } } +// // --------------------------------------------------------------------------- // SetContainerWindow @@ -160,51 +167,39 @@ FUNC_LOG; CCoeControl::SetContainerWindowL(aContainer); - InitComponentArrayL(); - // Check if we need to construct the components - if (Components().Count() == 2) return; + InitComponentArrayL(); + // Check if we need to construct the components + if (Components().Count() == 2) return; - // Load the controls into the compoent array - CCoeControlArray& controls = Components(); - controls.SetControlsOwnedExternally(ETrue); - // - if( iButton ) - { - controls.AppendLC( iButton ); - CleanupStack::Pop( iButton ); - } - else - { - controls.AppendLC( iLabel ); - CleanupStack::Pop( iLabel ); - } - - controls.AppendLC(iTextEditor); + // Load the controls into the compoent array + CCoeControlArray& controls = Components(); + controls.SetControlsOwnedExternally(ETrue); + // + if( iButton ) + { + controls.AppendLC( iButton ); + CleanupStack::Pop( iButton ); + } + else + { + controls.AppendLC( iLabel ); + CleanupStack::Pop( iLabel ); + } + // + controls.AppendLC(iTextEditor); CleanupStack::Pop(iTextEditor); - // Setup the text editor - iTextEditor->ConstructL( &aContainer, KMaxAddressFieldLines, 0 ); +// + + // Setup the text editor + iTextEditor->ConstructL( &aContainer, KMaxAddressFieldLines, 0 ); +// iTextEditor->SetBorder( TGulBorder::ENone ); - iTextEditor->SetAknEditorInputMode( EAknEditorTextInputMode ); - iTextEditor->SetAknEditorFlags( EAknEditorFlagNoT9 | EAknEditorFlagUseSCTNumericCharmap ); - - CRepository* repository = NULL; - TRAPD( err, repository = CRepository::NewL( KFreestyleEmailCenRep ) ); - if ( !err ) - { - TInt value( 0 ); - err = repository->Get( KEmailFeatureSplitScreen, value ); - if( !err && value ) - { - iTextEditor->SetAknEditorFlags( iTextEditor->AknEditorFlags() | EAknEditorFlagEnablePartialScreen ); - } - } - delete repository; - repository = NULL; - - iTextEditor->SetAknEditorCurrentCase( EAknEditorLowerCase ); - iTextEditor->CreateScrollBarFrameL()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); + iTextEditor->SetAknEditorInputMode( EAknEditorTextInputMode ); + iTextEditor->SetAknEditorFlags( EAknEditorFlagNoT9 | EAknEditorFlagUseSCTNumericCharmap ); + iTextEditor->SetAknEditorCurrentCase( EAknEditorLowerCase ); + iTextEditor->CreateScrollBarFrameL()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); iTextEditor->SetEdwinSizeObserver( this ); iTextEditor->SetupEditorL(); @@ -254,27 +249,27 @@ // ----------------------------------------------------------------------------- // void CNcsAddressInputField::SizeChanged() - { + { FUNC_LOG; - TRect rect = Rect(); - - if( AknLayoutUtils::PenEnabled() ) - { - LayoutTouch(); - } - else - { - LayoutNonTouch(); - } + TRect rect = Rect(); + + if( AknLayoutUtils::PenEnabled() ) + { + LayoutTouch(); + } + else + { + LayoutNonTouch(); + } // This needs to be bidi as in mirrored layout // writing language left to right can be set. // Need to set here as layout sets it also to left or right. iTextEditor->SetAlignment( EAknEditorAlignBidi ); - + UpdateFontSize(); - + if (iTextEditor->ScrollBarFrame()) { TRect rc = iTextEditor->Rect(); @@ -288,37 +283,38 @@ } iTextEditor->SetRect(rc); } - + PositionChanged(); - } + } // ----------------------------------------------------------------------------- // CNcsHeaderContainer::PositionChanged() // set size // ----------------------------------------------------------------------------- void CNcsAddressInputField::PositionChanged() - { + { FUNC_LOG; - + // keep the button in view as long as possible if( iButton && iParentControl->IsVisible() ) - { - const TRect rect( Rect() ); - const TRect buttonRect( iButton->Rect() ); - - TInt newButtonPos( iOriginalButtonPos.iY - iOriginalFieldPos.iY ); + { + const TRect rect( Rect() ); + const TRect buttonRect( iButton->Rect() ); + + TInt newButtonPos( iOriginalButtonPos.iY - iOriginalFieldPos.iY ); + + if( rect.iTl.iY < 0 && newButtonPos + buttonRect.Height() < rect.iBr.iY ) + { + iButton->SetPosition( TPoint(iOriginalButtonPos.iX, newButtonPos) ); + } + else + { + iButton->SetPosition( TPoint(iOriginalButtonPos.iX, newButtonPos + rect.iTl.iY) ); + } + } + } - if( rect.iTl.iY < 0 && newButtonPos + buttonRect.Height() < rect.iBr.iY ) - { - iButton->SetPosition( TPoint(iOriginalButtonPos.iX, newButtonPos) ); - } - else - { - iButton->SetPosition( TPoint(iOriginalButtonPos.iX, newButtonPos + rect.iTl.iY) ); - } - } - } - +// // ----------------------------------------------------------------------------- // CNcsAddressInputField::LayoutNonTouch() // @@ -348,7 +344,7 @@ iTextEditor->UpdateCustomDrawer(); } - + // ----------------------------------------------------------------------------- // CNcsAddressInputField::HandlePointerEventL() // Handles pointer events @@ -356,33 +352,37 @@ // void CNcsAddressInputField::HandlePointerEventL( const TPointerEvent& aPointerEvent ) { - FUNC_LOG; - CCoeControl::HandlePointerEventL( aPointerEvent ); - - switch ( aPointerEvent.iType ) + FUNC_LOG; + iTextEditor->HandlePointerEventL(aPointerEvent); + if( iButton ) { - case TPointerEvent::EButton1Down: - { + iButton->HandlePointerEventL( aPointerEvent ); + } + + switch( aPointerEvent.iType ) + { + case TPointerEvent::EButton1Down: + { // Save start position so that it can be used in // drag/scrolling calculations iStartPosition = aPointerEvent.iPosition; iIsDraggingStarted = EFalse; break; - } - - case TPointerEvent::EDrag: - { + } + + case TPointerEvent::EDrag: + { if ( !iIsDraggingStarted && iPhysics ) { TInt drag( iStartPosition.iY - aPointerEvent.iPosition.iY ); if ( Abs( drag ) > iPhysics->DragThreshold() ) { - iIsDraggingStarted = ETrue; + iIsDraggingStarted = ETrue; } } break; - } - } + } + } } // ----------------------------------------------------------------------------- @@ -400,6 +400,7 @@ } } } +// // ----------------------------------------------------------------------------- // CNcsAddressInputField::OfferKeyEventL() @@ -408,22 +409,22 @@ // TKeyResponse CNcsAddressInputField::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) - { + { FUNC_LOG; - TKeyResponse ret( EKeyWasNotConsumed ); + TKeyResponse ret( EKeyWasNotConsumed ); - if( aKeyEvent.iCode == EKeyOK ) - { - iTextEditor->SetCursorPosL( iTextEditor->TextLength(), EFalse ); - iTextEditor->UpdateAddressListAllL(); - } - else - { - ret = iTextEditor->OfferKeyEventL( aKeyEvent, aType ); - } + if( aKeyEvent.iCode == EKeyOK ) + { + iTextEditor->SetCursorPosL( iTextEditor->TextLength(), EFalse ); + iTextEditor->UpdateAddressListAllL(); + } + else + { + ret = iTextEditor->OfferKeyEventL( aKeyEvent, aType ); + } - return ret; - } + return ret; + } // ----------------------------------------------------------------------------- // CNcsAddressInputField::FocusChanged() @@ -436,6 +437,30 @@ { iTextEditor->SetFocus( ETrue, aDrawNow ); //TRAP_IGNORE( iTextEditor->SetCursorPosL( iTextEditor->TextLength(), EFalse ) ); + + // make sure that control is visible on screen + if ( Rect().iTl.iY < 0 ) + { + TPoint pt = TPoint( 0, 0 ); + Reposition( pt,Rect().Width() ); + iSizeObserver->UpdateFieldPosition( this ); + } + else + { + TPoint pos = PositionRelativeToScreen(); + pos.iY += Size().iHeight; + CWsScreenDevice* screenDev = ControlEnv()->ScreenDevice(); + TPixelsAndRotation pix; + screenDev->GetDefaultScreenSizeAndRotation( pix ); + const TInt h = pix.iPixelSize.iHeight; + if ( pos.iY >= h - h / 3 ) + { + TPoint pt = TPoint( 0, h / 3 ); + Reposition( pt,Rect().Width() ); + iSizeObserver->UpdateFieldPosition( this ); + } + } + if ( iParentControl ) { TRAP_IGNORE( iParentControl->SetMskL() ); @@ -728,10 +753,10 @@ // CNcsAddressInputField::GetLineRectL() // ----------------------------------------------------------------------------- // -void CNcsAddressInputField::GetLineRect( TRect& aLineRect ) const +void CNcsAddressInputField::GetLineRectL( TRect& aLineRect ) const { FUNC_LOG; - return iTextEditor->GetLineRect( aLineRect ); + return iTextEditor->GetLineRectL( aLineRect ); } // ----------------------------------------------------------------------------- diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/ncsaifeditor.cpp --- a/emailuis/emailui/src/ncsaifeditor.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/ncsaifeditor.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -216,17 +216,16 @@ } // --------------------------------------------------------------------------- -// Constructor +// constructor/destructor // --------------------------------------------------------------------------- // CNcsAifEditor::CNcsAifEditor( MNcsFieldSizeObserver* aSizeObserver, const TDesC& aCaptionText ) - : CNcsEditor( aSizeObserver, ETrue, ENcsEditorAddress, aCaptionText ), - iAddressPopupList( NULL ), + : CNcsEditor( aSizeObserver, ETrue, ENcsEditorAddress, aCaptionText ), iAddressPopupList( NULL ), iAddLeftover( ETrue ) { FUNC_LOG; - SetEdwinObserver( this ); + SetEdwinObserver( this ); } // --------------------------------------------------------------------------- @@ -249,15 +248,16 @@ CNcsAifEditor::~CNcsAifEditor() { FUNC_LOG; - iArray.ResetAndDestroy(); - iAddressArray.Reset(); - if ( iAsyncCallBack ) - { - iAsyncCallBack->Cancel(); - delete iAsyncCallBack; - } + iArray.ResetAndDestroy(); + iAddressArray.Reset(); + if ( iAsyncCallBack ) + { + iAsyncCallBack->Cancel(); + delete iAsyncCallBack; + } } + // ----------------------------------------------------------------------------- // CNcsAifEditor::CursorLineNumber() const // ----------------------------------------------------------------------------- @@ -311,61 +311,22 @@ { ret = SetEditorSelectionL( aKeyEvent, aType ); } - + //when press a key down, record the coursor position if ( aType == EEventKeyDown ) - { - iLastTimeCursorPos = CursorPos(); - } + { + iLastTimeCursorPos = CursorPos(); + } if ( ret == EKeyWasNotConsumed ) { // enter completes the address entry - if ( aType == EEventKey && ( aKeyEvent.iCode == EKeyEnter || - aKeyEvent.iScanCode == EStdKeyEnter ) ) - { - // make sure there is really some text inputted - const TInt cursorPos = CursorPos(); - TCursorSelection selection = NonEntryTextAtPos( cursorPos ); - - const TInt length = selection.Length(); - if ( length > 0 ) - { - HBufC* text = HBufC::NewLC( length ); - TPtr ptr = text->Des(); - Text()->Extract( ptr, selection.LowerPos(), length ); - ptr.Trim(); - - // complete the entry by adding a semicolon, - // address will be added in HandleTextUpdateL - if ( ptr.Length() > 0 ) - { - Text()->InsertL( cursorPos, KCharAddressDelimeterSemiColon ); - HandleTextChangedL(); - SetCursorPosL( cursorPos + 1, EFalse ); - iLastTimeCursorPos = CursorPos(); - HandleTextUpdateL(); - } - - CleanupStack::PopAndDestroy( text ); - } - } - else if ( IsCharacterKey( aKeyEvent ) ) - { - PrepareForTextInputL( CursorPos() ); - } - iTextSelection = Selection(); - ret = CNcsEditor::OfferKeyEventL( aKeyEvent, aType ); - } - - // for Korean we need to simulate event 'text update' as FEP - // doesn't send it and the MRU is not shown - if ( User::Language() == ELangKorean ) - { - if ( ret == EKeyWasNotConsumed && aType == EEventKeyUp ) - { + if( aType == EEventKey && (aKeyEvent.iCode == EKeyEnter || + aKeyEvent.iScanCode == EStdKeyEnter) ) + { + // make sure there is really some text inputted TInt cursorPos( CursorPos() ); - + TCursorSelection selection = NonEntryTextAtPos( cursorPos ); TInt length( selection.Length() ); @@ -374,14 +335,20 @@ TPtr ptr = text->Des(); Text()->Extract( ptr, selection.LowerPos(), length ); ptr.Trim(); - - if ( TFsEmailUiUtility::IsKoreanWord( ptr ) ) - { - HandleTextUpdateDeferred(); - } - - CleanupStack::PopAndDestroy( text ); - } + + // complete the entry by adding a semicolon, + // address will be added in HandleTextUpdateL + if( ptr.Length() > 0 ) + { + Text()->InsertL( cursorPos, KCharAddressDelimeterSemiColon ); + HandleTextChangedL(); + SetCursorPosL( cursorPos + 1, EFalse ); + } + + CleanupStack::PopAndDestroy( text ); + } + iTextSelection = Selection(); + ret = CNcsEditor::OfferKeyEventL( aKeyEvent, aType ); } return ret; @@ -433,7 +400,7 @@ if ( aKeyEvent.iCode == EKeyUpArrow || aKeyEvent.iCode == EKeyDownArrow ) { CompleteEntryL(); - + response = CNcsEditor::OfferKeyEventL( aKeyEvent,aType ); if ( response == EKeyWasConsumed ) { @@ -446,11 +413,10 @@ } } // Check if the cursor is in any of the addresses - else if ( aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyBackspace ) + else if( aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyBackspace ) { // We're moving left, but haven't yet. - const TInt cursorPos = CursorPos(); - entry = GetEntryAt( cursorPos, EDirectionLeft ); + entry = GetEntryAt( CursorPos(), EDirectionLeft ); if ( entry ) { if ( selection.Length() && aKeyEvent.iCode == EKeyLeftArrow) @@ -465,25 +431,11 @@ response = EKeyWasConsumed; } } - else - { - // Complete entry, if cursor is being moved to the previous row. - TCursorSelection selection = NonEntryTextAndSpaceAtPos( cursorPos ); - if ( cursorPos > 0 && selection.LowerPos() + 1 == cursorPos ) - { - if ( IsDelimiter( CharAtPos( selection.LowerPos() ) ) ) - { - CompleteEntryL(); - SetCursorPosL( cursorPos, EFalse ); - } - } - } } - else if ( aKeyEvent.iCode == EKeyRightArrow || aKeyEvent.iCode == EKeyDelete ) + else if( aKeyEvent.iCode == EKeyRightArrow || aKeyEvent.iCode == EKeyDelete ) { // We're moving right, but haven't yet. - const TInt cursorPos = CursorPos(); - entry = GetEntryAt( cursorPos, EDirectionRight ); + entry = GetEntryAt( CursorPos(), EDirectionRight ); if ( entry ) { if ( selection.Length() && aKeyEvent.iCode == EKeyRightArrow ) @@ -498,18 +450,6 @@ response = EKeyWasConsumed; } } - else - { - // Complete entry, if cursor is being moved to the next row. - TCursorSelection selection = NonEntryTextAndSpaceAtPos( cursorPos ); - if ( cursorPos > 0 && selection.HigherPos() - 1 == cursorPos ) - { - if ( IsDelimiter( CharAtPos( selection.HigherPos() - 1 ) ) ) - { - CompleteEntryL(); - } - } - } } // to fix problems with updating CBA when hash key is pressed and hold else if ( aKeyEvent.iScanCode == EStdKeyHash ) @@ -567,11 +507,10 @@ break; } } - - SetCursorVisible( EFalse ); + ClearSelectionL(); - RepositionEntries( entry ); - SetCursorVisible( ETrue ); + + RepositionEntriesL( entry ); // The key event is set consumed only on delete and backpace // events, other events need to be forwarded to the editor. @@ -590,26 +529,26 @@ // --------------------------------------------------------------------------- // void CNcsAifEditor::DoCharChangeL() - { + { FUNC_LOG; - RecalculateEntryPositions(); + RecalculateEntryPositions(); - TChar previousChar = CharAtPos( CursorPos() - 1 ); - TBool sentinel = ( previousChar == KCharAddressDelimeterSemiColon || - previousChar == KCharAddressDelimeterComma ); - if ( sentinel ) + TChar previousChar = CharAtPos( CursorPos() - 1 ); + TBool sentinel = ( previousChar == KCharAddressDelimeterSemiColon || + previousChar == KCharAddressDelimeterComma ); + if ( sentinel ) { // if comma was pressed we replace it with semicolon - if ( previousChar == KCharAddressDelimeterComma ) + if ( previousChar == KCharAddressDelimeterComma ) { - CPlainText* text = Text(); - text->DeleteL( CursorPos() - 1, 1 ); - text->InsertL( CursorPos() - 1, KCharAddressDelimeterSemiColon ); + CPlainText* text = Text(); + text->DeleteL( CursorPos() - 1, 1 ); + text->InsertL( CursorPos() - 1, KCharAddressDelimeterSemiColon ); } - ParseNewAddressL(); + ParseNewAddressL(); } - UpdateAddressAutoCompletionL(); - } + UpdateAddressAutoCompletionL(); + } // --------------------------------------------------------------------------- // CNcsAddressInputField::CharAtPos @@ -618,15 +557,15 @@ TChar CNcsAifEditor::CharAtPos( TInt aPos ) const { FUNC_LOG; - if ( aPos >= 0 && aPos < TextLength() ) + if ( aPos >= 0 && aPos < TextLength() ) { - TBuf<1> buf; - Text()->Extract( buf, aPos, 1 ); - return buf[0]; + TBuf<1> buf; + Text()->Extract( buf, aPos, 1 ); + return buf[0]; } - else + else { - return 0; + return 0; } } @@ -645,8 +584,7 @@ // CNcsAifEditor::AppendAddressesL() // ----------------------------------------------------------------------------- // -void CNcsAifEditor::AppendAddressesL( - const RPointerArray& aAddresses ) +void CNcsAifEditor::AppendAddressesL( const RPointerArray& aAddresses ) { FUNC_LOG; // First, add all the addresses without updating the editor text contents @@ -654,13 +592,8 @@ { AddAddressL( *aAddresses[i], EFalse ); } - - // Update editor text content after all the items have been added. - SetCursorVisible( EFalse ); - const TInt count = iArray.Count(); - CNcsAifEntry* lastEntry = count ? iArray[count-1] : NULL; - RepositionEntries( lastEntry ); - SetCursorVisible( ETrue ); + // Update editor text content after all the items have been added + RepositionEntriesL( NULL ); } // ----------------------------------------------------------------------------- @@ -669,17 +602,17 @@ // const RPointerArray& CNcsAifEditor::GetAddressesL() { - // Clear the existing array since it may be out of sync - iAddressArray.Reset(); + // Clear the existing array since it may be out of sync + iAddressArray.Reset(); - for ( TInt i=0; iAddress() ); + iAddressArray.AppendL(&iArray[i]->Address()); } - return iAddressArray; + return iAddressArray; } - + // ----------------------------------------------------------------------------- // CNcsAifEditor::GetEntryAt() // ----------------------------------------------------------------------------- @@ -777,29 +710,29 @@ void CNcsAifEditor::ParseNewAddressL() { FUNC_LOG; - HBufC* text = GetNonEntryTextLC(); - __ASSERT_ALWAYS( text, Panic(EFSEmailUiNullPointerException) ); + HBufC* text = GetNonEntryTextLC(); + __ASSERT_ALWAYS( text, Panic(EFSEmailUiNullPointerException) ); - if ( text->Length() ) - { + if ( text->Length() ) + { // if changing focus leftover text is parsed to email // object - we don't need to add it anymore iAddLeftover = EFalse; // check if there is a name for the email address HBufC* name = CFsDelayedLoader::InstanceL()->GetContactHandlerL()->GetLastSearchNameL( *text ); - if ( name ) - { + if ( name ) + { CleanupStack::PushL( name ); - AddAddressL( *name, *text, ETrue ); - CleanupStack::PopAndDestroy( name ); - } - else - { - AddAddressL( KNullDesC, *text ); - } - } - - CleanupStack::PopAndDestroy(text); + AddAddressL( *name, *text, ETrue ); + CleanupStack::PopAndDestroy( name ); + } + else + { + AddAddressL( KNullDesC, *text ); + } + } + + CleanupStack::PopAndDestroy(text); } // ----------------------------------------------------------------------------- @@ -915,8 +848,7 @@ // CNcsAifEditor::AddAddressL() // ----------------------------------------------------------------------------- // -void CNcsAifEditor::AddAddressL( const CNcsEmailAddressObject& aAddress, - TBool aUpdateEditorText /*= ETrue*/ ) +void CNcsAifEditor::AddAddressL( const CNcsEmailAddressObject& aAddress, TBool aUpdateEditorText /*= ETrue*/ ) { FUNC_LOG; CNcsAifEntry* entry = CNcsAifEntry::NewL( aAddress ); @@ -934,59 +866,57 @@ FUNC_LOG; CNcsAifEntry* entry = CNcsAifEntry::NewL( aDisplayName, aEmail, aDisplayFull ); CleanupStack::PushL( entry ); - AddAddressL( entry, aUpdateEditorText ); - CleanupStack::Pop( entry ); + AddAddressL( entry, aUpdateEditorText ); + CleanupStack::Pop( entry ); } void CNcsAifEditor::AddAddressL( CNcsAifEntry* aNewEntry, TBool aUpdateEditorText ) { FUNC_LOG; - TInt idx; - - // Check for duplicate display names - for ( idx=0 ; idxIsSameDN(*aNewEntry) ) + if ( iArray[idx]->IsSameDN(*aNewEntry) ) { - iArray[idx]->SetDupL(); - aNewEntry->SetDupL(); + iArray[idx]->SetDupL(); + aNewEntry->SetDupL(); } } - // Find the location where we need to insert the address. - // Browse from back to forth to make last index as default index. - // This ensures items remain in correct order when populating field from - // existing message. - TInt cursorPos = CursorPos(); + // Find the location where we need to insert the address. + // Browse from back to forth to make last index as default index. + // This ensures items remain in correct order when populating field from + // existing message. + TInt cursorPos = CursorPos(); // if we are at the end of editor the address was // added from MRU list or separator was typed in if ( cursorPos == Text()->DocumentLength() ) { iAddLeftover = EFalse; } - - for ( idx = iArray.Count() ; idx > 0 ; idx-- ) + + for ( idx = iArray.Count() ; idx > 0 ; idx-- ) { - if ( cursorPos >= iArray[idx-1]->End() ) break; + if ( cursorPos >= iArray[idx-1]->End() ) break; } - if ( idx == iArray.Count() ) - { - // Tack the address onto the end of the array - iArray.AppendL( aNewEntry ); - } - else + if ( idx == iArray.Count() ) { - iArray.InsertL( aNewEntry, idx ); + // Tack the address onto the end of the array + iArray.AppendL( aNewEntry ); } - - if ( aUpdateEditorText ) + else { - // Trap because we must not leave after we have taken the ownership of - // aNewEntry. Otherwise douple deletion might happen. - SetCursorVisible( EFalse ); - RepositionEntries( aNewEntry ); - SetCursorVisible( ETrue ); + iArray.InsertL( aNewEntry, idx ); } + + if ( aUpdateEditorText ) + { + // Trap because we must not leave after we have taken the ownership of aNewEntry. + // Otherwise douple deletion might happen. + TRAP_IGNORE( RepositionEntriesL( aNewEntry ) ); + } } // --------------------------------------------------------------------------- @@ -1036,37 +966,27 @@ } // --------------------------------------------------------------------------- -// CNcsAifEditor::RepositionEntries() -// --------------------------------------------------------------------------- -// -TInt CNcsAifEditor::RepositionEntries( const CNcsAifEntry* aPosEntry ) - { - FUNC_LOG; - TRAPD( err, RepositionEntriesL( aPosEntry ) ); - return err; - } - -// --------------------------------------------------------------------------- // CNcsAifEditor::RepositionEntriesL() // --------------------------------------------------------------------------- // void CNcsAifEditor::RepositionEntriesL( const CNcsAifEntry* aPosEntry ) - { + { FUNC_LOG; - TInt pos = 0; - CNcsAifEntry* entry; - for ( TInt i=0 ; iSetPos( pos ); - pos++; // for whitespace - } + TInt pos = 0; + CNcsAifEntry* entry; + for ( TInt i=0 ; iSetPos( pos ); + pos++; // for whitespace + } - // Reset the text - HBufC* text = GetFormattedAddressListLC( iArray ); - // fix for dissapearing text PWAN-82DNEJ - //SetCursorPosL( 0, EFalse ); //In case the cursor pos is invalid - + // Reset the text + HBufC* text = NULL; + text = GetFormattedAddressListLC( iArray ); + // fix for dissapearing text PWAN-82DNEJ + SetCursorPosL( 0, EFalse ); //In case the cursor pos is invalid + if ( iAddLeftover ) { TInt lengthBefore = Text()->DocumentLength(); @@ -1081,10 +1001,10 @@ HBufC* newText = HBufC::NewLC( text->Length() + leftover.Length() ); TPtr newTextPtr = newText->Des(); // add all email addresses - newTextPtr.Append( *text ); + newTextPtr.Append( text->Des() ); // add the text that was after last email object newTextPtr.Append( leftover ); - + SetTextL( newText ); CleanupStack::PopAndDestroy( newText ); CleanupStack::PopAndDestroy( textBefore ); @@ -1093,21 +1013,19 @@ { SetTextL( text ); } - - if ( !aPosEntry ) - { - // Set cursor at the beginning of the document. - SetCursorPosL( 0, EFalse ); - } - else - { - // Set the cursor at the end of the given entry - SetCursorPosL( aPosEntry->End(), EFalse ); - } - CleanupStack::PopAndDestroy( text ); HandleTextChangedL(); - } + + // Set the cursor at the end of the given entry + if ( !aPosEntry ) + { + SetCursorPosL( 0, EFalse ); + } + else + { + SetCursorPosL( aPosEntry->End(), EFalse ); + } + } // --------------------------------------------------------------------------- // CNcsAifEditor::CheckAndRemoveInvalidEntriesL() @@ -1165,19 +1083,19 @@ HBufC* CNcsAifEditor::GetLookupTextLC() const { FUNC_LOG; - HBufC* text = GetTextInHBufL(); - CleanupStack::PushL( text ); - if ( text ) + HBufC* text = GetTextInHBufL(); + + if (text == NULL) return NULL; + + CleanupStack::PushL( text ); + TPtr ptr( text->Des() ); + TInt location = ptr.LocateReverse( KCharAddressDelimeterSemiColon ); + if( location != KErrNotFound ) { - TPtr ptr( text->Des() ); - TInt location = ptr.LocateReverse( KCharAddressDelimeterSemiColon ); - if ( location != KErrNotFound ) - { - ptr = ptr.RightTPtr( ptr.Length() - location -1 ); - ptr.TrimLeft(); - } + ptr = ptr.RightTPtr( ptr.Length() - location -1 ); + ptr.TrimLeft(); } - return text; + return text; } // --------------------------------------------------------------------------- @@ -1189,17 +1107,17 @@ TBool aDisplayList ) const { FUNC_LOG; - TInt length = CalculateAddressListLength( aEntries, aDisplayList ); - if ( length <= 0 ) + TInt length = CalculateAddressListLength( aEntries, aDisplayList ); + if ( length <= 0 ) { - return HBufC::NewLC(0); + return HBufC::NewLC(0); } - - HBufC* buf = HBufC::NewLC( length ); - TPtr ptr = buf->Des(); - - TInt count = aEntries.Count(); - for ( TInt i = 0; i < count; i++ ) + + HBufC* buf = HBufC::NewLC( length ); + TPtr ptr = buf->Des(); + + TInt count = aEntries.Count(); + for ( TInt i = 0; i < count; i++ ) { if ( aDisplayList ) { @@ -1228,12 +1146,12 @@ HBufC* CNcsAifEditor::GetFormattedAddressListL( RPointerArray& aEntries, TBool aDisplayList ) const - { + { FUNC_LOG; HBufC* buf = GetFormattedAddressListLC( aEntries, aDisplayList ); CleanupStack::Pop( buf ); return buf; - } + } // --------------------------------------------------------------------------- // CNcsAifEditor::CalculateAddressListLength() @@ -1284,12 +1202,12 @@ void CNcsAifEditor::UpdateAddressAutoCompletionL() { FUNC_LOG; - HBufC* text = GetNonEntryTextLC(); - __ASSERT_ALWAYS( text, Panic(EFSEmailUiNullPointerException) ); + HBufC* text = GetNonEntryTextLC(); + __ASSERT_ALWAYS( text, Panic(EFSEmailUiNullPointerException) ); - iAddressPopupList->UpdatePopupContactListL( *text, EFalse ); - CleanupStack::PopAndDestroy( text ); - } + iAddressPopupList->UpdatePopupContactListL( *text, EFalse ); + CleanupStack::PopAndDestroy( text ); + } // --------------------------------------------------------------------------- // CNcsAifEditor::UpdateAddressAutoCompletionL() @@ -1322,9 +1240,10 @@ void CNcsAifEditor::UpdateAddressListAllL() { FUNC_LOG; - iAddressPopupList->UpdatePopupContactListL( KNullDesC, ETrue ); + iAddressPopupList->UpdatePopupContactListL( KNullDesC, ETrue ); } + // --------------------------------------------------------------------------- // Updates the duplicate markings in the entry array. // --------------------------------------------------------------------------- @@ -1387,23 +1306,38 @@ FUNC_LOG; RecalculateEntryPositions(); TCursorSelection textSelection = NonEntryTextAtPos( CursorPos() ); + TBool newEntryCreated = EFalse; if ( textSelection.Length() ) { // Check non-entry text for complete entries. - const TBool newEntriesAdded = HandleTextUpdateL( textSelection ); - if ( newEntriesAdded ) + newEntryCreated = HandleTextUpdateL( textSelection ); + } + + if ( newEntryCreated ) + { + iAddressPopupList->ClosePopupContactListL(); + + // add line feed after new entry + TInt cursorPos( CursorPos() ); + // related to PWAN-82DNEJ cursorPos shouldn't be 0 here + if (cursorPos == 0) + { + cursorPos = TextLength(); + } + + if ( !iPartialRemove ) { - iAddressPopupList->ClosePopupContactListL(); - iSizeObserver->UpdateFieldSizeL( ETrue ); - iPartialRemove = EFalse; + Text()->InsertL( cursorPos, TChar(CEditableText::ELineBreak) ); } - else - { - MoveNonEntryTextToDedicatedRowsL( CursorPos() ); - } - textSelection = NonEntryTextAtPos( CursorPos() ); + HandleTextChangedL(); + SetCursorPosL( cursorPos + 1, EFalse ); + iSizeObserver->UpdateFieldSizeL( ETrue ); + iPartialRemove = EFalse; } - UpdateAddressAutoCompletionL( textSelection ); + else + { + UpdateAddressAutoCompletionL( textSelection ); + } } // --------------------------------------------------------------------------- @@ -1416,10 +1350,10 @@ iAddLeftover = ETrue; TInt firstCharacter = aSelection.LowerPos(); TInt lastCharacter = aSelection.HigherPos(); - + // get the inputted text - const TInt length = lastCharacter - firstCharacter; - + TInt length = lastCharacter - firstCharacter; + HBufC* text = HBufC::NewLC( length ); TPtr ptr = text->Des(); Text()->Extract( ptr, firstCharacter, length ); @@ -1477,114 +1411,30 @@ } } } - + // add email that wasn't ended with semicolon if ( lastSentinel != KErrNotFound ) { if ( lastSentinel < end && start < end ) { AddAddressL( KNullDesC(), ptr.Mid(start, end-start) ); - entriesFound = ETrue; } } - + CleanupStack::PopAndDestroy( text ); + return entriesFound; } // --------------------------------------------------------------------------- -// Moves inputted non-entry text to separate row -// --------------------------------------------------------------------------- -// -void CNcsAifEditor::MoveNonEntryTextToDedicatedRowsL( TUint aPosition ) - { - // Get the non-entry text and whitespace at given location - TCursorSelection textSelection = NonEntryTextAndSpaceAtPos( aPosition ); - const TInt start = textSelection.LowerPos(); - const TInt end = textSelection.HigherPos(); - const TInt length = end - start; - - const TChar lineBreak = TChar( CEditableText::ELineBreak ); - const TChar paragraphDelimiter = - TChar( CEditableText::EParagraphDelimiter ); - - // Make sure that the inputted non-entry text is not on the same lines - // with existing entries. - if ( length ) - { - HBufC* text = HBufC::NewLC( length ); - TPtr ptr = text->Des(); - Text()->Extract( ptr, start, length ); - - const TChar firstCharacter = TChar( ptr[0] ); - const TChar lastCharacter = TChar( ptr[length-1] ); - const TInt documentLength = Text()->DocumentLength(); - - TBool textChanged = EFalse; - - if ( end < documentLength && - lastCharacter != paragraphDelimiter && - lastCharacter != lineBreak ) - { - Text()->InsertL( end, lineBreak ); - HandleTextChangedL(); - textChanged = ETrue; - } - - if ( start > 0 && start < end && - firstCharacter != paragraphDelimiter && - firstCharacter != lineBreak ) - { - Text()->InsertL( start, lineBreak ); - SetCursorVisible( EFalse ); - HandleTextChangedL(); - SetCursorPosL( CursorPos() + 1, EFalse ); - SetCursorVisible( ETrue ); - textChanged = ETrue; - } - - if ( textChanged ) - { - RecalculateEntryPositions(); - } - - CleanupStack::PopAndDestroy( text ); - } - } - -// --------------------------------------------------------------------------- -// Prepares for text entry to given cursor position making sure that the -// new text will not be entered on same row with existing -// --------------------------------------------------------------------------- -// -void CNcsAifEditor::PrepareForTextInputL( TUint aPosition ) - { - FUNC_LOG; - // Get the non-entry text and whitespace at given position. - TCursorSelection textSelection = NonEntryTextAndSpaceAtPos( aPosition ); - const TInt start = textSelection.LowerPos(); - const TInt end = textSelection.HigherPos(); - const TInt length = end - start; - - const TChar lineBreak = TChar( CEditableText::ELineBreak ); - - if ( start > 0 && ( !length || aPosition == start ) ) - { - Text()->InsertL( start, lineBreak ); - HandleTextChangedL(); - SetCursorPosL( start + 1, EFalse ); - } - } - -// --------------------------------------------------------------------------- // Handles navigation event. // --------------------------------------------------------------------------- // void CNcsAifEditor::HandleNavigationEventL() { FUNC_LOG; - // Close the contact popup when cursor is moved withing the field to make - // it less distracting. It's reopened when user types something. + // Close the contact popup when cursor is moved withing the field to make it less distracting. + // It's reopened when user types something. iAddressPopupList->ClosePopupContactListL(); } @@ -1595,51 +1445,6 @@ TCursorSelection CNcsAifEditor::NonEntryTextAtPos( TUint aPosition ) const { FUNC_LOG; - // Get the range of non-entry text and whitespace at given position. - TCursorSelection text = NonEntryTextAndSpaceAtPos( aPosition ); - - // Get the selected text to remove whitespace - const TInt length = text.Length(); - - HBufC* selectedText = NULL; - TRAPD( err, selectedText = HBufC::NewL( length ) ); - - if( err == KErrNone ) - { - TPtr ptr = selectedText->Des(); - Text()->Extract( ptr, text.LowerPos(), length ); - - // trim from end - TInt index( length - 1 ); - - while( index >= 0 && IsWhitespace( ptr[index--] ) ) - { - text.iCursorPos--; - } - - // trim from begin - index = 0; - - while( index < length && IsWhitespace( ptr[index++] ) ) - { - text.iAnchorPos++; - } - - delete selectedText; - selectedText = NULL; - } - - return text; - } - -// --------------------------------------------------------------------------- -// Gets non-entry text including surrounding whitespace at given position. -// --------------------------------------------------------------------------- -// -TCursorSelection CNcsAifEditor::NonEntryTextAndSpaceAtPos( - TUint aPosition ) const - { - FUNC_LOG; TCursorSelection text( TextLength(), 0 ); for ( TInt ii = iArray.Count() - 1; ii >= 0; --ii ) { @@ -1662,6 +1467,37 @@ } } + // get the selected text to remove whitespace + TInt length( text.Length() ); + + HBufC* selectedText = NULL; + TRAPD( err, selectedText = HBufC::NewL( length ) ); + + if( err == KErrNone ) + { + TPtr ptr = selectedText->Des(); + Text()->Extract( ptr, text.LowerPos(), length ); + + // trim from end + TInt index( length - 1 ); + + while( index >= 0 && IsWhitespace( ptr[index--] ) ) + { + text.iCursorPos--; + } + + // trim from begin + index = 0; + + while( index < length && IsWhitespace( ptr[index++] ) ) + { + text.iAnchorPos++; + } + + delete selectedText; + selectedText = NULL; + } + return text; } @@ -1704,18 +1540,6 @@ } // --------------------------------------------------------------------------- -// Checks whether given character is considered as line delimiter. -// --------------------------------------------------------------------------- -// -// -TBool CNcsAifEditor::IsDelimiter( TChar aCharacter ) const - { - FUNC_LOG; - return ( aCharacter == TChar( CEditableText::ELineBreak) || - aCharacter == TChar( CEditableText::EParagraphDelimiter) ); - } - -// --------------------------------------------------------------------------- // Checks whether given character is considered as whitespace. // --------------------------------------------------------------------------- // @@ -1723,8 +1547,8 @@ { FUNC_LOG; return ( aCharacter == KCharSpace || - aCharacter == TChar(CEditableText::ELineBreak) || - aCharacter == TChar(CEditableText::EParagraphDelimiter) ); + aCharacter == TChar(CEditableText::ELineBreak) || + aCharacter == TChar(CEditableText::EParagraphDelimiter) ); } // --------------------------------------------------------------------------- @@ -1824,68 +1648,61 @@ //adjust touch point to mach editor coordinates touchPoint.iX -= Position().iX; - - TInt pointerLineNbr = textLayout->GetLineNumber( - textLayout->XyPosToDocPosL( touchPoint ) ); + + TInt pointerLineNbr = textLayout->GetLineNumber( textLayout->XyPosToDocPosL( touchPoint )); TInt cursorLineNbr = textLayout->GetLineNumber( cursorPos ); - + + if ( pointerLineNbr != cursorLineNbr ) { CompleteEntryL(); // We're moving to a new line. - CNcsAifEntry* entry = GetEntryAt( CursorPos() ); + CNcsAifEntry* entry = NULL; + entry = GetEntryAt( CursorPos() ); if ( entry ) { SetSelectionL( entry->iCursorPos, entry->iAnchorPos ); } - } + } } - + CEikEdwin::HandlePointerEventL( aPointerEvent ); - - // Do not allow to insert cursor into the middle of some entry - CNcsAifEntry* entry = GetEntryAt( CursorPos() ); - if ( entry ) - { - SetSelectionL( entry->iCursorPos, entry->iAnchorPos ); - } } // ----------------------------------------------------------------------------- // CNcsAifEditor::CompleteEntryL() -// Adds semicolon to the end of the entry. +// Adds semicolol to the of the entry // ----------------------------------------------------------------------------- // void CNcsAifEditor::CompleteEntryL() { // make sure there is really some text inputted - const TInt cursorPos = CursorPos(); + TInt cursorPos( CursorPos() ); TCursorSelection selection = NonEntryTextAtPos( cursorPos ); - const TInt length = selection.Length(); + + TInt length( selection.Length() ); - if ( length > 0 && selection.LowerPos() >= 0 ) + HBufC* text = HBufC::NewLC( length ); + TPtr ptr = text->Des(); + + if( selection.LowerPos() >= 0 ) { - HBufC* text = HBufC::NewLC( length ); - TPtr ptr = text->Des(); - Text()->Extract( ptr, selection.LowerPos(), length ); ptr.Trim(); - + // complete the entry - if ( ptr.Length() > 0 ) + if( ptr.Length() > 0 ) { Text()->InsertL( selection.HigherPos(), KCharAddressDelimeterSemiColon ); HandleTextChangedL(); - HandleTextUpdateL( TCursorSelection( selection.LowerPos(), - selection.HigherPos() + 1 ) ); + HandleTextUpdateL( TCursorSelection(selection.LowerPos(), selection.HigherPos() + 1) ); } + } - CleanupStack::PopAndDestroy( text ); - } + CleanupStack::PopAndDestroy( text ); } - // End of File diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/ncsattachmentfield.cpp --- a/emailuis/emailui/src/ncsattachmentfield.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/ncsattachmentfield.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -37,11 +37,13 @@ CNcsAttachmentField* CNcsAttachmentField::NewL( TInt aLabelTextId, MNcsFieldSizeObserver* aSizeObserver, + MNcsAttachmentFieldObserver* aObserver, CNcsHeaderContainer* aParentControl ) { FUNC_LOG; CNcsAttachmentField* self = - new ( ELeave ) CNcsAttachmentField( aLabelTextId, aSizeObserver, aParentControl ); + new ( ELeave ) CNcsAttachmentField( aLabelTextId, aSizeObserver, + aObserver, aParentControl ); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); @@ -66,9 +68,11 @@ // CNcsAttachmentField::CNcsAttachmentField( TInt aLabelTextId, MNcsFieldSizeObserver* aSizeObserver, + MNcsAttachmentFieldObserver* aObserver, CNcsHeaderContainer* aParentControl ): MNcsControl( aSizeObserver ), iParentControl( aParentControl ), + iObserver( aObserver ), iLabelTextId ( aLabelTextId ), iFocusedLabelIndex( KNoAttachmentLabelFocused ) { @@ -274,12 +278,11 @@ // ----------------------------------------------------------------------------- // void CNcsAttachmentField::SetContainerWindowL( const CCoeControl& aContainer ) - { + { FUNC_LOG; - CCoeControl::SetContainerWindowL( aContainer ); - - UpdateComponentArrayL(); - } + CCoeControl::SetContainerWindowL( aContainer ); + UpdateComponentArrayL(); + } // ----------------------------------------------------------------------------- // CNcsAttachmentField::UpdateComponentArrayL() @@ -376,13 +379,23 @@ // CNcsAttachmentField::FocusedAttachmentLabelIndex() // ----------------------------------------------------------------------------- // -TInt CNcsAttachmentField::FocusedAttachmentLabelIndex() +TInt CNcsAttachmentField::FocusedAttachmentLabelIndex() const { FUNC_LOG; return iFocusedLabelIndex; } // ----------------------------------------------------------------------------- +// CNcsAttachmentField::SetFocusedAttachmentLabelIndex() +// ----------------------------------------------------------------------------- +// +void CNcsAttachmentField::SetFocusedAttachmentLabelIndex( TInt aIndex ) + { + FUNC_LOG; + iFocusedLabelIndex = aIndex; + } + +// ----------------------------------------------------------------------------- // CNcsAttachmentField::UpdateAttachmentTextsL() // ----------------------------------------------------------------------------- // @@ -457,14 +470,14 @@ // ----------------------------------------------------------------------------- // void CNcsAttachmentField::FocusChanged( TDrawNow aDrawNow ) - { + { FUNC_LOG; - if ( IsFocused() ) - { - for ( TInt i( 0 ); iSetFocus( i==iFocusedLabelIndex ); - } + if ( IsFocused() ) + { + for ( TInt i( 0 ); i < iAttachmentLabelCount; ++i ) + { + iAttachmentLabels[i]->SetFocus( i==iFocusedLabelIndex ); + } // make sure that control is visible on screen if ( Rect().iTl.iY < 0 ) { @@ -492,26 +505,26 @@ { TRAP_IGNORE( iParentControl->SetMskL() ); } - } - else - { - for ( TInt i( 0 ); iSetFocus( EFalse ); - } - } - + } + else + { + for ( TInt i( 0 ); iSetFocus( EFalse ); + } + } + UpdateColors(); - - if ( aDrawNow ) - { - DrawNow(); - } - else - { - DrawDeferred(); - } - } + + if ( aDrawNow ) + { + DrawNow(); + } + else + { + DrawDeferred(); + } + } // ----------------------------------------------------------------------------- // CNcsAttachmentField::UpdateColors() @@ -662,7 +675,7 @@ { FUNC_LOG; CCoeControl::HandlePointerEventL( aPointerEvent ); - + if ( aPointerEvent.iType == TPointerEvent::EButton1Down && Rect().Contains( aPointerEvent.iPosition ) ) { @@ -679,7 +692,7 @@ { feedback->InstantFeedback( this, ETouchFeedbackBasic ); } - + if ( iFocusedLabelIndex != i ) { focusedAttachmentLabelIndexChanged = ETrue; @@ -712,6 +725,67 @@ } // ----------------------------------------------------------------------------- +// CNcsAttachmentField::OfferKeyEventL() +// ----------------------------------------------------------------------------- +// +TKeyResponse CNcsAttachmentField::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + TKeyResponse response = EKeyWasNotConsumed; + TBool focusedAttachmentLabelIndexChanged = EFalse; + + if ( aType == EEventKey ) + { + if ( aKeyEvent.iCode == EKeyUpArrow ) + { + if ( iFocusedLabelIndex > 0 ) + { + iFocusedLabelIndex -= 1; + focusedAttachmentLabelIndexChanged = ETrue; + response = EKeyWasConsumed; + } + } + else if ( aKeyEvent.iCode == EKeyDownArrow ) + { + if ( iFocusedLabelIndex < iAttachmentLabelCount - 1 ) + { + iFocusedLabelIndex += 1; + focusedAttachmentLabelIndexChanged = ETrue; + response = EKeyWasConsumed; + } + } + else if ( aKeyEvent.iCode == EKeyBackspace || + aKeyEvent.iCode == EKeyDelete ) + { + iObserver->AttachmentRemoveL(); + response = EKeyWasConsumed; + } + else if ( aKeyEvent.iCode == EKeyEnter || + aKeyEvent.iScanCode == EStdKeyEnter || + aKeyEvent.iCode == EKeyOK || + aKeyEvent.iScanCode == EStdKeyDevice3 ) + { + iObserver->AttachmentOpenL(); + response = EKeyWasConsumed; + } + } + + if ( focusedAttachmentLabelIndexChanged ) + { + // only redraw if focused attachment label changed + for ( TInt i = 0; i < iAttachmentLabelCount; i++ ) + { + iAttachmentLabels[i]->SetFocus( i == iFocusedLabelIndex ); + } + + UpdateColors(); + DrawDeferred(); + } + + return response; + } + +// ----------------------------------------------------------------------------- // CNcsAttachmentField::CreateIcons() // ----------------------------------------------------------------------------- // diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/ncscomposeview.cpp --- a/emailuis/emailui/src/ncscomposeview.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/ncscomposeview.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -37,7 +37,6 @@ #include #include -#include #include "ncscomposeview.h" #include "ncscomposeviewcontainer.h" #include "ncsconstants.h" @@ -87,10 +86,9 @@ iMsvSession( aMsvSession ), iEnv( aEnv ), iFakeSyncGoingOn(EFalse), iFetchDialogCancelled(EFalse), iExecutingDoExitL( EFalse ), - iMessageTextPartModified( EFalse ), iMessageModified( EFalse ), - iIncludeMessageTextAsync( EFalse ), iChildActivationState( EChildActivationDeactivated ) + iMessageTextPartModified( EFalse ), iMessageModified( EFalse ) { - FUNC_LOG; + FUNC_LOG; iAttachmentListSaveDraft = EFalse; @@ -290,7 +288,7 @@ TUid aCustomMessageId, const TDesC8& aCustomMessage ) { FUNC_LOG; - iChildActivationState = EChildActivationStarted; + // needed when "Opening" (replying/forwarding)note is shown and // we receive incoming call- Email application goes to background. // When coming back to application the view is activated and reseted. @@ -347,19 +345,7 @@ // once from BaseView. if ( iLaunchParams.iActivatedExternally ) { - //notify Contact details view to close on external activation - CFSEmailUiContactHandler* contactHandler = NULL; // not owned - CFsDelayedLoader* delLoader = CFsDelayedLoader::InstanceL(); // not owned - if( delLoader ) - { - contactHandler = delLoader->GetContactHandlerL(); - - if( contactHandler && aPrevViewId.iViewUid == contactHandler->GetDetailsViewUid() ) - { - contactHandler->CloseContactDetailsL(); - } - iAppUi.ViewActivatedExternallyL( Id() ); - } + iAppUi.ViewActivatedExternallyL( Id() ); } // Try to get the mailbox by other means if using launch parameters failed @@ -448,51 +434,41 @@ Toolbar()->SetDimmed( EFalse ); RefreshToolbar(); iContainer->ActivateL(); - + } // if there is a embedded app in FSEmail. if( iAppUi.EmbeddedApp() ) - { - // Set email editor started from embedded app flag to true - // so that we can switch view correct when sent email. - iAppUi.SetEditorStartedFromEmbeddedApp( ETrue ); + { + // Set email editor started from embedded app flag to true + // so that we can switch view correct when sent email. + iAppUi.SetEditorStartedFromEmbeddedApp( ETrue ); RWsSession rwsSession; - User::LeaveIfError( rwsSession.Connect() ); - CleanupClosePushL( rwsSession ); + User::LeaveIfError( rwsSession.Connect() ); + CleanupClosePushL( rwsSession ); // Simulate a back key to exit embedded app - // so that email editor could show on the top level. - TKeyEvent KeyEvent = TKeyEvent(); - // this is neccesary for photogalery image viewer (don't remove) - KeyEvent.iScanCode = EStdKeyUpArrow; - rwsSession.SimulateKeyEvent( KeyEvent ); - KeyEvent.iCode = EKeyCBA2; - rwsSession.SimulateKeyEvent( KeyEvent ); + // so that email editor could show on the top level. + TKeyEvent KeyEvent = TKeyEvent(); + // this is neccesary for photogalery image viewer (don't remove) + KeyEvent.iScanCode = EStdKeyUpArrow; + rwsSession.SimulateKeyEvent( KeyEvent ); + KeyEvent.iCode = EKeyCBA2; + rwsSession.SimulateKeyEvent( KeyEvent ); rwsSession.Close(); - CleanupStack::PopAndDestroy( &rwsSession ); - } + CleanupStack::PopAndDestroy( &rwsSession ); + } if ( iIncludeMessageTextAsync ) - { - // including message body in async way - IncludeMessageTextAsyncL( ETrue ); - } - - iViewFullyActivated = ETrue; - iChildActivationState = EChildActivationProcessed; + { + // including message body in async way + IncludeMessageTextAsyncL( ETrue ); + } + + iViewFullyActivated = ETrue; TIMESTAMP( "Editor launched" ); - return; // ok - } -// problems with init close the view asynchronously - iViewFullyActivated = EFalse; - iChildActivationState = EChildActivationExitRequired; -// iFakeSyncGoingOn = EFalse; iExecutingDoExitL = EFalse; - iActiveHelper->Start(); // calls AsyncExit() - TIMESTAMP( "Editor NOT launched" ); - return; } // ----------------------------------------------------------------------------- @@ -819,9 +795,7 @@ { SaveAndCleanPreviousMessage(); } - - iChildActivationState = EChildActivationDeactivated ; - + } // ----------------------------------------------------------------------------- @@ -967,10 +941,6 @@ { case ENcsCmdSend: { - // Set focus on body of message need for correct - // MSK setting for CAknConfirmationNote dialog. - iContainer->SetFocusToMessageFieldL(); - // Show query if the Subject field is empty if ( iContainer->IsSubjectFieldEmpty() ) { @@ -989,7 +959,7 @@ { // Sending successful HBufC* confMessage = NULL; - if ( !TFsEmailUiUtility::IsOfflineModeL() || WLANConnectionActive() ) + if ( !TFsEmailUiUtility::IsOfflineModeL() ) { // when sync status is currently ONLINE confMessage = StringLoader::LoadLC( @@ -1089,38 +1059,29 @@ break; case ENcsCmdPriorityHigh: { - if ( iNewMessage ) - { - iNewMessage->ResetFlag( EFSMsgFlag_Low ); - iNewMessage->SetFlag( EFSMsgFlag_Important ); - iNewMessage->SaveMessageL(); - iMessageModified = EFalse; - iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityHigh ); - } + iNewMessage->ResetFlag( EFSMsgFlag_Low ); + iNewMessage->SetFlag( EFSMsgFlag_Important ); + iNewMessage->SaveMessageL(); + iMessageModified = EFalse; + iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityHigh ); } break; case ENcsCmdPriorityNormal: { - if ( iNewMessage ) - { - iNewMessage->ResetFlag( EFSMsgFlag_Low ); - iNewMessage->ResetFlag( EFSMsgFlag_Important ); - iNewMessage->SaveMessageL(); - iMessageModified = EFalse; - iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityNormal ); - } + iNewMessage->ResetFlag( EFSMsgFlag_Low ); + iNewMessage->ResetFlag( EFSMsgFlag_Important ); + iNewMessage->SaveMessageL(); + iMessageModified = EFalse; + iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityNormal ); } break; case ENcsCmdPriorityLow: { - if ( iNewMessage ) - { - iNewMessage->ResetFlag( EFSMsgFlag_Important ); - iNewMessage->SetFlag( EFSMsgFlag_Low ); - iNewMessage->SaveMessageL(); - iMessageModified = EFalse; - iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityLow ); - } + iNewMessage->ResetFlag( EFSMsgFlag_Important ); + iNewMessage->SetFlag( EFSMsgFlag_Low ); + iNewMessage->SaveMessageL(); + iMessageModified = EFalse; + iStatusPaneIndicators->SetPriorityFlag( EMsgPriorityLow ); } break; case ENcsCmdShowCc: @@ -1207,8 +1168,7 @@ break; case EAknSoftkeyClose: { - if ( !iAddingAttachmentDialogOpened ) - DoSafeExit(); + DoSafeExit(); } break; case ENcsCmdExit: @@ -1243,12 +1203,7 @@ User::Leave( KErrNotFound ); } - TRAPD( commitErr, CommitL( ETrue, EAllFields, ETrue ) ); - if ( KErrNone != commitErr ) - { - iMailSendFailed = ETrue; - User::Leave( commitErr ); - } + CommitL( ETrue, EAllFields, ETrue ); TRAPD(r, iMailBox->SendMessageL( *iNewMessage ) ); if ( KErrNone != r ) @@ -1731,7 +1686,8 @@ TFsEmailUiUtility::CreatePlainTextPartL( *iNewMessage, iNewMessageTextPart ); InitFieldsL(); - IncludeMessageTextL(); + TBool spaceInBegin = ETrue; + IncludeMessageTextL(spaceInBegin); AttachmentsListControl()->Model()->Clear(); GetAttachmentsFromMailL(); SetAttachmentLabelContentL(); @@ -1823,7 +1779,7 @@ { FUNC_LOG; - if ( iFirstStartCompleted && iContainer && !iExecutingDoExitL ) + if ( iFirstStartCompleted && iContainer ) { if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged ) { @@ -1840,23 +1796,6 @@ } -// --------------------------------------------------------------------------- -// CNcsComposeView::FadeOut() -// enables hiding toolbar on different view -> DoActivate() -// which is earlier than -> CFsEmailUiViewBase::DoDeactivate() -// ----------------------------------------------------------------------------- -// -void CNcsComposeView::FadeOut( TBool aDirectionOut ) - { - if ( aDirectionOut && Toolbar()->IsShown() ) - { - HideToolbar(); - } - else if ( ! ( aDirectionOut || Toolbar()->IsShown() ) ) - { - ShowToolbar(); - } - } // ----------------------------------------------------------------------------- // CNcsComposeView::InitReplyFieldsL() // Initialises the reply fields from the reply message created by the plug-in. @@ -2287,70 +2226,56 @@ break; } - if ( iNewMessage ) + if ( commitToField ) + { + RPointerArray& recipients = + iNewMessage->GetToRecipients(); + recipients.ResetAndDestroy(); + NcsUtility::ConvertAddressArrayL( + iContainer->GetToFieldAddressesL( aParseAddresses ), recipients ); + } + + if ( commitCcField ) + { + RPointerArray& recipients = + iNewMessage->GetCCRecipients(); + recipients.ResetAndDestroy(); + NcsUtility::ConvertAddressArrayL( + iContainer->GetCcFieldAddressesL( aParseAddresses ), recipients ); + } + + if ( commitBccField ) + { + RPointerArray& recipients = + iNewMessage->GetBCCRecipients(); + recipients.ResetAndDestroy(); + NcsUtility::ConvertAddressArrayL( + iContainer->GetBccFieldAddressesL( aParseAddresses ), recipients ); + } + + if ( commitSubjectField ) { - if ( commitToField ) - { - RPointerArray& recipients = - iNewMessage->GetToRecipients(); - recipients.ResetAndDestroy(); - NcsUtility::ConvertAddressArrayL( - iContainer->GetToFieldAddressesL( aParseAddresses ), recipients ); - } - - if ( commitCcField ) - { - RPointerArray& recipients = - iNewMessage->GetCCRecipients(); - recipients.ResetAndDestroy(); - NcsUtility::ConvertAddressArrayL( - iContainer->GetCcFieldAddressesL( aParseAddresses ), recipients ); - } - - if ( commitBccField ) - { - RPointerArray& recipients = - iNewMessage->GetBCCRecipients(); - recipients.ResetAndDestroy(); - NcsUtility::ConvertAddressArrayL( - iContainer->GetBccFieldAddressesL( aParseAddresses ), recipients ); - } - - if ( commitSubjectField ) - { - // get subject from UI to MSG object - HBufC* subject = iContainer->GetSubjectLC(); - TPtr ptr = subject->Des(); - // replace new line characters with spaces as Subject is normally - // one line only - AknTextUtils::ReplaceCharacters( - ptr, KLineSeparators, KReplacementChar ); - iNewMessage->SetSubject( *subject ); - CleanupStack::PopAndDestroy( subject ); - } + // get subject from UI to MSG object + HBufC* subject = iContainer->GetSubjectLC(); + TPtr ptr = subject->Des(); + // replace new line characters with spaces as Subject is normally + // one line only + AknTextUtils::ReplaceCharacters( + ptr, KLineSeparators, KReplacementChar ); + iNewMessage->SetSubject( *subject ); + CleanupStack::PopAndDestroy( subject ); + } + + if ( commitBodyField ) + { + HBufC* body = iContainer->GetBodyContentLC(); + TPtr bodyPtr = body->Des(); // this TPtr is needed only because of + // incorrect argument type in FW API, can be removed when API fixed + iNewMessageTextPart->SetContent( bodyPtr ); + CleanupStack::PopAndDestroy( body ); + iMessageTextPartModified = ETrue; } - else // iNewMessage is still NULL - { - User::Leave( KErrNotFound ); - } - - if ( iNewMessageTextPart ) - { - if ( commitBodyField ) - { - HBufC* body = iContainer->GetBodyContentLC(); - TPtr bodyPtr = body->Des(); // this TPtr is needed only because of - // incorrect argument type in FW API, can be removed when API fixed - iNewMessageTextPart->SetContent( bodyPtr ); - CleanupStack::PopAndDestroy( body ); - iMessageTextPartModified = ETrue; - } - } - else // iNewMessageTextPart is still NULL - { - User::Leave( KErrNotFound ); - } - + iMessageModified = ETrue; RefreshToolbar(); @@ -2531,13 +2456,7 @@ CFSMailMessagePart* msgPart = iNewMessage->ChildPartL( item->MailMsgPartId() ); CleanupStack::PushL( msgPart ); - - //We are forbidding to change MSK label during OpenAttachmentL - //because dialog/popup can be open - iContainer->SwitchChangeMskOff( ETrue ); TFsEmailUiUtility::OpenAttachmentL( *msgPart ); - iContainer->SwitchChangeMskOff( EFalse ); - CleanupStack::PopAndDestroy( msgPart ); } } @@ -2935,10 +2854,6 @@ } TFsEmailUiUtility::CreatePlainTextPartL( *iNewMessage, iNewMessageTextPart ); - if (NULL == iNewMessageTextPart) // problems with creating - { - User::Leave( KErrUnknown ); - } } // ----------------------------------------------------------------------------- @@ -2990,10 +2905,7 @@ TFsEmailUiUtility::CreatePlainTextPartL( *iNewMessage, iNewMessageTextPart ); - if (NULL == iNewMessageTextPart) // problems with creating - { - User::Leave( KErrUnknown ); - } + } // ----------------------------------------------------------------------------- @@ -3219,11 +3131,7 @@ { if ( !aError ) { - // may leave if unable to create new message part TRAP( aError, InitReplyOrForwardUiL() ); - } - if ( !aError ) - { iAutoSaver->Enable( ETrue ); } else @@ -3273,16 +3181,6 @@ { FUNC_LOG; - // dont exit while in child activation - if ( EChildActivationStarted == iChildActivationState ) - { - iChildActivationState = EChildActivationError; - } - if ( EChildActivationError == iChildActivationState ) - { - return; - } - if ( iStatusPaneIndicators ) { iStatusPaneIndicators->HideStatusPaneIndicators(); @@ -3352,7 +3250,7 @@ delete iContainer; iContainer = NULL; } - iIncludeMessageTextAsync = EFalse; + } // ----------------------------------------------------------------------------- @@ -3410,11 +3308,7 @@ void CNcsComposeView::AsyncExitL() { FUNC_LOG; - if ( EChildActivationExitRequired == iChildActivationState ) - { - ExitComposer(); - } - else if ( iFakeSyncGoingOn || iExecutingDoExitL ) + if ( iFakeSyncGoingOn || iExecutingDoExitL ) { // if some sync method is still going on, we continue waiting iActiveHelper->Cancel(); @@ -3508,30 +3402,6 @@ } // --------------------------------------------------------------------------- -// Returns ETrue if WLAN connection is active. -// --------------------------------------------------------------------------- -// -TBool CNcsComposeView::WLANConnectionActive() - { - TBool ret = EFalse; - - TInt wlanState; - TInt err = RProperty::Get( KPSUidWlan, KPSWlanIndicator, wlanState ); - - if ( err == KErrNone ) - { - if ( wlanState == EPSWlanIndicatorActive || - wlanState == EPSWlanIndicatorActiveSecure ) - { - ret = ETrue; - } - } - - return ret; - } - - -// --------------------------------------------------------------------------- // CActiveHelper::NewL() // --------------------------------------------------------------------------- // @@ -3581,9 +3451,7 @@ void CActiveHelper::RunL() { if( iComposeView ) - { iComposeView->AsyncExitL(); - } } // --------------------------------------------------------------------------- diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/ncscomposeviewcontainer.cpp --- a/emailuis/emailui/src/ncscomposeviewcontainer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/ncscomposeviewcontainer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -148,7 +148,7 @@ // Listen edwin events and size events from smart quote field iReadOnlyQuoteField->AddEdwinObserverL( this ); iReadOnlyQuoteField->SetEdwinSizeObserver( this ); - iReadOnlyQuoteField->EnableKineticScrollingL( iPhysics ); + iReadOnlyQuoteField->EnableKineticScrollingL( iPhysics ); // Create the scroll bar iScrollBar = new( ELeave ) CAknDoubleSpanScrollBar( this ); @@ -199,16 +199,16 @@ iAsyncTextFormatter->Cancel(); delete iAsyncTextFormatter; } - + if ( iContactHandler ) { iContactHandler->ClearObservers(); } - delete iHeader; + delete iHeader; delete iScrollBar; delete iMessageField; delete iBgContext; - delete iLongTapDetector; + delete iLongTapDetector; delete iReadOnlyQuoteField; delete iReadOnlyQuote; @@ -232,6 +232,10 @@ { iFocused = iHeader; } + if ( iFocused == iHeader ) + { + iHeader->ShowCursor( IsFocused() ); + } iFocused->SetFocus( IsFocused(), aDrawNow ); iView.HandleContainerChangeRequiringToolbarRefresh(); @@ -241,6 +245,7 @@ DrawNow(); } } + // ----------------------------------------------------------------------------- // CNcsComposeViewContainer::SetMskL() // @@ -261,20 +266,21 @@ const TPointerEvent& aPointerEvent ) { FUNC_LOG; - TBool clearSelection(EFalse); + TBool clearSelection(EFalse); if ( aPointerEvent.iType != TPointerEvent::EButton1Down && - iHeader->NeedsLongTapL( aPointerEvent.iPosition ) ) + iHeader->NeedsLongTapL( aPointerEvent.iPosition ) ) { - iLongTapDetector->PointerEventL( aPointerEvent ); + iLongTapDetector->PointerEventL( aPointerEvent ); } - + switch( aPointerEvent.iType ) - { - case TPointerEvent::EButton1Down: - { + { + case TPointerEvent::EButton1Down: + { // Save current and original position so that those can be used in // drag/scrolling calculations - iPreviousPosition = iOriginalPosition = aPointerEvent.iPosition; + iPreviousPosition = iOriginalPosition = + aPointerEvent.iPosition; iIsDragging = EFalse; iIsFlicking = EFalse; @@ -284,19 +290,19 @@ iPhysics->ResetFriction(); iStartTime.HomeTime(); UpdatePhysicsL(); - } + } if ( iHeader->Rect().Contains( aPointerEvent.iPosition ) ) { if ( iFocused == iMessageField ) { - if( iMessageField->SelectionLength() ) - { - iMessageField->ClearSelectionL(); - } + if( iMessageField->SelectionLength() ) + { + iMessageField->HandleTextChangedL(); + } iMessageField->SetFocus( EFalse, ENoDrawNow ); iFocused = iHeader; - iHeader->SetFocus( ETrue, ENoDrawNow ); + iHeader->SetFocus( ETrue,ENoDrawNow ); } else if ( iFocused == iReadOnlyQuoteField ) { @@ -381,49 +387,53 @@ TPoint position = aPointerEvent.iPosition; - if ( iPhysics ) - { - if ( iIsDragging ) - { + if( iPhysics ) + { + if ( iIsDragging ) + { TPoint delta( 0, iPreviousPosition.iY - position.iY ); if ( !( iMessageField->SelectionLength() || iReadOnlyQuoteField->SelectionLength() ) ) - iPhysics->RegisterPanningPosition( delta ); - } + iPhysics->RegisterPanningPosition( delta ); + } } else { - TInt topPosition( iHeaderPos.iY - iHeader->Position().iY ); - TInt totalHeight( ContentTotalHeight() ); - TInt areaHeight( VisibleAreaHeight() ); - TInt scrollOffset( 0 ); + TInt topPosition( -iHeader->Position().iY ); + + TInt totalHeight( ContentTotalHeight() ); - if ( totalHeight > areaHeight ) - { - // Calculate new scroll offset based on current and - // previous Y-positions - scrollOffset = topPosition + - ( iPreviousPosition.iY - position.iY ); - // Ensure that thumb position is in correct range - scrollOffset = Max( scrollOffset, 0 ); - scrollOffset = Min( scrollOffset, - totalHeight - areaHeight ); - } + TInt areaHeight( Rect().Size().iHeight ); + TInt scrollOffset( 0 ); + + if( totalHeight > areaHeight ) + { + // Calculate new scroll offset based on current and + // previous Y-positions + scrollOffset = topPosition + + ( iPreviousPosition.iY - position.iY ); + // Ensure that thumb position is in correct range + scrollOffset = Max( scrollOffset, 0 ); + scrollOffset = Min( scrollOffset, + totalHeight - areaHeight ); + } - Scroll( scrollOffset ); - } - - // Save current position as previous pos for future calculations - iPreviousPosition = position; - - break; - } - + Scroll( scrollOffset ); + } + + // Save current position as previous pos for future calculations + iPreviousPosition = position; + + break; + } + default: { // unknown event, ignored break; } } + + CCoeControl::HandlePointerEventL( aPointerEvent ); if ( aPointerEvent.iType == TPointerEvent::EButton1Down && iHeader->NeedsLongTapL( aPointerEvent.iPosition ) ) @@ -431,10 +441,9 @@ iLongTapDetector->PointerEventL( aPointerEvent ); } - CCoeControl::HandlePointerEventL( aPointerEvent ); if (clearSelection) { - iMessageField->ClearSelectionL(); + iMessageField->HandleTextChangedL(); } } @@ -494,7 +503,10 @@ else if ( aKeyEvent.iCode == EKeyUpArrow || aKeyEvent.iCode == EKeyDownArrow ) { - ret = iFocused->OfferKeyEventL( aKeyEvent, aType ); + if ( iFocused ) + { + ret = iFocused->OfferKeyEventL( aKeyEvent, aType ); + } if ( ret == EKeyWasNotConsumed ) { @@ -530,18 +542,18 @@ } // ----------------------------------------------------------------------------- -// CNcsComposeViewContainer::UpdateScreenPosition() +// CNcsComposeViewContainer::UpdateScreenPositionL() // If the user scrolled down in the message field // we want to scroll up the header and grow the message field. // ----------------------------------------------------------------------------- // -void CNcsComposeViewContainer::UpdateScreenPosition( +void CNcsComposeViewContainer::UpdateScreenPositionL( const TUint& /*aKeyCode*/ ) { FUNC_LOG; // get screen rectangle - const TRect screenRect = iCmailPaneRect; + const TRect screenRect( Rect() ); TPoint msgPos( iMessageField->Position() ); TPoint quotePos( iReadOnlyQuoteField->Position() ); @@ -550,12 +562,12 @@ TRect lineRect; if ( iFocused == iMessageField ) { - iMessageField->GetLineRect( lineRect ); + iMessageField->GetLineRectL( lineRect ); lineRect.Move( msgPos ); } else if ( iFocused == iReadOnlyQuoteField ) { - iReadOnlyQuoteField->GetLineRect( lineRect ); + iReadOnlyQuoteField->GetLineRectL( lineRect ); lineRect.Move( quotePos ); } else @@ -566,8 +578,8 @@ } TPoint linePos = lineRect.iTl; - TInt minTargetY = screenRect.iTl.iY + lineRect.Height(); - TInt maxTargetY = screenRect.iBr.iY - lineRect.Height() * 2; + TInt minTargetY = lineRect.Height(); + TInt maxTargetY = screenRect.Height() - lineRect.Height() * 2; TInt moveY = 0; // if cursor goes out of screen then move the controls @@ -582,17 +594,17 @@ // Check we don't scroll too low if ( quotePos.iY + moveY + iReadOnlyQuoteField->Size().iHeight < - screenRect.iBr.iY ) + screenRect.Height() ) { - moveY = screenRect.iBr.iY - quotePos.iY - + moveY = screenRect.Height() - quotePos.iY - iReadOnlyQuoteField->Size().iHeight; } // Check we don't scroll too high TPoint headerPos = iHeader->Position(); - if ( headerPos.iY + moveY > iHeaderPos.iY ) + if ( headerPos.iY + moveY > 0 ) { - moveY = iHeaderPos.iY - headerPos.iY; + moveY = -headerPos.iY; } if ( moveY ) @@ -600,24 +612,13 @@ headerPos.iY += moveY; iHeader->SetPosition( headerPos ); - iSeparatorLineYPos += moveY; - msgPos.iY += moveY; iMessageField->SetPosition( msgPos ); quotePos.iY += moveY; iReadOnlyQuoteField->SetPosition( quotePos ); - const TInt bottom = Rect().iBr.iY; - if ( iMessageField->IsFocused() ) - { - iMessageField->SetCursorVisible( msgPos.iY <= bottom ); - } - else if ( iReadOnlyQuoteField->IsFocused() ) - { - iReadOnlyQuoteField->SetCursorVisible( quotePos.iY <= bottom ); - } - + iSeparatorLineYPos += moveY; UpdateScrollBar(); } } @@ -652,18 +653,6 @@ quotePos.iY = iMessageField->Rect().iBr.iY; iReadOnlyQuoteField->SetPosition( quotePos ); - const TInt bottom = Rect().iBr.iY; - if ( iMessageField->IsFocused() ) - { - iMessageField->SetCursorVisible( bodyPos.iY <= bottom ); - } - else if ( iReadOnlyQuoteField->IsFocused() ) - { - iReadOnlyQuoteField->SetCursorVisible( quotePos.iY <= bottom ); - } - - TInt scrollSpan = Max( ContentTotalHeight(), VisibleAreaHeight() + 1 ); - iScrollBarModel.SetScrollSpan( scrollSpan ); UpdateScrollBar(); DrawDeferred(); } @@ -675,6 +664,7 @@ // Handles key events // ----------------------------------------------------------------------------- // + TKeyResponse CNcsComposeViewContainer::ChangeFocusL( const TKeyEvent& aKeyEvent ) { @@ -694,9 +684,10 @@ if ( aKeyEvent.iCode == EKeyUpArrow ) { iFocused = iHeader; - iHeader->SetFocus( ETrue, ENoDrawNow ); + iHeader->SetFocusToBottom( ENoDrawNow ); iMessageField->SetFocus( EFalse, ENoDrawNow ); iHeader->MakeVisible( ETrue ); + iHeader->ShowCursor( ETrue ); CommitL( EBodyField ); ret = EKeyWasConsumed; } @@ -722,10 +713,9 @@ if ( ret == EKeyWasConsumed ) { - UpdateScreenPosition( aKeyEvent.iCode ); + UpdateScreenPositionL( aKeyEvent.iCode ); } - DrawDeferred(); return ret; } @@ -753,7 +743,7 @@ // ----------------------------------------------------------------------------- // CNcsComposeViewContainer::SizeChanged() -// Handles container size change. +// set size // ----------------------------------------------------------------------------- // void CNcsComposeViewContainer::SizeChanged() @@ -765,13 +755,9 @@ TRect cmailPaneRect( NcsUtility::ListCmailPaneRect( rect ) ); const TInt headerLineCount( iHeader->LayoutLineCount() ); - iHeaderPos = NcsUtility::HeaderControlPosition( cmailPaneRect, 0 ); - iHeader->SetOrigin( iHeaderPos ); - const TPoint currentHeaderPos = iHeader->Position(); - if ( currentHeaderPos.iY > iHeaderPos.iY ) - { - cmailPaneRect.Move( 0, currentHeaderPos.iY - iHeaderPos.iY ); - } + const TPoint headerPos( + NcsUtility::HeaderControlPosition( cmailPaneRect, 0 ) ); + cmailPaneRect.Move( 0, iHeader->Position().iY - headerPos.iY ); iCmailPaneRect = cmailPaneRect; NcsUtility::LayoutHeaderControl( @@ -792,6 +778,7 @@ } iMessageField->UpdateFontSize(); + iSeparatorHeight = NcsUtility::SeparatorSizeInThisResolution().iHeight; TInt readOnlyQuoteFieldHeight( 0 ); if ( iReadOnlyQuoteField->TextLength() ) @@ -801,9 +788,21 @@ iReadOnlyQuoteField, cmailPaneRect, iHeader->LayoutLineCount() + iMessageField->LineCount(), iReadOnlyQuoteField->LineCount(), dummySeparatorPos ); + + TInt quoteOffset = iReadOnlyQuoteField->Rect().iTl.iY - + iMessageField->Rect().iBr.iY; + + if( quoteOffset > iSeparatorHeight ) + { + TRect quoteRect = iReadOnlyQuoteField->Rect(); + quoteRect.Move( 0, iMessageField->Rect().iBr.iY + + iSeparatorHeight - quoteRect.iTl.iY ); + iReadOnlyQuoteField->SetRect( quoteRect ); + } + iReadOnlyQuoteField->SetAlignment( EAknEditorAlignBidi ); // we don't need format again when format was already done - // during creation of forward/reply message + // during creation of forward/reply message if ( !iSwitchOffFormattingText ) { TRAP_IGNORE( iReadOnlyQuoteField->FormatAllTextNowL() ); @@ -811,21 +810,14 @@ iReadOnlyQuoteField->UpdateFontSize(); readOnlyQuoteFieldHeight = iReadOnlyQuoteField->Rect().Height(); } - else - { - // Set quote field immediatelly bellow message field with zero height. - TRect quoteRect = iMessageField->Rect(); - quoteRect.iTl = quoteRect.iBr; - iReadOnlyQuoteField->SetRect( quoteRect ); - } - iBgContext->SetRect( rect ); - iMessageField->SetRealRect( rect ); - iReadOnlyQuoteField->SetRealRect( rect ); + iBgContext->SetRect( Rect() ); + iMessageField->SetRealRect( Rect() ); + iReadOnlyQuoteField->SetRealRect( Rect() ); TInt messageLineHeigth = NcsUtility::HeaderCaptionPaneRect( cmailPaneRect ).Height(); - iSeparatorHeight = NcsUtility::SeparatorSizeInThisResolution().iHeight; + iMessageEditorMinHeigth = cmailPaneRect.Height() - iHeader->Size().iHeight - iSeparatorHeight - @@ -851,29 +843,17 @@ // update some layout variables iHeaderHeight = iHeader->Rect().Height(); TRect bodyRect = iMessageField->Rect(); - iReadOnlyQuoteField->SetPosition( - TPoint( bodyRect.iTl.iX, bodyRect.iBr.iY ) ); TRect quoteRect = iReadOnlyQuoteField->Rect(); - iTotalComposerHeight = iHeaderHeight + iSeparatorHeight + - bodyRect.Height() + quoteRect.Height(); - - iVisibleAreaHeight = iCmailPaneRect.Height(); + iTotalComposerHeight = iHeaderHeight + iSeparatorHeight * 2 + + bodyRect.Height() + quoteRect.Height(); + + iVisibleAreaHeight = Rect().Height(); + + UpdateScrollBar(); - // Scroll span is set always to be larger than the window size to - // keep the scroll bar visible. - TInt scrollSpan = Max( iTotalComposerHeight, iVisibleAreaHeight + 1 ); - iScrollBarModel.SetScrollSpan( scrollSpan ); + iScrollBarModel.SetScrollSpan( iTotalComposerHeight ); iScrollBarModel.SetWindowSize( iVisibleAreaHeight ); - if ( iHeader->IsFocused() ) - { - iHeader->DoScroll(); - } - else - { - UpdateScreenPosition(); - } - UpdateScrollBar(); DrawDeferred(); } @@ -988,13 +968,13 @@ iProcessedField = iReadOnlyQuoteField; if ( iReadOnlyQuote ) { - TInt dummySeparatorPos; - NcsUtility::LayoutBodyEdwin( iReadOnlyQuoteField, iCmailPaneRect, - iHeader->LayoutLineCount() + iMessageField->LineCount(), - iReadOnlyQuoteField->LineCount(), dummySeparatorPos ); + TInt dummySeparatorPos; + NcsUtility::LayoutBodyEdwin( iReadOnlyQuoteField, iCmailPaneRect, + iHeader->LayoutLineCount() + iMessageField->LineCount(), + iReadOnlyQuoteField->LineCount(), dummySeparatorPos ); iReadOnlyQuoteField->SetAlignment( EAknEditorAlignBidi ); - - RMemReadStream inputStream; + + RMemReadStream inputStream; inputStream.Open( iReadOnlyQuote->Ptr(), iReadOnlyQuote->Size() ); TRAP_IGNORE( iReadOnlyQuoteField->RichText()->ImportTextL( 0, inputStream, CPlainText::EOrganiseByParagraph ) ); @@ -1169,7 +1149,7 @@ // Update screen position and scroll bar when text changed // or cursor moved - UpdateScreenPosition(); + UpdateScreenPositionL(); UpdateScrollBar(); DrawDeferred(); } @@ -1185,6 +1165,9 @@ { FUNC_LOG; TBool ret = ETrue; + + const TRect rect( Rect() ); + TRect cmailPaneRect( NcsUtility::ListCmailPaneRect( rect ) ); if ( aDesirableEdwinSize.iHeight < iPrevDesiredHeigth ) { @@ -1202,7 +1185,7 @@ { aEdwin->SetSize( aDesirableEdwinSize ); } - } + } } else { @@ -1211,21 +1194,15 @@ aEdwin->SetSize( aDesirableEdwinSize ); } } - if ( aEdwin == iMessageField ) { // move the quote field below the body field TPoint quotePos = iMessageField->Position(); quotePos.iY += iMessageField->Size().iHeight; iReadOnlyQuoteField->SetPosition( quotePos ); - UpdateScreenPosition(); + UpdateScreenPositionL(); } - // Update scroll span and position. - TInt scrollSpan = Max( ContentTotalHeight(), VisibleAreaHeight() + 1 ); - iScrollBarModel.SetScrollSpan( scrollSpan ); - UpdateScrollBar(); - iPrevDesiredHeigth = aDesirableEdwinSize.iHeight; return ret; @@ -1255,22 +1232,12 @@ FUNC_LOG; TRect headerRect = iHeader->Rect(); - TInt visiblePosition = iHeaderPos.iY - headerRect.iTl.iY; + TInt visiblePosition = -headerRect.iTl.iY; iScrollBarModel.SetFocusPosition( visiblePosition ); iScrollBar->SetModel( &iScrollBarModel ); - iScrollBar->MakeVisible( !iHeader->IsPopupActive() ); - } - -// ----------------------------------------------------------------------------- -// CNcsComposeViewContainer::UpdateScrollBarVisibility() -// ----------------------------------------------------------------------------- -// -void CNcsComposeViewContainer::UpdateScrollBarVisibility( TBool aVisible ) - { - FUNC_LOG; - iScrollBar->MakeVisible( aVisible ); + iScrollBar->MakeVisible( IsVisible() ); } // ----------------------------------------------------------------------------- @@ -1287,7 +1254,7 @@ iMessageField->SetCursorPosL( 0, EFalse ); iMessageField->SetFocus( ETrue, ENoDrawNow ); iFocused = iMessageField; - UpdateScreenPosition(); + UpdateScreenPositionL(); DrawDeferred(); } } @@ -1410,17 +1377,26 @@ } // ----------------------------------------------------------------------------- -// CNcsComposeViewContainer::HandleAttachmentsOpenCommand +// CNcsComposeViewContainer::HandleAttachmentOpenCommand // If attachment header field is focused and open key is pressed // ----------------------------------------------------------------------------- // -void CNcsComposeViewContainer::HandleAttachmentsOpenCommandL() - { +void CNcsComposeViewContainer::HandleAttachmentOpenCommandL() + { FUNC_LOG; + iView.HandleCommandL( EFsEmailUiCmdOpenAttachment ); + } - iView.HandleCommandL( EFsEmailUiCmdOpenAttachment ); - - } +// ----------------------------------------------------------------------------- +// CNcsComposeViewContainer::HandleAttachmentRemoveCommandL +// If attachment header field is focused and delete key is pressed +// ----------------------------------------------------------------------------- +// +void CNcsComposeViewContainer::HandleAttachmentRemoveCommandL() + { + FUNC_LOG; + iView.HandleCommandL( EFsEmailUiCmdRemoveAttachment ); + } // ----------------------------------------------------------------------------- // CNcsComposeViewContainer::LaunchStylusPopupMenu @@ -1802,7 +1778,9 @@ void CNcsComposeViewContainer::HideAttachmentLabel() { FUNC_LOG; - iHeader->HideAttachmentLabel(); + + iHeader->HideAttachmentLabel(); + } // ----------------------------------------------------------------------------- @@ -2006,28 +1984,21 @@ TInt CNcsComposeViewContainer::ContentTotalHeight() { FUNC_LOG; - TInt totalHeight( iHeader->Size().iHeight + - iSeparatorHeight + iMessageField->Size().iHeight ); - - if ( iReadOnlyQuoteField->IsVisible() ) - { - totalHeight += iReadOnlyQuoteField->Size().iHeight; - } + TInt totalHeight( iHeader->Size().iHeight + + iSeparatorHeight * 2 + + iMessageField->Size().iHeight ); - return totalHeight; - } - -// ----------------------------------------------------------------------------- -// Returns the height of visible composer area. -// ----------------------------------------------------------------------------- -// -TInt CNcsComposeViewContainer::VisibleAreaHeight() - { - return iVisibleAreaHeight; + if( iReadOnlyQuoteField->IsVisible() ) + { + totalHeight += iReadOnlyQuoteField->Size().iHeight; + } + + return totalHeight; } // ----------------------------------------------------------------------------- // CNcsComposeViewContainer::CommitL() +// // ----------------------------------------------------------------------------- // void CNcsComposeViewContainer::CommitL( TFieldToCommit aFieldToCommit ) @@ -2076,7 +2047,7 @@ FUNC_LOG; if ( iPhysics ) { - const TSize viewSize( iCmailPaneRect.Size() ); + const TSize viewSize( Rect().Size() ); // We must ensure that world size is at least the size of the view const TSize worldSize( viewSize.iWidth, Max( ContentTotalHeight(), viewSize.iHeight ) ); @@ -2091,23 +2062,22 @@ void CNcsComposeViewContainer::Scroll( TInt aTargetPos, TBool aDrawNow ) { FUNC_LOG; - TPoint headerPos = iHeader->Position(); - const TInt currentPos = iHeaderPos.iY - headerPos.iY; - TInt moveY = currentPos - aTargetPos; - + TPoint headerPos( iHeader->Position() ); + TInt moveY = -headerPos.iY - aTargetPos; + if ( aDrawNow ) - { - moveY = iTotalMoveY + moveY; - iTotalMoveY = 0; - if ( moveY ) - { - headerPos.iY += moveY; - iHeader->SetPosition( headerPos ); + { + moveY = iTotalMoveY + moveY; + iTotalMoveY = 0; + if ( moveY ) + { + headerPos.iY += moveY; + iHeader->SetPosition( headerPos ); - // set header invisible if it is not in visible area - // this is done to prevent drawing of header when it is not necessary + // set header invisible if it is not in visible area + // this is done to prevent drawing of header when it is not necessary if ( headerPos.iY + iHeaderHeight <= KHeaderVisibilityThreshold && iHeader->IsVisible() ) - { + { iHeader->MakeVisible( EFalse ); } // set header visible if it is in visible area @@ -2115,35 +2085,28 @@ { iHeader->MakeVisible( ETrue ); } - - TPoint msgPos( iMessageField->Position() ); - msgPos.iY += moveY; - iMessageField->SetPosition( msgPos ); - - TPoint quotePos( iReadOnlyQuoteField->Position() ); - quotePos.iY += moveY; - iReadOnlyQuoteField->SetPosition( quotePos ); + + TPoint msgPos( iMessageField->Position() ); + msgPos.iY += moveY; + iMessageField->SetPosition( msgPos ); + + if( iReadOnlyQuoteField->IsVisible() ) + { + TPoint readOnlyPos( iReadOnlyQuoteField->Position() ); + readOnlyPos.iY += moveY; + iReadOnlyQuoteField->SetPosition( readOnlyPos ); + } + + iSeparatorLineYPos += moveY; - const TInt bottom = Rect().iBr.iY; - if ( iMessageField->IsFocused() ) - { - iMessageField->SetCursorVisible( msgPos.iY <= bottom ); - } - else if ( iReadOnlyQuoteField->IsFocused() ) - { - iReadOnlyQuoteField->SetCursorVisible( quotePos.iY <= bottom ); - } - - iSeparatorLineYPos += moveY; - - UpdateScrollBar(); - DrawDeferred(); - } - } + UpdateScrollBar(); + DrawDeferred(); + } + } else - { - iTotalMoveY += moveY; - } + { + iTotalMoveY += moveY; + } } // ----------------------------------------------------------------------------- @@ -2188,10 +2151,10 @@ TPoint CNcsComposeViewContainer::ViewPosition() const { FUNC_LOG; - TInt y = iHeaderPos.iY - iHeader->Position().iY + iVisibleAreaHeight / 2; - return TPoint( 0, y ); + return TPoint(0, -iHeader->Position().iY + iVisibleAreaHeight / 2 ); } + // ----------------------------------------------------------------------------- // CNcsComposeViewContainer::IsRemoteSearchInprogress // ----------------------------------------------------------------------------- diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/ncseditor.cpp --- a/emailuis/emailui/src/ncseditor.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/ncseditor.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -28,13 +28,11 @@ #include #include #include -#include #include "ncseditor.h" #include "ncsutility.h" #include "ncscustomdraw.h" #include "ncseditorcustomdraw.h" -#include "freestyleemailcenrepkeys.h" // ========================= MEMBER FUNCTIONS ================================== @@ -73,19 +71,6 @@ CEikEdwin::ENoAutoSelection | CEikEdwin::EInclusiveSizeFixed | CEikEdwin::ENoHorizScrolling | CEikRichTextEditor::EPasteAsPlainText ); - CRepository* repository = NULL; - TRAPD( err, repository = CRepository::NewL( KFreestyleEmailCenRep ) ); - if ( !err ) - { - TInt value( 0 ); - err = repository->Get( KEmailFeatureSplitScreen, value ); - if( !err && value ) - { - SetAknEditorFlags( AknEditorFlags() | EAknEditorFlagEnablePartialScreen ); - } - } - delete repository; - repository = NULL; iGlobalCharFormat = CCharFormatLayer::NewL(); iGlobalCharFormat->SetBase( GlobalText()->GlobalCharFormatLayer() ); GlobalText()->SetGlobalCharFormat( iGlobalCharFormat ); @@ -129,11 +114,11 @@ // CNcsEditor::GetLineRectL() const // ----------------------------------------------------------------------------- // -void CNcsEditor::GetLineRect( TRect& aLineRect ) const +void CNcsEditor::GetLineRectL( TRect& aLineRect ) const { FUNC_LOG; TPoint position; - TRAP_IGNORE( iLayout->DocPosToXyPosL( CursorPos(), position ) ); + iLayout->DocPosToXyPosL( CursorPos(), position ); iLayout->GetLineRect( position.iY, aLineRect ); } @@ -670,10 +655,7 @@ void CNcsEditor::SetPhysicsEmulationOngoing( TBool aPhysOngoing ) { iPhysOngoing = aPhysOngoing; - if ( IsFocused() ) - { - SetCursorVisible( !aPhysOngoing ); - } + this->SetCursorVisible( !aPhysOngoing ); } TBool CNcsEditor::IsPhysicsEmulationOngoing() const diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/ncsheadercontainer.cpp --- a/emailuis/emailui/src/ncsheadercontainer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/ncsheadercontainer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -23,11 +23,9 @@ #include //CAknInformationNote #include #include -#include #include "cfsmailbox.h" #include -#include #include "FSEmailBuildFlags.h" #include "ncsheadercontainer.h" @@ -83,8 +81,7 @@ iFieldSizeObserver( static_cast< CNcsComposeViewContainer& >( aParent ) ), iMailBox( aMailBox ), iLongTapEventConsumed( EFalse ), - iPhysics( aPhysics ), - iSplitScreenVKBEnabled( EFalse ) + iPhysics( aPhysics ) { FUNC_LOG; } @@ -130,7 +127,7 @@ &iFieldSizeObserver, this ); iAttachmentField = CNcsAttachmentField::NewL( R_NCS_ATTACHMENT_LABEL_TEXT, - &iFieldSizeObserver, this ); + &iFieldSizeObserver, this, this ); // Setup the control array // Add all of them now so the container and parent is set correctly @@ -162,15 +159,16 @@ } // initially attachments field is hidden - iAttachmentField->MakeVisible( EFalse ); - controls.Remove( iAttachmentField ); + iAttachmentField->MakeVisible( EFalse ); + controls.Remove( iAttachmentField ); - // test whether mailbox supports remote lookup - TBool remoteLookupSupported = + // test whether mailbox supports remote lookup + TBool remoteLookupSupported = TFsEmailUiUtility::IsRemoteLookupSupported( iMailBox ); - - iAacListBox = CNcsPopupListBox::NewL( - this, iMailBox, *this, remoteLookupSupported ); + + iAacListBox = CNcsPopupListBox::NewL( + this, iMailBox, *this, remoteLookupSupported ); + iAacListBox->MakeVisible( EFalse ); iRALInProgress = EFalse; @@ -196,43 +194,6 @@ } // --------------------------------------------------------------------------- -// From MNcsPopupListBoxObserver. -// --------------------------------------------------------------------------- -// -TBool CNcsHeaderContainer::PopupVisibilityChangingL( TBool aVisible ) - { - CNcsComposeViewContainer& parent = - static_cast( iParent ); - - if ( aVisible ) - { - DoScrollFocusToTop(); - iAacListBox->SetPopupMaxRect( CalculatePopupRect() ); - } - else - { - // Scroll editor top, if it can be fully displayed. - if ( parent.ContentTotalHeight() < parent.VisibleAreaHeight() ) - { - parent.Scroll( 0, ETrue ); - } - } - - parent.UpdateScrollBarVisibility( !aVisible ); - ShowPopupMenuBarL( aVisible ); - return ETrue; - } - -// --------------------------------------------------------------------------- -// From MNcsPopupListBoxObserver. -// --------------------------------------------------------------------------- -// -void CNcsHeaderContainer::PopupItemSelectedL() - { - DoPopupSelectL(); - } - -// --------------------------------------------------------------------------- // CNcsHeaderContainer::FocusChanged // --------------------------------------------------------------------------- // @@ -279,6 +240,23 @@ } } +// --------------------------------------------------------------------------- +// CNcsHeaderContainer::ShowCursor +// --------------------------------------------------------------------------- +// +void CNcsHeaderContainer::ShowCursor( TBool aShow, TDrawNow aDrawNow ) + { + CCoeControl* focused = FindFocused(); + if ( focused ) + { + iFocused = focused; + } + if ( iFocused ) + { + iFocused->SetFocus( aShow, aDrawNow ); + } + } + // ----------------------------------------------------------------------------- // CNcsHeaderContainer::Draw() const // Draws the display @@ -289,16 +267,6 @@ } // ----------------------------------------------------------------------------- -// CNcsHeaderContainer::DrawAttachmentFocusNow() const -// ----------------------------------------------------------------------------- -// -void CNcsHeaderContainer::DrawAttachmentFocusNow() - { - FUNC_LOG; - iAttachmentField->DrawDeferred(); - } - -// ----------------------------------------------------------------------------- // CNcsHeaderContainer::HandleControlArrayEventL() // Handles removal or additons of controls to the header. // ----------------------------------------------------------------------------- @@ -371,22 +339,22 @@ const TPointerEvent& aPointerEvent ) { FUNC_LOG; - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) + if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) { - CCoeControl* component = 0; + CCoeControl* clicked = 0; for ( TInt i=0; i < Components().Count(); ++i ) { TRect rc = Components().At( i ).iControl->Rect(); if ( rc.Contains( aPointerEvent.iPosition ) ) { - component = Components().At( i ).iControl; + clicked = Components().At( i ).iControl; } } - if ( component ) + if ( clicked ) { CCoeControl* pOldCtrl = FindFocused(); - CCoeControl* pNewCtrl= component; + CCoeControl* pNewCtrl= clicked; if ( pOldCtrl != pNewCtrl ) { @@ -403,53 +371,28 @@ CommitFieldL( pOldCtrl ); } - // If the attachments label has changed focus - if ( pOldCtrl == iAttachmentField || - pNewCtrl == iAttachmentField ) - { - DrawAttachmentFocusNow(); - } - CNcsComposeViewContainer* container = - static_cast( &iParent ); + static_cast( &iParent ); container->UpdateScrollBar(); } - DrawDeferred(); - } - } - - if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) - { - if ( iLongTapEventConsumed ) - { - iLongTapEventConsumed = EFalse; - return; - } + if ( iLongTapEventConsumed ) + { + iLongTapEventConsumed = EFalse; + return; + } - CCoeControl* component = 0; - for ( TInt i=0; i < Components().Count(); ++i ) - { - TRect rc = Components().At( i ).iControl->Rect(); - if ( rc.Contains( aPointerEvent.iPosition ) ) - { - component = Components().At( i ).iControl; - } - } - - if ( component && component == iFocused ) - { TBool physicsActionOngoing( EFalse ); if ( iPhysics && iPhysics->OngoingPhysicsAction() != CAknPhysics::EAknPhysicsActionNone ) { physicsActionOngoing = ETrue; - } + } - if ( component == iAttachmentField && !physicsActionOngoing ) + if( pNewCtrl == iAttachmentField && !physicsActionOngoing ) { CNcsComposeViewContainer& parent = - static_cast( iParent ); - parent.HandleAttachmentsOpenCommandL(); + static_cast( iParent ); + parent.HandleAttachmentOpenCommandL(); } } } @@ -509,19 +452,20 @@ { FUNC_LOG; TKeyResponse ret( EKeyWasNotConsumed ); - TBool doScroll( EFalse ); + CCoeControl* focused = FindFocused(); - if ( aKeyEvent.iCode == EKeyUpArrow || aKeyEvent.iCode == EKeyDownArrow ) + if ( aKeyEvent.iCode == EKeyUpArrow || + aKeyEvent.iCode == EKeyDownArrow ) { if ( iAacListBox && iAacListBox->IsVisible() && !iAacListBox->IsPopupEmpty() ) { - return iAacListBox->OfferKeyEventL( aKeyEvent, aType ); + return iAacListBox->OfferKeyEventL( aKeyEvent, aType ); } - else + else if ( focused ) { - ret = FindFocused()->OfferKeyEventL( aKeyEvent, aType ); + ret = focused->OfferKeyEventL( aKeyEvent, aType ); doScroll = ( ret == EKeyWasConsumed ); } @@ -532,78 +476,56 @@ } } else - { - if ( FindFocused() == iAttachmentField ) - { - if ( aType == EEventKey ) - { - CNcsComposeViewContainer& parent = - static_cast( iParent ); - - if ( aKeyEvent.iCode == EKeyEnter || - aKeyEvent.iScanCode == EStdKeyEnter || - aKeyEvent.iCode == EKeyOK || - aKeyEvent.iScanCode == EStdKeyDevice3 ) - { - // open list or attachment - parent.HandleAttachmentsOpenCommandL(); - ret = EKeyWasConsumed; - } - } + { + if ( IsPopupActive() && aType == EEventKey ) + { + // select current + if( aKeyEvent.iCode == EKeyEnter || + aKeyEvent.iCode == EKeyDevice4 || + aKeyEvent.iCode == EKeyOK ) + { + DoPopupSelectL(); + ret = EKeyWasConsumed; + } } - else if ( IsPopupActive() && aType == EEventKey ) - { - // select current - if( aKeyEvent.iCode == EKeyEnter || - aKeyEvent.iCode == EKeyDevice4 || - aKeyEvent.iCode == EKeyOK ) - { - DoPopupSelectL(); - ret = EKeyWasConsumed; - } - } - else - { - // Don't allow line feeds in header fields. - // Could be nice if enter committed the field and moved the focus - // to next one - if ( aType == EEventKey && - ( aKeyEvent.iCode == EKeyEnter || - aKeyEvent.iScanCode == EStdKeyEnter) ) - { - FindFocused()->OfferKeyEventL( aKeyEvent, aType ); - ret = EKeyWasConsumed; - doScroll = ETrue; - } - } - } + else + { + // Don't allow line feeds in header fields. + // Could be nice if enter committed the field and moved the focus + // to next one + if ( aType == EEventKey && + ( aKeyEvent.iCode == EKeyEnter || + aKeyEvent.iScanCode == EStdKeyEnter) ) + { + focused->OfferKeyEventL( aKeyEvent, aType ); + ret = EKeyWasConsumed; + } + } + } if ( ret == EKeyWasNotConsumed ) - { - CCoeControl* focused = FindFocused(); - if ( focused ) - { - ret = focused->OfferKeyEventL( aKeyEvent, aType ); - - if( aType == EEventKeyDown && - aKeyEvent.iScanCode != EStdKeyUpArrow && - aKeyEvent.iScanCode != EStdKeyDownArrow ) - { - doScroll = ETrue; - } - else - { - doScroll = (ret == EKeyWasConsumed); - } - } - } + { + if ( focused ) + { + ret = focused->OfferKeyEventL( aKeyEvent, aType ); - if( doScroll ) - { - DoScroll(); - } + if(aType==EEventKeyDown) + { + doScroll = ETrue; + } + else + { + doScroll = (ret == EKeyWasConsumed); + } + } + } + + if ( doScroll ) + { + DoScroll(); + } return ret; - } + } // --------------------------------------------------------------------------- // CNcsHeaderContainer::FindFocused @@ -650,18 +572,28 @@ // Unfocus the control pOldCtrl->SetFocus( EFalse, ENoDrawNow ); - CCoeControl* pNewCtrl= NULL; - if ( ( aKeyEvent.iCode == EKeyDownArrow && cur.Next() ) || - ( aKeyEvent.iCode == EKeyUpArrow && cur.Prev() ) ) + CCoeControl* pNewCtrl = NULL; + if ( aKeyEvent.iCode == EKeyDownArrow && cur.Next() ) { pNewCtrl = cur.Control(); + if ( pNewCtrl == iAttachmentField ) + { + iAttachmentField->SetFocusedAttachmentLabelIndex( 0 ); + } + pNewCtrl->SetFocus( ETrue, ENoDrawNow ); iFocused = pNewCtrl; + ret = EKeyWasConsumed; + } + else if ( aKeyEvent.iCode == EKeyUpArrow && cur.Prev() ) + { + pNewCtrl = cur.Control(); pNewCtrl->SetFocus( ETrue, ENoDrawNow ); + iFocused = pNewCtrl; ret = EKeyWasConsumed; } CNcsComposeViewContainer* container = - static_cast( &iParent ); + static_cast( &iParent ); if ( pOldCtrl == iToField ) { container->CommitL( EToField ); @@ -679,12 +611,6 @@ container->CommitL( ESubjectField ); } - // If the attachments label has changed focus - if ( pOldCtrl == iAttachmentField || pNewCtrl == iAttachmentField ) - { - DrawAttachmentFocusNow(); - } - // if focus was changed, update scroll bar if ( ret == EKeyWasConsumed ) { @@ -756,8 +682,9 @@ // set size // ----------------------------------------------------------------------------- void CNcsHeaderContainer::SizeChanged() - { + { FUNC_LOG; + const TRect rect( Rect() ); TInt currentLine( 0 ); @@ -775,11 +702,11 @@ currentLine += ToNcsControl( cur )->LayoutLineCount(); } } while ( cur.Next() ); - - if ( iAacListBox->IsVisible() && !iAacListBox->IsPopupEmpty() ) - { - iAacListBox->SetPopupMaxRect( CalculatePopupRect() ); - } + + if( iAacListBox->IsVisible() && !iAacListBox->IsPopupEmpty() ) + { + iAacListBox->SetPopupMaxRect( CalculatePopupRect() ); + } } // ----------------------------------------------------------------------------- @@ -841,19 +768,22 @@ // --------------------------------------------------------------------------- // TInt CNcsHeaderContainer::GetToLineHeight() const - { - FUNC_LOG; - TInt lineHeight = 0; - - if ( iToField ) - { - TRect lineRect; - iToField->GetLineRect( lineRect ); - lineHeight = lineRect.Height(); - } - return lineHeight; - } - + { + FUNC_LOG; + TInt lineHeight = 0; + + if(iToField) + { + TRect lineRect; + TRAPD(err, iToField->GetLineRectL(lineRect) ); + if(err == KErrNone) + { + lineHeight = lineRect.iBr.iY - lineRect.iTl.iY; + } + } + return lineHeight; + } + // --------------------------------------------------------------------------- // CNcsHeaderContainer::GetTotalHeight // --------------------------------------------------------------------------- @@ -885,7 +815,6 @@ if( aAttachmentNames ) { ShowAttachmentLabelL(); - DrawAttachmentFocusNow(); } } @@ -894,7 +823,7 @@ // // ----------------------------------------------------------------------------- // -TInt CNcsHeaderContainer::FocusedAttachmentLabelIndex() +TInt CNcsHeaderContainer::FocusedAttachmentLabelIndex() const { FUNC_LOG; return iAttachmentField->FocusedAttachmentLabelIndex(); @@ -921,7 +850,6 @@ pOldCtrl->SetFocus( EFalse, ENoDrawNow ); } - iFocused = iAttachmentField; iAttachmentField->SetFocus( ETrue, ENoDrawNow ); iFieldSizeObserver.UpdateFieldPosition( iAttachmentField ); } @@ -939,6 +867,11 @@ CCoeControl* pOldCtrl = FindFocused(); CCoeControl* pNewCtrl = NULL; + if ( iFocused == iAttachmentField ) + { + iFocused = NULL; + } + if ( pOldCtrl == iAttachmentField ) { CCoeControlArray::TCursor cur = Components().Find( pOldCtrl ); @@ -947,7 +880,6 @@ if ( cur.Prev() ) { pNewCtrl = cur.Control(); - iFocused = pNewCtrl; pNewCtrl->SetFocus( ETrue, ENoDrawNow ); } } @@ -956,11 +888,6 @@ pNewCtrl = pOldCtrl; // no need to move focus } - if ( pOldCtrl == iAttachmentField || pNewCtrl == iAttachmentField ) - { - DrawAttachmentFocusNow(); - } - iAttachmentField->MakeVisible( EFalse ); Components().Remove( iAttachmentField ); TRAP_IGNORE( iFieldSizeObserver.UpdateFieldSizeL() ); @@ -981,101 +908,100 @@ TBool aVisible, TDrawNow aDrawNow, TBool aFocus ) { FUNC_LOG; - if ( iBccField->IsVisible() == aVisible ) - { - return; - } + if ( iBccField->IsVisible() == aVisible ) + { + return; + } - if ( aVisible ) - { - CCoeControlArray::TCursor cur = Components().Find( iSubjectField ); - Components().InsertLC( cur, iBccField ); - CleanupStack::Pop( iBccField ); + if ( aVisible ) + { + CCoeControlArray::TCursor cur = Components().Find( iSubjectField ); + Components().InsertLC( cur, iBccField ); + CleanupStack::Pop( iBccField ); - if ( aFocus ) - { - CCoeControl* focused = FindFocused(); + if ( aFocus ) + { + CCoeControl* focused = FindFocused(); - if ( focused ) - { - focused->SetFocus( EFalse, aDrawNow ); - } - iBccField->SetFocus( ETrue, aDrawNow ); + if ( focused ) + { + focused->SetFocus( EFalse ); + } + iBccField->SetFocus( ETrue ); iFocused = iBccField; - iBccField->SelectAllTextL(); - } - } - else - { - if ( iBccField->IsFocused() ) - { - CCoeControlArray::TCursor cur = Components().Find( iBccField ); - ASSERT( cur.IsValid() ); + iBccField->SelectAllTextL(); + } + } + else + { + if ( iBccField->IsFocused() ) + { + CCoeControlArray::TCursor cur = Components().Find( iBccField ); + ASSERT( cur.IsValid() ); + + iBccField->SetFocus( EFalse ); - iBccField->SetFocus( EFalse ); - - cur.Prev(); // Get the control before this field - CCoeControl* focused = cur.Control(); - focused->SetFocus( ETrue ); - iFocused = focused; - } - Components().Remove( iBccField ); - } + cur.Prev(); // Get the control before this field + cur.Control()->SetFocus( ETrue ); + } + Components().Remove( iBccField ); + iFocused = iSubjectField; + } TRAP_IGNORE( iFieldSizeObserver.UpdateFieldSizeL() ); - if ( aDrawNow == EDrawNow ) - { - DrawDeferred(); - } - } + if ( aDrawNow == EDrawNow ) + { + DrawDeferred(); + } + } // ----------------------------------------------------------------------------- // CNcsHeaderContainer::SetCcFieldVisibleL() // ----------------------------------------------------------------------------- void CNcsHeaderContainer::SetCcFieldVisibleL( TBool aVisible, TDrawNow aDrawNow, TBool aFocus ) - { + { FUNC_LOG; - if ( iCcField->IsVisible() == aVisible ) - { - return; - } + if ( iCcField->IsVisible() == aVisible ) + { + return; + } - if ( aVisible ) - { - Components().InsertAfterLC( Components().Id( *iToField ), iCcField ); - CleanupStack::Pop( iCcField ); + if ( aVisible ) + { + Components().InsertAfterLC( Components().Id( *iToField ), iCcField ); + CleanupStack::Pop( iCcField ); - if ( aFocus ) - { - CCoeControl* focused = FindFocused(); - if ( focused ) - { - focused->SetFocus( EFalse, aDrawNow ); - } - iCcField->SetFocus( ETrue, aDrawNow ); + if ( aFocus ) + { + CCoeControl* focused = FindFocused(); + if ( focused ) + { + focused->SetFocus( EFalse ); + } + iCcField->SetFocus( ETrue ); iFocused = iCcField; - iCcField->SelectAllTextL(); - } - } - else - { - if( iCcField->IsFocused() ) - { - iCcField->SetFocus( EFalse ); - iToField->SetFocus( ETrue ); - iFocused = iToField; - } - Components().Remove( iCcField ); - } - - TRAP_IGNORE( iFieldSizeObserver.UpdateFieldSizeL() ); + iCcField->SelectAllTextL(); + } + } + else + { + if( iCcField->IsFocused() ) + { + iCcField->SetFocus( EFalse ); + iToField->SetFocus( ETrue ); + } + Components().Remove( iCcField ); + iFocused = iToField; + } + + TRAP_IGNORE( iFieldSizeObserver.UpdateFieldSizeL() ); if ( aDrawNow == EDrawNow ) - { - DrawDeferred(); - } + { + DrawDeferred(); + } } // ----------------------------------------------------------------------------- @@ -1198,63 +1124,65 @@ // void CNcsHeaderContainer::UpdatePopupContactListL( const TDesC& aMatchString, TBool /*aListAll*/ ) - { + { FUNC_LOG; // do update only for address fields - CCoeControl* focused = FindFocused(); - - if ( !IsAddressInputField( focused ) ) - { - return; - } - - if ( aMatchString.CompareC( KNullDesC ) == 0 || - aMatchString.Compare( KAddressDelimeterSemiColon ) == 0 ) - { - ClosePopupContactListL(); - return; - } - - if( !iAacListBox->IsVisible() ) - { + CCoeControl* focused = FindFocused(); + + if ( !IsAddressInputField( focused ) ) + { + return; + } + + if ( aMatchString.CompareC( KNullDesC ) == 0 || + aMatchString.Compare( KAddressDelimeterSemiColon ) == 0 ) + { + ClosePopupContactListL(); + return; + } + + if( !iAacListBox->IsVisible() ) + { iAacListBox->SetPopupMaxRect( CalculatePopupRect() ); iAacListBox->InitAndSearchL( aMatchString, 1 ); iAacListBox->ActivateL(); - } - else - { - iAacListBox->SetSearchTextL( aMatchString ); - } - } + } + else + { + iAacListBox->SetSearchTextL( aMatchString ); + } + } // ----------------------------------------------------------------------------- // CNcsHeaderContainer::ClosePopupContactListL() // ----------------------------------------------------------------------------- // void CNcsHeaderContainer::ClosePopupContactListL() - { + { FUNC_LOG; + if ( iAacListBox->IsVisible() ) { - iAacListBox->ClosePopupL(); - } - - // The focused address field should be redrawn after the popup is - // closed to fix the field border. - if ( iToField->IsFocused() ) - { - iToField->DrawDeferred(); + iAacListBox->MakeVisible( EFalse ); + ShowPopupMenuBarL( EFalse ); + + // The focused address field should be redrawn after the popup is + // closed to fix the field border. + if ( iToField->IsFocused() ) + { + iToField->DrawDeferred(); + } + else if ( iCcField->IsFocused() ) + { + iCcField->DrawDeferred(); + } + else if ( iBccField->IsFocused() ) + { + iBccField->DrawDeferred(); + } } - else if ( iCcField->IsFocused() ) - { - iCcField->DrawDeferred(); - } - else if ( iBccField->IsFocused() ) - { - iBccField->DrawDeferred(); - } - } + } // --------------------------------------------------------------------------- // CNcsHeaderContainer::ShowPopupMenuBarL @@ -1342,10 +1270,9 @@ iSubjectField->SelectAllTextL(); } -// --------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- // CNcsHeaderContainer::CalculatePopupRect -// --------------------------------------------------------------------------- -// +// ----------------------------------------------------------------------------- TRect CNcsHeaderContainer::CalculatePopupRect() { FUNC_LOG; @@ -1361,22 +1288,10 @@ TPoint editorPos = aifEditor->Editor()->PositionRelativeToScreen(); TRect editorRect = aifEditor->Editor()->Rect(); - // When layouts are available we'll use them. Until that these are now - // hardcoded! - TInt tlXPos = 3; - TInt tlYPos = editorPos.iY + aifEditor->CursorPosition() + 1; - - if ( Layout_Meta_Data::IsLandscapeOrientation() && - iSplitScreenVKBEnabled ) - { - tlXPos = iAvkonAppUi->ApplicationRect().Width() / 2; - tlYPos = 3; - } - - popupRect.iTl = TPoint( tlXPos, tlYPos ); + popupRect.iTl = TPoint( editorPos.iX, + editorPos.iY + aifEditor->CursorPosition() + 1 ); - - popupRect.iBr = TPoint( iAvkonAppUi->ApplicationRect().iBr.iX - 3, + popupRect.iBr = TPoint( editorPos.iX + editorRect.Width(), iParent.PositionRelativeToScreen().iY + iParent.Rect().Height() ); } @@ -1392,7 +1307,7 @@ __ASSERT_DEBUG( iAacListBox, Panic( ENcsBasicUi ) ); __ASSERT_DEBUG( &iMailBox, Panic( ENcsBasicUi ) ); - if ( iAacListBox->IsRemoteLookupItemSelected() ) + if( iAacListBox->IsRemoteLookupItemSelected() ) { CCoeControl* focused = FindFocused(); @@ -1827,13 +1742,13 @@ { FUNC_LOG; - CCoeControl* focused = FindFocused(); - if ( IsAddressInputField( focused ) ) - { - CNcsAddressInputField* aifFocused = NULL; - aifFocused = static_cast( focused ); - aifFocused->AddAddressL( aEml ); - } + CCoeControl* focused = FindFocused(); + if ( IsAddressInputField( focused ) ) + { + CNcsAddressInputField* aifFocused = NULL; + aifFocused = static_cast( focused ); + aifFocused->AddAddressL( aEml ); + } DoScroll(); } @@ -1851,32 +1766,59 @@ // --------------------------------------------------------------------------- // void CNcsHeaderContainer::FocusToField() - { + { FUNC_LOG; CCoeControl* oldCtrl = FindFocused(); - if ( !oldCtrl ) - { - return; - } - oldCtrl->SetFocus( EFalse, ENoDrawNow ); - iToField->SetFocus( ETrue, ENoDrawNow ); - } + if ( oldCtrl ) + { + oldCtrl->SetFocus( EFalse, ENoDrawNow ); + } + + iToField->SetFocus( ETrue, ENoDrawNow ); + iFocused = iToField; + } // --------------------------------------------------------------------------- // CNcsHeaderContainer::FocusAttachmentField // --------------------------------------------------------------------------- // void CNcsHeaderContainer::FocusAttachmentField() - { + { FUNC_LOG; CCoeControl* oldCtrl = FindFocused(); - if ( !oldCtrl ) - { - return; - } - oldCtrl->SetFocus( EFalse, ENoDrawNow ); - iAttachmentField->SetFocus( ETrue, ENoDrawNow ); - } + if ( oldCtrl ) + { + oldCtrl->SetFocus( EFalse, ENoDrawNow ); + } + + iAttachmentField->SetFocus( ETrue, ENoDrawNow ); + iFocused = iAttachmentField; + } + +// --------------------------------------------------------------------------- +// Sets focus to the first visible header field from the bottom. +// --------------------------------------------------------------------------- +// +void CNcsHeaderContainer::SetFocusToBottom( TDrawNow aDrawNow ) + { + FUNC_LOG; + CCoeControl* oldCtrl = FindFocused(); + if ( oldCtrl ) + { + oldCtrl->SetFocus( EFalse, aDrawNow ); + } + + CCoeControlArray::TCursor cur = Components().End(); + cur.Prev(); + CCoeControl* newControl = cur.Control(); + if ( newControl && newControl == iAttachmentField ) + { + // set focus to the last attachment + TInt count = GetAttachmentCount(); + iAttachmentField->SetFocusedAttachmentLabelIndex( count - 1 ); + } + SetFocus( ETrue, aDrawNow ); + } // --------------------------------------------------------------------------- // CNcsHeaderContainer::AreAddressFieldsEmpty @@ -1922,13 +1864,14 @@ CCoeControlArray::TCursor cur = Components().Begin(); do { - totalLineCount += ToNcsControl( cur )->LayoutLineCount(); + totalLineCount += ToNcsControl( cur )->LayoutLineCount(); } while ( cur.Next() ); return totalLineCount; } + // --------------------------------------------------------------------------- // CNcsHeaderContainer::IsAddressInputField // --------------------------------------------------------------------------- @@ -2032,11 +1975,11 @@ } void CNcsHeaderContainer::FixSemicolonInAddressFieldsL() - { - iToField->FixSemicolonAtTheEndL(); - iCcField->FixSemicolonAtTheEndL(); - iBccField->FixSemicolonAtTheEndL(); - } + { + iToField->FixSemicolonAtTheEndL(); + iCcField->FixSemicolonAtTheEndL(); + iBccField->FixSemicolonAtTheEndL(); + } TBool CNcsHeaderContainer::IsRemoteSearchInprogress() const { @@ -2056,75 +1999,63 @@ { if ( aField == iToField ) { + if( iToField->TextEditor()->SelectionLength() ) + { + iToField->TextEditor()->HandleTextChangedL(); + } container->CommitL( EToField ); } else if ( aField == iCcField ) { + if( iCcField->TextEditor()->SelectionLength() ) + { + iCcField->TextEditor()->HandleTextChangedL(); + } container->CommitL( ECcField ); } else if ( aField == iBccField ) { + if( iBccField->TextEditor()->SelectionLength() ) + { + iBccField->TextEditor()->HandleTextChangedL(); + } container->CommitL( EBccField ); } else if ( aField == iSubjectField ) { + if( iSubjectField->Editor()->SelectionLength() ) + { + iSubjectField->Editor()->HandleTextChangedL(); + } container->CommitL( ESubjectField ); } } } -// --------------------------------------------------------------------------- -// Scrolls editor to make cursor visible, if it is outside the visible area -// --------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// CNcsHeaderContainer::DoScroll +// ----------------------------------------------------------------------------- // void CNcsHeaderContainer::DoScroll() { // scroll the screen if the cursor goes beyond the screen - CNcsComposeViewContainer& parent = - static_cast( iParent ); - - // Scrolling based on cursor line number can only be done when - // header composer and one of its fields is focused. - if ( IsFocused() ) - { - const TRect rect = Rect(); - const TInt screenPos = iOrigin.iY - rect.iTl.iY; - const TInt screenHeight = parent.VisibleAreaHeight(); - - const TInt lineNumber = CursorLineNumber(); - const TInt lineHeight = rect.Height() / LineCount(); - const TInt linePos = lineNumber * lineHeight; + CNcsComposeViewContainer& parent = static_cast( iParent ); + + TInt screenPos( -Position().iY ); + TInt cursorPos( CursorPosition() ); + TInt lineHeight( Rect().Height() / LineCount() ); + TInt screenHeight( parent.Rect().Height() ); - TInt targetPos = screenPos; - if ( linePos - lineHeight < screenPos ) - { - targetPos = linePos - lineHeight; - } - else if ( linePos + lineHeight > screenPos + screenHeight ) - { - targetPos = linePos + lineHeight - screenHeight; - } - - parent.Scroll( targetPos ); + if ( cursorPos - lineHeight < screenPos ) + { + screenPos = cursorPos - lineHeight; } - } + else if( cursorPos + lineHeight > screenPos + screenHeight ) + { + screenPos = cursorPos + lineHeight - screenHeight; + } -// --------------------------------------------------------------------------- -// Scrolls focused editor line to the top of visible area. -// --------------------------------------------------------------------------- -// -void CNcsHeaderContainer::DoScrollFocusToTop() - { - CNcsComposeViewContainer& parent = - static_cast( iParent ); - - // Calculate the position of the focused editor line. - const TRect rect = Rect(); - const TInt lineNumber = CursorLineNumber(); - const TInt lineHeight = rect.Height() / LineCount(); - const TInt targetPos = ( lineNumber - 1 ) * lineHeight; - - parent.Scroll( targetPos ); + parent.Scroll( screenPos ); } // --------------------------------------------------------------------------- @@ -2140,29 +2071,25 @@ } // --------------------------------------------------------------------------- -// CNcsHeaderContainer::HandleResourceChange +// CNcsHeaderContainer::AttachmentOpenL // --------------------------------------------------------------------------- // -void CNcsHeaderContainer::HandleResourceChange( TInt aType ) +void CNcsHeaderContainer::AttachmentOpenL() { - FUNC_LOG; - CCoeControl::HandleResourceChange( aType ); - if ( aType == KAknSplitInputEnabled || aType == KAknSplitInputDisabled ) - { - iSplitScreenVKBEnabled = ( aType == KAknSplitInputEnabled ); - if ( iAacListBox->IsVisible() ) - { - iAacListBox->SetPopupMaxRect( CalculatePopupRect() ); - } - } + CNcsComposeViewContainer& parent = + static_cast( iParent ); + + parent.HandleAttachmentOpenCommandL(); } // --------------------------------------------------------------------------- -// Set origin for header's top position. +// CNcsHeaderContainer::AttachmentRemoveL // --------------------------------------------------------------------------- // -void CNcsHeaderContainer::SetOrigin( TPoint& aOrigin ) +void CNcsHeaderContainer::AttachmentRemoveL() { - iOrigin = aOrigin; + CNcsComposeViewContainer& parent = + static_cast( iParent ); + + parent.HandleAttachmentRemoveCommandL(); } - diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/ncspopuplistbox.cpp --- a/emailuis/emailui/src/ncspopuplistbox.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/ncspopuplistbox.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -20,8 +20,8 @@ #include "emailtrace.h" #include #include -#include -#include +#include // R_FSE_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH +#include // StringLoader #include #include #include @@ -29,10 +29,10 @@ #include #include "ncspopuplistbox.h" -#include "ncsemailaddressobject.h" +#include "ncsemailaddressobject.h" // CNcsEmailAddressObject #include "ncsconstants.h" -#include "ncsheadercontainer.h" -#include "FreestyleEmailUiContactHandler.h" +#include "ncsheadercontainer.h" // CNcsHeaderContainer +#include "FreestyleEmailUiContactHandler.h" // CFSEmailUiClsListsHandler #include "ncsutility.h" #include "FreestyleEmailUiUtilities.h" #include "FreestyleEmailUiAppui.h" @@ -49,12 +49,12 @@ // ----------------------------------------------------------------------------- CNcsPopupListBox* CNcsPopupListBox::NewL( const CCoeControl* aParent, CFSMailBox& aMailBox, - MNcsPopupListBoxObserver& aObserver, + CNcsHeaderContainer& aHeaderContainer, TBool aRemoteLookupSupported ) { FUNC_LOG; - CNcsPopupListBox* self = new (ELeave) CNcsPopupListBox( aMailBox, - aObserver, aRemoteLookupSupported ); + CNcsPopupListBox* self = new (ELeave) CNcsPopupListBox( aHeaderContainer, + aRemoteLookupSupported, aMailBox ); CleanupStack::PushL( self ); self->ConstructL( aParent ); CleanupStack::Pop( self ); @@ -64,10 +64,11 @@ // ----------------------------------------------------------------------------- // CNcsPopupListBox::CNcsPopupListBox // ----------------------------------------------------------------------------- -CNcsPopupListBox::CNcsPopupListBox( CFSMailBox& aMailBox, - MNcsPopupListBoxObserver& aObserver, TBool aRemoteLookupSupported ) - : iMailBox( aMailBox ), - iObserver( aObserver ), +CNcsPopupListBox::CNcsPopupListBox( CNcsHeaderContainer& aHeaderContainer, + TBool aRemoteLookupSupported, + CFSMailBox& aMailBox) + : iHeaderContainer( aHeaderContainer ), + iMailBox( aMailBox ), iRemoteLookupSupported( aRemoteLookupSupported ), iCachingInProgress( EFalse ), iAppUi( static_cast( iEikonEnv->AppUi() ) ) @@ -86,12 +87,11 @@ SetMopParent( const_cast( aParent ) ); User::LeaveIfError( SetParent( const_cast( aParent ) ) ); - CreateScrollBarFrameL( EFalse, EFalse, ETrue ); + CEikScrollBarFrame* frame = CreateScrollBarFrameL( EFalse, EFalse, ETrue ); CEikTextListBox::SetBorder( TGulBorder::ENone ); - const CFont* font = - AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont ); + const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont ); CEikTextListBox::SetItemHeightL( font->FontMaxHeight() + 12 ); iBackgroundContext = CAknsFrameBackgroundControlContext::NewL( @@ -105,7 +105,6 @@ } SetListBoxObserver( this ); - MakeVisible( EFalse ); } // ----------------------------------------------------------------------------- @@ -122,14 +121,6 @@ } // --------------------------------------------------------------------------- -// Hides the popup window. -// --------------------------------------------------------------------------- -void CNcsPopupListBox::ClosePopupL() - { - UpdateVisibilityL( EFalse ); - } - -// --------------------------------------------------------------------------- // CNcsPopupListBox::~CNcsPopupListBox // --------------------------------------------------------------------------- CNcsPopupListBox::~CNcsPopupListBox() @@ -153,7 +144,7 @@ // ----------------------------------------------------------------------------- // CNcsPopupListBox::MopSupplyObject // ----------------------------------------------------------------------------- -TTypeUid::Ptr CNcsPopupListBox::MopSupplyObject( TTypeUid aId ) +TTypeUid::Ptr CNcsPopupListBox::MopSupplyObject(TTypeUid aId) { FUNC_LOG; if ( aId.iUid == MAknsControlContext::ETypeId ) @@ -182,24 +173,15 @@ TRAP_IGNORE( HandleViewRectSizeChangeL() ); } -// ----------------------------------------------------------------------------- -// CNcsPopupListBox::HandleResourceChange -// ----------------------------------------------------------------------------- -// void CNcsPopupListBox::HandleResourceChange( TInt aType ) { FUNC_LOG; - CEikTextListBox::HandleResourceChange( aType ); if ( aType == KAknsMessageSkinChange ) { UpdateTextColors(); } } -// ----------------------------------------------------------------------------- -// CNcsPopupListBox::HandlePointerEventL -// ----------------------------------------------------------------------------- -// void CNcsPopupListBox::HandlePointerEventL( const TPointerEvent& aPointerEvent ) { CEikTextListBox::HandlePointerEventL( aPointerEvent ); @@ -208,7 +190,7 @@ // ----------------------------------------------------------------------------- // CNcsPopupListBox::OfferKeyEventL // ----------------------------------------------------------------------------- -// +// TKeyResponse CNcsPopupListBox::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) { @@ -217,32 +199,27 @@ if( aKeyEvent.iCode == EKeyDownArrow ) { MoveRemoteLookupItemL( ERemoteLookupItemDown ); - iView->MoveCursorL( - CListBoxView::ECursorNextItem, CListBoxView::ENoSelection ); + iView->MoveCursorL( CListBoxView::ECursorNextItem, CListBoxView::ENoSelection ); ret = EKeyWasConsumed; } else if( aKeyEvent.iCode == EKeyUpArrow ) { TBool stay = EFalse; // Move cursor separator line over - if ( CurrentItemIndex() - 1 > 0 && - CurrentItemIndex() - 1 == iRemoteLookupItemPos ) + if ( CurrentItemIndex() - 1 > 0 && CurrentItemIndex() - 1 == iRemoteLookupItemPos ) { MoveRemoteLookupItemL( ERemoteLookupItemUp ); - iView->MoveCursorL( CListBoxView::ECursorPreviousItem, - CListBoxView::ENoSelection ); + iView->MoveCursorL( CListBoxView::ECursorPreviousItem, CListBoxView::ENoSelection ); stay = ETrue; } MoveRemoteLookupItemL( ERemoteLookupItemUp ); - iView->MoveCursorL( CListBoxView::ECursorPreviousItem, - CListBoxView::ENoSelection ); + iView->MoveCursorL( CListBoxView::ECursorPreviousItem, CListBoxView::ENoSelection ); if( stay ) { MoveRemoteLookupItemL( ERemoteLookupItemDown ); - iView->MoveCursorL( CListBoxView::ECursorNextItem, - CListBoxView::ENoSelection ); + iView->MoveCursorL( CListBoxView::ECursorNextItem, CListBoxView::ENoSelection ); } @@ -253,10 +230,9 @@ { ret = CEikListBox::OfferKeyEventL( aKeyEvent, aType ); } - // call HandleItemAdditionL just in case. There might be changes on remote - // lookup item place. - // The call is here, because we don't want to have extra redraw events when - // the popuplist is not fully updated. + // call HandleItemAdditionL just in case. There might be changes on remote lookup item place. + // The call is here, because we don't want to have extra redraw events when the popuplist + // is not fully updated. HandleItemAdditionL(); return ret; } @@ -271,7 +247,7 @@ if ( aEventType == EEventItemClicked || aEventType == EEventItemSingleClicked ) { - iObserver.PopupItemSelectedL(); + iHeaderContainer.DoPopupSelectL(); } } @@ -305,24 +281,17 @@ if ( aCmd == ESearchContacts ) { - // KerrNotReady --> caching in progress, - // KErrNotFound --> caching not started yet - if ( ( aError == KErrNotReady ) || ( aError == KErrNotFound ) ) + // KerrNotReady --> caching in progress, KErrNotFound --> caching not started yet + if ( (aError == KErrNotReady) || (aError == KErrNotFound) ) { - if( !iAppUi->AppUiExitOngoing() ) - { - TFsEmailUiUtility::ShowInfoNoteL( - R_FSE_EDITOR_INFO_BUILDING_CACHE ); - } + if(!iAppUi->AppUiExitOngoing()) // + TFsEmailUiUtility::ShowInfoNoteL( R_FSE_EDITOR_INFO_BUILDING_CACHE ); iCachingInProgress = ETrue; } if ( aError == KErrNone && iCachingInProgress ) { - if ( !iAppUi->AppUiExitOngoing() ) - { - TFsEmailUiUtility::ShowInfoNoteL( - R_FSE_EDITOR_INFO_CACHING_COMPLETED ); - } + if(!iAppUi->AppUiExitOngoing()) // + TFsEmailUiUtility::ShowInfoNoteL( R_FSE_EDITOR_INFO_CACHING_COMPLETED ); iCachingInProgress = EFalse; } } @@ -338,17 +307,12 @@ delete iCurrentSearchText; iCurrentSearchText = NULL; iCurrentSearchText = aText.AllocL(); - if ( !iCachingInProgress ) + if ( !iCachingInProgress ) { - if ( iContactHandler ) + if ( iContactHandler ) { iContactHandler->SearchMatchesL( aText, this, &iMailBox, aMode ); } - else - { - // update list for languages which don't support PCS - UpdateListL(); - } } } @@ -367,17 +331,15 @@ if ( iRemoteLookupSupported ) { // calculate index of item - TInt index = ( CurrentItemIndex() > iRemoteLookupItemPos ? - CurrentItemIndex() - 1 : CurrentItemIndex() ); + TInt index = (CurrentItemIndex() > iRemoteLookupItemPos ? CurrentItemIndex() - 1 : CurrentItemIndex()); clsItem = iMatchingItems[index]; } else { - clsItem = iMatchingItems[CurrentItemIndex()]; + clsItem = iMatchingItems[CurrentItemIndex()]; // no iRemoteLookupItemPos } - addressObject= CNcsEmailAddressObject::NewL( - clsItem->DisplayName(), clsItem->EmailAddress() ); + addressObject= CNcsEmailAddressObject::NewL( clsItem->DisplayName(), clsItem->EmailAddress() ); CleanupStack::PushL( addressObject ); if ( clsItem->MultipleEmails() ) { @@ -428,8 +390,7 @@ // ----------------------------------------------------------------------------- // CNcsPopupListBox::CurrentPopupClsItemsArray // ----------------------------------------------------------------------------- -const RPointerArray& -CNcsPopupListBox::CurrentPopupClsItemsArray() const +const RPointerArray& CNcsPopupListBox::CurrentPopupClsItemsArray() const { return iMatchingItems; } @@ -458,32 +419,22 @@ void CNcsPopupListBox::SetListItemsFromArrayL() { FUNC_LOG; - + // reset the cursor to point to the first item + //iView->MoveCursorL( CListBoxView::ECursorFirstItem, CListBoxView::ENoSelection); Reset(); // Create totally new text array CreateTextArrayAndSetToTheListboxL( ETrue ); - TInt matchCount = iMatchingItems.Count(); - // Remote lookup item's index is set as last item by default - // (in case of empty matching items list it is the only item) - TInt rmluIndex = matchCount; - // append texts to text array - for( TInt i=0; i < matchCount; i++ ) - { - iItemTextsArray->AppendL( iMatchingItems[i]->FullTextL() ); - if ( iRemoteLookupSupported && - rmluIndex == matchCount && - iMatchingItems[i]->EmailAddress().Compare( KNullDesC ) == 0 ) - { - rmluIndex = i; - } - } + for( TInt i=0; i < iMatchingItems.Count(); i++ ) + { + iItemTextsArray->AppendL( iMatchingItems[i]->FullTextL() ); + } // Update rmlu item - SetRemoteLookupItemToTheListL( rmluIndex ); - + SetRemoteLookupItemFirstToTheListL(); + SetPopupRect(); SetScrollBarVisibilityL(); HandleItemAdditionL(); @@ -502,13 +453,13 @@ // ----------------------------------------------------------------------------- // CNcsPopupListBox::RoundToItemHeight // ----------------------------------------------------------------------------- -TInt CNcsPopupListBox::RoundToItemHeight( const TInt aPopupHeight ) const +TInt CNcsPopupListBox::RoundToItemHeight(const TInt aPopupHeight) const { TReal fullItems; // number of full visible items in window - TInt err = Math::Round( fullItems, ( aPopupHeight / ItemHeight() ), 0 ); - if ( err == KErrNone ) + TInt err = Math::Round(fullItems, (aPopupHeight / ItemHeight()), 0); + if (err == KErrNone) { - return (TInt)( fullItems * ItemHeight() ); + return (TInt)(fullItems * ItemHeight()); } return aPopupHeight; // in case of error } @@ -519,42 +470,79 @@ void CNcsPopupListBox::SetPopupRect() { FUNC_LOG; + // The popup width and horizontal position is adjusted so that it + // will be within the area specified in both layout data and the set + // maximum rect. + TAknLayoutRect editorPane; + editorPane.LayoutRect( iAppUi->ClientRect(), + TAknWindowComponentLayout::Compose( + TAknWindowComponentLayout::Compose( + AknLayoutScalable_Apps::list_cmail_pane(), + AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) ), + AknLayoutScalable_Apps::list_single_cmail_header_editor_pane_bg( 4 ) ) ); + TRect editorPaneRect = editorPane.Rect(); - // The popup height and vertical position is adjusted based on the + TRect newRect = iPopupMaxRect; + newRect.iTl.iX = Max( iPopupMaxRect.iTl.iX, editorPaneRect.iTl.iX ); + newRect.iBr.iX = Min( iPopupMaxRect.iBr.iX, editorPaneRect.iBr.iX ); + + // Thhe popup height and vertical position is adjusted based on the // available space below and above the cursor and the number of items // in the list. - TRect newRect = iPopupMaxRect; + const TRect rect = iPopupMaxRect; TAknLayoutRect subpane; - subpane.LayoutRect( newRect, - AknLayoutScalable_Avkon::bg_popup_sub_pane_g1() ); - const TInt frameHeights = - iPopupMaxRect.Height() - subpane.Rect().Height(); + subpane.LayoutRect( rect, AknLayoutScalable_Avkon::bg_popup_sub_pane_g1() ); + const TRect subpaneRect = subpane.Rect(); + + const TInt frameHeights = iPopupMaxRect.Height() - subpaneRect.Height(); // This is the total height in pixels needed to show all items - const TInt minimumHeight = frameHeights + + TInt minimumHeight = frameHeights + CalcHeightBasedOnNumOfItems( Model()->NumberOfItems() ); + CCoeControl* container = Parent()->Parent(); + TInt containerTop = container->PositionRelativeToScreen().iY; + TInt containerHeight = container->Rect().Height(); + TInt containerCenter = containerTop + containerHeight / 2; + // Get height of one line in Address field - TInt toLineHeight = - static_cast( Parent() )->GetToLineHeight(); + CNcsHeaderContainer* headerObj = static_cast(Parent()); + TInt toLineHeight = headerObj->GetToLineHeight(); // height of one line height if ( toLineHeight == 0 ) { toLineHeight = ItemHeight(); } TInt newHeight = minimumHeight; // default window height - CCoeControl* container = Parent()->Parent(); - const TInt maxHeight = - container->Rect().Height() - - ( newRect.iTl.iY - container->PositionRelativeToScreen().iY ); - newHeight = - RoundToItemHeight( maxHeight - frameHeights ) + frameHeights; - if ( newHeight > minimumHeight ) + + // latch listbox on the bottom of the editor field + if ( newRect.iTl.iY <= containerCenter ) + { + TInt maxHeight = containerHeight - ( newRect.iTl.iY - containerTop ); + newHeight = RoundToItemHeight( maxHeight - frameHeights ) + frameHeights; + if ( newHeight > minimumHeight ) + { + newHeight = minimumHeight; // shrink window (if needed) + } + } + // latch listbox on the top of the editor field + else { - newHeight = minimumHeight; // shrink window (if needed) + TInt yOffset = -minimumHeight - toLineHeight; // how much up + TInt newTlY = newRect.iTl.iY + yOffset; // new Top Left Y coordinate + if ( newTlY >= containerTop ) + { + newRect.Move( 0, yOffset ); + } + else + { + // shrink height to visible area and move + TInt maxHeight = newRect.iTl.iY - toLineHeight - containerTop; + newHeight = RoundToItemHeight( maxHeight - frameHeights ) + frameHeights; + newRect.Move( 0, -newHeight - toLineHeight ); + } } - - newRect.SetHeight( newHeight ); + newRect.SetHeight( newHeight ); // set new height SetRect( newRect ); } @@ -565,11 +553,10 @@ { FUNC_LOG; // This is the total height in pixels needed to show all items - TInt minimumHeight = - CalcHeightBasedOnNumOfItems( Model()->NumberOfItems() ); + TInt minimumHeight = CalcHeightBasedOnNumOfItems( Model()->NumberOfItems() ); // Show scroll bar if there is more items we can show at once. - if( iPopupMaxRect.Height() > minimumHeight ) + if( iPopupMaxRect.Height() > minimumHeight ) { ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); @@ -583,20 +570,19 @@ // ----------------------------------------------------------------------------- -// CNcsPopupListBox::SetRemoteLookupItemToTheListL +// CNcsPopupListBox::SetRemoteLookupItemFirstToTheListL // ----------------------------------------------------------------------------- -void CNcsPopupListBox::SetRemoteLookupItemToTheListL( TInt aIndex ) +void CNcsPopupListBox::SetRemoteLookupItemFirstToTheListL() { FUNC_LOG; if( iRemoteLookupSupported ) { HBufC* rmluText = StringLoader::LoadLC( - R_FSE_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH, - *iCurrentSearchText ); + R_FSE_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH, *iCurrentSearchText ); - iItemTextsArray->InsertL( aIndex, *rmluText ); + iItemTextsArray->InsertL( 0, *rmluText ); CleanupStack::PopAndDestroy( rmluText ); - iRemoteLookupItemPos = aIndex; + iRemoteLookupItemPos = 0; } else { @@ -607,8 +593,7 @@ // ----------------------------------------------------------------------------- // CNcsPopupListBox::MoveRemoteLookupItemL // ----------------------------------------------------------------------------- -void CNcsPopupListBox::MoveRemoteLookupItemL( - TRemoteLookupItemMoveDirection aDirection ) +void CNcsPopupListBox::MoveRemoteLookupItemL( TRemoteLookupItemMoveDirection aDirection ) { FUNC_LOG; if( iRemoteLookupSupported ) @@ -633,9 +618,7 @@ { iItemTextsArray->Delete( iRemoteLookupItemPos ); - HBufC* rmluText = StringLoader::LoadLC( - R_FSE_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH, - *iCurrentSearchText ); + HBufC* rmluText = StringLoader::LoadLC( R_FSE_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH, *iCurrentSearchText ); iItemTextsArray->InsertL( newRMLUItemIndex, *rmluText ); CleanupStack::PopAndDestroy( rmluText ); @@ -648,8 +631,7 @@ // ----------------------------------------------------------------------------- // CNcsPopupListBox::CreateTextArrayAndSetToTheListboxL // ----------------------------------------------------------------------------- -void CNcsPopupListBox::CreateTextArrayAndSetToTheListboxL( - const TBool& aResetIfExists ) +void CNcsPopupListBox::CreateTextArrayAndSetToTheListboxL( const TBool& aResetIfExists ) { FUNC_LOG; if( !iItemTextsArray ) @@ -678,16 +660,16 @@ FUNC_LOG; // Store a GC for later use iGc = &CCoeEnv::Static()->SystemGc(); - SetGc( iGc ); + SetGc(iGc); } // ----------------------------------------------------------------------------- // CNcsListItemDrawer::DrawActualItem // ----------------------------------------------------------------------------- -void CNcsListItemDrawer::DrawActualItem( TInt aItemIndex, +void CNcsListItemDrawer::DrawActualItem(TInt aItemIndex, const TRect& aActualItemRect, TBool aItemIsCurrent, TBool /*aViewIsEmphasized*/, TBool /*aViewIsDimmed*/, - TBool /*aItemIsSelected*/ ) const + TBool /*aItemIsSelected*/) const { FUNC_LOG; iGc->DiscardFont(); @@ -698,8 +680,7 @@ TInt rmluPosition = iListBox.RemoteLookupItemPos(); // Sets all the attributes, like font, text color and background color. - const CFont* font = AknLayoutUtils::FontFromId( - EAknLogicalFontPrimarySmallFont ); + const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont ); iGc->UseFont( font ); iGc->SetPenStyle( CGraphicsContext::ESolidPen ); iGc->SetBrushStyle( CGraphicsContext::ENullBrush ); @@ -802,16 +783,14 @@ // For now, we support underlining the matching part only if the // text is written completely with left-to-right script - // We know the text contains RTL script if the display string is not - // just truncated version of the original string. + // We know the text contains RTL script if the display string is not just + // truncated version of the original string. TPtrC dispText = bidiText->DisplayText(); - // -1 to omit the truncation character - TInt compLength = dispText.Length() - 1; + TInt compLength = dispText.Length() - 1; // -1 to omit the truncation character TBool textContainsRtl = - ( itemText.Left( compLength ) != dispText.Left( compLength ) ); + ( itemText.Left(compLength) != dispText.Left(compLength) ); - const RArray& underlines = - clsItemArray[aItemIndex]->Highlights(); + const RArray& underlines = clsItemArray[aItemIndex]->Highlights(); if ( underlines.Count() > 0 && !textContainsRtl ) { @@ -826,8 +805,7 @@ { // draw letters to the start of the underlined part currentTextLength = underlines[i].index - currentTextStart; - DrawPartOfItem( textRect, *font, currentTextStart, - currentTextLength, itemText, + DrawPartOfItem( textRect, *font, currentTextStart, currentTextLength, itemText, EFalse, topToBaseline ); } else if ( currentTextStart == underlines[i].index ) @@ -835,16 +813,14 @@ // draw underlined letters currentTextLength = underlines[i].length; - DrawPartOfItem( textRect, *font, currentTextStart, - currentTextLength, itemText, + DrawPartOfItem( textRect, *font, currentTextStart, currentTextLength, itemText, ETrue, topToBaseline ); i++; } else { - // This is here, because PCS Engine might give you - // duplicate match entries, in this case we're not - // advancing text but we'll skip that match + // This is here, because PCS Engine might give you duplicate match entries, + // in this case we're not advancing text but we'll skip that match currentTextLength = 0; i++; } @@ -854,14 +830,11 @@ if ( i >= underlines.Count() ) { partsLeft = EFalse; - // draw rest of the letters, if there are any after the - // last underlined part + // draw rest of the letters, if there are any after the last underlined part if ( currentTextStart < itemText.Length() ) { - currentTextLength = - itemText.Length() - currentTextStart; - DrawPartOfItem( textRect, *font, currentTextStart, - currentTextLength, itemText, + currentTextLength = itemText.Length() - currentTextStart; + DrawPartOfItem( textRect, *font, currentTextStart, currentTextLength, itemText, EFalse, topToBaseline ); } } @@ -882,10 +855,9 @@ // ----------------------------------------------------------------------------- // CNcsListItemDrawer::DrawPartOfItem // ----------------------------------------------------------------------------- -void CNcsListItemDrawer::DrawPartOfItem( - const TRect& aItemRect, const CFont& aFont, - TInt aStartPos, TInt aLength, const TDesC& aDes, - TBool aUnderlined, TInt aBaselineOffsetFromTop ) const +void CNcsListItemDrawer::DrawPartOfItem( const TRect& aItemRect, const CFont& aFont, + TInt aStartPos, TInt aLength, const TDesC& aDes, + TBool aUnderlined, TInt aBaselineOffsetFromTop ) const { FUNC_LOG; if( aUnderlined ) @@ -904,50 +876,24 @@ } -// --------------------------------------------------------------------------- -// Updates popup list content. -// --------------------------------------------------------------------------- -// void CNcsPopupListBox::UpdateListL() { FUNC_LOG; SetListItemsFromArrayL(); // Close the popup if it's empty and make sure it's visible if it's not empty. - UpdateVisibilityL( !IsPopupEmpty() ); - } - -// --------------------------------------------------------------------------- -// Shows or hides popup if necessary. -// --------------------------------------------------------------------------- -// -void CNcsPopupListBox::UpdateVisibilityL( TBool aVisible ) - { - if ( IsVisible() != aVisible ) + if ( IsPopupEmpty() ) { - if ( iObserver.PopupVisibilityChangingL( aVisible ) ) - { - MakeVisible( aVisible ); - if ( aVisible ) - { - UpdateScrollBarsL(); - SetScrollBarVisibilityL(); - // Popup is always on top (also on top of e.g. toolbar buttons) - DrawableWindow()->SetOrdinalPosition( 0 ); - } - } + iHeaderContainer.ClosePopupContactListL(); } - else if ( IsVisible() ) + else { + MakeVisible( ETrue ); UpdateScrollBarsL(); - SetScrollBarVisibilityL(); + iHeaderContainer.ShowPopupMenuBarL( ETrue ); } } -// --------------------------------------------------------------------------- -// Updates popup text colors. -// --------------------------------------------------------------------------- -// void CNcsPopupListBox::UpdateTextColors() { if ( iItemDrawer ) diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/ncssubjectfield.cpp --- a/emailuis/emailui/src/ncssubjectfield.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/ncssubjectfield.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -82,37 +81,13 @@ // Create label HBufC* aTextBuf = StringLoader::LoadLC( aLabelTextId ); TPtrC captionText = aTextBuf ? aTextBuf->Des() : TPtrC(); + iLabel = new ( ELeave ) CNcsLabel( *this, NULL ); + iLabel->SetTextL( captionText ); - if( AknLayoutUtils::PenEnabled() ) - { - // Create a frameless button that has no observer - // This is done like this to make Subject: field appear similar as - // other header fields (To:, Cc:), although it doesn't have other - // button-like features - TRect buttRect( 10, 10, 70, 100 ); - iButton = CAknButton::NewL( NULL, NULL, NULL, NULL, - captionText, TPtrC(), - KAknButtonTextLeft | KAknButtonNoFrame , - 0 ); - iButton->SetTextColorIds( - KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG63 ); - iButton->SetContainerWindowL( *iParentControl ); - iButton->SetRect( buttRect ); - iButton->EnableFeedback( EFalse ); - iButton->MakeVisible( ETrue ); - iButton->ActivateL(); - } - else - { - iLabel = new ( ELeave ) CNcsLabel( *this, NULL ); - iLabel->SetTextL( captionText ); - - // S60 Skin support - iLabel->SetBrushStyle(CWindowGc::ENullBrush); - } - - iTextEditor = new ( ELeave ) CNcsEditor( - iSizeObserver, ETrue, ENcsEditorSubject, captionText ); + // S60 Skin support + iLabel->SetBrushStyle(CWindowGc::ENullBrush); + + iTextEditor = new ( ELeave ) CNcsEditor( iSizeObserver, ETrue, ENcsEditorSubject, captionText ); CleanupStack::PopAndDestroy( aTextBuf ); } @@ -125,41 +100,37 @@ FUNC_LOG; delete iTextEditor; delete iLabel; - delete iButton; + // Platform layout change + /*if ( iFont ) + { + ControlEnv()->ScreenDevice()->ReleaseFont( iFont ); + iFont = NULL; + }*/ } // ----------------------------------------------------------------------------- // CNcsSubjectField::SetContainerWindowL() const // ----------------------------------------------------------------------------- // -void CNcsSubjectField::SetContainerWindowL( const CCoeControl& aContainer ) +void CNcsSubjectField::SetContainerWindowL(const CCoeControl& aContainer) { FUNC_LOG; - CCoeControl::SetContainerWindowL( aContainer ); + CCoeControl::SetContainerWindowL(aContainer); // Create the component array InitComponentArrayL(); CCoeControlArray& controls = Components(); - controls.SetControlsOwnedExternally( ETrue ); - if ( iButton ) - { - controls.AppendLC( iButton ); - CleanupStack::Pop( iButton ); - } - else - { - controls.AppendLC( iLabel ); - CleanupStack::Pop( iLabel ); - } - controls.AppendLC( iTextEditor ); - CleanupStack::Pop( iTextEditor ); + controls.SetControlsOwnedExternally(ETrue); + controls.AppendLC(iLabel); + CleanupStack::Pop(iLabel); + controls.AppendLC(iTextEditor); + CleanupStack::Pop(iTextEditor); // Setup text editor iTextEditor->ConstructL( &aContainer, KMaxAddressFieldLines, 0 ); iTextEditor->SetBorder( TGulBorder::ENone ); iTextEditor->SetAknEditorInputMode( EAknEditorTextInputMode ); - iTextEditor->CreateScrollBarFrameL()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); + iTextEditor->CreateScrollBarFrameL()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); iTextEditor->SetEdwinSizeObserver( this ); iTextEditor->SetupEditorL(); // Setup label @@ -186,7 +157,7 @@ TInt CNcsSubjectField::GetMinLabelLength() const { FUNC_LOG; - return iLabel ? iLabel->Font()->TextWidthInPixels( *iLabel->Text() ) : 0; + return iLabel->Font()->TextWidthInPixels( *iLabel->Text() ); } // ----------------------------------------------------------------------------- @@ -199,49 +170,35 @@ FUNC_LOG; const TRect rect( Rect() ); - if ( iButton ) - { - NcsUtility::LayoutCaptionButton( iButton, rect ); - } - else - { - NcsUtility::LayoutCaptionLabel( iLabel, rect ); - } - - NcsUtility::LayoutDetailEdwinTouch( - iTextEditor, rect, iEditorLineCount, EFalse ); + NcsUtility::LayoutCaptionLabel( iLabel, rect ); + NcsUtility::LayoutDetailEdwinTouch( iTextEditor, rect, iEditorLineCount, EFalse ); - if ( iTextEditor->ScrollBarFrame() ) + if (iTextEditor->ScrollBarFrame()) { TRect rc = iTextEditor->Rect(); - if ( AknLayoutUtils::LayoutMirrored() ) + if (AknLayoutUtils::LayoutMirrored()) { - rc.iTl.iX += iTextEditor->ScrollBarFrame()->ScrollBarBreadth( - CEikScrollBar::EVertical ); + rc.iTl.iX += iTextEditor->ScrollBarFrame()->ScrollBarBreadth(CEikScrollBar::EVertical); } else { - rc.iBr.iX -= iTextEditor->ScrollBarFrame()->ScrollBarBreadth( - CEikScrollBar::EVertical ); + rc.iBr.iX -= iTextEditor->ScrollBarFrame()->ScrollBarBreadth(CEikScrollBar::EVertical); } - iTextEditor->SetRect( rc ); + iTextEditor->SetRect(rc); } // Setup text alignment according the mirrored/normal layout. - if ( iLabel ) + if ( AknLayoutUtils::LayoutMirrored() ) { - if ( AknLayoutUtils::LayoutMirrored() ) - { - iLabel->SetAlignment( EHLeftVCenter ); - iLabel->SetLabelAlignment( ELayoutAlignLeft ); - } - else - { - iLabel->SetAlignment( EHRightVCenter ); - iLabel->SetLabelAlignment( ELayoutAlignRight ); - } + iLabel->SetAlignment( EHLeftVCenter ); + iLabel->SetLabelAlignment( ELayoutAlignLeft ); } - + else + { + iLabel->SetAlignment( EHRightVCenter ); + iLabel->SetLabelAlignment( ELayoutAlignRight ); + } + // this needs to be bidi as in mirrored layout // writing language left to right can be set iTextEditor->SetAlignment( EAknEditorAlignBidi ); @@ -253,12 +210,13 @@ // ----------------------------------------------------------------------------- // CNcsSubjectField::PositionChanged() +// set size // ----------------------------------------------------------------------------- // void CNcsSubjectField::PositionChanged() { FUNC_LOG; - // empty + //SizeChanged(); } // ----------------------------------------------------------------------------- @@ -266,8 +224,7 @@ // Handles key events // ----------------------------------------------------------------------------- // -TKeyResponse CNcsSubjectField::OfferKeyEventL( - const TKeyEvent& aKeyEvent, TEventCode aType ) +TKeyResponse CNcsSubjectField::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) { FUNC_LOG; TKeyResponse ret( EKeyWasNotConsumed ); @@ -283,8 +240,8 @@ // void CNcsSubjectField::HandlePointerEventL( const TPointerEvent& aPointerEvent ) { - FUNC_LOG; - CCoeControl::HandlePointerEventL( aPointerEvent ); + FUNC_LOG; + iTextEditor->HandlePointerEventL( aPointerEvent ); } // ----------------------------------------------------------------------------- @@ -292,26 +249,51 @@ // ----------------------------------------------------------------------------- // void CNcsSubjectField::FocusChanged( TDrawNow aDrawNow ) - { + { FUNC_LOG; - if ( IsFocused() ) - { - iTextEditor->SetFocus( ETrue, aDrawNow ); - if ( iParentControl ) - { - TRAP_IGNORE( iParentControl->SetMskL() ); - } - } - else - { - iTextEditor->SetFocus( EFalse, aDrawNow ); - } + if ( IsFocused() ) + { + iTextEditor->SetFocus( ETrue ); + //TRAP_IGNORE( iTextEditor->SetCursorPosL( iTextEditor->TextLength(), EFalse ) ); - if ( aDrawNow ) - { - DrawNow(); - } - } + // make sure that control is visible on screen + if ( Rect().iTl.iY < 0 ) + { + TPoint pt = TPoint( 0, 0 ); + Reposition( pt, Rect().Width() ); + iSizeObserver->UpdateFieldPosition( this ); + } + else + { + TPoint pos = PositionRelativeToScreen(); + pos.iY += Size().iHeight; + CWsScreenDevice* screenDev = ControlEnv()->ScreenDevice(); + TPixelsAndRotation pix; + screenDev->GetDefaultScreenSizeAndRotation( pix ); + const TInt h = pix.iPixelSize.iHeight; + if ( pos.iY >= h - h / 3 ) + { + TPoint pt = TPoint( 0, h / 3 ); + Reposition( pt, Rect().Width() ); + iSizeObserver->UpdateFieldPosition( this ); + } + } + + if ( iParentControl ) + { + TRAP_IGNORE( iParentControl->SetMskL() ); + } + } + else + { + iTextEditor->SetFocus( EFalse ); + } + + if ( aDrawNow ) + { + DrawNow(); + } + } // ----------------------------------------------------------------------------- // CNcsSubjectField::MinimumHeight() @@ -321,6 +303,20 @@ TInt CNcsSubjectField::MinimumHeight() { FUNC_LOG; + // Platform layout changes + /* + TNcsMeasures m = NcsUtility::Measures(); + TInt height = m.iAifHeight - m.iAifEditorHeight + iEditorMinimumHeight + m.iSubjectExtraHeightBottom; + TInt height2 = m.iAifHeight + m.iSubjectExtraHeightBottom; + // if followup icon and priority icon are both visible increase the subject field height + if ( iFollowUp && iPriority != EMsgPriorityNormal ) + { + height2 += KIconHeightFollowUp; + } + return Max( height, height2 ); + */ + //return NcsUtility::MinimumHeaderSize( Rect(), iEditorLineCount ).iHeight; + // Platform layout changes return 0; } @@ -344,12 +340,11 @@ RMemReadStream inputStream( aSubject.Ptr(), aSubject.Size() ); CleanupClosePushL( inputStream ); - iTextEditor->RichText()->ImportTextL( - 0, inputStream, CPlainText::EOrganiseByParagraph ); + iTextEditor->RichText()->ImportTextL( 0, inputStream, CPlainText::EOrganiseByParagraph ); // Activating the field will set the control to the end of the text iTextEditor->ActivateL(); - iTextEditor->SetCursorPosL( 0, EFalse ); + iTextEditor->SetCursorPosL(0,EFalse); CleanupStack::PopAndDestroy( &inputStream ); } @@ -363,10 +358,41 @@ TEdwinSizeEvent /*aEventType*/, TSize aDesirableEdwinSize ) { FUNC_LOG; + // Platform layout chage + /* TInt ret( EFalse ); TInt htLine = iTextEditor->GetLineHeightL(); TInt numLinesDesired = aDesirableEdwinSize.iHeight / htLine; + + if ( numLinesDesired < KMaxAddressFieldLines && + iEditorMinimumHeight != aDesirableEdwinSize.iHeight ) + { + iEditorMinimumHeight = aDesirableEdwinSize.iHeight; + iTextEditor->CreateScrollBarFrameL()->SetScjrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); + if ( iSizeObserver ) + { + ret = iSizeObserver->UpdateFieldSizeL(); + } + } + else if ( iEditorMinimumHeight != htLine * KMaxAddressFieldLines ) + { + //We may still need to resize the controll. + iEditorMinimumHeight = htLine * KMaxAddressFieldLines; + iTextEditor->CreateScrollBarFrameL()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn ); + if ( iSizeObserver ) + { + ret = iSizeObserver->UpdateFieldSizeL(); + } + } + */ + + TInt ret( EFalse ); + TInt htLine = iTextEditor->GetLineHeightL(); + TInt numLinesDesired = aDesirableEdwinSize.iHeight / htLine; + // commented because of EGWG-83ECSR, no negative feedback after removing + //CEikScrollBarFrame& scrollBarFrame( *iTextEditor->CreateScrollBarFrameL() ); iEditorLineCount = numLinesDesired; + //scrollBarFrame.SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff ); if ( iSizeObserver ) { ret = iSizeObserver->UpdateFieldSizeL(); @@ -451,6 +477,7 @@ return KNullDesC; } +// Platform layout change // --------------------------------------------------------------------------- // CNcsSubjectField::LayoutLineCount // --------------------------------------------------------------------------- @@ -467,17 +494,23 @@ void CNcsSubjectField::Reposition(TPoint& aPt, TInt /*aWidth*/) { FUNC_LOG; + /* + const TSize size( aWidth, MinimumHeight() ); + SetExtent( aPt, size ); + aPt.iY += size.iHeight; + */ SetPosition( aPt ); + // Platform layout changes } // ----------------------------------------------------------------------------- // CNcsSubjectField::GetLineRectL // ----------------------------------------------------------------------------- -void CNcsSubjectField::GetLineRect( TRect& aLineRect ) const - { +void CNcsSubjectField::GetLineRectL( TRect& aLineRect ) const + { FUNC_LOG; - return iTextEditor->GetLineRect( aLineRect ); - } + return iTextEditor->GetLineRectL( aLineRect ); + } // ----------------------------------------------------------------------------- // CNcsSubjectField::SetMaxLabelLength @@ -504,19 +537,23 @@ void CNcsSubjectField::UpdateColors() { FUNC_LOG; + // Platform layout change + TRgb textColor = KRgbBlack; + if ( AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor, + KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone ) + { + textColor = KRgbBlack; + } + TRAP_IGNORE( iLabel->OverrideColorL( EColorLabelText, textColor ) ); + // Platform layout change - if ( iLabel ) - { - TRgb textColor = KRgbBlack; - if ( AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor, - KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone ) - { - textColor = KRgbBlack; - } - TRAP_IGNORE( iLabel->OverrideColorL( EColorLabelText, textColor ) ); - } + CFreestyleEmailUiAppUi* appUi = + static_cast( ControlEnv()->AppUi() ); + iBorderColor = appUi->LayoutHandler()->ComposerFieldBorderColor(); + iBgColor = appUi->LayoutHandler()->ComposerFieldBackgroundColor(); } +// Platform layout changes // --------------------------------------------------------------------------- // CNcsSubjectField::UpdateFontSize() // --------------------------------------------------------------------------- @@ -524,18 +561,20 @@ void CNcsSubjectField::UpdateFontSize() { FUNC_LOG; - CCoeControl* control = - iButton ? ( CCoeControl* )iButton : ( CCoeControl* )iLabel; - iFont = NcsUtility::GetLayoutFont( - control->Rect(), NcsUtility::ENcsHeaderCaptionFont ); - if( control == iButton ) + /*if ( iFont ) { - iButton->SetTextFont( iFont ); + ControlEnv()->ScreenDevice()->ReleaseFont( iFont ); + iFont = NULL; } - else - { - iLabel->SetFont( iFont ); - } + + TNcsMeasures m = NcsUtility::Measures(); + if ( !iFont ) + { + TRAP_IGNORE( iFont = NcsUtility::GetNearestFontL(EAknLogicalFontPrimarySmallFont, + m.iLabelFontHeightPx) ); + }*/ + iFont = NcsUtility::GetLayoutFont( iLabel->Rect(), NcsUtility::ENcsHeaderCaptionFont ); + iLabel->SetFont( iFont ); iTextEditor->UpdateFontSize(); UpdateColors(); } @@ -553,24 +592,18 @@ { UpdateFontSize(); UpdateColors(); - iTextEditor->HandleResourceChange( aType ); + // Platform layout changes + iTextEditor->HandleResourceChange( aType ) ;//CreateScrollBarFrameL()->DrawScrollBarsNow(); + // Platform layout changes } } -// --------------------------------------------------------------------------- -// CNcsSubjectField::EnableKineticScrollingL() -// --------------------------------------------------------------------------- -// -void CNcsSubjectField::EnableKineticScrollingL( CAknPhysics* aPhysics ) +void CNcsSubjectField::EnableKineticScrollingL(CAknPhysics* aPhysics) { - iTextEditor->EnableKineticScrollingL( aPhysics ); + iTextEditor->EnableKineticScrollingL(aPhysics); iTextEditor->TextLayout()->RestrictScrollToTopsOfLines( ETrue ); } -// --------------------------------------------------------------------------- -// CNcsSubjectField::SetPhysicsEmulationOngoing() -// --------------------------------------------------------------------------- -// void CNcsSubjectField::SetPhysicsEmulationOngoing( TBool aPhysOngoing ) { iTextEditor->SetPhysicsEmulationOngoing( aPhysOngoing ); diff -r c8382f7b54ef -r 726fba06891a emailuis/emailui/src/ncsutility.cpp --- a/emailuis/emailui/src/ncsutility.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/emailui/src/ncsutility.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -324,19 +324,19 @@ // first word, than loop ends do { - indexRe = formattedSubjectLinePtr.FindC( rePtr ); - if( indexRe == 0 ) - { - formattedSubjectLinePtr.Delete( indexRe, rePtr.Length() ); - formattedSubjectLinePtr.Trim(); - } + indexRe = formattedSubjectLinePtr.FindC( rePtr ); + if( indexRe == 0 ) + { + formattedSubjectLinePtr.Delete( indexRe, rePtr.Length() ); + formattedSubjectLinePtr.Trim(); + } - indexFw = formattedSubjectLinePtr.FindC( fwdPrt ); - if( indexFw == 0 ) - { - formattedSubjectLinePtr.Delete( indexFw, rePtr.Length() ); - formattedSubjectLinePtr.Trim(); - } + indexFw = formattedSubjectLinePtr.FindC( fwdPrt ); + if( indexFw == 0 ) + { + formattedSubjectLinePtr.Delete( indexFw, rePtr.Length() ); + formattedSubjectLinePtr.Trim(); + } } while( !( indexRe != 0 && indexFw != 0) ); diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/bwins/fs_generic_alfu.def --- a/emailuis/uicomponents/bwins/fs_generic_alfu.def Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/bwins/fs_generic_alfu.def Wed Oct 13 14:11:15 2010 +0300 @@ -306,5 +306,4 @@ ?VisibilityMode@CFsAlfScrollbarLayout@@QAE?AW4TFsScrollbarVisibility@@W4TFsScrollbar@@@Z @ 305 NONAME ; enum TFsScrollbarVisibility CFsAlfScrollbarLayout::VisibilityMode(enum TFsScrollbar) ?Visual@CFsControlBar@@QAEPAVCAlfVisual@@XZ @ 306 NONAME ; class CAlfVisual * CFsControlBar::Visual(void) ?Width@CFsControlBar@@QBEHXZ @ 307 NONAME ; int CFsControlBar::Width(void) const - ?SetMarkingModeL@CFsTreeList@@QAEXH@Z @ 308 NONAME ; void CFsTreeList::SetMarkingModeL(int) diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/eabi/fs_generic_alfU.def --- a/emailuis/uicomponents/eabi/fs_generic_alfU.def Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/eabi/fs_generic_alfU.def Wed Oct 13 14:11:15 2010 +0300 @@ -416,5 +416,4 @@ _ZThn32_N14CFsTreeControl11OfferEventLERK9TAlfEvent @ 415 NONAME ; ## _ZThn4_N26CFsControlButtonVisualiser23TextureLoadingCompletedER11CAlfTextureii @ 416 NONAME ; ## _ZThn4_NK11CFsTreeList20TreeVisualizerEventLEN25MFsTreeVisualizerObserver22TFsTreeVisualizerEventEiRK6TPoint @ 417 NONAME ; ## - _ZN11CFsTreeList15SetMarkingModeLEi @ 418 NONAME diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fscontrolbuttonvisualiser.h --- a/emailuis/uicomponents/inc/fscontrolbuttonvisualiser.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fscontrolbuttonvisualiser.h Wed Oct 13 14:11:15 2010 +0300 @@ -548,11 +548,6 @@ * Show dropdown shadow for buttons */ TBool iShowShadow; - - /** - * Help variable to omit unnecessary iDefaultBgBrush updates. - */ - TSize iLastUpdatedButtonModelSize; }; diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fsmultilineitemvisualizer.h --- a/emailuis/uicomponents/inc/fsmultilineitemvisualizer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fsmultilineitemvisualizer.h Wed Oct 13 14:11:15 2010 +0300 @@ -169,8 +169,7 @@ virtual void UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout = 0, TBool aUpdateData = ETrue); diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fsseparatorvisualizer.h --- a/emailuis/uicomponents/inc/fsseparatorvisualizer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fsseparatorvisualizer.h Wed Oct 13 14:11:15 2010 +0300 @@ -167,8 +167,6 @@ */ virtual void SetAlwaysExtended( TBool aAlwaysExtended ); - virtual void SetMarkingMode( TBool aMarkingMode ); - /** * From MFsTreeItemVisualizer. * This function returns wether an item is always in extended state. @@ -196,8 +194,7 @@ virtual void UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout = 0, TBool aUpdateData = ETrue); diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fstreeitemvisualizer.h --- a/emailuis/uicomponents/inc/fstreeitemvisualizer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fstreeitemvisualizer.h Wed Oct 13 14:11:15 2010 +0300 @@ -66,7 +66,6 @@ const TUint32 KFsTreeListItemManagedLayout = 0x0800; const TUint32 KFsTreeListItemHasMenu = 0x1000; const TUint32 KFsTreeListItemTextBold = 0x2000; -const TUint32 KFsTreeListMarkingMode = 0x4000; const TInt KFsDefaultIndentation = 20; @@ -268,6 +267,7 @@ */ virtual void SetBackgroundTexture( const CAlfTexture& aTexture ) = 0; + // /** * Sets item background brush. Ownership not transfered. * @@ -284,6 +284,7 @@ * @return ETrue if background brush is set, EFalse otherwise. */ virtual TBool GetBackgroundBrush( CAlfBrush*& aBrush ) = 0; + // /** * Returns background texture if it's set. @@ -392,8 +393,7 @@ virtual void UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout = 0, TBool aUpdateData = ETrue) = 0; @@ -449,8 +449,6 @@ * @param ETrue if item should always be in extended state. */ virtual void SetAlwaysExtended( TBool aAlwaysExtended ) = 0; - - virtual void SetMarkingMode( TBool aMarkingMode ) = 0; /** * This function returns wether an item is always in extended state. diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fstreeitemvisualizerbase.h --- a/emailuis/uicomponents/inc/fstreeitemvisualizerbase.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fstreeitemvisualizerbase.h Wed Oct 13 14:11:15 2010 +0300 @@ -20,7 +20,12 @@ #define FSTREEITEMVISUALIZERBASE_H_ #include +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag +// SF #include +// #include "fstreeitemvisualizer.h" #include "fslayoutmanager.h" @@ -308,6 +313,7 @@ */ virtual void SetBackgroundTexture( const CAlfTexture& aTexture ); + // /** * From MFsTreeItemVisualizer. * Sets item background brush. Ownership not transfered. @@ -325,6 +331,7 @@ * @return ETrue if background brush is set, EFalse otherwise. */ virtual TBool GetBackgroundBrush( CAlfBrush*& aBrush ); + // /** * From MFsTreeItemVisualizer. @@ -360,8 +367,6 @@ * @param ETrue if item should always be in extended state. */ virtual void SetAlwaysExtended( TBool aAlwaysExtended ); - - virtual void SetMarkingMode( TBool aMarkingMode ); /** * This function returns wether an item is always in extended state. @@ -436,8 +441,7 @@ virtual void UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout = 0, TBool aUpdateData = ETrue); @@ -556,7 +560,9 @@ EFsItemBackgroundNone, EFsItemBackgroundColor, EFsItemBackgroundTexture, + // this feature is waiting for title divider bg graphics EFsItemBackgroundBrush + // }; protected: diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fstreelist.h --- a/emailuis/uicomponents/inc/fstreelist.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fstreelist.h Wed Oct 13 14:11:15 2010 +0300 @@ -23,9 +23,15 @@ /////SYSTEM INCLUDES //////TOOLKIT INCLUDES +// SF #include +// //////PROJECT INCLUDES +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag + #include "fstreelistconstants.h" #include "fstreevisualizerbase.h" #include "fstreevisualizerobserver.h" @@ -581,14 +587,6 @@ */ IMPORT_C CFsTreeList* ItemMenu( TFsTreeItemId aItemId ); - /** - * Sets marking mode on\off - * - * @param ETrue if marking mode is set on - */ - - IMPORT_C void SetMarkingModeL( const TBool aMarkingMode ); - public: // Visualization management /** diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fstreenodevisualizerbase.h --- a/emailuis/uicomponents/inc/fstreenodevisualizerbase.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fstreenodevisualizerbase.h Wed Oct 13 14:11:15 2010 +0300 @@ -22,8 +22,13 @@ #include +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag #include +// SF #include +// #include "fstreenodevisualizer.h" class CAlfLayout; @@ -305,6 +310,7 @@ */ virtual void SetBackgroundTexture( const CAlfTexture& aTexture ); + // /** * From MFsTreeItemVisualizer. * Sets item background brush. Ownership not transfered. @@ -322,6 +328,7 @@ * @return ETrue if background brush is set, EFalse otherwise. */ virtual TBool GetBackgroundBrush( CAlfBrush*& aBrush ); + // /** * From MFsTreeItemVisualizer. @@ -357,8 +364,6 @@ * @param ETrue if item should always be in extended state. */ virtual void SetAlwaysExtended( TBool aAlwaysExtended ); - - virtual void SetMarkingMode( TBool aMarkingMode ); /** * This function returns wether an item is always in extended state. @@ -434,8 +439,7 @@ virtual void UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout = 0, TBool aUpdateData = ETrue); @@ -565,7 +569,9 @@ EFsNodeBackgroundNone, EFsNodeBackgroundColor, EFsNodeBackgroundTexture, + // this feature is waiting for title divider bg graphics EFsNodeBackgroundBrush + // }; protected: diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fstreeplainonelineitemvisualizer.h --- a/emailuis/uicomponents/inc/fstreeplainonelineitemvisualizer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fstreeplainonelineitemvisualizer.h Wed Oct 13 14:11:15 2010 +0300 @@ -20,7 +20,12 @@ #define C_FSTREEPLAINONELINEITEMVISUALIZER_H #include +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag +// SF #include +// #include "fstreeitemvisualizerbase.h" class CAlfViewportLayout; @@ -90,8 +95,7 @@ virtual void UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout = 0, TBool aUpdateData = ETrue); @@ -173,7 +177,7 @@ /** * Visual for a mark icon. */ - CAlfImageVisual* iIconMark; + CAlfImageVisual* iIconMarked; /** * Visual for a menu icon. diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fstreeplainonelinenodevisualizer.h --- a/emailuis/uicomponents/inc/fstreeplainonelinenodevisualizer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fstreeplainonelinenodevisualizer.h Wed Oct 13 14:11:15 2010 +0300 @@ -20,6 +20,10 @@ #define C_FSTREEPLAINONELINENODEVISUALIZER_H #include +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag + #include "fstreenodevisualizerbase.h" class CAlfViewportLayout; @@ -134,8 +138,6 @@ */ virtual void SetAlwaysExtended( TBool aAlwaysExtended ); - virtual void SetMarkingMode( TBool aMarkingMode ); - /** * From MFsTreeItemVisualizer. * This function returns wether an item is always in extended state. @@ -165,8 +167,7 @@ virtual void UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout = 0, TBool aUpdateData = ETrue); diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fstreeplainrootvisualizer.h --- a/emailuis/uicomponents/inc/fstreeplainrootvisualizer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fstreeplainrootvisualizer.h Wed Oct 13 14:11:15 2010 +0300 @@ -21,6 +21,10 @@ #include +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag + #include "fstreenodevisualizerbase.h" class CAlfTextVisual; @@ -90,8 +94,7 @@ virtual void UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout = 0, TBool aUpdateData = ETrue); diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fstreeplaintwolineitemvisualizer.h --- a/emailuis/uicomponents/inc/fstreeplaintwolineitemvisualizer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fstreeplaintwolineitemvisualizer.h Wed Oct 13 14:11:15 2010 +0300 @@ -20,6 +20,10 @@ #define C_FSTREEPLAINTWOLINEITEMVISUALIZER_H #include +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag + #include "fstreeplainonelineitemvisualizer.h" class CFsTreePlainTwoLineItemData; @@ -177,8 +181,7 @@ virtual void UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout = 0, TBool aUpdateData = ETrue); diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fstreerichitemvisualizer.h --- a/emailuis/uicomponents/inc/fstreerichitemvisualizer.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fstreerichitemvisualizer.h Wed Oct 13 14:11:15 2010 +0300 @@ -22,6 +22,11 @@ #include +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag + + #include "fstreeitemvisualizerbase.h" class CAlfControl; @@ -116,8 +121,7 @@ virtual void UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout = 0, TBool aUpdateData = ETrue); diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/inc/fstreevisualizerbase.h --- a/emailuis/uicomponents/inc/fstreevisualizerbase.h Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/inc/fstreevisualizerbase.h Wed Oct 13 14:11:15 2010 +0300 @@ -843,27 +843,15 @@ /** * Sets icon for a mark sign. * - * @param aMarkOnIcon Icon to mark items. + * @param aMarkIcon Icon to mark items. */ - virtual void SetMarkOnIcon( CAlfTexture& aMarkOnIcon ); + virtual void SetMarkIcon( CAlfTexture& aMarkIcon ); /** - * Sets icon for a mark sign. - * - * @param aMarkOffIcon Icon to unmark items. + * Returns icon used to mark items. */ - virtual void SetMarkOffIcon( CAlfTexture& aMarkOffIcon ); - - /** - * Returns icon used to identify marked items. - */ - virtual CAlfTexture* MarkOnIcon( ); - - /** - * Returns icon used to identify unmarked items. - */ - virtual CAlfTexture* MarkOffIcon( ); - + virtual CAlfTexture* MarkIcon( ); + /** * Checks if item is marked and return status * @param aItemId item id to be checked @@ -936,14 +924,6 @@ void SetFocusedL( const TBool aFocused ); /** - * Sets marking mode on\off - * - * @param ETrue if marking mode is set on - */ - - void SetMarkingModeL( const TBool aMarkingMode ); - - /** * * @param aTexture A custom texture for the selector. * The texture is used to create an image brush. @@ -1029,7 +1009,9 @@ * * @panic EFsListPanicInvalidItemID Item with specified ID is not found. */ + // virtual void SetFocusedItemL( const TFsTreeItemId aItem, TBool aCheckFocus = ETrue ); + // /** * Gets item vertical position in the list @@ -1060,7 +1042,9 @@ * * @param aItemId Id of an item that will be displayed as first. */ + // virtual void SetFirstVisibleItemL( const TFsTreeItemId aItemId ); + // /** * Get an id of the first visible item. @@ -1316,11 +1300,6 @@ */ virtual TBool IsItemsAlwaysExtended ( ); - /* - * The function returns ETrue if marking mode is on - */ - virtual TBool IsMarkingMode ( ); - /** * The function sets a text for empty list's view. * The function does not refresh the view automatically. @@ -2192,13 +2171,8 @@ /** * Icon used to mark items. */ - CAlfTexture* iMarkOnIcon; - - /** - * Icon used to unmark items. - */ - CAlfTexture* iMarkOffIcon; - + CAlfTexture* iMarkIcon; + /** * Icon indicating that item has menu. */ @@ -2396,12 +2370,7 @@ * This flag is checked when trying to focus item. Focus is ignored * if list is being panned. */ - EListPanning, - - /** - * Informs if marking mode is on - */ - EMarkingMode + EListPanning }; // Flags diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fscontrolbutton.cpp --- a/emailuis/uicomponents/src/fscontrolbutton.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fscontrolbutton.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -206,11 +206,8 @@ TFsControlButtonElem aWhich ) { FUNC_LOG; - if ( iModel->Icon( aWhich ) != &aIcon ) // don't set the same icon twice - { - iModel->SetIconL( aIcon, aWhich ); - iVisualiser->UpdateElementL( aWhich ); - } + iModel->SetIconL( aIcon, aWhich ); + iVisualiser->UpdateElementL( aWhich ); } @@ -632,9 +629,7 @@ iParent.HandleButtonEvent( MFsControlButtonObserver::EEventButton, iModel->Id() ); - - // EStdKeyDevice3 (EKeyOK) cannot be consumed here. - result = EFalse; + result = ETrue; if ( iTriggeredComponent ) { diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp --- a/emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -221,8 +221,7 @@ if( iUseDefaultBackground ) { ClearBackgroundImage(); - iDefaultBgBrush = CAlfFrameBrush::NewL( iParent->Env(), KAknsIIDQsnFrButtonTb ); - iLastUpdatedButtonModelSize.SetSize(0,0); // prevent code skip in ClearBackgroundImage + iDefaultBgBrush = CAlfFrameBrush::NewL( iParent->Env(), KAknsIIDQsnFrButtonTb ); iBgBrush = iDefaultBgBrush; iButtonLayout->Brushes()->AppendL( iBgBrush, EAlfDoesNotHaveOwnership ); UpdateBarLayout(); @@ -679,16 +678,14 @@ } } - TSize size = iButtonModel->Size(); - // New size for the button background. - iButtonLayout->SetSize( size ); + iButtonLayout->SetSize( iButtonModel->Size() ); // Same size for the content - iButtonContentLayout->SetSize( size ); + iButtonContentLayout->SetSize( iButtonModel->Size() ); - if ( iDefaultBgBrush && size != iLastUpdatedButtonModelSize ) + if( iDefaultBgBrush ) { - iLastUpdatedButtonModelSize = size; + TSize size = iButtonModel->Size(); TRect fullRect = TRect( size ); TRect innerRect = fullRect; innerRect.Shrink( KButtonBorderSize,KButtonBorderSize ); diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fsmultilineitemvisualizer.cpp --- a/emailuis/uicomponents/src/fsmultilineitemvisualizer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fsmultilineitemvisualizer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -19,6 +19,7 @@ //////SYSTEM INCLUDES //////TOOLKIT INCLUDES +// SF #include "emailtrace.h" #include #include @@ -28,6 +29,8 @@ #include #include #include +// + //////PROJECT INCLUDES #include "fsmultilineitemvisualizer.h" @@ -336,8 +339,7 @@ void CFsMultiLineItemVisualizer::UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& /*aMarkOffIcon*/, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint /*aTimeout*/, TBool aUpdateData) @@ -437,10 +439,10 @@ iFirstLineIconVis->SetImage( TAlfImage( *data->LineIcon( 0 ) ) ); } //mark icon - if ( iMarkIconVis && IsMarked() && aMarkOnIcon ) + if ( iMarkIconVis && IsMarked() && aMarkIcon ) { iMarkIconVis->SetScaleMode( CAlfImageVisual::EScaleFit ); - iMarkIconVis->SetImage( *aMarkOnIcon ); + iMarkIconVis->SetImage( *aMarkIcon ); } //menu icon if ( iMenuIconVis && (iFlags & KFsTreeListItemHasMenu) && aMenuIcon ) diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fsseparatorvisualizer.cpp --- a/emailuis/uicomponents/src/fsseparatorvisualizer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fsseparatorvisualizer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -23,13 +23,13 @@ #include "fsseparatordata.h" #include "fstreelist.h" #include "fslayoutmanager.h" - +// SF #include #include #include #include #include - +// // ======== MEMBER FUNCTIONS ======== @@ -218,15 +218,6 @@ iFlags &= ~KFsTreeListItemAlwaysExtended; } -// --------------------------------------------------------------------------- -// -// -// --------------------------------------------------------------------------- -// -void CFsSeparatorVisualizer::SetMarkingMode( TBool /*aMarkingMode*/ ) - { - FUNC_LOG; - } // --------------------------------------------------------------------------- // From class MFsTreeItemVisualizer. @@ -287,8 +278,7 @@ void CFsSeparatorVisualizer::UpdateL( const MFsTreeItemData& aData, TBool /*aFocused*/, const TUint aLevel, - CAlfTexture*& /*aMarkOnIcon*/, - CAlfTexture*& /*aMarkOffIcon*/, + CAlfTexture*& /*aMarkIcon*/, CAlfTexture*& /*aMenuIcon*/, const TUint /*aTimeout*/, TBool /*aUpdateData*/) diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fstreeitemvisualizerbase.cpp --- a/emailuis/uicomponents/src/fstreeitemvisualizerbase.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fstreeitemvisualizerbase.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -26,6 +26,7 @@ #include "fslayoutmanager.h" #include "fsalftextstylemanager.h" +// SF #include #include #include @@ -36,6 +37,7 @@ #include #include #include +// // --------------------------------------------------------------------------- // C++ destructor. @@ -536,6 +538,7 @@ return retVal; } +// // --------------------------------------------------------------------------- // From MFsTreeItemVisualizer. // Sets item background brush. @@ -565,6 +568,7 @@ return retVal; } +// // --------------------------------------------------------------------------- // From MFsTreeItemVisualizer. @@ -633,24 +637,6 @@ } // --------------------------------------------------------------------------- -// From class MFsTreeItemVisualizer. -// Sets marking mode on/off. -// --------------------------------------------------------------------------- -// -void CFsTreeItemVisualizerBase::SetMarkingMode( TBool aMarkingMode ) - { - FUNC_LOG; - if ( aMarkingMode ) - { - iFlags |= KFsTreeListMarkingMode; - } - else - { - iFlags &= ~KFsTreeListMarkingMode; - } - } - -// --------------------------------------------------------------------------- // This function returns wether an item is always in extended state. // --------------------------------------------------------------------------- // @@ -681,8 +667,7 @@ void CFsTreeItemVisualizerBase::UpdateL( const MFsTreeItemData& /*aData*/, TBool /*aFocused*/, const TUint /*aLevel*/, - CAlfTexture*& /*aMarkOnIcon*/, - CAlfTexture*& /*aMarkOffIcon*/, + CAlfTexture*& /*aMarkIcon*/, CAlfTexture*& /*aMenuIcon*/, const TUint /*aTimeout*/, TBool /*aUpdateData*/) diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fstreelist.cpp --- a/emailuis/uicomponents/src/fstreelist.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fstreelist.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -20,9 +20,15 @@ //////SYSTEM INCLUDES //////TOOLKIT INCLUDES +// SF #include "emailtrace.h" #include +// +//////PROJECT INCLUDES +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag #include "fstreelist.h" #include "fstreecontrol.h" #include "fstree.h" @@ -341,16 +347,6 @@ return iListFocused; } -//--------------------------------------------------------------------------- -// -//--------------------------------------------------------------------------- -EXPORT_C void CFsTreeList::SetMarkingModeL( const TBool aMarkingMode ) - { - FUNC_LOG; - iTreeVisualizer->SetMarkingModeL( aMarkingMode ); - } - - // --------------------------------------------------------------------------- // The function sets duration of the slide-in effect. // --------------------------------------------------------------------------- @@ -944,16 +940,19 @@ // Retrieves events from tree visualizer // --------------------------------------------------------------------------- // +// Touch EXPORT_C void CFsTreeList::TreeVisualizerEventL( const TFsTreeVisualizerEvent aEvent, const TFsTreeItemId aId, const TPoint& aPoint ) const +// { FUNC_LOG; MFsTreeListObserver::TFsTreeListEvent listEvent; switch ( aEvent ) { + // "Base class modifications for using touch" case MFsTreeVisualizerObserver::EFsTreeItemTouchAction: { listEvent = MFsTreeListObserver::EFsTreeListItemTouchAction; @@ -969,6 +968,9 @@ listEvent = MFsTreeListObserver::EFsTreeListItemTouchFocused; break; } + + // + case MFsTreeVisualizerObserver::EFsTreeItemSelected: { listEvent = MFsTreeListObserver::EFsTreeItemSelected; @@ -1004,6 +1006,8 @@ listEvent = MFsTreeListObserver::EFsTreeListItemWillGetFocused; break; } + + // // Pass on the collapse/expand events. case MFsTreeVisualizerObserver::EFsTreeListItemCollapsed: { @@ -1025,6 +1029,7 @@ listEvent = MFsTreeListObserver::EFsTreeListExpandedAll; break; } + // case MFsTreeVisualizerObserver::EFsChangeFocusVisibility: { listEvent = MFsTreeListObserver::EFsFocusVisibilityChange; diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fstreenodevisualizerbase.cpp --- a/emailuis/uicomponents/src/fstreenodevisualizerbase.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fstreenodevisualizerbase.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -26,6 +26,7 @@ #include "fslayoutmanager.h" #include "fsalftextstylemanager.h" +// SF #include #include #include @@ -36,6 +37,7 @@ #include #include #include +// // --------------------------------------------------------------------------- // C++ destructor. @@ -532,6 +534,7 @@ return retVal; } +// // --------------------------------------------------------------------------- // From MFsTreeItemVisualizer. // Sets item background brush. @@ -561,6 +564,7 @@ return retVal; } +// // --------------------------------------------------------------------------- // From MFsTreeItemVisualizer. @@ -622,23 +626,6 @@ } // --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CFsTreeNodeVisualizerBase::SetMarkingMode( TBool aMarkingMode ) - { - FUNC_LOG; - if ( aMarkingMode ) - { - iFlags |= KFsTreeListMarkingMode; - } - else - { - aMarkingMode &= ~KFsTreeListMarkingMode; - } - } - -// --------------------------------------------------------------------------- // This function returns wether an item is always in extended state. // --------------------------------------------------------------------------- // @@ -669,8 +656,7 @@ void CFsTreeNodeVisualizerBase::UpdateL( const MFsTreeItemData& /*aData*/, TBool /*aFocused*/, const TUint /*aLevel*/, - CAlfTexture*& /*aMarkIconOn*/, - CAlfTexture*& /*aMarkIconOff*/, + CAlfTexture*& /*aMarkIcon*/, CAlfTexture*& /*aMenuIcon*/, const TUint /*aTimeout*/, TBool /*aUpdateData*/) diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp --- a/emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -15,6 +15,11 @@ * */ + +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag + #include "emailtrace.h" #include "fstreeplainonelineitemvisualizer.h" #include "fstreeplainonelineitemdata.h" @@ -25,6 +30,7 @@ #include "fsmarqueeclet.h" #include +// SF #include #include #include @@ -35,6 +41,7 @@ #include #include +// // ======== MEMBER FUNCTIONS ======== @@ -340,7 +347,7 @@ if ( iFlags & KFsTreeListItemMarked ) { TInt iconMarkedVisIndex = - iLayout->FindVisual(iIconMark); + iLayout->FindVisual(iIconMarked); if ( iconMarkedVisIndex != KErrNotFound ) { iLayout->SetAnchor(EAlfAnchorTopLeft, @@ -358,16 +365,16 @@ TAlfTimedValue opacity; opacity.SetValueNow(1.0f); - iIconMark->SetOpacity(opacity); + iIconMarked->SetOpacity(opacity); } } else { - if (iIconMark) + if (iIconMarked) { TAlfTimedValue opacity; opacity.SetValueNow(0.0f); - iIconMark->SetOpacity(opacity); + iIconMarked->SetOpacity(opacity); } } iLayout->UpdateChildrenLayout(); @@ -400,6 +407,7 @@ { iIconVisual = CAlfImageVisual::AddNewL(iOwnerControl, iLayout); + // aspect ratio preserved iIconVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside); iIconVisual->SetFlag( EAlfVisualFlagIgnorePointer ); } @@ -418,11 +426,11 @@ iTextVisual->SetFlag( EAlfVisualFlagIgnorePointer ); } - if (!iIconMark) + if (!iIconMarked) { - iIconMark = CAlfImageVisual::AddNewL(iOwnerControl, iLayout); - iIconMark->SetScaleMode( CAlfImageVisual::EScaleFitInside); - iIconMark->SetFlag( EAlfVisualFlagIgnorePointer ); + iIconMarked = CAlfImageVisual::AddNewL(iOwnerControl, iLayout); + iIconMarked->SetScaleMode( CAlfImageVisual::EScaleFitInside); + iIconMarked->SetFlag( EAlfVisualFlagIgnorePointer ); } if (!iIconMenu) @@ -453,8 +461,7 @@ void CFsTreePlainOneLineItemVisualizer::UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& /*aMarkOffIcon*/, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint /*aTimeout*/, TBool aUpdateData) @@ -492,7 +499,9 @@ if (iIconVisual && data->IsIconSet()) { + // aspect ratio preserved iIconVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside ); + // iIconVisual->SetImage( TAlfImage( data->Icon() ) ); } @@ -557,9 +566,9 @@ if ( IsMarked() ) { // aspect ratio preserved - iIconMark->SetScaleMode( CAlfImageVisual::EScaleFitInside); + iIconMarked->SetScaleMode( CAlfImageVisual::EScaleFitInside); // - iIconMark->SetImage( *aMarkOnIcon ); + iIconMarked->SetImage( *aMarkIcon ); } if ((iFlags & KFsTreeListItemHasMenu) @@ -621,7 +630,7 @@ iLayout = NULL; iTextVisual = NULL; iIconVisual = NULL; - iIconMark = NULL; + iIconMarked = NULL; iIconMenu = NULL; iParentLayout = NULL; iViewportLayout = NULL; diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fstreeplainonelinenodevisualizer.cpp --- a/emailuis/uicomponents/src/fstreeplainonelinenodevisualizer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fstreeplainonelinenodevisualizer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -15,6 +15,11 @@ * */ + +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag + #include "emailtrace.h" #include "fstreeplainonelinenodevisualizer.h" #include "fstreeplainonelinenodedata.h" @@ -24,6 +29,7 @@ #include "fsmarqueeclet.h" #include +// SF #include #include #include @@ -33,6 +39,7 @@ #include #include +// // ======== MEMBER FUNCTIONS ======== @@ -186,15 +193,6 @@ iFlags &= ~KFsTreeListItemAlwaysExtended; } -// --------------------------------------------------------------------------- -// From MFsTreeItemVisualizer. -// -// --------------------------------------------------------------------------- -// -void CFsTreePlainOneLineNodeVisualizer::SetMarkingMode( TBool /*aMarkingMode*/ ) //TEJ_MMD - { - FUNC_LOG; - } // --------------------------------------------------------------------------- // From MFsTreeItemVisualizer. @@ -535,7 +533,7 @@ if (!iIconVisual) { iIconVisual = CAlfImageVisual::AddNewL(iOwnerControl,iLayout); - iIconVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside); + iIconVisual->SetScaleMode( CAlfImageVisual::EScaleNormal ); iIconVisual->SetFlag( EAlfVisualFlagIgnorePointer ); } @@ -557,7 +555,7 @@ if (!iIconMarked) { iIconMarked = CAlfImageVisual::AddNewL( iOwnerControl, iLayout ); - iIconMarked->SetScaleMode( CAlfImageVisual::EScaleFitInside); + iIconMarked->SetScaleMode( CAlfImageVisual::EScaleNormal); iIconMarked->SetFlag( EAlfVisualFlagIgnorePointer ); } @@ -565,7 +563,7 @@ { iIconMenu = CAlfImageVisual::AddNewL(iOwnerControl, iLayout); - iIconMenu->SetScaleMode( CAlfImageVisual::EScaleFitInside); + iIconMenu->SetScaleMode( CAlfImageVisual::EScaleNormal); iIconMenu->SetFlag( EAlfVisualFlagIgnorePointer ); } @@ -589,8 +587,7 @@ void CFsTreePlainOneLineNodeVisualizer::UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& /*aMarkOffIcon*/, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint /*aTimeout*/, TBool aUpdateData) @@ -625,7 +622,7 @@ //update the ancors for current item settings const TInt indent( iTextIndentation * ( aLevel - 1 ) ); - UpdateLayout(data, indent, aMarkOnIcon, aMenuIcon); + UpdateLayout(data, indent, aMarkIcon, aMenuIcon); if (iTextVisual && aUpdateData) { @@ -698,9 +695,9 @@ } } - if ( IsMarked() && iIconMarked && aMarkOnIcon ) + if ( IsMarked() && iIconMarked && aMarkIcon ) { - iIconMarked->SetImage( *aMarkOnIcon ); + iIconMarked->SetImage( *aMarkIcon ); } if ( (iFlags & KFsTreeListItemHasMenu) && iIconMenu && aMenuIcon ) diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fstreeplainrootvisualizer.cpp --- a/emailuis/uicomponents/src/fstreeplainrootvisualizer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fstreeplainrootvisualizer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -22,11 +22,12 @@ #include "fstreeplainonelineitemdata.h" #include "fstreeplainrootvisualizer.h" #include "fstextstylemanager.h" - +// SF #include #include #include #include +// // ======== MEMBER FUNCTIONS ======== @@ -116,8 +117,7 @@ void CFsTreePlainRootVisualizer::UpdateL( const MFsTreeItemData& aData, TBool /*aFocused*/, const TUint /*aLevel*/, - CAlfTexture*& /*aMarkOnIcon*/, - CAlfTexture*& /*aMarkOffIcon*/, + CAlfTexture*& /*aMarkIcon*/, CAlfTexture*& /*aMenuIcon*/, const TUint /*aTimeout*/, TBool aUpdateData) diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fstreeplaintwolineitemvisualizer.cpp --- a/emailuis/uicomponents/src/fstreeplaintwolineitemvisualizer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fstreeplaintwolineitemvisualizer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -12,10 +12,14 @@ * Contributors: * * Description : A visualizer for data items with plain text. -* Version : %version: tr1sido#18 % +* Version : %version: tr1sido#17 % * */ + +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag #include "emailtrace.h" #include #include @@ -26,7 +30,7 @@ #include "fslayoutmanager.h" #include "fstextstylemanager.h" #include "fsmarqueeclet.h" - +// SF #include #include #include @@ -34,8 +38,10 @@ #include #include #include + #include #include +// // ======== MEMBER FUNCTIONS ======== @@ -266,7 +272,7 @@ CFsLayoutManager::TFsLayoutMetrics mainIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG1, - markIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG1, + markIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG4, menuIconMetrics = CFsLayoutManager::EFsLmListSingleDycRowPaneG3, sizeMetrics = CFsLayoutManager::EFsLmListSingleDycRowPane, exSizeMetrics = CFsLayoutManager::EFsLmListSingleFsDycPane, @@ -337,7 +343,7 @@ if (aData->IsIconSet()) { - if ( iFlags & KFsTreeListMarkingMode ) + if (iFlags & KFsTreeListItemMarked) { if ((iFlags & KFsTreeListItemHasMenu) && (iFlags & KFsTreeListItemFocused)) @@ -396,12 +402,12 @@ { //mainIcon + markIcon mainIconMetrics = - CFsLayoutManager::EFsLmListSingleDycRowPaneG2; - mainIconVariety = 2; + CFsLayoutManager::EFsLmListSingleDycRowPaneG1; + mainIconVariety = 4; markIconMetrics = - CFsLayoutManager::EFsLmListSingleDycRowPaneG1; - markIconVariety = 2; - firstLineTextParentVariety = 2; + CFsLayoutManager::EFsLmListSingleDycRowPaneG4; + markIconVariety = 3; + firstLineTextParentVariety = 4; if (firstLineTextFields==1) { firstLineTextMetrics[0] = @@ -412,10 +418,10 @@ { firstLineTextMetrics[0] = CFsLayoutManager::EFsLmListSingleDycRowTextPaneT1; - firstLineTextVarieties[0] = 11; + firstLineTextVarieties[0] = 13; firstLineTextMetrics[1] = CFsLayoutManager::EFsLmListSingleDycRowTextPaneT2; - firstLineTextVarieties[1] = 2; + firstLineTextVarieties[1] = 4; } } } @@ -646,8 +652,10 @@ secondLineTextVariety = 8; } } + // ??? thirdLineTextMetrics = CFsLayoutManager::EFsLmListSingleDycRowTextPaneT1; thirdLineTextVariety = 4; + // } else { @@ -1358,50 +1366,51 @@ } } - if ( iFlags & KFsTreeListMarkingMode && iIconMark ) - { - - TRect iconRowParent = currentSize; - if (markIconRow > 0) + if ( IsMarked() && iIconMarked ) + { + if (iIconMarked) { - CFsLayoutManager::LayoutMetricsRect(currentSize, CFsLayoutManager::EFsLmListSingleDycRowPane, iconRowParent, markIconRow, markIconRow); - } - CFsLayoutManager::LayoutMetricsRect( - iconRowParent, - markIconMetrics, - rect, - markIconVariety); - - tpMarkIconTl.SetTarget(TAlfRealPoint(rect.iTl)); - tpMarkIconBr.SetTarget(TAlfRealPoint(rect.iBr)); + TRect iconRowParent = currentSize; + if (markIconRow > 0) + { + CFsLayoutManager::LayoutMetricsRect(currentSize, CFsLayoutManager::EFsLmListSingleDycRowPane, iconRowParent, markIconRow, markIconRow); + } + CFsLayoutManager::LayoutMetricsRect( + iconRowParent, + markIconMetrics, + rect, + markIconVariety); + tpMarkIconTl.SetTarget(TAlfRealPoint(rect.iTl)); + tpMarkIconBr.SetTarget(TAlfRealPoint(rect.iBr)); - TInt iconMarkedVisIndex = iLayout->FindVisual(iIconMark); - - if ( iconMarkedVisIndex != KErrNotFound ) - { - tpMarkIconTl.SetStyle(EAlfTimedValueStyleSineWave); - iLayout->SetAnchor(EAlfAnchorTopLeft, - iconMarkedVisIndex, - EAlfAnchorOriginLeft,EAlfAnchorOriginTop, - EAlfAnchorMetricAbsolute,EAlfAnchorMetricAbsolute, - tpMarkIconTl ); - tpMarkIconBr.SetStyle(EAlfTimedValueStyleSineWave); - iLayout->SetAnchor(EAlfAnchorBottomRight, - iconMarkedVisIndex, - EAlfAnchorOriginLeft,EAlfAnchorOriginTop, - EAlfAnchorMetricAbsolute,EAlfAnchorMetricAbsolute, - tpMarkIconBr ); - opacity.SetValueNow(1.0f); - iIconMark->SetOpacity(opacity); + TInt iconMarkedVisIndex = + iLayout->FindVisual(iIconMarked); + if ( iconMarkedVisIndex != KErrNotFound ) + { + tpMarkIconTl.SetStyle(EAlfTimedValueStyleSineWave); + iLayout->SetAnchor(EAlfAnchorTopLeft, + iconMarkedVisIndex, + EAlfAnchorOriginLeft,EAlfAnchorOriginTop, + EAlfAnchorMetricAbsolute,EAlfAnchorMetricAbsolute, + tpMarkIconTl ); + tpMarkIconBr.SetStyle(EAlfTimedValueStyleSineWave); + iLayout->SetAnchor(EAlfAnchorBottomRight, + iconMarkedVisIndex, + EAlfAnchorOriginLeft,EAlfAnchorOriginTop, + EAlfAnchorMetricAbsolute,EAlfAnchorMetricAbsolute, + tpMarkIconBr ); + } } + opacity.SetValueNow(1.0f); + iIconMarked->SetOpacity(opacity); } else { - if (iIconMark) - { - opacity.SetValueNow(0.0f); - iIconMark->SetOpacity(opacity); - } + if (iIconMarked) + { + opacity.SetValueNow(0.0f); + iIconMarked->SetOpacity(opacity); + } } if ( iPreviewPaneTextVisual ) @@ -1441,6 +1450,7 @@ } iLayout->UpdateChildrenLayout(); + // } // --------------------------------------------------------------------------- @@ -1496,16 +1506,17 @@ iSecondaryTextVisual->SetFlag( EAlfVisualFlagIgnorePointer ); } - if (!iIconMark) + if (!iIconMarked) { - iIconMark = CAlfImageVisual::AddNewL( iOwnerControl, iLayout ); - iIconMark->SetScaleMode( CAlfImageVisual::EScaleFit ); - iIconMark->SetFlag( EAlfVisualFlagIgnorePointer ); + iIconMarked = CAlfImageVisual::AddNewL( iOwnerControl, iLayout ); + iIconMarked->SetScaleMode( CAlfImageVisual::EScaleFit ); + iIconMarked->SetFlag( EAlfVisualFlagIgnorePointer ); } if (!iIconMenu) { - iIconMenu = CAlfImageVisual::AddNewL(iOwnerControl, iLayout); + iIconMenu = + CAlfImageVisual::AddNewL(iOwnerControl, iLayout); iIconMenu->SetScaleMode( CAlfImageVisual::EScaleFit ); iIconMenu->SetFlag( EAlfVisualFlagIgnorePointer ); } @@ -1553,8 +1564,7 @@ void CFsTreePlainTwoLineItemVisualizer::UpdateL( const MFsTreeItemData& aData, TBool aFocused, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& aMarkOffIcon, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint aTimeout, TBool aUpdateData) @@ -1736,15 +1746,10 @@ iDateTimeTextVisual->SetTextStyle( styleId ); } - if ( IsMarked() && iIconMark && aMarkOnIcon ) + if ( IsMarked() && iIconMarked && aMarkIcon ) { - iIconMark->SetScaleMode( CAlfImageVisual::EScaleFit ); - iIconMark->SetImage( *aMarkOnIcon ); - } - else if ( !IsMarked() && iIconMark && aMarkOffIcon ) - { - iIconMark->SetScaleMode( CAlfImageVisual::EScaleFit ); - iIconMark->SetImage( *aMarkOffIcon ); + iIconMarked->SetScaleMode( CAlfImageVisual::EScaleFit ); + iIconMarked->SetImage( *aMarkIcon ); } //menu icon - visible only when item is focused diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fstreerichitemvisualizer.cpp --- a/emailuis/uicomponents/src/fstreerichitemvisualizer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fstreerichitemvisualizer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -19,7 +19,11 @@ #include "emailtrace.h" #include +// removed __FS_ALFRED_SUPPORT flag +//#include +// removed __FS_ALFRED_SUPPORT flag +// SF #include #include #include @@ -30,6 +34,7 @@ #include #include #include +// #include "fstreerichitemvisualizer.h" #include "fstreerichitemdata.h" @@ -500,8 +505,7 @@ const MFsTreeItemData& aData, TBool /*aFocused*/, const TUint aLevel, - CAlfTexture*& aMarkOnIcon, - CAlfTexture*& /*aMarkOffIcon*/, + CAlfTexture*& aMarkIcon, CAlfTexture*& aMenuIcon, const TUint /*aTimeout*/, TBool aUpdateData) @@ -530,7 +534,7 @@ if (iFlags & KFsTreeListItemMarked) { iIconMarked->SetScaleMode( CAlfImageVisual::EScaleFit ); - iIconMarked->SetImage(TAlfImage(*aMarkOnIcon)); + iIconMarked->SetImage(TAlfImage(*aMarkIcon)); } if (iFlags & KFsTreeListItemHasMenu) diff -r c8382f7b54ef -r 726fba06891a emailuis/uicomponents/src/fstreevisualizerbase.cpp --- a/emailuis/uicomponents/src/fstreevisualizerbase.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/uicomponents/src/fstreevisualizerbase.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -24,6 +24,7 @@ #include //////TOOLKIT INCLUDES +// SF #include #include #include @@ -49,6 +50,7 @@ //visuals #include #include +// //////PROJECT INCLUDES @@ -362,6 +364,8 @@ aItems.Reset(); TInt i(0); aOffset = 0; + aBeginIndex = KErrNotFound; + if (aY > Height()) { aHeight = -1; @@ -1062,40 +1066,20 @@ // Sets icon for a mark sign. // --------------------------------------------------------------------------- // -void CFsTreeVisualizerBase::SetMarkOnIcon(CAlfTexture& aMarkOnIcon) +void CFsTreeVisualizerBase::SetMarkIcon(CAlfTexture& aMarkIcon) { FUNC_LOG; - iMarkOnIcon = &aMarkOnIcon; - } - -// --------------------------------------------------------------------------- -// Sets icon for a unmark sign. -// --------------------------------------------------------------------------- -// -void CFsTreeVisualizerBase::SetMarkOffIcon(CAlfTexture& aMarkOffIcon) - { - FUNC_LOG; - iMarkOffIcon = &aMarkOffIcon; + iMarkIcon = &aMarkIcon; } // --------------------------------------------------------------------------- // Returns icon used to mark items. // --------------------------------------------------------------------------- // -CAlfTexture* CFsTreeVisualizerBase::MarkOnIcon() +CAlfTexture* CFsTreeVisualizerBase::MarkIcon() { FUNC_LOG; - return iMarkOnIcon; - } - -// --------------------------------------------------------------------------- -// Returns icon used to unmark items. -// --------------------------------------------------------------------------- -// -CAlfTexture* CFsTreeVisualizerBase::MarkOffIcon() - { - FUNC_LOG; - return iMarkOffIcon; + return iMarkIcon; } // --------------------------------------------------------------------------- @@ -1127,7 +1111,7 @@ data = &(iTreeData->ItemData(aItemId)); vis->UpdateL(*data, IsItemFocused(aItemId) && IsFocusShown(), - iTreeData->Level(aItemId), iMarkOnIcon, iMarkOffIcon, iMenuIcon); + iTreeData->Level(aItemId), iMarkIcon, iMenuIcon); } } @@ -1287,8 +1271,7 @@ MakeSelectorVisibleL(EFalse); visualizer->UpdateL(*data, EFalse, iTreeData->Level(iFocusedItem), - iMarkOnIcon, iMarkOffIcon, - iMenuIcon, iCurrentScrollSpeed); + iMarkIcon, iMenuIcon, iCurrentScrollSpeed); } } } @@ -1299,57 +1282,6 @@ } // --------------------------------------------------------------------------- -// The functions sets wether all item in the list should be always in -// extended state or in normal state. -// --------------------------------------------------------------------------- -// -void CFsTreeVisualizerBase::SetMarkingModeL( TBool aMarkingMode ) - { - FUNC_LOG; - // Do not change this to: IsMarkingMode() != aAlwaysExtended, because - // it will not work. TBool is defined as TInt and thus this comparison - // comes out as TInt != TInt, which always evaluates true in this case. - if ( ( IsMarkingMode() && !aMarkingMode ) || - ( !IsMarkingMode() && aMarkingMode ) ) - { - iFlags.Assign(EMarkingMode, aMarkingMode); - TFsTreeIterator treeIter( - iTreeData->Iterator(KFsTreeRootID, KFsTreeRootID)); - while (treeIter.HasNext()) - { - TFsTreeItemId itemId(treeIter.Next()); - if (itemId != KFsTreeNoneID && !iTreeData->IsNode(itemId)) - { - MFsTreeItemVisualizer* itemviz(iTreeData->ItemVisualizer(itemId)); - ApplyListSpecificValuesToItem(itemviz); - } - } - const TBool isUpdating(iWorld.IsUpdating()); - if (!isUpdating) - { - iWorld.BeginUpdate(); - } - iWorld.RemoveAllL(); - treeIter = iTreeData->Iterator(KFsTreeRootID, KFsTreeRootID, - KFsTreeIteratorSkipCollapsedFlag); - while (treeIter.HasNext()) - { - TFsTreeItemId itemId(treeIter.Next()); - if (itemId != KFsTreeNoneID) - { - MFsTreeItemVisualizer* itemviz(iTreeData->ItemVisualizer(itemId)); - iWorld.AppendL(itemId, itemviz->Size()); - } - } - iViewPort.ClearCache(); - if (!isUpdating) - { - iWorld.EndUpdateL(); - } - } - } - -// --------------------------------------------------------------------------- // The function sets some properties of the selector like bitmap, type // of movement. // --------------------------------------------------------------------------- @@ -1780,7 +1712,7 @@ if ( visualizer ) { visualizer->UpdateL( iTreeData->ItemData( iFocusedItem ), EFalse, - iTreeData->Level( iFocusedItem ), iMarkOnIcon, iMarkOffIcon, iMenuIcon, 0 ); + iTreeData->Level( iFocusedItem ), iMarkIcon, iMenuIcon, 0 ); } iFocusedItem = aItemId; @@ -1791,8 +1723,7 @@ if ( visualizer ) { visualizer->UpdateL( iTreeData->ItemData( iFocusedItem ), IsFocusShown(), - iTreeData->Level( iFocusedItem ), iMarkOnIcon, - iMarkOffIcon, iMenuIcon, 0 ); + iTreeData->Level( iFocusedItem ), iMarkIcon, iMenuIcon, 0 ); } if ( iFocusedItem != KFsTreeNoneID ) @@ -1841,6 +1772,7 @@ // Sets an item as first visible one in the list. // --------------------------------------------------------------------------- // +// void CFsTreeVisualizerBase::SetFirstVisibleItemL(const TFsTreeItemId /*aItemId*/) { FUNC_LOG; @@ -1856,6 +1788,9 @@ TFsTreeItemId retId = KFsTreeNoneID; if (iVisibleItems.Count()) { + // + // TRAP_IGNORE( ClearVisibleItemsListL(EFalse) ); + // retId = iVisibleItems[0]; } else @@ -1889,6 +1824,7 @@ // Displays the list. // --------------------------------------------------------------------------- // +// void CFsTreeVisualizerBase::ShowListL(const TBool aFadeIn, const TBool aSlideIn) { @@ -1897,8 +1833,7 @@ if (iTreeData->Count() == 0) { iRootVisualizer->ShowL(*iRootLayout); - iRootVisualizer->UpdateL(*iRootData, EFalse, 0, iMarkOnIcon, - iMarkOffIcon, iMenuIcon); + iRootVisualizer->UpdateL(*iRootData, EFalse, 0, iMarkIcon, iMenuIcon); } else { @@ -1913,7 +1848,7 @@ if ( visualizer ) { visualizer->UpdateL(iTreeData->ItemData(itemId), itemFocused, - iTreeData->Level(itemId), iMarkOnIcon, iMarkOffIcon, iMenuIcon, + iTreeData->Level(itemId), iMarkIcon, iMenuIcon, 0); } } @@ -1990,6 +1925,7 @@ UpdateScrollBarL(); } +// // --------------------------------------------------------------------------- // The function assures that the list view is correct. @@ -2592,7 +2528,7 @@ vis->UpdateL(iTreeData->ItemData(aItemId), IsItemFocused(aItemId) && IsFocusShown(), iTreeData->Level(aItemId), - iMarkOnIcon, iMarkOffIcon, iMenuIcon, 0); + iMarkIcon, iMenuIcon, 0); } } } @@ -2661,16 +2597,6 @@ } // --------------------------------------------------------------------------- -// The function returns if marking mode is on or off -// --------------------------------------------------------------------------- -// -TBool CFsTreeVisualizerBase::IsMarkingMode() - { - FUNC_LOG; - return iFlags.IsSet(EMarkingMode); - } - -// --------------------------------------------------------------------------- // Set the background texture, clears the background color. // --------------------------------------------------------------------------- // @@ -2806,7 +2732,9 @@ iWatermark = CFsWatermark::NewL(*iOwnerControl, *iWatermarkLayout); } + // iWatermark->SetWatermarkTextureL(*aTexture); + // } else { @@ -2918,8 +2846,8 @@ if (!iWorld.IsUpdating()) { iRootVisualizer->ShowL(*iRootLayout); - iRootVisualizer->UpdateL(*iRootData, EFalse, 0, iMarkOnIcon, - iMarkOffIcon, iMenuIcon); + iRootVisualizer->UpdateL(*iRootData, EFalse, 0, iMarkIcon, + iMenuIcon); } iVisibleItems.Reset(); iWorld.RemoveAllL(); @@ -2941,7 +2869,7 @@ { visualizer->UpdateL(iTreeData->ItemData(itemId), IsItemFocused(itemId), iTreeData->Level(itemId), - iMarkOnIcon, iMarkOffIcon, iMenuIcon, 0); + iMarkIcon, iMenuIcon, 0); } } break; @@ -3001,8 +2929,7 @@ if (iTreeData->Count() == 0) { iRootVisualizer->ShowL(*iRootLayout); - iRootVisualizer->UpdateL(*iRootData, EFalse, 0, iMarkOnIcon, - iMarkOffIcon, iMenuIcon); + iRootVisualizer->UpdateL(*iRootData, EFalse, 0, iMarkIcon, iMenuIcon); } else { @@ -3338,16 +3265,20 @@ if (iVisualizationState == EFsTreeVisible && iVisualizerObserver) { - TRAP_IGNORE(iVisualizerObserver->TreeVisualizerEventL( + // Touch + TRAP_IGNORE(iVisualizerObserver->TreeVisualizerEventL( MFsTreeVisualizerObserver::EFsTreeListVisualizerShown, KFsTreeNoneID )); + // } if (iVisualizationState == EFsTreeHidden && iVisualizerObserver) { - TRAP_IGNORE(iVisualizerObserver->TreeVisualizerEventL( + // Touch + TRAP_IGNORE(iVisualizerObserver->TreeVisualizerEventL( MFsTreeVisualizerObserver::EFsTreeListVisualizerHidden, KFsTreeNoneID )); + // } } @@ -3396,7 +3327,8 @@ if (iVisualizationState == EFsTreeVisible && iVisualizerObserver) { - TRAP_IGNORE(iVisualizerObserver->TreeVisualizerEventL( + // Touch + TRAP_IGNORE(iVisualizerObserver->TreeVisualizerEventL( MFsTreeVisualizerObserver::EFsTreeListVisualizerShown, KFsTreeNoneID )); @@ -3404,9 +3336,10 @@ if (iVisualizationState == EFsTreeHidden && iVisualizerObserver) { - TRAP_IGNORE(iVisualizerObserver->TreeVisualizerEventL( + TRAP_IGNORE(iVisualizerObserver->TreeVisualizerEventL( MFsTreeVisualizerObserver::EFsTreeListVisualizerHidden, KFsTreeNoneID )); + // } } @@ -3862,8 +3795,7 @@ { visualizer->UpdateL(iTreeData->ItemData(itemId), IsItemFocused(itemId) && IsFocusShown(), - iTreeData->Level(itemId), iMarkOnIcon, iMarkOffIcon, - iMenuIcon, 0, EFalse); + iTreeData->Level(itemId), iMarkIcon, iMenuIcon, 0, EFalse); } } UpdateSelectorVisualL(); @@ -3933,6 +3865,9 @@ border->SetLayer(EAlfBrushLayerBackground); border->SetBorders(-8, -8, -8, -8); + // + // layout values needed here (not: only used from FS action menu) + // iBorderLayout->SetPadding(TPoint(5, 5)); if (iBorderLayout->Brushes()->Count() > 0) @@ -4614,8 +4549,6 @@ FUNC_LOG; //list can have all items in extended or in a normal state aItemVis->SetAlwaysExtended(IsItemsAlwaysExtended()); - - aItemVis->SetMarkingMode(IsMarkingMode()); //global indentation in pixels for a list component aItemVis->SetIndentation(iLevelIndentation); @@ -4716,6 +4649,8 @@ return isFocused; } +// "Base class modifications for using touch" + // --------------------------------------------------------------------------- // C++ constructor. // --------------------------------------------------------------------------- @@ -4761,6 +4696,7 @@ iFlags.Assign( EPopupMode, aPopUpMode ); iFlags.Set( EExpandCollapseOnLongTap ); } +// // --------------------------------------------------------------------------- // Second phase constructor. @@ -4974,6 +4910,7 @@ { UpdatePhysicsL(); } + UpdateScrollBarL(); } // --------------------------------------------------------------------------- @@ -5019,8 +4956,8 @@ itemId); visualizer->UpdateL(iTreeData->ItemData(itemId), IsItemFocused(itemId) && IsFocusShown(), - iTreeData->Level(itemId), iMarkOnIcon, - iMarkOffIcon, iMenuIcon, 0); + iTreeData->Level(itemId), iMarkIcon, iMenuIcon, + 0); } } CleanupStack::PopAndDestroy(); @@ -5076,7 +5013,7 @@ visualizerLayout.SetSize(tpItemSize); visualizer->UpdateL(iTreeData->ItemData(itemId), IsItemFocused(itemId) && IsFocusShown(), - iTreeData->Level(itemId), iMarkOnIcon, iMarkOffIcon, iMenuIcon, + iTreeData->Level(itemId), iMarkIcon, iMenuIcon, 0); visualizerLayout.PropertySetIntegerL(KPropertyItemId(), itemId); visualizerLayout.Brushes()->AppendL(iBorderBrush, @@ -5533,3 +5470,5 @@ return ( iTouchPressed || iFocusVisible ) && iFlags.IsClear( EListPanning ); } + +// diff -r c8382f7b54ef -r 726fba06891a emailuis/widget/emailwidgetsettings/conf/cmailwidget.confml Binary file emailuis/widget/emailwidgetsettings/conf/cmailwidget.confml has changed diff -r c8382f7b54ef -r 726fba06891a emailuis/widget/emailwidgetsettings/conf/cmailwidget_2001E272.crml Binary file emailuis/widget/emailwidgetsettings/conf/cmailwidget_2001E272.crml has changed diff -r c8382f7b54ef -r 726fba06891a emailuis/widget/hsps/00/emailwidgetconfiguration.dtd --- a/emailuis/widget/hsps/00/emailwidgetconfiguration.dtd Wed Sep 15 11:52:37 2010 +0300 +++ b/emailuis/widget/hsps/00/emailwidgetconfiguration.dtd Wed Oct 13 14:11:15 2010 +0300 @@ -1,23 +1,21 @@  Download next - SaveNextRemoteAttachmentL(); - } - else - { - // All remote attachments have been saved. Show info note. - ShowInfoNoteL( iEntry.AttachmentCountL() ); - } - } - else - { - iCommandInProgress = 0; - } + // Send asynchronous event, that attachment with + // given index is saved. This command will return to + // HandleAttachmentCommandL in this class. Async command + // is used to avoid system caused error where memory selection + // query in document handler does not receive key events + // correctly. + CESMRFieldCommandEvent* event = CESMRFieldCommandEvent::NewLC( + NULL, + EESMRViewerSaveAttachment ); + + // Record attachment index + iAttachmentIndex = attachmentIndex; + + // Send async event + iEventQueue.NotifyEventAsyncL( event ); + CleanupStack::Pop( event ); + + // Set to zero for the duration of the saving. + iCommandInProgress = 0; } } @@ -751,6 +792,8 @@ iDownloadOperations.Remove( remoteCommand ); delete command; } + + iSaveAllAttachmentsCommand = EFalse; } break; case EESMRViewerSaveAllAttachments: diff -r c8382f7b54ef -r 726fba06891a meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrviewerattachmentfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrviewerattachmentfield.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrviewerattachmentfield.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -155,6 +155,7 @@ EFalse ); iRichTextViewer->SetSkinBackgroundControlContextL( iBgCtrlContext ); + iSelectedLink = NULL; } // --------------------------------------------------------------------------- @@ -467,6 +468,15 @@ if ( IsValidAttachmentViewerCommand(aCommand) && iAttachmentCommandHandler ) { const CESMRRichTextLink* currentLink = iRichTextViewer->GetSelectedLink(); + // remember the state if Saving all is not in progress + if( currentLink && !iAttachmentCommandHandler->IsSaveAllAttachmentsInProgress() ) + { + iSelectedLink = currentLink; + } + else + { + currentLink = iSelectedLink;// restore link when selection is lost + } ASSERT( currentLink ); @@ -758,7 +768,14 @@ { FUNC_LOG; - if ( iRichTextViewer->Rect().Contains( aPosition ) ) + // prevent link selection if SaveAllAttachments is in progress + TBool saveAllInProgress ( EFalse ); + if( iAttachmentCommandHandler ) + { + saveAllInProgress = iAttachmentCommandHandler->IsSaveAllAttachmentsInProgress( ); + } + + if ( !saveAllInProgress && iRichTextViewer->Rect().Contains( aPosition ) ) { iRichTextViewer->LinkSelectedL(); } @@ -778,7 +795,15 @@ if( iAttachmentCount > 0 && aPointerEvent.iType == TPointerEvent::EButton1Up ) { - if( iRichTextViewer->Rect().Contains( aPointerEvent.iPosition ) ) + + // prevent handling events if SaveAllAttachments is in progress + TBool saveAllInProgress ( EFalse ); + if( iAttachmentCommandHandler ) + { + saveAllInProgress = iAttachmentCommandHandler->IsSaveAllAttachmentsInProgress( ); + } + + if( !saveAllInProgress && iRichTextViewer->Rect().Contains( aPointerEvent.iPosition ) ) { iRichTextViewer->HandlePointerEventL( aPointerEvent ); ret = ETrue; diff -r c8382f7b54ef -r 726fba06891a meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrconflictpopup.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrconflictpopup.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrconflictpopup.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -29,6 +29,7 @@ #include #include "emailtrace.h" +#include "cesmrcaluserutil.h" // Unnamed namespace for local definitions namespace{ @@ -43,7 +44,7 @@ const TInt KTextLineVariety( 5 ); const TInt KNumTitleLines( 1 ); -const TInt KNumLocationLines( 2 ); +const TInt KNumLocationLines( 1 ); /** * Clips given text and allocates new buffer if needed. @@ -117,7 +118,19 @@ return text; } - +/** + * Judge is one CCalEntry is a all day event + * @param aEntry the entry be checked + * @return ETure if it is a all day event + */ +TBool IsAllDayEventL( CCalEntry& aEntry ) + { + FUNC_LOG; + CESMRCalUserUtil* entryUtil = CESMRCalUserUtil::NewLC( aEntry ); + TBool allDayEvent( entryUtil->IsAlldayEventL() ); + CleanupStack::PopAndDestroy( entryUtil ); + return allDayEvent; + } }//namespace // ======== MEMBER FUNCTIONS ======== @@ -193,7 +206,8 @@ { User::Leave( KErrNotFound ); } - + // Record the blank rows. + TInt blankRow = 0; // Pointer descriptor for R_QTN_MEET_REQ_CONFLICT_UNNAMED TPtrC unnamedTitle( KNullDesC ); @@ -226,6 +240,13 @@ startTime = entryArray[ 0 ]->StartTimeL().TimeLocalL(); endTime = entryArray[ 0 ]->EndTimeL().TimeLocalL(); + + //If the first entry is a all day event, it should be show as + //12:00Am - 11:59Pm, so we should subtract one min from end time. + if ( IsAllDayEventL( *entryArray[ 0 ] ) ) + { + endTime -= TTimeIntervalMinutes( 1 ); + } } HBufC* conflictLabel = StringLoader::LoadLC( @@ -289,23 +310,63 @@ CleanupStack::PushL( locationBuf ); meetingLocation.Set( *locationBuf ); } - strings->AppendL( meetingLocation ); + if ( meetingLocation.Length() > 0 ) + { + strings->AppendL( meetingLocation ); + } + else + { + blankRow++ ; + } + } else { + blankRow++; // Prepare location locationBuf = ClipTextL( - meetingLocation, - KNumTitleLines + KNumLocationLines ); + meetingLocation, KNumLocationLines ); if ( locationBuf ) { CleanupStack::PushL( locationBuf ); meetingLocation.Set( *locationBuf ); } - strings->AppendL( meetingLocation ); + if ( meetingLocation.Length() > 0 ) + { + strings->AppendL( meetingLocation ); + } + else + { + blankRow++; + } + } + HBufC* otherconflictBuf = NULL ; + if( entryArray.Count() == 2) + { + otherconflictBuf = StringLoader::LoadLC( + R_MEET_REQ_CONFLICT_OTHERCONFLICT_SINGULAR_FORMAT, + entryArray.Count()-1, + env ); + strings->AppendL( *otherconflictBuf ); + } + else if ( entryArray.Count() > 2 ) + { + otherconflictBuf = StringLoader::LoadLC( + R_MEET_REQ_CONFLICT_OTHERCONFLICT_FORMAT, + entryArray.Count()-1, + env ); + strings->AppendL( *otherconflictBuf ); + } + else + { + blankRow++; + } + + while( blankRow ) + { strings->AppendL( KNullDesC() ); - } - + blankRow-- ; + } HBufC* displayString = StringLoader::LoadLC( R_MEET_REQ_CONFLICT_TEXT_FORMAT, *strings, @@ -319,6 +380,10 @@ // Clean allocated buffers CleanupStack::PopAndDestroy( displayString ); + if ( otherconflictBuf ) + { + CleanupStack::PopAndDestroy( otherconflictBuf ); + } if ( locationBuf ) { CleanupStack::PopAndDestroy( locationBuf ); diff -r c8382f7b54ef -r 726fba06891a meetingrequest/mrgui/src/cesmrview.cpp --- a/meetingrequest/mrgui/src/cesmrview.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/meetingrequest/mrgui/src/cesmrview.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -730,16 +730,10 @@ NMRLayoutManager::EMRLayoutMRNaviArrowRight ); TRect naviArrowRightRect( naviArrowRightLayoutRect.Rect() ); - // Right arrow needs to be moved left the amount of - // possible toolbar width in landscape - TInt scrollWidth( 0 ); - if( iScrollBar ) - { - scrollWidth = iScrollBar->Rect().Width(); - } - - naviArrowRightRect.Move( scrollWidth, 0 ); - + // Right arrow needs to be moved right the amount of + // stripe width in landscape + naviArrowRightRect.Move( iStripeRect.Width(), 0 ); + iNaviArrowRight->SetRect( naviArrowRightRect ); } } diff -r c8382f7b54ef -r 726fba06891a meetingrequest/mrgui/src/cesmrviewerdialog.cpp --- a/meetingrequest/mrgui/src/cesmrviewerdialog.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/meetingrequest/mrgui/src/cesmrviewerdialog.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -239,11 +239,6 @@ // we want in case of non-MR iToolbar = CMRToolbar::NewL(); - TRect clientRect; - AknLayoutUtils::LayoutMetricsRect( - AknLayoutUtils::EMainPane, - clientRect ); - TBool responseReady(EFalse); MESMRCalEntry* calEntry = iInfoProvider.EntryL(); MESMRMeetingRequestEntry* mrEntry = NULL; @@ -255,8 +250,23 @@ // Change the status pane layout to remove navi pane CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane(); - sp->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT); + // If open the MR viewer from Cmail side, the status pane + // is not visible, we need to show it in viewer dialog + if ( sp && !sp->IsVisible() ) + { + sp->MakeVisible( ETrue ); + } + // Change the type of statuspane to usual_flat. + if ( sp ) + { + sp->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ); + } } + + TRect clientRect; + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EMainPane, + clientRect ); iESMRSendUI = CESMRSendUI::NewL(EESMRCmdSendAs); @@ -432,6 +442,22 @@ ProcessCommandL(EESMRCmdMailNextMessage); break; } + case EStdKeyDelete: + case EStdKeyBackspace: + { + if( CCalenInterimUtils2::IsMeetingRequestL( + iInfoProvider.EntryL()->Entry() ) ) + { + response = EKeyWasConsumed; + ProcessCommandL( EESMRCmdDeleteMR ); + } + else + { + response = EKeyWasConsumed; + ProcessCommandL( EESMRCmdCalEntryUIDelete ); + } + break; + } default: { response = CAknDialog::OfferKeyEventL( aEvent, aType ); @@ -1235,13 +1261,35 @@ case EESMRCmdDeleteMR: // Fall through case EESMRCmdCalEntryUIDelete: { - TBool okToDelete = ETrue; + TBool okToDelete( ETrue ); MESMRCalEntry* calEntry = iInfoProvider.EntryL(); - if ( calEntry->IsRecurrentEventL() ) + + if ( calEntry->IsRecurrentEventL() && calEntry->IsStoredL() ) { - SetRecurrenceModRuleL( - *calEntry, - CESMRListQuery::EESMRDeleteThisOccurenceOrSeriesQuery ); + if( CCalenInterimUtils2::IsMeetingRequestL( calEntry->Entry() ) ) + { + // Static cast is safe here. We know for sure that entry is MR + MESMRMeetingRequestEntry* mrEntry = + static_cast( calEntry ); + + if( mrEntry->IsOpenedFromMail() ) + { + okToDelete = CESMRConfirmationQuery::ExecuteL( + CESMRConfirmationQuery::EESMRDeleteMR ); + } + else + { + SetRecurrenceModRuleL( + *calEntry, + CESMRListQuery::EESMRDeleteThisOccurenceOrSeriesQuery ); + } + } + else + { + SetRecurrenceModRuleL( + *calEntry, + CESMRListQuery::EESMRDeleteThisOccurenceOrSeriesQuery ); + } } else { @@ -1892,6 +1940,9 @@ // Toolbar created, relayouting needed SizeChanged(); + // help the relayout of the viewer + iView->ListPane()->RecordFields(); + DrawDeferred(); } } } diff -r c8382f7b54ef -r 726fba06891a meetingrequest/mrgui/src/cmrfieldcontainer.cpp --- a/meetingrequest/mrgui/src/cmrfieldcontainer.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/meetingrequest/mrgui/src/cmrfieldcontainer.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -361,8 +361,10 @@ // Remove existing focus focusedField->SetOutlineFocusL( EFalse ); focusedField->SetFocus( EFalse ); + focusedField->MoveToScreen( EFalse ); // Set focus to new field + visibleField->MoveToScreen( ETrue ); visibleField->SetOutlineFocusL( ETrue ); visibleField->SetFocus( ETrue ); @@ -554,7 +556,7 @@ // is done. ScrollControlVisible( iFocusedFieldIndex ); } - + SizeChanged(); DrawDeferred(); } } @@ -920,9 +922,11 @@ if ( field->IsVisible() ) { - field->SetPosition( aTl ); - - aTl.iY += field->Size().iHeight; + TPoint pos( field->Position() ); + pos.iY = aTl.iY; + field->SetPosition( pos ); + + aTl.iY += field->Size().iHeight; } } } @@ -1064,6 +1068,23 @@ field->MoveToScreen( !iScrolling ); } +// --------------------------------------------------------------------------- +// CMRFieldContainer::RedrawField +// --------------------------------------------------------------------------- +// +void CMRFieldContainer::RedrawField( CESMRField& aField ) + { + FUNC_LOG; + + // Record and redraw field only if it is not on screen + if ( !aField.HasOutlineFocus() ) + { + aField.RecordField(); + TRect rect( aField.Rect() ); + rect.Move( iPosition.iX - rect.iTl.iX, 0 ); + aField.DrawNow( rect ); + } + } // --------------------------------------------------------------------------- // CMRFieldContainer::Draw diff -r c8382f7b54ef -r 726fba06891a meetingrequest/mrgui/src/cmrlistpane.cpp --- a/meetingrequest/mrgui/src/cmrlistpane.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/meetingrequest/mrgui/src/cmrlistpane.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -875,12 +875,13 @@ TInt listTopY( listPaneRect.iTl.iY ); TInt listBottomY( listPaneRect.iBr.iY ); - if ( ( fieldBottomY > listBottomY || - fieldTopY < listTopY ) && + if ( ( fieldTopY > listBottomY || + fieldBottomY < listTopY ) && focusedFieldRect.Height() < listPaneRect.Height() ) { hiddenFocus = ETrue; } + } return hiddenFocus; } diff -r c8382f7b54ef -r 726fba06891a meetingrequest/mrgui/src/cmrresponsedialogview.cpp --- a/meetingrequest/mrgui/src/cmrresponsedialogview.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/meetingrequest/mrgui/src/cmrresponsedialogview.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -15,11 +15,16 @@ * */ #include "cmrresponsedialogview.h" +#include "nmrcolormanager.h" +#include "nmrlayoutmanager.h" + // System includes #include #include #include #include +#include +#include // DEBUG #include "emailtrace.h" @@ -156,6 +161,11 @@ iEditor->SetSize( Rect().Size() ); iEditor->SetSkinBackgroundControlContextL( iBgContext ); iEditor->EnableCcpuSupportL(ETrue); + CEikScrollBarFrame* scrollBar = iEditor->CreateScrollBarFrameL(); + scrollBar->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EAuto ); + iEditor->TextLayout()->RestrictScrollToTopsOfLines( EFalse ); } // --------------------------------------------------------------------------- @@ -166,10 +176,27 @@ { FUNC_LOG; CCoeControl::HandleResourceChange( aType ); + TInt error = KErrNone; - if ( aType == KEikDynamicLayoutVariantSwitch ) + switch ( aType ) { - iEditor->SetRect( Rect() ); + case KAknsMessageSkinChange: + case KEikMessageColorSchemeChange: + { + TAknLayoutText editorLayoutText = NMRLayoutManager::GetLayoutText( + Rect(), + NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); + TRAP( error, SetFontL( editorLayoutText.Font() ) ); + if ( error != KErrNone ) + { + iCoeEnv->HandleError( error ); + } + break; + } + case KEikDynamicLayoutVariantSwitch: + { + iEditor->SetRect( Rect() ); + } } } @@ -179,18 +206,95 @@ // void CESMRResponseDialogView::SizeChanged() { - if(iBgContext) - { - iBgContext->SetRect(Rect()); - if ( &Window() ) + if(iBgContext) + { + iBgContext->SetRect(Rect()); + if ( &Window() ) + { + iBgContext->SetParentPos( PositionRelativeToScreen() ); + } + } + if( iEditor ) + { + TRect r = Rect(); + TInt scrollbarWidth = iEditor->ScrollBarFrame()-> + ScrollBarBreadth(CEikScrollBar::EVertical); + TInt editorWidth = r.Width() - scrollbarWidth; + TPoint upperLeftCorner = TPoint(0, 0); + iEditor->SetExtent(upperLeftCorner, TSize(editorWidth, r.Height())); + + TAknLayoutText editorLayoutText = NMRLayoutManager::GetLayoutText( + r, + NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ); + + TInt error = KErrNone; + TRAP( error, SetFontL( editorLayoutText.Font() ) ); + if ( error != KErrNone ) { - iBgContext->SetParentPos( PositionRelativeToScreen() ); + iCoeEnv->HandleError( error ); } - } - if( iEditor ) - { - iEditor->SetRect( Rect() ); - } + } + } + +// --------------------------------------------------------------------------- +// CESMRResponseDialogView::MinimumSize() +// --------------------------------------------------------------------------- +// +TSize CESMRResponseDialogView::MinimumSize() + { + FUNC_LOG; + TRect rect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); + return rect.Size(); } +// --------------------------------------------------------------------------- +// CESMRResponseDialogView::SetFontL() +// --------------------------------------------------------------------------- +// +void CESMRResponseDialogView::SetFontL( const CFont* aFont ) + { + FUNC_LOG; + + TFontSpec fontSpec = aFont->FontSpecInTwips(); + + CParaFormat* paraFormat = CParaFormat::NewLC(); + TParaFormatMask paraFormatMask; + paraFormat->iLineSpacingControl = CParaFormat::ELineSpacingExactlyInPixels; + + paraFormatMask.SetAttrib( EAttLineSpacing ); + paraFormat->iHorizontalAlignment = CParaFormat::ELeftAlign; + if ( AknLayoutUtils::LayoutMirrored() ) + { + paraFormat->iHorizontalAlignment = CParaFormat::ERightAlign; + } + paraFormatMask.SetAttrib( EAttAlignment ); + + TCharFormat charFormat; + TCharFormatMask formatMask; + charFormat.iFontSpec = fontSpec; + + formatMask.SetAttrib( EAttFontTypeface ); + formatMask.SetAttrib( EAttFontHeight ); + formatMask.SetAttrib( EAttFontPosture ); + formatMask.SetAttrib( EAttFontStrokeWeight ); + formatMask.SetAttrib( EAttFontHighlightColor ); + formatMask.SetAttrib( EAttColor ); + + charFormat.iFontPresentation.iTextColor = NMRColorManager::Color( + NMRColorManager::EMRMainAreaTextColor ); + charFormat.iFontPresentation.iHighlightColor = + NMRColorManager::Color( NMRColorManager::EMRCutCopyPasteHighlightColor ); + + CParaFormatLayer* paraFormatLayer = + CParaFormatLayer::NewL( paraFormat, paraFormatMask ); + CleanupStack::PushL( paraFormatLayer ); + CCharFormatLayer* charFormatLayer = + CCharFormatLayer::NewL( charFormat, formatMask ); + + iEditor->SetParaFormatLayer( paraFormatLayer ); + CleanupStack::Pop( paraFormatLayer ); + CleanupStack::PopAndDestroy( paraFormat ); + iEditor->SetCharFormatLayer( charFormatLayer ); + } // end of file diff -r c8382f7b54ef -r 726fba06891a meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp --- a/meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -605,22 +605,6 @@ { iConvertedEntry->SetPriorityL( iMRInfoObject->PriorityL() ); } - - if ( IsFieldSupported( iSupportedFields, MMRInfoObject::EESMRInfoFieldPrivacy ) ) - { - if( iMRInfoObject->PrivacyL() == MMRInfoObject::EMRSensitivityPrivate ) - { - iConvertedEntry->SetReplicationStatusL( CCalEntry::EPrivate ); - } - else if( iMRInfoObject->PrivacyL() == MMRInfoObject::EMRSensitivityConfidential ) - { - iConvertedEntry->SetReplicationStatusL( CCalEntry::ERestricted ); - } - else - { - iConvertedEntry->SetReplicationStatusL( CCalEntry::EOpen ); - } - } } // --------------------------------------------------------------------------- diff -r c8382f7b54ef -r 726fba06891a meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrforwardasmeetingrequestfrommail.rss --- a/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrforwardasmeetingrequestfrommail.rss Wed Sep 15 11:52:37 2010 +0300 +++ b/meetingrequest/mrpolicy/mrentryresolver/data/policies/esmrsrforwardasmeetingrequestfrommail.rss Wed Oct 13 14:11:15 2010 +0300 @@ -67,6 +67,12 @@ }, ESMR_FIELD { + field_id = EESMRFieldAllDayEvent; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeEdit; + }, + ESMR_FIELD + { field_id = EESMRFieldMeetingTime; field_type = EESMRFieldTypeDefault; field_mode = EESMRFieldModeView; @@ -85,6 +91,18 @@ }, ESMR_FIELD { + field_id = EESMRFieldAlarmTime; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { + field_id = EESMRFieldAlarmDate; + field_type = EESMRFieldTypeDefault; + field_mode = EESMRFieldModeView; + }, + ESMR_FIELD + { field_id = EESMRFieldLocation; field_type = EESMRFieldTypeDefault; field_mode = EESMRFieldModeView; diff -r c8382f7b54ef -r 726fba06891a meetingrequest/mrservices/src/cesmrconflictchecker.cpp --- a/meetingrequest/mrservices/src/cesmrconflictchecker.cpp Wed Sep 15 11:52:37 2010 +0300 +++ b/meetingrequest/mrservices/src/cesmrconflictchecker.cpp Wed Oct 13 14:11:15 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description : ESMR conflict checker implementation -* Version : %version: e002sa33#9 % +* Version : %version: e002sa33#10.1.2 % * */ @@ -22,6 +22,7 @@ #include "esmrhelper.h" #include "esmrentryhelper.h" #include "esmrinternaluid.h" +#include "cesmrcaluserutil.h" #include #include @@ -96,7 +97,7 @@ { FUNC_LOG; const CalCommon::TCalViewFilter instanceFilter = - CalCommon::EIncludeAppts; + CalCommon::EIncludeAppts | CalCommon::EIncludeEvents; TDateTime start = aStart.DateTime(); TDateTime end = aEnd.DateTime(); @@ -295,7 +296,8 @@ allCalenInstanceView[i]->FindInstanceL( aInstances, - CalCommon::EIncludeAppts, + CalCommon::EIncludeAppts | + CalCommon::EIncludeEvents , timeRange ); } @@ -367,7 +369,7 @@ MoveInstancesL( tmpInstanceArray, aInstances ); if ( !aFindAllConflicts ) { - break; + //break; } } } @@ -399,7 +401,7 @@ MoveInstancesL( tmpInstanceArray, aInstances ); if ( !aFindAllConflicts ) { - break; + //break; } } @@ -479,7 +481,7 @@ MoveInstancesL( tmpInstanceArray, aInstances ); if ( !aFindAllConflicts ) { - break; + //break; } } } @@ -523,7 +525,7 @@ MoveInstancesL( tmpInstanceArray, aInstances ); if ( !aFindAllConflicts ) { - break; + // break; } } } @@ -545,6 +547,50 @@ } /** + * Judge is one CCalEntry is a all day event + * @param aEntry the entry be checked + * @return ETure if it is a all day event + */ +TBool IsAllDayEventL( const CCalEntry& aEntry ) + { + FUNC_LOG; + // for judge all day event + CCalEntry* tmpEntry = ESMRHelper::CopyEntryLC( + aEntry, + aEntry.MethodL(), + ESMRHelper::ECopyFull ); + + CESMRCalUserUtil* entryUtil = CESMRCalUserUtil::NewLC( *tmpEntry ); + TBool allDayEvent( entryUtil->IsAlldayEventL() ); + CleanupStack::PopAndDestroy( entryUtil ); + CleanupStack::PopAndDestroy( tmpEntry ); + + return allDayEvent; + } +/** + * Get the first visible instance from the iterater. + * @param aIterater the handler of the iterater. + * @return the first instance + */ +CCalInstance* FirstInstanceL ( CCalInstanceIterator* aIterater) + { + FUNC_LOG; + CCalInstance* previous = aIterater->PreviousL(); + while( previous ) + { + CleanupStack::PushL( previous ); + CleanupStack::PopAndDestroy( previous ); + previous = aIterater->PreviousL(); + } + + CCalInstance* next = aIterater->NextL(); + CleanupStack::PushL( next ); + CleanupStack::PopAndDestroy( next ); + previous = aIterater->PreviousL(); + return previous; + } + +/** * Finds conflict for recurrent entry */ void FindConflictsForRepeatingMeetingL( @@ -562,38 +608,67 @@ CleanupStack::PushL( instance ); RCPointerArray< CCalInstance > tmpInstanceArray; CleanupClosePushL( tmpInstanceArray ); + CCalEntry& parent = instance->Entry(); + CCalInstanceView* instanceView = aDb.InstanceViewL( aEntry ); - CCalEntry& parent = instance->Entry(); - CCalInstanceView* instanceView = aDb.InstanceViewL( parent ); + // create the iterator for instances by current entry CCalInstanceIterator* iterator = instanceView->FindInstanceByUidL( - parent.UidL(), - parent.StartTimeL() ); + aEntry.UidL(), + aEntry.StartTimeL() ); + CleanupStack::PushL( iterator ); CCalEntry* entry = ESMRHelper::CopyEntryLC( parent, parent.MethodL(), ESMRHelper::ECopyFull ); - - while ( iterator->HasMore() ) - { - CCalInstance* next = iterator->NextL(); - CleanupStack::PushL( next ); - entry->SetStartAndEndTimeL( next->StartTimeL(), next->EndTimeL() ); - CleanupStack::PopAndDestroy( next ); - FindConflictsForEntryL( *entry, - tmpInstanceArray, - aDb ); - - if ( tmpInstanceArray.Count() ) - { - MoveInstancesL( tmpInstanceArray, aInstances ); - - if ( !aFindAllConflicts ) - { - break; - } - } - } + // For CCalInstanceIterator class don't have any function on how to get current instance, + // handle the special situation for it. + if( iterator ->Count() == 1 ) + { + entry->SetStartAndEndTimeL( aEntry.StartTimeL(), aEntry.EndTimeL() ); + + FindConflictsForEntryL( *entry, + tmpInstanceArray, + aDb ); + + if ( tmpInstanceArray.Count() ) + { + MoveInstancesL( tmpInstanceArray, aInstances ); + } + } + else + { + // For CCalInstanceIterator class don't have any function on how to get current instance, + // handle the first instance action when find conflict. + CCalInstance* previous = FirstInstanceL( iterator ); + CleanupStack::PushL( previous ); + entry->SetStartAndEndTimeL( previous->StartTimeL(), previous->EndTimeL() ); + CleanupStack::PopAndDestroy( previous ); + FindConflictsForEntryL( *entry, tmpInstanceArray, aDb ); + + if ( tmpInstanceArray.Count() ) + { + MoveInstancesL( tmpInstanceArray, aInstances ); + } + // does the normal find conflict action. From the second to the end. + while ( iterator->HasMore() ) + { + CCalInstance* next = iterator->NextL(); + CleanupStack::PushL( next ); + entry->SetStartAndEndTimeL( next->StartTimeL(), next->EndTimeL() ); + + CleanupStack::PopAndDestroy( next ); + + FindConflictsForEntryL( *entry, + tmpInstanceArray, + aDb ); + + if ( tmpInstanceArray.Count() ) + { + MoveInstancesL( tmpInstanceArray, aInstances ); + } + } + } CleanupStack::PopAndDestroy( entry );