# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1274779396 -10800 # Node ID 67369d1b217f6da8e7a5f6214a651156c05f6b47 # Parent b5fbb9b25d571f39727c741d0a28dbec8f6cadb8 Revision: 201019 Kit: 2010121 diff -r b5fbb9b25d57 -r 67369d1b217f email_plat/email_client_api/group/bld.inf --- a/email_plat/email_client_api/group/bld.inf Tue May 11 15:57:15 2010 +0300 +++ b/email_plat/email_client_api/group/bld.inf Tue May 25 12:23:16 2010 +0300 @@ -36,5 +36,6 @@ ../inc/memailcontent.h APP_LAYER_PLATFORM_EXPORT_PATH(memailcontent.h) ../inc/memailmessagesearch.h APP_LAYER_PLATFORM_EXPORT_PATH(memailmessagesearch.h) ../inc/mmailboxsyncobserver.h APP_LAYER_PLATFORM_EXPORT_PATH(mmailboxsyncobserver.h) +../inc/mmailboxcontentobserver.h APP_LAYER_PLATFORM_EXPORT_PATH(mmailboxcontentobserver.h) // End of File diff -r b5fbb9b25d57 -r 67369d1b217f email_plat/email_client_api/inc/memailmailbox.h --- a/email_plat/email_client_api/inc/memailmailbox.h Tue May 11 15:57:15 2010 +0300 +++ b/email_plat/email_client_api/inc/memailmailbox.h Tue May 25 12:23:16 2010 +0300 @@ -140,6 +140,17 @@ * The method follows "fire and forget" pattern, returns immediately. */ virtual void EditNewMessageL() = 0; + + /** Register mailbox observer + * @param aObserver observer called back when changes in mailbox (new message, + * messages changes or messages deleted). + * */ + virtual void RegisterObserverL( MMailboxContentObserver& aObserver ) = 0; + + /** + * Unregister mailbox observe.r + */ + virtual void UnregisterObserver( MMailboxContentObserver& aObserver ) = 0; }; diff -r b5fbb9b25d57 -r 67369d1b217f email_plat/email_client_api/inc/mmailboxcontentobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_plat/email_client_api/inc/mmailboxcontentobserver.h Tue May 25 12:23:16 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Observer interface for mailbox events. +* +*/ + +#ifndef MMAILBOXCONTENTOBSERVER_H +#define MMAILBOXCONTENTOBSERVER_H + +#include + +namespace EmailInterface { + +class MMailboxContentObserver +{ +public: + virtual void NewMessageEventL( const TMailboxId& aMailbox, const REmailMessageIdArray aNewMessages, const TFolderId& aParentFolderId ) = 0; + + virtual void MessageChangedEventL( const TMailboxId& aMailbox, const REmailMessageIdArray aChangedMessages, const TFolderId& aParentFolderId ) = 0; + + virtual void MessageDeletedEventL( const TMailboxId& aMailbox, const REmailMessageIdArray aDeletedMessages, const TFolderId& aParentFolderId ) = 0; +}; + +} // namespace EmailInterface + +#endif // MMAILBOXCONTENTOBSERVER_H diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailclientapi/inc/emailmailbox.h --- a/emailservices/emailclientapi/inc/emailmailbox.h Tue May 11 15:57:15 2010 +0300 +++ b/emailservices/emailclientapi/inc/emailmailbox.h Tue May 25 12:23:16 2010 +0300 @@ -22,6 +22,7 @@ #include #include "mfsmaileventobserver.h" #include "mfsmailrequestobserver.h" +#include "mmailboxcontentobserver.h" using namespace EmailInterface; @@ -124,6 +125,7 @@ virtual void EventL(TFSMailEvent aEvent, TFSMailMsgId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 ); typedef void (CEmailMailbox::TObserverEventMapper::*TEventMapFunc)( TMailboxId, TAny*, TAny*, TAny* ); private: // mappers, so say we all! + void ConvertParamsL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, REmailMessageIdArray& aMessageIds, TFolderId& aFolderId ); void IgnoreEventL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 ); void NewMessageL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 ); void MessageChangedL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 ); diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailclientapi/src/emailmailbox.cpp --- a/emailservices/emailclientapi/src/emailmailbox.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailservices/emailclientapi/src/emailmailbox.cpp Tue May 25 12:23:16 2010 +0300 @@ -41,8 +41,6 @@ // Constants -_LIT( KNewLine, "\n" ); - // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -201,15 +199,21 @@ { case EInbox: fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSInbox ); + break; case EOutbox: fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSOutbox ); + break; case EDrafts: fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSDraftsFolder ); + break; case EDeleted: fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSDeleted ); + break; case ESent: fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSSentFolder ); + break; case EOther: + break; default: User::Leave( KErrNotFound ); break; @@ -286,13 +290,27 @@ // ----------------------------------------------------------------------------- MEmailMessage* CEmailMailbox::CreateForwardMessageL( const TMessageId& aMessageId ) const { + // create temp header descriptor + TReplyForwardParams params; + params.iHeader = HBufC::NewLC(1); + params.iHeader->Des().Copy(KNullDesC()); + params.iSmartTag = HBufC::NewLC(1); + params.iSmartTag->Des().Copy(KNullDesC()); + TPckgBuf buf( params ); + HBufC* temp = HBufC::NewLC( buf.Length() ); + temp->Des().Copy( buf ); + CFSMailMessage* fsMessage = iFsMailbox->CreateForwardMessage( - FsMsgId( iPluginData, aMessageId ), KNewLine() ); + FsMsgId( iPluginData, aMessageId ), *temp ); User::LeaveIfNull( fsMessage ); CleanupStack::PushL( fsMessage ); MEmailMessage* message = CEmailMessage::NewL( iPluginData, fsMessage, EClientOwns ); CleanupStack::Pop(); // fsMessage - + + CleanupStack::PopAndDestroy( temp ); + CleanupStack::PopAndDestroy( params.iSmartTag ); + CleanupStack::PopAndDestroy( params.iHeader ); + return message; } @@ -448,6 +466,7 @@ &CEmailMailbox::TObserverEventMapper::IgnoreEventL, &CEmailMailbox::TObserverEventMapper::IgnoreEventL, &CEmailMailbox::TObserverEventMapper::IgnoreEventL, + &CEmailMailbox::TObserverEventMapper::IgnoreEventL, &CEmailMailbox::TObserverEventMapper::NewMessageL, &CEmailMailbox::TObserverEventMapper::MessageChangedL, &CEmailMailbox::TObserverEventMapper::MessageDeletedL, @@ -471,24 +490,68 @@ } } +void CEmailMailbox::TObserverEventMapper::ConvertParamsL( TMailboxId aMailbox, TAny* aParam1, + TAny* aParam2, REmailMessageIdArray& aMessageIds, TFolderId& aFolderId ) + { + RArray* newEntries( static_cast< RArray* >( aParam1 ) ); + CleanupClosePushL( *newEntries ); + TFSMailMsgId* parentFolder = static_cast( aParam2 ); + aFolderId = TFolderId( parentFolder->Id(), aMailbox ); + + for (TInt j = 0; j < newEntries->Count(); j++ ) + { + TFSMailMsgId fsId(( *newEntries )[j]); + TMessageId messageId( fsId.Id(), aFolderId.iId, aMailbox); + aMessageIds.Append(messageId); + } + + CleanupStack::PopAndDestroy( newEntries ); + } + void CEmailMailbox::TObserverEventMapper::IgnoreEventL( TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ ) { } void CEmailMailbox::TObserverEventMapper::NewMessageL( - TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ ) - { + TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* /*aParam3*/ ) + { + REmailMessageIdArray messageIds; + TFolderId folderId; + ConvertParamsL( aMailbox, aParam1, aParam2, messageIds, folderId ); + for ( TInt i = 0; i < iClientObservers.Count(); i++ ) + { + MMailboxContentObserver* observer = iClientObservers[i]; + observer->NewMessageEventL( aMailbox, messageIds, folderId ); + } } void CEmailMailbox::TObserverEventMapper::MessageChangedL( - TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ ) + TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* /*aParam3*/ ) { + REmailMessageIdArray messageIds; + TFolderId folderId; + ConvertParamsL( aMailbox, aParam1, aParam2, messageIds, folderId ); + + for ( TInt i = 0; i < iClientObservers.Count(); i++ ) + { + MMailboxContentObserver* observer = iClientObservers[i]; + observer->MessageChangedEventL( aMailbox, messageIds, folderId ); + } } void CEmailMailbox::TObserverEventMapper::MessageDeletedL( - TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ ) + TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* /*aParam3*/ ) { + REmailMessageIdArray messageIds; + TFolderId folderId; + ConvertParamsL( aMailbox, aParam1, aParam2, messageIds, folderId ); + + for ( TInt i = 0; i < iClientObservers.Count(); i++ ) + { + MMailboxContentObserver* observer = iClientObservers[i]; + observer->MessageDeletedEventL( aMailbox, messageIds, folderId ); + } } void CEmailMailbox::TObserverEventMapper::MessageMoved( diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailframework/commonlib/group/bld.inf --- a/emailservices/emailframework/commonlib/group/bld.inf Tue May 11 15:57:15 2010 +0300 +++ b/emailservices/emailframework/commonlib/group/bld.inf Tue May 25 12:23:16 2010 +0300 @@ -28,6 +28,7 @@ ../inc/cfsmailmessagepart.h |../../../../inc/cfsmailmessagepart.h ../inc/cfsmailaddress.h |../../../../inc/cfsmailaddress.h ../inc/cemailextensionbase.h |../../../../inc/cemailextensionbase.h +../inc/emailextensionuids.hrh |../../../../inc/emailextensionuids.hrh ../inc/cmrcalendarinfo.h |../../../../inc/cmrcalendarinfo.h ../inc/cmailmessageext.h |../../../../inc/cmailmessageext.h ../inc/cmailboxstateext.h |../../../../inc/cmailboxstateext.h diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailframework/commonlib/inc/cmailboxstateext.h --- a/emailservices/emailframework/commonlib/inc/cmailboxstateext.h Tue May 11 15:57:15 2010 +0300 +++ b/emailservices/emailframework/commonlib/inc/cmailboxstateext.h Tue May 25 12:23:16 2010 +0300 @@ -19,10 +19,10 @@ #define CMAILBOXSTATEEXT_H #include "cemailextensionbase.h" +#include "emailextensionuids.hrh" #include "cfsmailcommon.h" // interface UID value passed to CFSMailClient::ExtensionL -const TUid KEmailMailboxStateExtensionUid = { 0x2001E28B }; /** * Data providider interface. diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailframework/commonlib/inc/emailextensionuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailframework/commonlib/inc/emailextensionuids.hrh Tue May 25 12:23:16 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description : Common email extension uid definitions +* Version : %version: 1 % +* +*/ + + +#ifndef EMAILEXTENSIONUIDS_HRH +#define EMAILEXTENSIONUIDS_HRH + +// interface UID value passed to CFSMailClient::ExtensionL +const TUid KEmailMailboxStateExtensionUid = { 0x2001E28B }; +const TUid KEmailSettingExtensionUid = { 0x2001E289 }; + +#endif // EMAILEXTENSIONUIDS_HRH diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailframework/commonlib/src/CFSMailBox.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailBox.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailservices/emailframework/commonlib/src/CFSMailBox.cpp Tue May 25 12:23:16 2010 +0300 @@ -21,6 +21,7 @@ #include "cfsmailplugin.h" #include "cmrcalendarinfoimpl.h" +#include "emailextensionuids.hrh" #include "cfsmailbox.h" #include "cfsmailrequestobserver.h" @@ -844,8 +845,20 @@ // exists. It is released in desctrucor if( aExtension->Uid() != KMailboxExtMrCalInfo ) { - // no specialized behaviour, call base class - CExtendableEmail::ReleaseExtension( aExtension ); + if( aExtension->Uid() == KEmailSettingExtensionUid ) + { + // check that plugin supports requested extension. + if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) + { + // remove extension from plugin + plugin->ReleaseExtension(aExtension); + } + } + else + { + // no specialized behaviour, call base class + CExtendableEmail::ReleaseExtension( aExtension ); + } } else { @@ -874,7 +887,8 @@ CleanupStack::Pop(); // calInfo } } - else if ( aInterfaceUid == KEmailMailboxStateExtensionUid ) + else if ( aInterfaceUid == KEmailMailboxStateExtensionUid || + aInterfaceUid == KEmailSettingExtensionUid ) { if ( !extension ) { diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailframework/data/fsmailbrandmanager.rss --- a/emailservices/emailframework/data/fsmailbrandmanager.rss Tue May 11 15:57:15 2010 +0300 +++ b/emailservices/emailframework/data/fsmailbrandmanager.rss Tue May 25 12:23:16 2010 +0300 @@ -466,35 +466,7 @@ red = 0xff; green = 0x30; blue = 0x20; alpha = 0xff; } }; }, - - BRAND { - // Definition of Verizon Yahoo! Mail brand - graphics_file_path = APP_BITMAP_DIR"\\yahoo_brand_graphics.mif"; - brand_id_match_strings = - { - BRAND_MATCH_STRING { text = "verizon.net"; } - }; - - graphics = - { - BRANDABLE_GRAPHIC { id = EFSMailboxIcon; - icon_id = EMbmYahoo_brand_graphicsYahoo; - mask_id = EMbmYahoo_brand_graphicsYahoo_mask; } - }; - - texts = - { - BRANDABLE_TEXT { id = EFSMailboxName; text = "Verizon Yahoo! Mail"; } - }; - - colors = - { - BRANDABLE_COLOR { id = EFSMailboxNameColor; - red = 0xff; green = 0x30; blue = 0x20; alpha = 0xff; } - }; - }, - BRAND { // Definition of Yahoo!Xtra Mail brand graphics_file_path = APP_BITMAP_DIR"\\yahoo_brand_graphics.mif"; diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h Tue May 11 15:57:15 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h Tue May 25 12:23:16 2010 +0300 @@ -434,6 +434,8 @@ */ CMailPluginProxy* GetExtPluginL( const TDesC& aContentId ); + TBool BackupOrRestoreMode(); + private: // data CEikonEnv* iEnv; // pointer to liw wrapper that handles actual publishing diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp Tue May 25 12:23:16 2010 +0300 @@ -26,7 +26,8 @@ #include #include #include - +#include +#include #include // CleanupResetAndDestroyPushL #include "emailtrace.h" @@ -334,7 +335,11 @@ { TBuf cid; iSettings->GetContentId( aMailbox.Id(), i + 1, cid ); - iLiwIf->SetUpdateNeeded( iLiwIf->GetWidgetInstanceId( cid ), ETrue ); + TInt widgetInstance = iLiwIf->GetWidgetInstanceId( cid ); + if ( widgetInstance != KErrNotFound ) + { + iLiwIf->SetUpdateNeeded( widgetInstance, ETrue ); + } } } @@ -839,7 +844,12 @@ { FUNC_LOG; - // Is the mailbox in our list + // If backup or restore is ongoing ignore all events + if ( BackupOrRestoreMode() ) + { + return; + } + switch ( aEvent ) { case TFSEventNewMailbox: @@ -1943,4 +1953,42 @@ iQuery->ShowNoteL(EAknGlobalConfirmationNote, str->Des()); CleanupStack::PopAndDestroy( str ); } + +// ---------------------------------------------------------------------------- +// CMailCpsHandler::BackupOrRestoreMode() +// Check if phone is in backup/restore mode +// ---------------------------------------------------------------------------- +// +TBool CMailCpsHandler::BackupOrRestoreMode() + { + FUNC_LOG; + TBool backupOrRestore = EFalse; + + // Get the back-up restore key, return EFalse if we can't get the key + TInt keyVal = 0; + const TInt error = RProperty::Get( KUidSystemCategory, conn::KUidBackupRestoreKey, keyVal ); + if( error == KErrNone ) + { + const conn::TBURPartType partType = + static_cast< conn::TBURPartType >( keyVal & conn::KBURPartTypeMask ); + + if ( keyVal != 0 ) + { + switch( partType ) + { + case conn::EBURBackupFull: + case conn::EBURBackupPartial: + case conn::EBURRestoreFull: + case conn::EBURRestorePartial: + backupOrRestore = ETrue; + break; + case conn::EBURUnset: + case conn::EBURNormal: + default: + break; + } + } + } + return backupOrRestore; + } diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp Tue May 25 12:23:16 2010 +0300 @@ -117,8 +117,17 @@ // --------------------------------------------------------------------------- // CMailCpsSettings::LoadSettingsL +// +// synchronizes the iMailboxArray with Central repository settings +// only existing mailboxes are synchronized +// usecases +// 1. delete widget from homesceen - removed item from cenrep array +// 2. add widget to homescreen - added item to the end of cenrep array +// 3. change mailbox for widget - changed value of cenrep array item +// 4. remove mailbox from server - mailbox absence for array item +// 5. add mailbox to the server (leads to widget adding) // --------------------------------------------------------------------------- -// + void CMailCpsSettings::LoadSettingsL() { FUNC_LOG; @@ -136,12 +145,13 @@ GetMailboxNonZeroKeysL( keys ); TInt dMax( keys.Count() ); - cenrepMailboxes.ReserveL( dMax ); - cenrepMailboxesExistence.ReserveL( dMax ); + cenrepMailboxes.ReserveL( dMax ); // cenrep mailbox ids array + cenrepMailboxesExistence.ReserveL( dMax ); // auxiliary if it was found in iMailboxArray looping - // make array of mailbox keys + // initialize array of mailbox keys TInt value( 0 ); - TInt i; + TInt i; // main loop + TInt j; // auxiliary / inner loop for ( i = 0; i < dMax; i++ ) { User::LeaveIfError( ret = iCenRep->Get( keys[i], value )); @@ -151,73 +161,135 @@ CleanupStack::PopAndDestroy(&keys); // Sync array of cenrep keys with iMailboxArray - // remove from array what is not in cenrep + // 1. remove from iMailboxArray what is not in cenrep, mark what is. Distinct existence. + // 2. remove mailbox ids not detected on the server TInt dFound( KErrNotFound ); - for ( i = iMailboxArray.Count()-1; i >= 0; i -- ) + for ( i = iMailboxArray.Count()-1; i >= 0; i -- ) // iArray loop { dFound = cenrepMailboxes.Find( iMailboxArray[i].Id() ); - if ( KErrNotFound != dFound ) + if ( KErrNotFound != dFound ) // if found in cenrep { - // mailbox is in iMailboxArray and in cenrep => check provider + // mailbox is in iMailboxArray and in cenrep => check provider INFO_1("Mailbox both in cenrep and iMailboxArray: i = %d ", i ); - ret = CheckMailboxExistence( iMailboxArray[i] ); - if ( KErrNotFound == ret) - { - // mailbox was removed from provider => remove from cenrep also - // cenrepMailboxes indexed the same way as keys => finding key not needed - ret = iCenRep->Reset( KCMailMailboxIdBase + i ); - ret = iCenRep->Reset( KCMailPluginIdBase + i ); - ret = iCenRep->Reset( KCMailWidgetContentIdBase + i ); - INFO_1("Mailbox removed from cenrep: dFound %d ", dFound ); - } - else - { - User::LeaveIfError(ret); // for instance if no memory - INFO_1("Mailbox provider check ok: dFound = %d ", dFound ); - } - cenrepMailboxesExistence[dFound] = ETrue; // not remove to ensure indexes are the same as in keys + if ( ! cenrepMailboxesExistence[dFound] ) + { + ret = CheckMailboxExistence( iMailboxArray[i] ); + if ( KErrNotFound == ret) + { + // mailbox was removed from provider => remove from cenrep also + // cenrepMailboxes indexed the same way as keys => finding key not needed + ret = iCenRep->Reset( KCMailMailboxIdBase + i ); + ret = iCenRep->Reset( KCMailPluginIdBase + i ); + ret = iCenRep->Reset( KCMailWidgetContentIdBase + i ); + INFO_1("Mailbox removed from cenrep: dFound %d ", dFound ); + // remove also from all arrays + iMailboxArray.Remove(i); + cenrepMailboxes.Remove( dFound ); + cenrepMailboxesExistence.Remove( dFound ); + dMax--; + } + else + { + User::LeaveIfError(ret); // for instance if no memory + INFO_1("Mailbox provider check ok: dFound = %d ", dFound ); + cenrepMailboxesExistence[dFound] = ETrue; // not remove to ensure indexes are the same as in keys + // handle also possible mailbox duplications + for (j = dFound+1; j remove from array + // mailbox was removed from cenrep => remove from iArray as well iMailboxArray.Remove(i); INFO_1("Mailbox removed from iMailboxArray: i = %d ", i ); } - } - // Check order and new mailboxes - TInt j(0); + } // iArray loop + + // Add mailboxes existing only in cenrep to iMailboxArray in correct order + // or check and correct order of mailboxes (swap already dot checked, copy duplicated) for ( i = 0; i < dMax; i++ ) { - // new mailboxes in cenrep needs to be added to iMailboxArray + // firstly new mailboxes in cenrep needs to be added to iMailboxArray if ( ! cenrepMailboxesExistence[i] ) { TFSMailMsgId mailbox; - // Find mailbox by this function because cenrep does not hold pluginID + // Find mailbox by this unefficient function because cenrep does not hold pluginID if ( KErrNone == ResolveMailbox( cenrepMailboxes[i], mailbox ) ) { - iMailboxArray.Insert( mailbox, i ); + iMailboxArray.InsertL( mailbox, i ); INFO_1("Mailbox added to iMailboxArray: i = %d ", i ); + // ensured iMailboxArray[i].Id() == cenrepMailboxes[i] } - } - // Check if order is OK - if ( iMailboxArray[i].Id() != cenrepMailboxes[i] ) - { - TInt jMax( iMailboxArray.Count() ); - for ( j = i+1; j <= jMax; j++ ) + else // KErrNotFound { - if ( iMailboxArray[j].Id() == cenrepMailboxes[i]) - { - iMailboxArray.Insert( iMailboxArray[j], i ); - iMailboxArray.Remove( j+1 );// insertion increased indices - break; + // remove not valid mailbox from cenrep arrays + cenrepMailboxes.Remove( i ); + cenrepMailboxesExistence.Remove( i ); + // remove from cenrep + ret = iCenRep->Reset( KCMailMailboxIdBase + i ); + ret = iCenRep->Reset( KCMailPluginIdBase + i ); + ret = iCenRep->Reset( KCMailWidgetContentIdBase + i ); + INFO_1("Mailbox removed from cenrep: i = %d ", i ); + // update loop control expression + dMax--; + i--; + } + continue; // ensured equation or removed item + } // end of if mailbox not in cenrep + + // Check if iMailboxArray is in correct order on i position + TInt jMax( iMailboxArray.Count() ); + j = i; // assume iMailboxArray[i].Id() == cenrepMailboxes[i] + if ( ( i < jMax ) && ( iMailboxArray[i].Id() != cenrepMailboxes[i] ) ) + { // not in correct order try to swap + for ( j = i+1; j < jMax; j++ ) + { + if ( iMailboxArray[j].Id() == cenrepMailboxes[i] ) + { // swap is better from efficiency point of view + TFSMailMsgId tmp( iMailboxArray[i] ); + iMailboxArray[i] = iMailboxArray[j]; + iMailboxArray[j] = tmp; + break; // j < jMax here } } - if (j == jMax) // arrays not in sync error + // as previous code does not detect existence of repeating id occurence + // the loop may not find the repeated mailbox id - then j=jMax + } + // if cenrep has multiplied mailbox widgets then add them + if ( j >= jMax ) // swapping did not help or item is missing + { + // if i=j=jMax then missing duplicated iArray element + // if j>i then iArray contains not used element + // two widgets shows the same mailbox then take already used iMailboxArray value + dFound = cenrepMailboxes.Find( cenrepMailboxes[i] ); + if ( dFound < i ) { + // the arrays are synchronized below up to i, duplication to correct i place + iMailboxArray.InsertL( iMailboxArray[dFound], i ); + } + else + { + // unable to synchronize the arrays - algorithm is wrong + INFO_1("CMAIL: CMailCpsSettings::LoadSettingsL() : FATAL ALGORITHM ERROR - ARRAY NOT SYNCHRONIZED i = %d ", i ); User::Leave( KErrNotFound ); } - } + } // end of j >= jMax + + } // end check order for i = 0..dMax loop + + // if iMailboxArray has more items than cenrepMailboxes then remove these items + for( i = iMailboxArray.Count()-1; i >= dMax; i-- ) + { + iMailboxArray.Remove(i); } + CleanupStack::PopAndDestroy(&cenrepMailboxesExistence); CleanupStack::PopAndDestroy(&cenrepMailboxes); } diff -r b5fbb9b25d57 -r 67369d1b217f emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp --- a/emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp Tue May 25 12:23:16 2010 +0300 @@ -83,7 +83,6 @@ iSequenceNumber = aMrInfo.MRSequenceNumberL(); iPriority = aMrInfo.PriorityL(); - iOrganizer = CBaseMrAttendee::NewL(); iOrganizer = CBaseMrAttendee::NewL( aMrInfo.MROrganizerL() ); RPointerArray& attendees = aMrInfo.AttendeesL(); diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/data/FreestyleEmailUi.rss --- a/emailuis/emailui/data/FreestyleEmailUi.rss Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/data/FreestyleEmailUi.rss Tue May 25 12:23:16 2010 +0300 @@ -1939,7 +1939,6 @@ { items = { - MENU_ITEM { command = EFsEmailUiCmdSelect; txt = text_softkey_select; }, MENU_ITEM { command = EFsEmailUiCmdHelp; txt = qtn_options_help; }, MENU_ITEM { command = EFsEmailUiCmdExit; txt = qtn_options_exit; } }; diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/group/FreestyleEmailUi.mmp --- a/emailuis/emailui/group/FreestyleEmailUi.mmp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/group/FreestyleEmailUi.mmp Tue May 25 12:23:16 2010 +0300 @@ -112,6 +112,7 @@ SOURCE OverlayControl.cpp SOURCE FSHtmlReloadAO.cpp SOURCE fsemailstatuspaneindicatorhandler.cpp +SOURCE FSAsyncTextFormatter.cpp SOURCEPATH ../group diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/inc/FSAsyncTextFormatter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/emailui/inc/FSAsyncTextFormatter.h Tue May 25 12:23:16 2010 +0300 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Declaration of asynchronous text formatter. +* +*/ + +#ifndef _CFSASYNCTEXTFORMATTER_H_ +#define _CFSASYNCTEXTFORMATTER_H_ + +#include + +class CTextLayout; + +/** + * Observer for informing about active object status. + */ +class MAsyncTextFormatterObserver + { +public: + + /** + * Called when text formatting is complete. + */ + virtual void FormatAllTextComplete() = 0; + + /** + * Called when text formatting was cancelled. + */ + virtual void FormatAllTextCancelled() = 0; + }; + +/** + * Asynchronous formatter of text from CTextLayout class. + */ +class CFSAsyncTextFormatter : public CActive + { +public: + + /** + * NewL for two phase construction. + */ + static CFSAsyncTextFormatter* NewL(); + + /** + * Destructor. + */ + virtual ~CFSAsyncTextFormatter(); + + /** + * Starts active object (formatting). + * @param aTextLayout pointer to text layout which content needs to be + * formatted + * @param aObserver observer which will be informed when formatting + * finished or cancelled + */ + void StartFormatting( CTextLayout* aTextLayout, + MAsyncTextFormatterObserver* aObserver ); + +private: + + /** + * constructor. + */ + CFSAsyncTextFormatter(); + + /** + * 2nd phase constructor can leave. + */ + void ConstructL(); + +protected: // From CActive + + /** + * From base class CActive + * Handles an active object's request completion event. + */ + void RunL(); + + /** + * From base class CActive + * Implements cancellation of an outstanding request. + */ + void DoCancel(); + +private: + + /** + * Current position of formatted part of document. + */ + TInt iCurrentDocPos; + + /** + * Observer which will be informed when formatting finished. + * Not own. + */ + MAsyncTextFormatterObserver* iObserver; + + /** + * Text layout which contains text to be formatted. + * Not own. + */ + CTextLayout* iTextLayout; + }; + +#endif /* _CFSASYNCTEXTFORMATTER_H_ */ diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/inc/FreestyleEmailUiAppui.h --- a/emailuis/emailui/inc/FreestyleEmailUiAppui.h Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiAppui.h Tue May 25 12:23:16 2010 +0300 @@ -450,11 +450,9 @@ TInt ViewLoadIdleCallbackFunctionL(); /** - * Sets the manual mailbox syncronisation/connection flag if the - * user chose to synchorise/connect mail boxes from the menu + * Sets the manual mailbox connection flag if the + * user chose to connect mail boxes from the menu */ - void ManualMailBoxSync( TBool aManualMailBoxSync ); - void ManualMailBoxSyncAll( TBool aManualMailBoxSyncAll ); void ManualMailBoxConnectAll( TBool aManualMailBoxConnectAll ); void ManualMailBoxDisconnectAll( TBool aManualMailBoxConnectAll ); @@ -502,6 +500,11 @@ // returns last seen pointer position const TPoint& LastSeenPointerPosition() const; + // Runs fake sync animation (needed for better user experience as + // otherwise in some connection/sync states pressing "send & receive" + // wouldn't have any visible effect. + void RunFakeSyncAnimL(); + public: //from MFSMailEventObserver /** * Framework event message. @@ -771,9 +774,7 @@ // For feature manager TBool iFeatureManagerInitialized; - //ETrue if user started the sync/connect all - TBool iManualMailBoxSync; - TBool iManualMailBoxSyncAll; + // ETrue if user started the connect all TBool iManualMailBoxConnectAll; TBool iManualMailBoxDisconnectAll; @@ -810,6 +811,7 @@ CCustomStatuspaneIndicators* iStatusPaneIndicators; TBool iConnectionStatusVisible; CFSEmailUiGenericTimer* iConnectionStatusIconAnimTimer; + CFSEmailUiGenericTimer* iFakeSyncAnimStopTimer; CFbsBitmap* iConnectionIconBitmap; CFbsBitmap* iConnectionIconMask; TInt iConnectionStatusIconAngle; diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h --- a/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h Tue May 25 12:23:16 2010 +0300 @@ -166,6 +166,8 @@ void OperationCompleted( TIcalViewerOperationResult aResult ); void OperationError( TIcalViewerOperationResult aResult ); + void FadeOut(TBool aDirectionOut); + private: // from /** * @see CFsEmailUiViewBase::ChildDoActivateL diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/inc/FreestyleEmailUiLauncherGridVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiLauncherGridVisualiser.h Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiLauncherGridVisualiser.h Tue May 25 12:23:16 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-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" @@ -21,17 +21,13 @@ #define __FREESTYLEEMAILUI_MAINGRIDUIVISUALISER_H__ // SYSTEM INCLUDE FILES -// SF #include -// -// for AIW handling #include -// #include #include #include #include -// +#include // INTERNAL INCLUDE FILES #include "FreestyleEmailUiViewBase.h" @@ -47,7 +43,7 @@ class CFsAlfScrollbarLayout; class CAknStylusPopUpMenu; class CCoeControl; - +class CAknPhysics; class TFSLauncherGridMailboxStatus { @@ -65,7 +61,8 @@ public MFSEmailLauncherItemObserver, public MEikScrollBarObserver, public MFSEmailUiMailboxDeleteObserver, - public MFSEmailUiGenericTimerCallback + public MFSEmailUiGenericTimerCallback, + public MAknPhysicsObserver { public: enum TDirection @@ -162,7 +159,7 @@ void SetRefreshNeeded(); // // Handling of foreground events - void HandleForegroundEventL(); + void HandleForegroundEventL( TBool aForeground ); /** * From MEikScrollBarObserver @@ -214,6 +211,23 @@ void MailboxDeletionComplete(); +private: // from MAknPhysicsObserver + + /** + * @see MAknPhysicsObserver::ViewPositionChanged + */ + virtual void ViewPositionChanged( const TPoint& aNewPosition, + TBool aDrawNow, TUint aFlags ); + + /** + * @see MAknPhysicsObserver::PhysicEmulationEnded + */ + virtual void PhysicEmulationEnded(); + + /** + * @see MAknPhysicsObserver::ViewPosition + */ + virtual TPoint ViewPosition() const; private: // New methods. @@ -324,6 +338,7 @@ void DetachSelectorMappingFunctions(); void UpdateFocusVisibility(); + void UpdatePhysicsL(); private: // data CAlfEnv& iEnv; @@ -422,6 +437,16 @@ // Timer to postpone the Drawing CFSEmailUiGenericTimer* iStartupCallbackTimer; - }; + + CAknPhysics* iPhysics; + TBool iPointerAction; + TBool iIsDragging; + TPoint iPreviousPosition; + TPoint iOriginalPosition; + TTime iStartTime; + TBool iScrolled; + TInt iTotalDragging; + TBool iLaunchWizardExecuted; // prevents reentrant Wizard calling + }; // class CFSEmailUiLauncherGridVisualiser #endif // __FREESTYLEEMAILUI_MAINGRIDUIVISUALISER_H__ diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h Tue May 25 12:23:16 2010 +0300 @@ -445,6 +445,10 @@ // Creates CMailboxStateExtension with this class set as dataprovider void CreateExtensionL(); + + // check from settings if manual or auto sync + TBool CheckAutoSyncSettingL(); + private: // from /** @@ -455,7 +459,7 @@ const TDesC8& aCustomMessage ); void ChildDoDeactivate(); void GetParentLayoutsL( RPointerArray& aLayoutArray ) const; - + TFSEmailUiTextures GetSortButtonTextureIndex(); void FadeOut(TBool aDirectionOut); /** diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h Tue May 25 12:23:16 2010 +0300 @@ -105,6 +105,7 @@ // Dynamic variant switch, called by appui void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ); void GetParentLayoutsL( RPointerArray& aLayoutArray ) const; + void FadeOut(TBool aDirectionOut); // Navigation functions, used mainly from viewer TBool IsNextMsgAvailable( TFSMailMsgId aCurrentMsgId, TFSMailMsgId& aFoundNextMsgId, TFSMailMsgId& aFoundNextMsgFolder ) const; diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/inc/FreestyleEmailUiTextureManager.h --- a/emailuis/emailui/inc/FreestyleEmailUiTextureManager.h Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/inc/FreestyleEmailUiTextureManager.h Tue May 25 12:23:16 2010 +0300 @@ -159,6 +159,20 @@ EFolderListServerFoldersTexturePopup, EFolderListEmailAccountTexturePopup, // SORT LIST ICONS + ESortListAttachmentAscTexturePopup, + ESortListAttachmentDescTexturePopup, + ESortListDateAscTexturePopup, + ESortListDateDescTexturePopup, + ESortListFollowAscTexturePopup, + ESortListFollowDescTexturePopup, + ESortListPriorityAscTexturePopup, + ESortListPriorityDescTexturePopup, + ESortListSenderAscTexturePopup, + ESortListSenderDescTexturePopup, + ESortListSubjectAscTexturePopup, + ESortListSubjectDescTexturePopup, + ESortListUnreadAscTexturePopup, + ESortListUnreadDescTexturePopup, ESortListAttachmentAscTexture, ESortListAttachmentDescTexture, ESortListDateAscTexture, @@ -242,6 +256,8 @@ CAlfTexture& WatermarkBackgroundForThisResolutionL(); // Get any texture by ID CAlfTexture& TextureByIndex( TFSEmailUiTextures aIndex ); + // Clear any texture by ID + void ClearTextureByIndex( TFSEmailUiTextures aIndex ); // Get new skinned selector brush object for gen ui list. // Ownership is NOT transferred to caller. CAlfFrameBrush* ListSelectorBrushL(); diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/inc/ceuiexitguardian.h --- a/emailuis/emailui/inc/ceuiexitguardian.h Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/inc/ceuiexitguardian.h Tue May 25 12:23:16 2010 +0300 @@ -22,8 +22,6 @@ // FORWARD DECLARATIONS class CFreestyleEmailUiAppUi; -class CIdle; - /** * Application exit guardian for email UI. This is needed because some routines * in email framework create nested scheduler loops to hide asynchronity in @@ -31,21 +29,11 @@ * as resources are freed while they are still being used on other recursion * levels. * - * Usage: - * - * void CClass::RoutineThatMayCreatedNestedLevelL() - * { - * iExitGuardian->EnterLC(); - * // call or execute code that may create nested sceduler loop - * ... - * // and finally popup and destroy cleanup item - * CleanupStack::PopAndDestroy(); // iExitGuardian->EnterLC() - * } * * @since S60 5.1 */ class CEUiExitGuardian : public CBase - { + { public: @@ -60,13 +48,6 @@ */ ~CEUiExitGuardian(); - /** - * Called before executing code that may cause new nested level in - * active scheduler. Leaves cleanup item in cleanup stack and this item - * must be purged by the caller after code execution. Cleanup item is used - * to make level counter leavesafe. - */ - void EnterLC(); /** * Called by the application to inform that application is ready to @@ -76,51 +57,29 @@ * @return KRequestPending if the exit execution is delayed because of * nesting, KErrNone otherwise. */ - TInt ExitApplication(); + TInt TryExitApplication(); private: - /** * Constructor. */ - CEUiExitGuardian(CFreestyleEmailUiAppUi& aAppUi); + CEUiExitGuardian( CFreestyleEmailUiAppUi& aAppUi ); /** * Pass 2 constructor, may leave. */ - void ConstructL(); - - /** - * Static exit method that is given to cleanup item. - */ - static void Exit(TAny* aPtr); - - /** - * Non static exit method that is called from static Exit. - */ - void DoExit(); + void ConstructL(); /** - * Static callback method for CIdle. This is run when recursion is rewinded - * and appication can be closed. + * Static callback method for CPeriodic. */ - static TInt IdleCallBack(TAny* aPtr); + static TInt PeriodicCallBack( TAny* aPtr ); private: - // Reference to application UI CFreestyleEmailUiAppUi& iAppUi; - - // Recursion depth (nested level count) - TInt iEnterCount; - - // ETrue if the application is ready to exit. - TBool iExitPending; - - // Idle class instance to rewind final level of recursion before calling the - // exit - CIdle* iIdle; - + TBool iPeriodicTimerStarted; + CPeriodic* iPeriodicTimer; }; #endif // C_EUIEXITGUARDIAN_H diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/inc/ncscomposeview.h --- a/emailuis/emailui/inc/ncscomposeview.h Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/inc/ncscomposeview.h Tue May 25 12:23:16 2010 +0300 @@ -213,6 +213,16 @@ void HandleContainerChangeRequiringToolbarRefresh(); + /** + * Callback method for setting body content in asynchronous way. + */ + void SetBodyContentComplete(); + + /** + * Checks if "Opening" wait note is visible. + */ + TBool IsOpeningWaitNoteVisible(); + protected: void ProcessCommandL( TInt aCommand ); @@ -373,6 +383,15 @@ * in front of any quote or signature */ void IncludeMessageTextL( TBool aEnsureSpaceInBegin = EFalse ); + + /** + * Async version of IncludeMessageTextL. + * Inits body text async when forwarding, replying message. + * @param aEnsureEmptyLineInBegin When true, the function ensures there's empty lines + * in the beginning of the message. I.e. line break(s) + * are inserted in front of any quote or signature + */ + void IncludeMessageTextAsyncL( TBool aEnsureSpaceInBegin = EFalse ); /** * SetPriority @@ -669,6 +688,32 @@ // Flag to indicate whether message has been modified. TBool iMessageModified; + + /** + * Flag indicating async way of inluding message body text. + */ + TBool iIncludeMessageTextAsync; + + /** + * Buffer for text of message's body. + * Own. + */ + HBufC* iBody; + + /** + * Flag indicating that view was fully activated. + */ + TBool iViewFullyActivated; + + /** + * Flag indicating that "Opening" wait note is visible. + */ + TBool iOpeningWaitNoteVisible; + + /** + * "Opening" wait dialog. + */ + CAknWaitDialog* iOpeningWaitDialog; }; /** diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/inc/ncscomposeviewcontainer.h --- a/emailuis/emailui/inc/ncscomposeviewcontainer.h Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/inc/ncscomposeviewcontainer.h Tue May 25 12:23:16 2010 +0300 @@ -30,6 +30,7 @@ #include "FreestyleEmailUiContactHandlerObserver.h" #include "FreestyleEmailUi.hrh" #include +#include "FSAsyncTextFormatter.h" class CAknPhysics; class CNcsEditor; @@ -59,7 +60,8 @@ public MAknLongTapDetectorCallBack, public MEikEdwinObserver, public MEikEdwinSizeObserver, - public MAknPhysicsObserver + public MAknPhysicsObserver, + public MAsyncTextFormatterObserver { public: @@ -380,6 +382,13 @@ * @parem aReadOnlyQuote Contents of read-only quote field. */ void SetBodyContentL( const TDesC& aMessage, const TDesC& aReadOnlyQuote ); + + /** + * Set the contents of the message body in asnchronous way. + * @param aMessage Contents of MESSAGE-field. + * @param aReadOnlyQuote Contents of read-only quote field. + */ + void SetBodyContentAsyncL( const TDesC& aMessage, const TDesC& aReadOnlyQuote ); /** * Get the contents of message body. The message body consists of @@ -502,7 +511,24 @@ * @param aTargetPos Scrolls display to given position */ void Scroll( TInt aTargetPos, TBool aDrawNow = ETrue ); - + + /** + * Stopping asynchronous text formatting of message body. + */ + void StopAsyncTextFormatter(); + +public: // from MAsyncTextFormatterObserver + + /** + * Called when text formatting was cancelled. + */ + void FormatAllTextCancelled(); + + /** + * Called when text formatting is complete. + */ + void FormatAllTextComplete(); + public: // from CoeControl /** @@ -642,12 +668,8 @@ */ virtual TPoint ViewPosition() const; -private: +private: // data - void DoUpdateSubjectL(); - -private: // data - /** * header container */ @@ -740,6 +762,27 @@ TInt iTotalMoveY; TInt iSeparatorHeight; TInt iHeaderHeight; + + /** + * Flag for switching off text formatting. + */ + TBool iSwitchOffFormattingText; + + /** + * Currently processed field - needed by async text formatting. + */ + CNcsEditor* iProcessedField; + + /** + * Async text formatter. + * Own. + */ + CFSAsyncTextFormatter* iAsyncTextFormatter; + + /** + * Pane rect calculated during ChangeSize. + */ + TRect iCmailPaneRect; }; diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FSAsyncTextFormatter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/emailui/src/FSAsyncTextFormatter.cpp Tue May 25 12:23:16 2010 +0300 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Definition of asynchronous text formatter. +* +*/ + +#include "emailtrace.h" +#include "FSAsyncTextFormatter.h" +#include +#include + +const TUint KCharsFormattedPerRun = 2000; + +// --------------------------------------------------------------------------- +// CFSAsyncTextFormatter::CFSAsyncTextFormatter +// Constructor. +// --------------------------------------------------------------------------- +// +CFSAsyncTextFormatter::CFSAsyncTextFormatter() : CActive( EPriorityLow ) + { + FUNC_LOG; + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// CFSAsyncTextFormatter::~CFSAsyncTextFormatter +// Destructor. +// --------------------------------------------------------------------------- +// +CFSAsyncTextFormatter::~CFSAsyncTextFormatter() + { + FUNC_LOG; + Cancel(); + } + +// --------------------------------------------------------------------------- +// CFSAsyncTextFormatter::NewL +// Two-phased constructor. +// --------------------------------------------------------------------------- +// +CFSAsyncTextFormatter* CFSAsyncTextFormatter::NewL() + { + FUNC_LOG; + CFSAsyncTextFormatter* self = new (ELeave) CFSAsyncTextFormatter(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CFSAsyncTextFormatter::ConstructL +// Symbian 2nd phase constructor can leave. +// --------------------------------------------------------------------------- +// +void CFSAsyncTextFormatter::ConstructL() + { + FUNC_LOG; + iCurrentDocPos = 0; + } + +// --------------------------------------------------------------------------- +// CFSAsyncTextFormatter::FormatAll +// Starts formatting process. +// --------------------------------------------------------------------------- +// +void CFSAsyncTextFormatter::StartFormatting( CTextLayout* aTextLayout, + MAsyncTextFormatterObserver* aObserver ) + { + FUNC_LOG; + iTextLayout = aTextLayout; + iObserver = aObserver; + iCurrentDocPos = 0; + + if ( !IsActive() ) + { + TRequestStatus * status = &iStatus; + User::RequestComplete(status, 0); + SetActive(); + } + } + +// --------------------------------------------------------------------------- +// CFSAsyncTextFormatter::RunL +// Handles an active object's request completion event. +// --------------------------------------------------------------------------- +// +void CFSAsyncTextFormatter::RunL() + { + FUNC_LOG; + + if ( iCurrentDocPos < iTextLayout->DocumentLength() ) + { + iCurrentDocPos += KCharsFormattedPerRun; + if ( iCurrentDocPos > iTextLayout->DocumentLength() ) + { + iCurrentDocPos = iTextLayout->DocumentLength(); + } + iTextLayout->ExtendFormattingToCoverPosL( iCurrentDocPos ); + + // run again + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + SetActive(); + } + else + { + if ( iObserver ) + { + iObserver->FormatAllTextComplete(); + } + } + } + +// --------------------------------------------------------------------------- +// CFSAsyncTextFormatter::DoCancel +// Implements cancellation of an outstanding request. +// --------------------------------------------------------------------------- +// +void CFSAsyncTextFormatter::DoCancel() + { + FUNC_LOG; + if ( IsActive() && iObserver ) + { + iObserver->FormatAllTextCancelled(); + } + } diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp --- a/emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp Tue May 25 12:23:16 2010 +0300 @@ -829,21 +829,8 @@ // no close button pressed if (iStatus.Int() != EAknSoftkeyClose ) { - // open attachment list - if ( iPopupLaunchData.iMessagePartId.IsNullId() ) - { - TAttachmentListActivationData params; - params.iMailBoxId = iPopupLaunchData.iMailBoxId; - params.iFolderId = iPopupLaunchData.iFolderId; - params.iMessageId = iPopupLaunchData.iMessageId; - // use package buffer to pass the params - TPckgBuf buf( params ); - TUid emptyCustomMessageId = { 0 }; - CFreestyleEmailUiAppUi* appUi = (CFreestyleEmailUiAppUi*)CCoeEnv::Static()->AppUi(); - appUi->EnterFsEmailViewL( AttachmentMngrViewId, emptyCustomMessageId, buf ); - } // open attachment - else + if ( !iPopupLaunchData.iMessagePartId.IsNullId() ) { // Force FsEmailUI to foreground because global completion note may appear // while some other application is active and our local error notes are not shown diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiAppui.cpp --- a/emailuis/emailui/src/FreestyleEmailUiAppui.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiAppui.cpp Tue May 25 12:23:16 2010 +0300 @@ -38,6 +38,7 @@ #include "cfsmailmessage.h" #include "cfsmailaddress.h" #include "cfsmailcommon.h" +#include "cemailsettingsextension.h" // #include #include @@ -151,6 +152,7 @@ } const TUint KConnectionStatusIconRotationInterval = 100; +const TUint KFakeSyncAnimStopTimerInterval = 3000; // 3 secs const TInt KConnectionStatusIconRotationAmount = 18; // Length of the drive letter descriptor (e.g. "c:") const TInt KDriveDescLength = 2; @@ -584,6 +586,7 @@ // Create custom statuspane indicators object, which shows priority and followup flags CreateStatusPaneIndicatorsL(); iConnectionStatusIconAnimTimer = CFSEmailUiGenericTimer::NewL(this, CActive::EPriorityLow); + iFakeSyncAnimStopTimer = CFSEmailUiGenericTimer::NewL(this, CActive::EPriorityLow); // this includes a wait note where code running will be pending // until a certain callback event is received @@ -740,7 +743,7 @@ delete iNaviDecorator2MailViewer; delete iConnectionStatusIconAnimTimer; - + delete iFakeSyncAnimStopTimer; MTouchFeedback* touchFeedback( MTouchFeedback::Instance() ); if (touchFeedback && touchFeedback->TouchFeedbackSupported()) @@ -1132,7 +1135,7 @@ FUNC_LOG; TIMESTAMP ("Exiting from email application"); g_ApplicationExitOnGoing = ETrue; - if ( iExitGuardian->ExitApplication() == KRequestPending ) + if ( iExitGuardian->TryExitApplication() == KRequestPending ) { SendToBackground(); } @@ -1586,18 +1589,6 @@ } } -void CFreestyleEmailUiAppUi::ManualMailBoxSync( TBool aManualMailBoxSync ) - { - FUNC_LOG; - iManualMailBoxSync = aManualMailBoxSync; - } - -void CFreestyleEmailUiAppUi::ManualMailBoxSyncAll( TBool aManualMailBoxSyncAll ) - { - FUNC_LOG; - iManualMailBoxSyncAll = aManualMailBoxSyncAll; - } - void CFreestyleEmailUiAppUi::ManualMailBoxConnectAll( TBool aManualMailBoxConnectAll ) { FUNC_LOG; @@ -1822,7 +1813,21 @@ // Disabled if offline or roaming if ( aAutoSync ) { - StartMonitoringL(); + // check manual online setting + CEmailExtension* ext=NULL; + TBool manualSync = EFalse; + ext = iActiveMailbox->ExtensionL( KEmailSettingExtensionUid ); + if (ext) + { + CEmailSettingsExtension* extension = reinterpret_cast( ext ); + extension->SetMailBoxId(iActiveMailbox->GetId()); + manualSync = extension->IsSetL(EmailSyncInterval); + iActiveMailbox->ReleaseExtension(ext); + } + if(!manualSync) + { + StartMonitoringL(); + } } } @@ -2111,10 +2116,6 @@ FUNC_LOG; INFO_1( "CMAIL Received event: %d", aEvent ); - if (iExitGuardian) - { - iExitGuardian->EnterLC(); - } TBool gridContentsChanged = EFalse; @@ -2177,6 +2178,7 @@ break; case TFSEventMailboxSyncStateChanged: { + TBool tryRunningFakeSyncAnim( EFalse ); TSSMailSyncState* newSyncState = static_cast( aParam1 ); if ( newSyncState !=0 && *newSyncState ) { @@ -2185,49 +2187,41 @@ case StartingSync: { TIMESTAMP( "Starting sync" ); - //If syncs were started by user, show the synchoronisation indicator - if(iManualMailBoxSyncAll) - { - ManualMailBoxSyncAll(EFalse); - } } break; case SyncError: { // error occured during "Connect" or "Send and receive" operation - // check if user needs to be notified TIMESTAMP( "Sync error" ); - if ( iManualMailBoxSync ) - { - /* - * As a fix to TJOS-82ZFCW, this general popup is no longer needed - * // since error id is not provided by plugin, lets popup general note - * HBufC* text = StringLoader::LoadL( R_FS_MSERVER_TEXT_UNABLE_TO_COMPLETE ); - * CleanupStack::PushL( text ); - * CAknInformationNote* infoNote = new ( ELeave ) CAknInformationNote; - * infoNote->ExecuteLD( *text ); - * CleanupStack::PopAndDestroy( text ); - */ - ManualMailBoxSync( EFalse ); - } } break; - case FinishedSuccessfully: + case FinishedSuccessfully: // fall through + case Idle: + tryRunningFakeSyncAnim = ETrue; + // fall through case SyncCancelled: - case Idle: { TIMESTAMP( "Sync finished" ); - ManualMailBoxSync( EFalse ); } - break; - + break; case PushChannelOffBecauseBatteryIsLow: { } break; } //switch } - UpdateTitlePaneConnectionStatus(); + + if ( tryRunningFakeSyncAnim ) + { + TRAP_IGNORE( RunFakeSyncAnimL() ); + } + + // update title pane connection status only if fake anim isn't + // ongoing (if it is the update will happen once it's finished) + if ( !iFakeSyncAnimStopTimer->IsActive() ) + { + UpdateTitlePaneConnectionStatus(); + } } //case break; @@ -2317,10 +2311,6 @@ } // Download manager removed - if (iExitGuardian) - { - CleanupStack::PopAndDestroy(); // iExitGuardian->EnterLC() - } } void CFreestyleEmailUiAppUi::LaunchWizardL() @@ -2530,6 +2520,7 @@ titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconBitmap && iConnectionIconMask); } iConnectionStatusIconAnimTimer->Stop(); + iFakeSyncAnimStopTimer->Stop(); } void CFreestyleEmailUiAppUi::UpdateTitlePaneConnectionStatus( @@ -2563,6 +2554,7 @@ // Set connection icon iConnectionStatusIconAnimTimer->Stop(); + iFakeSyncAnimStopTimer->Stop(); iConnectionIconBitmap = 0; iConnectionIconMask = 0; TSize iconSize = LayoutHandler()->statusPaneIconSize(); @@ -2920,6 +2912,56 @@ } // ----------------------------------------------------------------------------- +// CFreestyleEmailUiAppUi::RunFakeSyncAnimL +// ----------------------------------------------------------------------------- +void CFreestyleEmailUiAppUi::RunFakeSyncAnimL() + { + FUNC_LOG; + + if ( iConnectionStatusVisible ) + { + // don't run if animation already ongoing + if ( !iConnectionStatusIconAnimTimer->IsActive() ) + { + TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); + CEikStatusPaneBase::TPaneCapabilities subPaneTitle = + StatusPane()->PaneCapabilities( titlePaneUid ); + if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) + { + CAknTitlePane* titlePane = + static_cast( + StatusPane()->ControlL( titlePaneUid ) ); + if ( titlePane ) + { + iConnectionIconBitmap = NULL; + iConnectionIconMask = NULL; + FsTextureManager()->ProvideBitmapL( + EStatusTextureSynchronising, + iConnectionIconBitmap, + iConnectionIconMask ); + if ( iConnectionIconBitmap && iConnectionIconMask ) + { + AknIconUtils::SetSize( + iConnectionIconBitmap, + LayoutHandler()->statusPaneIconSize(), + EAspectRatioNotPreserved ); + titlePane->SetSmallPicture( + iConnectionIconBitmap, + iConnectionIconMask, + ETrue ); + iConnectionStatusIconAnimTimer->Start( + KConnectionStatusIconRotationInterval ); + iFakeSyncAnimStopTimer->Start( + KFakeSyncAnimStopTimerInterval ); + titlePane->DrawNow(); + } + } + } + } + } + } + +// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void CFreestyleEmailUiAppUi::ConstructNaviPaneL() @@ -2975,7 +3017,7 @@ void CFreestyleEmailUiAppUi::TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer ) { - if (aTriggeredTimer == iConnectionStatusIconAnimTimer) + if ( aTriggeredTimer == iConnectionStatusIconAnimTimer ) { if ( iConnectionStatusVisible ) { @@ -2997,6 +3039,12 @@ } } } + if ( aTriggeredTimer == iFakeSyncAnimStopTimer ) + { + // Just call the UpdateTitlePaneConnectionStatus. + // The method will put the correct sync icon to title pane + UpdateTitlePaneConnectionStatus(); + } } // ----------------------------------------------------------------------------- diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp Tue May 25 12:23:16 2010 +0300 @@ -599,15 +599,20 @@ iParentLayout->SetPadding( paddingMetric ); // Set list background - if ( !iBackgroundBrush ) - { - iBackgroundBrush = - CAlfFrameBrush::NewL( iEnv, KAknsIIDQsnFrPopup, 1, 1 ); - TRect outerRect( iScreenRect ); - outerRect.Shrink( paddingValue, paddingValue ); + TRect outerRect( iScreenRect ); + outerRect.Shrink( paddingValue, paddingValue ); + if ( !iBackgroundBrush ) + { + iBackgroundBrush = CAlfFrameBrush::NewL( iEnv, KAknsIIDQsnFrPopup, 1, 1 ); iBackgroundBrush->SetFrameRectsL( outerRect, iScreenRect ); - iParentLayout->Brushes()->AppendL( iBackgroundBrush, EAlfDoesNotHaveOwnership ); - } + iParentLayout->Brushes()->InsertL( 0, iBackgroundBrush, EAlfDoesNotHaveOwnership ); + } + else + { + // this prevents transparent popuplist background in portrait layout + // when sw keyboard in landscape layout was called between popups + iBackgroundBrush->SetFrameRectsL( outerRect, iScreenRect ); + } if( !iShadowBrush ) { @@ -620,12 +625,26 @@ } // Append brush if it's not yet appended. - if ( iParentLayout->Brushes()->Count() == 0 ) - { - // Keep the ownership of the brush to avoid unneeded object deletion / reconstruction - iParentLayout->Brushes()->InsertL( 0, iBackgroundBrush, EAlfDoesNotHaveOwnership ); - iParentLayout->Brushes()->AppendL( iShadowBrush, EAlfDoesNotHaveOwnership ); - } + switch ( iParentLayout->Brushes()->Count() ) + { + case 0 : + // Keep the ownership of the brush to avoid unneeded object deletion / reconstruction + iParentLayout->Brushes()->InsertL( 0, iBackgroundBrush, EAlfDoesNotHaveOwnership ); + iParentLayout->Brushes()->AppendL( iShadowBrush, EAlfDoesNotHaveOwnership ); + break; + case 1 : + if ( static_cast(iBackgroundBrush) == & ( iParentLayout->Brushes()->At(0)) ) + { + iParentLayout->Brushes()->AppendL( iShadowBrush, EAlfDoesNotHaveOwnership ); + } + else + { + iParentLayout->Brushes()->InsertL( 0, iBackgroundBrush, EAlfDoesNotHaveOwnership ); + } + break; + default: // 2: it's ok no need to add brush + break; + } // switch SetPopupSoftkeysL(); // SetRect need to be called also here, otherwise the list layout might @@ -1159,10 +1178,6 @@ // remove help support in pf5250 aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); } - - // select option - aMenuPane->SetItemDimmed( EFsEmailUiCmdSelect, iModel->Count() == 0 ); - } // Add shortcut hints @@ -1324,7 +1339,6 @@ } case EAknSoftkeyOpen: case EFsEmailUiCmdOpen: - case EFsEmailUiCmdSelect: { HandleSelectionL( EFSEmailUiCtrlBarResponseSelect ); } @@ -2702,20 +2716,20 @@ iIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( EFolderListEmailAccountTexturePopup ) ); // EFolderListIconEmailAccount // NOTE: Must be appended same order as are in TFsEmailUiSortListIcons! - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListAttachmentAscTexture ) ); // ESortListAttachmentAscIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListAttachmentDescTexture ) ); // ESortListAttachmentDescIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListDateAscTexture ) ); // ESortListDateAscIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListDateDescTexture ) ); // ESortListDateDescIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListFollowAscTexture ) ); // ESortListFollowAscIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListFollowDescTexture ) ); // ESortListFollowDescIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListPriorityAscTexture ) ); // ESortListPriorityAscIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListPriorityDescTexture ) ); // ESortListPriorityDescIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSenderAscTexture ) ); // ESortListSenderAscIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSenderDescTexture ) ); // ESortListSenderDescIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSubjectAscTexture ) ); // ESortListSubjectAscIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSubjectDescTexture ) ); // ESortListSubjectDescIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListUnreadAscTexture ) ); // ESortListUnreadAscIcon - iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListUnreadDescTexture ) ); // ESortListUnreadDescIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListAttachmentAscTexturePopup ) ); // ESortListAttachmentAscIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListAttachmentDescTexturePopup ) ); // ESortListAttachmentDescIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListDateAscTexturePopup ) ); // ESortListDateAscIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListDateDescTexturePopup ) ); // ESortListDateDescIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListFollowAscTexturePopup ) ); // ESortListFollowAscIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListFollowDescTexturePopup ) ); // ESortListFollowDescIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListPriorityAscTexturePopup ) ); // ESortListPriorityAscIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListPriorityDescTexturePopup ) ); // ESortListPriorityDescIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSenderAscTexturePopup ) ); // ESortListSenderAscIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSenderDescTexturePopup ) ); // ESortListSenderDescIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSubjectAscTexturePopup ) ); // ESortListSubjectAscIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListSubjectDescTexturePopup ) ); // ESortListSubjectDescIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListUnreadAscTexturePopup ) ); // ESortListUnreadAscIcon + iSortIconArray.AppendL( &iAppUi.FsTextureManager()->TextureByIndex( ESortListUnreadDescTexturePopup ) ); // ESortListUnreadDescIcon } } diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp --- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp Tue May 25 12:23:16 2010 +0300 @@ -455,6 +455,16 @@ } } +// --------------------------------------------------------------------------- +// hide or show Container ( used for activation of the view ) +// +void CFsEmailUiHtmlViewerView::FadeOut(TBool aDirectionOut ) + { + FUNC_LOG; + iContainer->MakeVisible(!aDirectionOut); + } + + // ----------------------------------------------------------------------------- // CFsEmailUiHtmlViewerView::DoActivateL() // Activate an Compose view @@ -1087,6 +1097,8 @@ void CFsEmailUiHtmlViewerView::HandleStatusPaneSizeChange() { CFsEmailUiViewBase::HandleStatusPaneSizeChange(); + + HandleViewRectChange(); } void CFsEmailUiHtmlViewerView::HandleViewRectChange() @@ -1536,7 +1548,9 @@ SetToolbarItemDimmed( EFsEmailUiTbCmdActions, ETrue); SetToolbarItemDimmed( EFsEmailUiTbCmdDelete, ETrue); + HideToolbar(); CFsDelayedLoader::InstanceL()->GetContactHandlerL()->LaunchRemoteLookupWithQueryL( *mailBox, *textData ); + ShowToolbar(); SetToolbarItemDimmed( EFsEmailUiTbCmdActions, EFalse); SetToolbarItemDimmed( EFsEmailUiTbCmdDelete, EFalse); diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp Tue May 25 12:23:16 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-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" @@ -58,6 +58,7 @@ #include #include #include +#include // INTERNAL INCLUDE FILES #include "FSEmailBuildFlags.h" @@ -125,7 +126,11 @@ iSelector( 0 ), iStartupAnimation( 0 ), iStartupEffectStyle( 0 ), - iWizardWaitnoteShown( EFalse ) + iWizardWaitnoteShown( EFalse ), + iPointerAction( EFalse ), + iIsDragging( EFalse ), + iScrolled( EFalse ), + iLaunchWizardExecuted( EFalse ) { FUNC_LOG; iItemIdInButtonDownEvent.iItemId = KErrNotFound; @@ -148,6 +153,13 @@ // Create startup timer iStartupCallbackTimer = CFSEmailUiGenericTimer::NewL( this ); + iCurrentLevel.iParentPos.iY = 0; + iCurrentLevel.iParentPos.iX = 0; + + if ( CAknPhysics::FeatureEnabled() ) + { + iPhysics = CAknPhysics::NewL(*this, NULL); + } } // ---------------------------------------------------------------------------- @@ -244,6 +256,8 @@ // Initial visual layout update is done when the view gets activated. iRefreshNeeded = ETrue; + UpdatePhysicsL(); // init sizes for scrooling + // First start toggle iConstructionCompleted = ETrue; } @@ -291,7 +305,10 @@ TAlfTimedValue scaleValue; scaleValue.SetTarget( transition, KIconScalingTransitionTimeMs * 2 ); iCurrentLevel.iItemVisualData[selectedItem].iImage->SetScale( scaleValue ); - HandleRowMovement( EDirectionTouch, selectedItem ); + if ( !iScrolled ) + { + HandleRowMovement( EDirectionTouch, selectedItem ); + } } } @@ -321,6 +338,7 @@ delete iMailboxDeleter; delete iStylusPopUpMenu; delete iCoeControl; + delete iPhysics; } void CFSEmailUiLauncherGridVisualiser::CreateModelL() @@ -354,7 +372,6 @@ TInt count = reader.ReadInt16(); -// Use layout data instead of hard-coded values TRect mainPaneRect; AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); @@ -370,7 +387,6 @@ TAknLayoutRect gridIconLRect; gridIconLRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); TSize iconSize = gridIconLRect.Rect().Size(); -// for ( TInt itemIndex = 0; itemIndex < count; itemIndex++ ) { @@ -681,7 +697,6 @@ iAppUi.GridStarted( startedFromOds ); iAppUi.ShowMailboxQueryL(); } - // else { // Ensure that FSMailServer is running, but don't do it on first @@ -713,7 +728,6 @@ { FUNC_LOG; iScrollbar->MakeVisible(EFalse); - FadeOut(ETrue); // hide CAlfVisuals on deactivation } void CFSEmailUiLauncherGridVisualiser::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) @@ -751,9 +765,7 @@ } else { - // aMenuPane->SetItemDimmed( EFsEmailUiCmdAbout, ETrue ); - // if( mbStatus.iMailboxCount <= 0 ) { @@ -905,14 +917,6 @@ case EFsEmailUiCmdSync: case EFsEmailUiCmdSyncAll: { - if (aCommand == EFsEmailUiCmdSyncAll) - { - iAppUi.ManualMailBoxSyncAll(ETrue); - } - else - { - iAppUi.ManualMailBoxSync(ETrue); - } RPointerArray mailBoxes; CleanupResetAndDestroyClosePushL( mailBoxes ); TFSMailMsgId id; @@ -1054,8 +1058,16 @@ || (scanCode == EStdKeyDeviceA) || (scanCode ==EStdKeyDevice3)) { - - if ( !iAppUi.SetFocusVisibility( ETrue ) ) + TBool scrolled = iScrolled; + if ( iScrolled ) + { + iScrolled = EFalse; + SetFocusedItemL( iFirstVisibleRow * iVisibleColumns ); + } + + //iCurrentLevel.iSelected = + if ( !iAppUi.SetFocusVisibility( ETrue ) || + scrolled ) { // focus is now activated. ignore key press. UpdateFocusVisibility(); @@ -1110,17 +1122,30 @@ const TAlfEvent& aEvent ) { FUNC_LOG; - TBool result( EFalse ); - TInt currentlyFocused( iCurrentLevel.iSelected ); + if( !IsViewActive() ) + { + return EFalse; + } TPointerEvent::TType type = aEvent.PointerEvent().iType; TInt id = FindPointedItem( aEvent ); - if( KErrNotFound != id ) + switch( type ) { - // The event coordinates correspond with an item. - switch( type ) + case TPointerEvent::EButton1Down: { - case TPointerEvent::EButton1Down: + iPreviousPosition = iOriginalPosition = aEvent.PointerEvent().iParentPosition; + iPointerAction = ETrue; + iIsDragging = EFalse; + + if( iPhysics ) + { + iPhysics->StopPhysics(); + iPhysics->ResetFriction(); + iStartTime.HomeTime(); + UpdatePhysicsL(); + iTotalDragging = 0; + } + if ( id != KErrNotFound) { // tactile feedback MTouchFeedback* feedback = MTouchFeedback::Instance(); @@ -1133,17 +1158,28 @@ iItemIdInButtonDownEvent.iLaunchSelection = ETrue; SetFocusedItemL( id ); UpdateFocusVisibility(); - break; } - case TPointerEvent::EButton1Up: + break; + } + case TPointerEvent::EButton1Up: + { + if( iIsDragging && iPhysics ) + { + TPoint drag( iOriginalPosition - aEvent.PointerEvent().iParentPosition ); + iPhysics->StartPhysics( drag, iStartTime ); + iIsDragging = EFalse; + iPointerAction = EFalse; + iTotalDragging = 0; + } + else if ( id != KErrNotFound ) { if ( iStylusPopUpMenuLaunched ) - { - // A pop-up menu was launched. Do not open the selected - // item. - iItemIdInButtonDownEvent.iLaunchSelection = EFalse; - break; - } + { + // A pop-up menu was launched. Do not open the selected + // item. + iItemIdInButtonDownEvent.iLaunchSelection = EFalse; + break; + } // Hide focus always after pointer up event. iAppUi.SetFocusVisibility( EFalse ); @@ -1161,100 +1197,75 @@ else { HandleButtonReleaseEvent(); - break; } } - case TPointerEvent::EDrag: + else if( iItemIdInButtonDownEvent.iItemId != KErrNotFound ) + { + iItemIdInButtonDownEvent.iLaunchSelection = EFalse; + ResizeItemIcon( ETrue ); + + // Hide focus always after pointer up event. + iAppUi.SetFocusVisibility( EFalse ); + iItemIdInButtonDownEvent.iItemId = KErrNotFound; + HandleButtonReleaseEvent(); + } + else { - // if pointer is moved on to other item, decrease focused - // item's icon. - if ( ( currentlyFocused != id ) && - ( iItemIdInButtonDownEvent.iItemId != KErrNotFound ) ) - { - iItemIdInButtonDownEvent.iLaunchSelection = EFalse; - ResizeItemIcon( ETrue ); - } - - // if pointer is moved on item that has focus, increase item's - // icon. - else if ( id == iItemIdInButtonDownEvent.iItemId ) + iAppUi.SetFocusVisibility( EFalse ); + } + break; + } + case TPointerEvent::EDrag: + { + if( iPhysics ) + { + TPoint position = aEvent.PointerEvent().iParentPosition; + TPoint delta( 0, iPreviousPosition.iY - position.iY ); + iTotalDragging = iTotalDragging + delta.iY; + if (Abs(iTotalDragging) >= iPhysics->DragThreshold() || iIsDragging ) { - iItemIdInButtonDownEvent.iLaunchSelection = ETrue; - ResizeItemIcon( EFalse ); + // Hide focus always when dragging. + iAppUi.SetFocusVisibility( EFalse ); + if ( iSelector ) + { + TAlfTimedValue selectorOpacity; + selectorOpacity.SetValueNow( 0 ); + iSelector->SetOpacity( selectorOpacity ); + } + + iIsDragging = ETrue; + + iPhysics->RegisterPanningPosition( delta ); + iScrolled = ETrue; } - - break; + // Save current position as previous pos for future calculations + iPreviousPosition = position; } - case TPointerEvent::EButtonRepeat: - { - // Long tap. - if ( currentlyFocused != id || - iItemIdInButtonDownEvent.iItemId == KErrNotFound ) - { - // The item beneath the touch was changed during the long - // tap. Thus, do not show the pop-up. - break; - } - - // Check the type of the currently selected item. + break; + } + case TPointerEvent::EButtonRepeat: + { + if (!iIsDragging && id != KErrNotFound ) + { + // Check the type of the currently selected item. TInt itemType = iCurrentLevel.iItems[id].iId; if ( itemType == EDefaultMailboxItem || itemType == EOtherMailboxItems ) - { - // The selected item is a mail box. Launch the pop-up - // menu. - LaunchStylusPopupMenu( id ); + { + // The selected item is a mail box. Launch the pop-up + // menu. + LaunchStylusPopupMenu( id ); } - - break; - } - default: - { - break; - } + } + break; } - - result = ETrue; - } - // if event do not concern any of items. - else if( iItemIdInButtonDownEvent.iItemId != KErrNotFound ) - { - iItemIdInButtonDownEvent.iLaunchSelection = EFalse; - ResizeItemIcon( ETrue ); - - switch( type ) + default: { - case TPointerEvent::EButton1Down: - { - // ask if focus is on (flip open) - // iItemIdInButtonDownEvent.iItemId = currentlyFocused - break; - } - case TPointerEvent::EButton1Up: - { - // Hide focus always after pointer up event. - iAppUi.SetFocusVisibility( EFalse ); - iItemIdInButtonDownEvent.iItemId = KErrNotFound; - HandleButtonReleaseEvent(); - break; - } - default: - { - break; - } + break; } } - else - { - if( aEvent.IsPointerEvent() && aEvent.PointerUp() ) - { - // Hide focus always after pointer up event. - iAppUi.SetFocusVisibility( EFalse ); - } - } - - return result; + return ETrue; } // --------------------------------------------------------------------------- @@ -1414,12 +1425,12 @@ iCurrentLevel.iSelected = itemCount - 1; } } - - TInt x = iCurrentLevel.iSelected % iVisibleColumns; - TInt y = (iCurrentLevel.iSelected-x) / iVisibleColumns; - - ScrollToRow( y ); - + if (!iPointerAction) + { + TInt x = iCurrentLevel.iSelected % iVisibleColumns; + TInt y = (iCurrentLevel.iSelected-x) / iVisibleColumns; + ScrollToRow( y ); + } } @@ -1430,10 +1441,8 @@ iSelector->SetPos( curPos, 0 ); // wrap position now // Calculate where are we heading - // Platform layout change CAlfVisual* selectedBase = iCurrentLevel.iItemVisualData[iCurrentLevel.iSelected].iBase; TPoint displayPos = selectedBase->LocalToDisplay( selectedBase->Pos().Target() ); - // TPoint targetPos = iSelector->DisplayToLocal( displayPos ); // Check if we need to wrap the selector over the edge of the screen @@ -1461,9 +1470,7 @@ // Animate the movement to the new position TInt animTime = KSelectTransitionTimeMs; - // if ( aDir == EDirectionReset || aDir == EDirectionNone || aDir == EDirectionTouch ) - // { animTime = KStartupAnimationTime; } @@ -1507,18 +1514,10 @@ return; } -// Fix scrolling so that it works properly with 2 visible rows (landscape layout data) if ( iFirstVisibleRow + iVisibleRows - 1 < aRow ) { // Scroll downwards -// if ( aRow == iRowCount - 1 ) -// { - iFirstVisibleRow = aRow - iVisibleRows + 1 ; - // } -// else -// { -// iFirstVisibleRow = aRow - iVisibleRows + 2; -// } + iFirstVisibleRow = aRow - iVisibleRows + 1 ; } else if ( iFirstVisibleRow > aRow ) { @@ -1539,11 +1538,9 @@ TAlfTimedPoint alfScrollOffset; alfScrollOffset.iY.SetTarget( offset , KScrollTransitionTimeMs ); iCurrentLevel.iGridLayout->SetScrollOffset(alfScrollOffset); -// - iScrollbarModel.SetFocusPosition(iFirstVisibleRow); + iScrollbarModel.SetFocusPosition(offset); TRAP_IGNORE( iScrollbar->SetModelL(&iScrollbarModel) ); iScrollbar->DrawNow(); -// } void CFSEmailUiLauncherGridVisualiser::RefreshLauncherViewL() @@ -1709,6 +1706,7 @@ FUNC_LOG; if ( !iAppUi.ViewSwitchingOngoing() ) { + iPointerAction = EFalse; iItemIdInButtonDownEvent.iItemId = KErrNotFound; UpdateFocusVisibility(); @@ -1794,12 +1792,8 @@ case EAddNewMailboxItem: { // To prevent accidental double clicks of the wizard item - // wizard would crash without this - if ( !iDoubleClickLock ) - { - iDoubleClickLock = ETrue; + // wizard would crash without this - moved to function LaunchWizardL(); - } } break; case EHelpItem: @@ -1821,14 +1815,14 @@ } -void CFSEmailUiLauncherGridVisualiser::HandleForegroundEventL() +void CFSEmailUiLauncherGridVisualiser::HandleForegroundEventL( TBool aForeground ) { FUNC_LOG; UpdateFocusVisibility(); // Toggle safety lock always when receiving foreground back. - if ( iFirstStartComplete && iDoubleClickLock ) + if ( aForeground && iDoubleClickLock && iFirstStartComplete ) { iDoubleClickLock = EFalse; } @@ -1908,9 +1902,17 @@ DoFirstStartL(); } - iAiwSHandler->ExecuteServiceCmdL( KAiwCmdSettingWizardFsEmail.iUid, - iAiwSHandler->InParamListL(), - iAiwSHandler->OutParamListL() ); + if ( ! iLaunchWizardExecuted ) // prevent reentrant calling + { + iLaunchWizardExecuted = ETrue; + TRAPD( err, iAiwSHandler->ExecuteServiceCmdL( KAiwCmdSettingWizardFsEmail.iUid, + iAiwSHandler->InParamListL(), + iAiwSHandler->OutParamListL() ) ); + // ExecuteServiceCmdL is synchronous - uses CActiveSchedulerWait + iLaunchWizardExecuted = EFalse; + User::LeaveIfError( err ); + } + } void CFSEmailUiLauncherGridVisualiser::GoToInboxL( TFSMailMsgId& aMailboxId, TFSMailMsgId& aMailboxInboxId ) @@ -1931,7 +1933,6 @@ FUNC_LOG; if ( iConstructionCompleted ) { - // Use layout data instead of hard-coded values TRect mainPaneRect; AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; @@ -1950,7 +1951,6 @@ //TInt gridIconSize = iAppUi.LayoutHandler()->GridIconSize(); TSize iconSize = gridIconRect.Rect().Size(); //iconSize.SetSize( gridIconSize, gridIconSize ); - // // Scale bitmaps for( TInt i = 0 ; i < iIconArray.Count() ; i++ ) @@ -1975,7 +1975,6 @@ if ( launcherItemIcon ) { -// Use layout data instead of hard-coded values TRect mainPaneRect; AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); @@ -1993,7 +1992,6 @@ gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); TSize iconSize = gridIconRect.Rect().Size(); -// const CFbsBitmap* bitmap = launcherItemIcon->Bitmap(); const CFbsBitmap* mask = launcherItemIcon->Mask(); @@ -2008,10 +2006,7 @@ CAlfTexture* texture = &CAlfStatic::Env().TextureManager().CreateTextureL( iPluginTextureId, this, EAlfTextureFlagDefault ); // Update texture id iPluginTextureId++; // Id is updated dynamically - // Set initiel size -// Use layout data instead of hard-coded values - //TSize iconSize(iAppUi.LayoutHandler()->GridIconSize(), iAppUi.LayoutHandler()->GridIconSize() ); -// + // Set initial size texture->Size().SetSize( iconSize.iHeight, iconSize.iWidth ); iModel->AddL( EShortcut, @@ -2047,16 +2042,14 @@ { iCurrentLevel.iParent = 0; - // Use layout data instead of hard-coded values TRect mainPaneRect; AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; TAknLayoutRect scrollBarRect; - // -// scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); + scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::scroll_pane_cp03()); - // + TRect gridRect = mainPaneRect; gridRect.iBr.iX -= scrollBarRect.Rect().Width(); @@ -2080,8 +2073,6 @@ TInt columns = iVisibleColumns = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastColumn() + 1; TInt rows = iVisibleRows = AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits(var).LastRow() + 1; - // - iCurrentLevel.iGridLayout->SetSize( gridRect.Size() ); iCurrentLevel.iGridLayout->SetColumnsL( columns ); iCurrentLevel.iGridLayout->SetRowsL( rows ); @@ -2090,7 +2081,6 @@ UpdateScrollBarRangeL(); TInt scrollbarWidth = scrollBarRect.Rect().Width(); - // if( iRowCount > iVisibleRows ) { iScrollbar->MakeVisible(ETrue); @@ -2099,7 +2089,6 @@ { iScrollbar->MakeVisible(EFalse); } - // TInt scrollbarTopLeftX = displaySize.iWidth - scrollbarWidth; TInt scrollbarTopLeftY = 0; @@ -2169,13 +2158,11 @@ SetRingWrapLimits(); MoveSelection( EDirectionNone ); - // TRect scrollbarRect; scrollbarRect.SetRect(scrollbarTopLeftX, scrollbarTopLeftY, scrollbarBottomRightX, scrollbarBottomRightY); scrollbarRect.Move(mainPaneRect.iTl); iScrollbar->SetRect(scrollbarRect); iScrollbar->DrawDeferred(); - // iRefreshNeeded = EFalse; } } @@ -2326,7 +2313,7 @@ } } } -// + void CFSEmailUiLauncherGridVisualiser::ConstructScrollbarL( CAlfLayout* aParent ) { FUNC_LOG; @@ -2347,8 +2334,13 @@ { FUNC_LOG; - iScrollbarModel.SetScrollSpan(iRowCount); - iScrollbarModel.SetWindowSize(iVisibleRows); + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); + TAknLayoutRect scrollBarRect; + scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar()); + + iScrollbarModel.SetScrollSpan(iRowCount * (scrollBarRect.Rect().Height() / iVisibleRows)); + iScrollbarModel.SetWindowSize(scrollBarRect.Rect().Height()); iScrollbarModel.SetFocusPosition(iFirstVisibleRow); iScrollbar->SetModelL(&iScrollbarModel); iScrollbar->DrawNow(); @@ -2357,10 +2349,14 @@ void CFSEmailUiLauncherGridVisualiser::HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType) { FUNC_LOG; - const TInt KScrollTransitionTimeMs = KSelectTransitionTimeMs; + if( iPhysics ) + { + iPhysics->StopPhysics(); + iPhysics->ResetFriction(); + } + if (aScrollBar == iScrollbar) { - switch( aEventType ) { case EEikScrollHome : @@ -2370,16 +2366,25 @@ //Jump to end break; default: - iFirstVisibleRow = aScrollBar->ThumbPosition(); - TReal offset = iFirstVisibleRow * iRowHeight; + iScrolled = ETrue; + iAppUi.SetFocusVisibility( EFalse ); + if ( iSelector ) + { + TAlfTimedValue selectorOpacity; + selectorOpacity.SetValueNow( 0 ); + iSelector->SetOpacity( selectorOpacity ); + } + iFirstVisibleRow = iCurrentLevel.iParentPos.iY/iRowHeight; + TReal offset = aScrollBar->ThumbPosition() + 1; TAlfTimedPoint alfScrollOffset; - alfScrollOffset.iY.SetTarget( offset , KScrollTransitionTimeMs ); - iCurrentLevel.iGridLayout->SetScrollOffset(alfScrollOffset); + alfScrollOffset.iY.SetTarget( offset , 0); + iCurrentLevel.iGridLayout->SetScrollOffset(alfScrollOffset); + iCurrentLevel.iParentPos.iY = offset; break; } } } -// + void CFSEmailUiLauncherGridVisualiser::UpdateLauncherItemListL() { FUNC_LOG; @@ -2510,7 +2515,6 @@ void CFSEmailUiLauncherGridVisualiser::ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap) { FUNC_LOG; -// Use layout data instead of hard-coded values TRect mainPaneRect; AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; @@ -2525,7 +2529,6 @@ TAknLayoutRect gridIconRect; gridIconRect.LayoutRect(itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1(var)); -// CAknIcon* launcherItemIcon(0); for ( TInt i=0; i Use layout data instead of hard-coded values // Set bitmap size - //TSize iconSize(iAppUi.LayoutHandler()->GridIconSize(), iAppUi.LayoutHandler()->GridIconSize() ); - TSize iconSize = gridIconRect.Rect().Size(); -// if( launcherItemIcon->Bitmap() ) { AknIconUtils::DisableCompression( launcherItemIcon->Bitmap() ); @@ -2680,6 +2679,69 @@ ResizeItemIcon( !aVisible ); } +// ----------------------------------------------------------------------------- +// CFSEmailUiLauncherGridVisualiser::ViewPositionChanged +// From MAknPhysicsObserver +// ----------------------------------------------------------------------------- +// +void CFSEmailUiLauncherGridVisualiser::ViewPositionChanged( + const TPoint& aNewPosition, + TBool /*aDrawNow*/, + TUint /*aFlags*/ ) + { + FUNC_LOG; + + // controls must be created first + if ( !iConstructionCompleted ) + { + return; + } + + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); + iCurrentLevel.iParentPos.iY = aNewPosition.iY - mainPaneRect.Height()/2; + TAlfTimedPoint alfScrollOffset; + alfScrollOffset.iY.SetTarget( iCurrentLevel.iParentPos.iY , 0 ); + iCurrentLevel.iGridLayout->SetScrollOffset(alfScrollOffset); + iScrollbarModel.SetFocusPosition( iCurrentLevel.iParentPos.iY ); + TRAP_IGNORE( iScrollbar->SetModelL(&iScrollbarModel) ); + iScrollbar->DrawNow(); + iFirstVisibleRow = iCurrentLevel.iParentPos.iY/iRowHeight; + if ( iFirstVisibleRow < 0 ) + { + iFirstVisibleRow = 0; + } + else if ( iFirstVisibleRow > iRowCount ) + { + iFirstVisibleRow = iRowCount; + } + } + +// ----------------------------------------------------------------------------- +// CNcsComposeViewContainer::PhysicEmulationEnded +// From MAknPhysicsObserver +// ----------------------------------------------------------------------------- +// +void CFSEmailUiLauncherGridVisualiser::PhysicEmulationEnded() + { + FUNC_LOG; + } + +// ----------------------------------------------------------------------------- +// CNcsComposeViewContainer::ViewPosition +// From MAknPhysicsObserver +// ----------------------------------------------------------------------------- +// +TPoint CFSEmailUiLauncherGridVisualiser::ViewPosition() const + { + FUNC_LOG; + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); + TInt current = iCurrentLevel.iParentPos.iY; + TInt viewCentre = mainPaneRect.Size().iHeight / 2; + TPoint point( 0, current + viewCentre ); + return point; + } // ---------------------------------------------------------------------------- // LaunchStylusPopupMenuL() @@ -2737,3 +2799,20 @@ iStartupCallbackTimer->Cancel(); } +// --------------------------------------------------------------------------- +// CFSEmailUiLauncherGridVisualiser::UpdatePhysicsL() +// --------------------------------------------------------------------------- +// +void CFSEmailUiLauncherGridVisualiser::UpdatePhysicsL() + { + FUNC_LOG; + if ( iPhysics ) + { + TRect mainPaneRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect ); + const TSize viewSize( mainPaneRect.Size() ); + const TSize worldSize( 0, iRowCount * iRowHeight ); + iPhysics->InitPhysicsL( worldSize, viewSize, EFalse ); + } + } + diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiLayoutHandler.cpp --- a/emailuis/emailui/src/FreestyleEmailUiLayoutHandler.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiLayoutHandler.cpp Tue May 25 12:23:16 2010 +0300 @@ -1239,15 +1239,21 @@ TAknLayoutRect controlBarRect; controlBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane(0)); TAknLayoutRect iconRect; - if ( AknLayoutUtils::LayoutMirrored() ) + if ( Layout_Meta_Data::IsLandscapeOrientation() ) { - iconRect.LayoutRect(controlBarRect.Rect(), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g2(0)); + iconRect.LayoutRect(controlBarRect.Rect(), AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_g2(0)); } else { - iconRect.LayoutRect(controlBarRect.Rect(), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g1(0)); - } - + if ( AknLayoutUtils::LayoutMirrored() ) + { + iconRect.LayoutRect(controlBarRect.Rect(), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g2(0)); + } + else + { + iconRect.LayoutRect(controlBarRect.Rect(), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g1(0)); + } + } return iconRect.Rect(); } diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp Tue May 25 12:23:16 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 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" @@ -90,6 +90,7 @@ #include "FSEmail.pan" #include "ipsplgcommon.h" +#include "cemailsettingsextension.h" // CONST VALUES const TInt KControlBarTransitionTime = 250; @@ -684,7 +685,10 @@ } } SetListAndCtrlBarFocusL(); - iAppUi.StartMonitoringL(); + if(!CheckAutoSyncSettingL()) + { + iAppUi.StartMonitoringL(); + } TIMESTAMP( "Locally stored messages fetched for message list" ); } @@ -1610,7 +1614,8 @@ else { iMailList->ShowListL(); - if (forwardNavigation) + TBool manualSync = CheckAutoSyncSettingL(); + if (forwardNavigation && !manualSync) { iAppUi.StartMonitoringL(); } @@ -1698,7 +1703,6 @@ iMailTreeListVisualizer->NotifyControlVisibilityChange( EFalse ); } iThisViewActive = EFalse; - FadeOut(ETrue); // hide CAlfVisuals on deactivation } // --------------------------------------------------------------------------- @@ -3021,6 +3025,13 @@ } else { + 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() ) ); + iMailTreeListVisualizer->HideList(); // screen layout changed iCurrentClientRect = iAppUi.ClientRect(); @@ -4282,6 +4293,7 @@ if ( aDestinationFolderId.IsNullId() ) { // Activate folder selection view and handle moving after callback gets destination + RemoveMarkingModeTitleTextL(); iMoveToFolderOngoing = ETrue; TFolderListActivationData folderListData; folderListData.iCallback = this; @@ -5617,7 +5629,14 @@ TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; TAknLayoutText textLayout; - textLayout.LayoutText(TRect(0,0,0,0), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_ddmenu_pane_t1(var)); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + textLayout.LayoutText(TRect(0,0,0,0), AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_t2(0)); + } + else + { + textLayout.LayoutText(TRect(0,0,0,0), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_ddmenu_pane_t1(var)); + } iNewEmailButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() ); iFolderListButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() ); iSortButton->SetTextFontL( textLayout.Font()->FontSpecInTwips() ); @@ -5655,10 +5674,23 @@ } CleanupStack::PopAndDestroy( buttonText ); - // Set icon + iSortButton->SetIconL( + iAppUi.FsTextureManager()->TextureByIndex( GetSortButtonTextureIndex() ), + ECBElemIconA ); + + } + +// --------------------------------------------------------------------------- +// +// +// --------------------------------------------------------------------------- +// +TFSEmailUiTextures CFSEmailUiMailListVisualiser::GetSortButtonTextureIndex() + { + FUNC_LOG; + TFSEmailUiTextures textureIndex( ETextureFirst ); - - switch ( iCurrentSortCriteria.iField ) + switch ( iCurrentSortCriteria.iField ) { case EFSMailSortBySubject: { @@ -5711,11 +5743,8 @@ ESortListDateAscTexture; } break; - } - - iSortButton->SetIconL( - iAppUi.FsTextureManager()->TextureByIndex( textureIndex ), - ECBElemIconA ); + } + return textureIndex; } // --------------------------------------------------------------------------- @@ -6727,6 +6756,10 @@ switch ( aResponse ) { case EFSEmailUiCtrlBarResponseCancel: + if ( iMarkingMode ) + { + DisplayMarkingModeTitleTextL(); + } iMarkingModeWaitingToExit = EFalse; SetMskL(); return; @@ -7223,7 +7256,8 @@ } // Set the position for the popup - iStylusPopUpMenu->SetPosition( aPoint ); + TPoint point(aPoint.iX, aPoint.iY + 45); + iStylusPopUpMenu->SetPosition( point, CAknStylusPopUpMenu::EPositionTypeRightBottom ); // Display the popup and set the flag to indicate that the menu was // launched. @@ -7636,7 +7670,8 @@ { CleanupStack::PushL( mailBoxIcon ); // - TSize defaultIconSize(iAppUi.LayoutHandler()->GetControlBarMailboxIconRect().Size()); + TInt iconSize( iAppUi.LayoutHandler()->GetControlBarMailboxIconRect().Width() ); + TSize defaultIconSize ( iconSize, iconSize ); // AknIconUtils::SetSize(mailBoxIcon->Bitmap(), defaultIconSize); AknIconUtils::SetSize(mailBoxIcon->Mask(), defaultIconSize); @@ -8055,6 +8090,25 @@ } } +TBool CFSEmailUiMailListVisualiser::CheckAutoSyncSettingL() + { + CEmailExtension* ext=NULL; + TBool manualSync = EFalse; + CFSMailBox* box = iAppUi.GetActiveMailbox(); + if (box) + { + ext = box->ExtensionL( KEmailSettingExtensionUid ); + if (ext) + { + CEmailSettingsExtension* extension = reinterpret_cast( ext ); + extension->SetMailBoxId(box->GetId()); + manualSync = extension->IsSetL(EmailSyncInterval); + box->ReleaseExtension(extension); + } + } + return manualSync; + } + ////////////////////////////////////////////////////////////////// // Class implementation CMailListUpdater /////////////////////////////////////////////////////////////////// diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp Tue May 25 12:23:16 2010 +0300 @@ -794,6 +794,24 @@ aLayoutArray.Append( iScreenAnchorLayout ); } +// --------------------------------------------------------------------------- +// hide or show CAlfVisuals ( used for activation or deactivation ) +// +void CFSEmailUiSearchListVisualiser::FadeOut(TBool aDirectionOut ) + { + FUNC_LOG; + if ( iScreenAnchorLayout != NULL ) + { + TAlfTimedValue timedValue( 0, 0 ); + if ( !aDirectionOut ) + { + timedValue.SetTarget( 1, 0 ); + } + iScreenAnchorLayout->SetOpacity( timedValue ); + } + } + + // ----------------------------------------------------------------------------- // CFSEmailUiMailListVisualiser::FlipStateChangedL // Called when keyboard flip state is changed @@ -2592,7 +2610,8 @@ iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, messageRead ); // Set the position for the popup - iStylusPopUpMenu->SetPosition( aPoint ); + TPoint point(aPoint.iX, aPoint.iY + 45); + iStylusPopUpMenu->SetPosition( point, CAknStylusPopUpMenu::EPositionTypeRightBottom ); // Display the popup and set the flag to indicate that the menu was // launched so that list focus stays visible. diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListControl.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListControl.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListControl.cpp Tue May 25 12:23:16 2010 +0300 @@ -432,10 +432,11 @@ static_cast( iAppUi->View(MailEditorId) ); TFSMailMsgId nullId; + TInt err( KErrNone ); if ( composeView->NewMessage() ) { // use composeview NewMessage if available - msgPart = composeView->NewMessage()->AddNewAttachmentL( filePath, nullId ); + TRAP( err, msgPart = composeView->NewMessage()->AddNewAttachmentL( filePath, nullId )); } else { @@ -447,10 +448,19 @@ iVisualiser->EditorParams().iMsgId, EFSMsgDataStructure ); CleanupStack::PushL( msg ); - msgPart = msg->AddNewAttachmentL( filePath, nullId ); + TRAP( err, msgPart = msg->AddNewAttachmentL( filePath, nullId )); CleanupStack::PopAndDestroy( msg ); } CleanupStack::PushL( msgPart ); + if( KErrNone != err) + { + if( iWaitNote ) + { + iWaitNote->ProcessFinishedL(); + } + iAttachmentAddingLocked = EFalse; + User::Leave( err ); + } msgPart->SaveL(); // append file to list model diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp Tue May 25 12:23:16 2010 +0300 @@ -1805,10 +1805,9 @@ // void CFsEmailSettingsList::ClearFocus() { - // This is not a nice way to clear the focus but unless some one comes - // with a better solution, this will have to do. iListBox->ItemDrawer()->SetFlags( CListItemDrawer::EDisableHighlight ); - iListBox->View()->Draw(); + iListBox->ClearSelection(); + iListBox->DrawNow(); iListBox->ItemDrawer()->ClearFlags( CListItemDrawer::EDisableHighlight ); } diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiSettingsListView.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSettingsListView.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiSettingsListView.cpp Tue May 25 12:23:16 2010 +0300 @@ -174,7 +174,7 @@ { if ( iStylusPopUpMenu ) { - iStylusPopUpMenu->SetPosition( aPosition ); + iStylusPopUpMenu->SetPosition( aPosition, CAknStylusPopUpMenu::EPositionTypeLeftBottom ); iStylusPopUpMenu->ShowMenu(); } } diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiTextureManager.cpp --- a/emailuis/emailui/src/FreestyleEmailUiTextureManager.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiTextureManager.cpp Tue May 25 12:23:16 2010 +0300 @@ -136,6 +136,17 @@ } // ----------------------------------------------------------------------------- +// CFreestyleEmailUiTextureManager::ClearTextureByIndex +// ----------------------------------------------------------------------------- +// +void CFreestyleEmailUiTextureManager::ClearTextureByIndex( TFSEmailUiTextures aIndex ) + { + FUNC_LOG; + // unload the texture + CAlfStatic::Env().TextureManager().UnloadTexture( aIndex ); + iTextures[aIndex] = &CAlfStatic::Env().TextureManager().BlankTexture(); + } +// ----------------------------------------------------------------------------- // CFreestyleEmailUiTextureManager::TextureByMailboxIdL // Returns branded mailbox icon texture based on PluginId, MailboxId and IconSize. // If not found. Will call LoadTexture to create new textures based on temporary @@ -1339,71 +1350,152 @@ AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_attach_asc, EMbmFreestyleemailuiQgn_prop_email_sort_attach_asc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListAttachmentAscTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); } break; + case ESortListAttachmentAscTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_attach_asc, + EMbmFreestyleemailuiQgn_prop_email_sort_attach_asc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListAttachmentAscTexturePopup ); + } + break; case ESortListAttachmentDescTexture: { AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_attach_desc, EMbmFreestyleemailuiQgn_prop_email_sort_attach_desc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListAttachmentDescTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); } break; + case ESortListAttachmentDescTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_attach_desc, + EMbmFreestyleemailuiQgn_prop_email_sort_attach_desc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListAttachmentDescTexturePopup ); + } + break; case ESortListDateAscTexture: { AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_date_asc, EMbmFreestyleemailuiQgn_prop_email_sort_date_asc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListDateAscTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); } break; + case ESortListDateAscTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_date_asc, + EMbmFreestyleemailuiQgn_prop_email_sort_date_asc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListDateAscTexturePopup ); + } + break; case ESortListDateDescTexture: { AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_date_desc, EMbmFreestyleemailuiQgn_prop_email_sort_date_desc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListDateDescTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); } break; + case ESortListDateDescTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_date_desc, + EMbmFreestyleemailuiQgn_prop_email_sort_date_desc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListDateDescTexturePopup ); + } + break; case ESortListFollowAscTexture: { AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_follow_asc, EMbmFreestyleemailuiQgn_prop_email_sort_follow_asc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListFollowAscTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); } break; + case ESortListFollowAscTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_follow_asc, + EMbmFreestyleemailuiQgn_prop_email_sort_follow_asc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListFollowAscTexturePopup ); + } + break; case ESortListFollowDescTexture: { AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_follow_desc, EMbmFreestyleemailuiQgn_prop_email_sort_follow_desc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListFollowDescTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); } break; + case ESortListFollowDescTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_follow_desc, + EMbmFreestyleemailuiQgn_prop_email_sort_follow_desc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListFollowDescTexturePopup ); + } + break; case ESortListPriorityAscTexture: { AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_priority_asc, EMbmFreestyleemailuiQgn_prop_email_sort_priority_asc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListPriorityAscTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); } break; + case ESortListPriorityAscTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_priority_asc, + EMbmFreestyleemailuiQgn_prop_email_sort_priority_asc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListPriorityAscTexturePopup ); + } + break; case ESortListPriorityDescTexture: { AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_priority_desc, EMbmFreestyleemailuiQgn_prop_email_sort_priority_desc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListPriorityDescTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); } break; + case ESortListPriorityDescTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_priority_desc, + EMbmFreestyleemailuiQgn_prop_email_sort_priority_desc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListPriorityDescTexturePopup ); + } + break; case ESortListSenderAscTexture: { AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_sender_asc, EMbmFreestyleemailuiQgn_prop_email_sort_sender_asc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListSenderAscTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); + } + break; + case ESortListSenderAscTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_sender_asc, + EMbmFreestyleemailuiQgn_prop_email_sort_sender_asc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListSenderAscTexturePopup ); } break; case ESortListSenderDescTexture: @@ -1411,7 +1503,16 @@ AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_sender_desc, EMbmFreestyleemailuiQgn_prop_email_sort_sender_desc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListSenderDescTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); + } + break; + case ESortListSenderDescTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_sender_desc, + EMbmFreestyleemailuiQgn_prop_email_sort_sender_desc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListSenderDescTexturePopup ); } break; case ESortListSubjectAscTexture: @@ -1419,7 +1520,16 @@ AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_subject_asc, EMbmFreestyleemailuiQgn_prop_email_sort_subject_asc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListSubjectAscTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); + } + break; + case ESortListSubjectAscTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_subject_asc, + EMbmFreestyleemailuiQgn_prop_email_sort_subject_asc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListSubjectAscTexturePopup ); } break; case ESortListSubjectDescTexture: @@ -1427,7 +1537,16 @@ AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_subject_desc, EMbmFreestyleemailuiQgn_prop_email_sort_subject_desc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListSubjectDescTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); + } + break; + case ESortListSubjectDescTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_subject_desc, + EMbmFreestyleemailuiQgn_prop_email_sort_subject_desc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListSubjectDescTexturePopup ); } break; case ESortListUnreadAscTexture: @@ -1435,7 +1554,16 @@ AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_unread_asc, EMbmFreestyleemailuiQgn_prop_email_sort_unread_asc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListUnreadAscTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); + } + break; + case ESortListUnreadAscTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_unread_asc, + EMbmFreestyleemailuiQgn_prop_email_sort_unread_asc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListUnreadAscTexturePopup ); } break; case ESortListUnreadDescTexture: @@ -1443,10 +1571,19 @@ AknIconUtils::CreateIconL( bitmap, mask, iconFileName, EMbmFreestyleemailuiQgn_prop_email_sort_unread_desc, EMbmFreestyleemailuiQgn_prop_email_sort_unread_desc_mask ); - iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListUnreadDescTexture ); + TInt tempsize = iAppUi->LayoutHandler()->ListControlBarMailboxDefaultIconSize(); + iconSize.SetSize( tempsize, tempsize ); } break; - // SORT LIST ICON READING STOPS HERE + case ESortListUnreadDescTexturePopup: + { + AknIconUtils::CreateIconL( bitmap, mask, iconFileName, + EMbmFreestyleemailuiQgn_prop_email_sort_unread_desc, + EMbmFreestyleemailuiQgn_prop_email_sort_unread_desc_mask ); + iconSize = iAppUi->LayoutHandler()->FolderListIconSize( aId == ESortListUnreadDescTexturePopup ); + } + break; + // SORT LIST ICON READING STOPS HERE // // ATTACHMENT ICONS STARTS HERE @@ -2123,6 +2260,22 @@ case ESortListSubjectDescTexture: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListSubjectDescTexture, this, EAlfTextureFlagRetainResolution); break; case ESortListUnreadAscTexture: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListUnreadAscTexture, this, EAlfTextureFlagRetainResolution); break; case ESortListUnreadDescTexture: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListUnreadDescTexture, this, EAlfTextureFlagRetainResolution); break; + + // SORT LIST ICONS POPUP + case ESortListAttachmentAscTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListAttachmentAscTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListAttachmentDescTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListAttachmentDescTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListDateAscTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListDateAscTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListDateDescTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListDateDescTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListFollowAscTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListFollowAscTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListFollowDescTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListFollowDescTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListPriorityAscTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListPriorityAscTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListPriorityDescTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListPriorityDescTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListSenderAscTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListSenderAscTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListSenderDescTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListSenderDescTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListSubjectAscTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListSubjectAscTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListSubjectDescTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListSubjectDescTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListUnreadAscTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListUnreadAscTexturePopup, this, EAlfTextureFlagRetainResolution); break; + case ESortListUnreadDescTexturePopup: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( ESortListUnreadDescTexturePopup, this, EAlfTextureFlagRetainResolution); break; // STATUS INDICATOR ICONS case EStatusTextureSynchronising: iTextures[aTextureId] = &CAlfStatic::Env().TextureManager().CreateTextureL( EStatusTextureSynchronising, this, EAlfTextureFlagRetainResolution); break; diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/FreestyleEmailUiViewBase.cpp --- a/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp Tue May 25 12:23:16 2010 +0300 @@ -128,10 +128,11 @@ } // View activated succesfully + DoTransition( EFalse ); if ( !iAppUi.SwitchingToBackground() ) { // Change visible control group - DoTransition( EFalse ); + // having here DoTransition caused grid transparency when app left from listview ActivateControlGroup(); } else @@ -279,7 +280,7 @@ // --------------------------------------------------------------------------- // virtual function to hide or show CAlfVisuals ( used for activation or deactivation ) // -void CFsEmailUiViewBase::FadeOut(TBool aDirectionOut ) +void CFsEmailUiViewBase::FadeOut( TBool /* aDirectionOut */ ) { FUNC_LOG; // should be overriden ( if needed ) to use polymorphism diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/ceuiexitguardian.cpp --- a/emailuis/emailui/src/ceuiexitguardian.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/ceuiexitguardian.cpp Tue May 25 12:23:16 2010 +0300 @@ -19,21 +19,22 @@ #include "ceuiexitguardian.h" #include "emailtrace.h" + // --------------------------------------------------------------------------- // CEUiExitGuardian::NewL // // --------------------------------------------------------------------------- // CEUiExitGuardian* CEUiExitGuardian::NewL( CFreestyleEmailUiAppUi& aAppUi ) - { + { FUNC_LOG; - CEUiExitGuardian* self = new (ELeave) CEUiExitGuardian(aAppUi); - CleanupStack::PushL(self); + CEUiExitGuardian* self = new (ELeave) CEUiExitGuardian( aAppUi ); + CleanupStack::PushL( self ); self->ConstructL(); - CleanupStack::Pop(self); + CleanupStack::Pop( self ); return self; - } + } // --------------------------------------------------------------------------- // CEUiExitGuardian::CEUiExitGuardian @@ -41,7 +42,7 @@ // --------------------------------------------------------------------------- // CEUiExitGuardian::CEUiExitGuardian( CFreestyleEmailUiAppUi& aAppUi ) - : iAppUi(aAppUi) + : iAppUi( aAppUi ) { FUNC_LOG; } @@ -55,9 +56,14 @@ { FUNC_LOG; - delete iIdle; + if ( iPeriodicTimer ) + { + iPeriodicTimer->Cancel(); + delete iPeriodicTimer; + } } + // --------------------------------------------------------------------------- // CEUiExitGuardian::ConstructL // @@ -67,86 +73,52 @@ { FUNC_LOG; - iIdle = CIdle::NewL(CActive::EPriorityStandard); + iPeriodicTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + iPeriodicTimerStarted = EFalse; } + // --------------------------------------------------------------------------- -// CEUiExitGuardian::EnterLC +// CEUiExitGuardian::PeriodicCallBack // // --------------------------------------------------------------------------- // -void CEUiExitGuardian::EnterLC() - { - FUNC_LOG; - - if (iExitPending) - { - User::Leave(KErrNotReady); - } - iEnterCount++; - CleanupStack::PushL(TCleanupItem(Exit, this)); - } - -// --------------------------------------------------------------------------- -// CEUiExitGuardian::Exit -// -// --------------------------------------------------------------------------- -// -void CEUiExitGuardian::Exit(TAny* aPtr) - { - FUNC_LOG; - - reinterpret_cast(aPtr)->DoExit(); - } - -// --------------------------------------------------------------------------- -// CEUiExitGuardian::DoExit -// -// --------------------------------------------------------------------------- -// -void CEUiExitGuardian::DoExit() +TInt CEUiExitGuardian::PeriodicCallBack( TAny* aPtr ) { FUNC_LOG; - iEnterCount--; - if (iExitPending && !iEnterCount && !iIdle->IsActive()) - { - // Start async exit processing to rewind recursion before the actual - // exit - iIdle->Start( TCallBack( IdleCallBack, this ) ); - } + reinterpret_cast(aPtr)->TryExitApplication(); + return KErrNone; } + // --------------------------------------------------------------------------- -// CEUiExitGuardian::IdleCallBack +// CEUiExitGuardian::TryExitApplication // // --------------------------------------------------------------------------- // -TInt CEUiExitGuardian::IdleCallBack( TAny* aPtr ) +TInt CEUiExitGuardian::TryExitApplication() { FUNC_LOG; - - reinterpret_cast( aPtr )->iAppUi.ExitNow(); - return KErrNone; - } + const TInt KDelay = 200*1000; // 200 ms + + TInt ret = KRequestPending; -// --------------------------------------------------------------------------- -// CEUiExitGuardian::ExitApplication -// -// --------------------------------------------------------------------------- -// -TInt CEUiExitGuardian::ExitApplication() - { - FUNC_LOG; - - TInt result( KRequestPending ); - iExitPending = ETrue; - if (!iEnterCount) + CActiveScheduler* scheduler = CActiveScheduler::Current(); + TInt nestedLevelCount = scheduler->StackDepth(); + if ( nestedLevelCount == 1 ) { - result = KErrNone; + iPeriodicTimer->Cancel(); iAppUi.ExitNow(); + ret = KErrNone; } - return result; + else if ( !iPeriodicTimerStarted ) + { + iPeriodicTimer->Start( KDelay, KDelay, TCallBack(PeriodicCallBack, this) ); + iPeriodicTimerStarted = ETrue; + } + + return ret; } // end of file diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/ncscomposeview.cpp --- a/emailuis/emailui/src/ncscomposeview.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/ncscomposeview.cpp Tue May 25 12:23:16 2010 +0300 @@ -243,6 +243,17 @@ iActiveHelper->Cancel(); iActiveHelper->Start(); } + else if ( iIncludeMessageTextAsync ) + { + if ( iContainer ) + { + iContainer->StopAsyncTextFormatter(); + } + ResetComposer(); + iAsyncCallback->Cancel(); // cancel any outstanding callback + iAsyncCallback->Set( TCallBack( AsyncExit, this ) ); + iAsyncCallback->CallBack(); + } else { DoSafeExit( ESaveDraft ); @@ -277,6 +288,16 @@ TUid aCustomMessageId, const TDesC8& aCustomMessage ) { FUNC_LOG; + + // 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. + // That's why we prevent activation and the same is done in ChildDoDeactivate + if ( iIncludeMessageTextAsync ) + { + return; + } + if ( !iFirstStartCompleted ) { DoFirstStartL(); @@ -412,6 +433,7 @@ iViewReady = ETrue; Toolbar()->SetDimmed( EFalse ); RefreshToolbar(); + iContainer->ActivateL(); } // if there is a embedded app in FSEmail. @@ -434,6 +456,14 @@ rwsSession.Close(); CleanupStack::PopAndDestroy( &rwsSession ); } + + if ( iIncludeMessageTextAsync ) + { + // including message body in async way + IncludeMessageTextAsyncL( ETrue ); + } + + iViewFullyActivated = ETrue; TIMESTAMP( "Editor launched" ); } @@ -735,6 +765,14 @@ void CNcsComposeView::ChildDoDeactivate() { FUNC_LOG; + + // see comment in ChildDoActivate + if ( iIncludeMessageTextAsync && !iAppUi.AppUiExitOngoing() ) + { + return; + } + + iViewFullyActivated = EFalse; iAppUi.StopEndKeyCapture(); @@ -1880,6 +1918,104 @@ } // ----------------------------------------------------------------------------- +// CNcsComposeView::IncludeMessageTextAsyncL() +// +// ----------------------------------------------------------------------------- +// +void CNcsComposeView::IncludeMessageTextAsyncL( TBool aEnsureSpaceInBegin /*= EFalse*/ ) + { + FUNC_LOG; + + __ASSERT_DEBUG( iContainer, Panic( ENcsBasicUi ) ); + + delete iBody; + iBody = NULL; + HBufC* rawBody = GetMessageBodyL(); + + // Ensure there's free space in the beginning of the message if required + if ( aEnsureSpaceInBegin && rawBody->Length() ) + { + TText firstChar = (*rawBody)[0]; + _LIT( KNewLines, "\r\n\x2028\x2029" ); + if ( KNewLines().Locate( firstChar ) == KErrNotFound ) + { + CleanupStack::PushL( rawBody ); + // First character is not a new line character. Insert one. + iBody = HBufC::NewL( rawBody->Length() + KIMSLineFeed().Length() ); + TPtr ptr = iBody->Des(); + ptr.Append( KIMSLineFeed ); + ptr.Append( *rawBody ); + CleanupStack::PopAndDestroy( rawBody ); + rawBody = NULL; + } + } + // If no modifications were needed, then just set body pointer to point + // the rawBody + if ( !iBody ) + { + iBody = rawBody; + rawBody = NULL; + } + // Now we have possibly decorated message text in body pointer and + // in cleanup stack + + // Divide the contents into normal body and the read-only quote fields + // Convert bytes length to words length + TInt readOnlyLength = iNewMessageTextPart->ReadOnlyPartSize() / 2; + //This check is unnecessary, but without that coverity complains + if ( iBody ) + { + TInt modifiableLength = iBody->Length() - readOnlyLength; + + // Remove one newline from the end of the modifiable body if there's + // read-only quote present. This is because the field boundary appears + // as newline on the screen. This newline is added back when saving + // the message. + TInt lfLength = KIMSLineFeed().Length(); + if ( readOnlyLength && modifiableLength >= lfLength && + iBody->Mid( modifiableLength-lfLength, lfLength ) == KIMSLineFeed ) + { + modifiableLength -= lfLength; + } + + iContainer->SetBodyContentAsyncL( iBody->Left( modifiableLength ), + iBody->Right( readOnlyLength ) ); + + // callback: SetBodyContentCompleteL + } + } + +// ----------------------------------------------------------------------------- +// CNcsComposeView::SetBodyContentComplete() +// +// ----------------------------------------------------------------------------- +// +void CNcsComposeView::SetBodyContentComplete() + { + delete iBody; + iBody = NULL; + + if ( iOpeningWaitDialog ) + { + TRAP_IGNORE( iOpeningWaitDialog->ProcessFinishedL() ); + iOpeningWaitDialog = NULL; + } + + iOpeningWaitNoteVisible = EFalse; + iIncludeMessageTextAsync = EFalse; + } + +// ----------------------------------------------------------------------------- +// CNcsComposeView::IsOpeningWaitNoteVisible() +// +// ----------------------------------------------------------------------------- +// +TBool CNcsComposeView::IsOpeningWaitNoteVisible() + { + return iOpeningWaitNoteVisible; + } + +// ----------------------------------------------------------------------------- // CNcsComposeView::InitForwardFieldsL() // // ----------------------------------------------------------------------------- @@ -2611,13 +2747,18 @@ { FUNC_LOG; // Show "Opening" wait note if the message body is large - TInt waitNoteId = KErrNotFound; + iOpeningWaitNoteVisible = EFalse; if ( TFsEmailUiUtility::IsMessageBodyLargeL(iOrigMessage) ) { - waitNoteId = TFsEmailUiUtility::ShowGlobalWaitNoteLC( - R_FSE_WAIT_OPENING_TEXT ); + TFsEmailUiUtility::ShowWaitNoteL( iOpeningWaitDialog, + R_FSE_WAIT_OPENING_TEXT, EFalse, ETrue ); + iOpeningWaitNoteVisible = ETrue; } + // disable this flag if "old style" sync mode is needed + // for including body of text + iIncludeMessageTextAsync = ETrue; + if ( iCustomMessageId == TUid::Uid( KEditorCmdReply ) ) { GenerateReplyMessageL( EFalse ); @@ -2638,11 +2779,13 @@ // This shouldn't ever happen. Panic in debug builds. ASSERT( EFalse ); } - - // Close the "Opening" wait note if it was shown - if ( waitNoteId != KErrNotFound ) + + // Close the "Opening" wait note if it was shown + // and include message text was done synchronously + if ( !iIncludeMessageTextAsync && iOpeningWaitDialog ) { - CleanupStack::PopAndDestroy( (TAny*)waitNoteId ); + iOpeningWaitDialog->ProcessFinishedL(); + iOpeningWaitDialog = NULL; } } @@ -2760,7 +2903,16 @@ if ( iFirstStartCompleted ) // Safety check { InitReplyFieldsL( aReplyAll ); - IncludeMessageTextL( ETrue ); + // if flag is set - + // message text will be included asynchronously by calling method + // IncludeMessageTextAsyncL() at the end of view activation or when + // all attachments are downloaded - this is done because formatting + // text in CTextView with method FormatTextL() causes phone + // irresponsive. + if ( !iIncludeMessageTextAsync ) + { + IncludeMessageTextL( ETrue ); + } iContainer->SetFocusToMessageFieldL(); } } @@ -2800,7 +2952,16 @@ if ( iFirstStartCompleted ) // Safety check { InitForwardFieldsL(); - IncludeMessageTextL( ETrue ); + // if flag is set - + // message text will be included asynchronously by calling method + // IncludeMessageTextAsyncL() at the end of view activation or when + // all attachments are downloaded - this is done because formatting + // text in CTextView with method FormatTextL() causes phone + // irresponsive. + if ( !iIncludeMessageTextAsync ) + { + IncludeMessageTextL( ETrue ); + } iContainer->SetFocusToToField(); iContainer->SelectAllToFieldTextL(); } @@ -2971,6 +3132,29 @@ TRAP_IGNORE( iFetchWaitDialog->ProcessFinishedL() ); iFetchWaitDialog = NULL; } + + if ( iMailFetchingErrCode == KErrNone ) + { + if ( iIncludeMessageTextAsync ) + { + // in case the "Opening" wait note was closed by + // wait note "Retrieving" + if ( !iOpeningWaitDialog && iOpeningWaitNoteVisible ) + { + TRAP_IGNORE( TFsEmailUiUtility::ShowWaitNoteL( iOpeningWaitDialog, + R_FSE_WAIT_OPENING_TEXT, EFalse, ETrue ) ); + } + } + + if ( iViewFullyActivated && iIncludeMessageTextAsync ) + { + // include message body in async way. + // it is done here only if view was already activated + // this mean that attachments were added in async way + // and we couldn't start async including body text + TRAP_IGNORE( IncludeMessageTextAsyncL( ETrue ) ); + } + } return result; } diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/ncscomposeviewcontainer.cpp --- a/emailuis/emailui/src/ncscomposeviewcontainer.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/ncscomposeviewcontainer.cpp Tue May 25 12:23:16 2010 +0300 @@ -52,7 +52,7 @@ #include "FreestyleEmailUi.hrh" #include "FSAutoSaver.h" #include "FreestyleEmailUiCLSItem.h" - +#include "FSAsyncTextFormatter.h" const TInt KHeaderVisibilityThreshold = -100; @@ -169,14 +169,23 @@ iLongTapDetector = CAknLongTapDetector::NewL( this ); - ActivateL(); - DrawDeferred(); - // activate auto save functionality iAutoSaver.Enable( ETrue ); } // --------------------------------------------------------------------------- +// CNcsComposeViewContainer::StopAsyncTextFormatter +// --------------------------------------------------------------------------- +// +void CNcsComposeViewContainer::StopAsyncTextFormatter() + { + if ( iAsyncTextFormatter ) + { + iAsyncTextFormatter->Cancel(); + } + } + +// --------------------------------------------------------------------------- // CNcsComposeViewContainer::~CNcsComposeViewContainer // Destructor // --------------------------------------------------------------------------- @@ -184,6 +193,13 @@ CNcsComposeViewContainer::~CNcsComposeViewContainer() { FUNC_LOG; + + if ( iAsyncTextFormatter ) + { + iAsyncTextFormatter->Cancel(); + delete iAsyncTextFormatter; + } + if ( iContactHandler ) { iContactHandler->ClearObservers(); @@ -503,8 +519,7 @@ if ( iFocused ) ret = iFocused->OfferKeyEventL( aKeyEvent, aType ); - if( aType == EEventKeyUp ) - iView.HandleContainerChangeRequiringToolbarRefresh(); + iView.HandleContainerChangeRequiringToolbarRefresh(); // Report user activity to auto saver if editor field handled the // event. In case of message field (body text), EKeyWasConsumed @@ -738,6 +753,7 @@ const TPoint headerPos( NcsUtility::HeaderControlPosition( cmailPaneRect, 0 ) ); cmailPaneRect.Move( 0, iHeader->Position().iY - headerPos.iY ); + iCmailPaneRect = cmailPaneRect; NcsUtility::LayoutHeaderControl( iHeader, cmailPaneRect, 0, headerLineCount ); @@ -747,7 +763,13 @@ NcsUtility::LayoutBodyEdwin( iMessageField, cmailPaneRect, iHeader->LayoutLineCount(), iMessageField->LineCount(), iSeparatorLineYPos ); - TRAP_IGNORE( iMessageField->FormatAllTextNowL() ); + + // we don't need format again when format was already done + // during creation of forward/reply message + if ( !iSwitchOffFormattingText ) + { + TRAP_IGNORE( iMessageField->FormatAllTextNowL() ); + } iMessageField->UpdateFontSize(); @@ -759,7 +781,12 @@ iReadOnlyQuoteField, cmailPaneRect, iHeader->LayoutLineCount() + iMessageField->LineCount(), iReadOnlyQuoteField->LineCount(), dummySeparatorPos ); - TRAP_IGNORE( iReadOnlyQuoteField->FormatAllTextNowL() ); + // we don't need format again when format was already done + // during creation of forward/reply message + if ( !iSwitchOffFormattingText ) + { + TRAP_IGNORE( iReadOnlyQuoteField->FormatAllTextNowL() ); + } iReadOnlyQuoteField->UpdateFontSize(); readOnlyQuoteFieldHeight = iReadOnlyQuoteField->Rect().Height(); } @@ -782,8 +809,11 @@ TSize newSize( iMessageField->Size().iWidth, Max( iMessageField->Size().iHeight, iMessageEditorMinHeigth ) ); - - iMessageField->SetSize( newSize ); + + if ( !iSwitchOffFormattingText ) + { + iMessageField->SetSize( newSize ); + } } else { @@ -865,6 +895,94 @@ } // ----------------------------------------------------------------------------- +// CNcsComposeViewContainer::SetBodyContentAsyncL() +// ----------------------------------------------------------------------------- +// +void CNcsComposeViewContainer::SetBodyContentAsyncL( const TDesC& aMessage, + const TDesC& aReadOnlyQuote ) + { + FUNC_LOG; + delete iReadOnlyQuote; + iReadOnlyQuote = NULL; + if ( aReadOnlyQuote.Length() ) + { + iReadOnlyQuote = aReadOnlyQuote.AllocL(); + } + + RMemReadStream inputStream( aMessage.Ptr(), aMessage.Size() ); + CleanupClosePushL( inputStream ); + iMessageField->RichText()->ImportTextL( 0, inputStream, + CPlainText::EOrganiseByParagraph ); + CleanupStack::PopAndDestroy( &inputStream ); + + + // Activating the field will set the control to the end of the text + iMessageField->ActivateL(); + iMessageField->SetCursorPosL( 0, EFalse ); + + iProcessedField = iMessageField; + + iAsyncTextFormatter = CFSAsyncTextFormatter::NewL(); + iAsyncTextFormatter->StartFormatting( iMessageField->TextLayout(), this ); + + // callback from AO: FormatAllTextCompleteL +} + +// ----------------------------------------------------------------------------- +// CNcsComposeViewContainer::FormatAllTextCancelled() +// ----------------------------------------------------------------------------- +// +void CNcsComposeViewContainer::FormatAllTextCancelled() + { + iView.SetBodyContentComplete(); + } + +// ----------------------------------------------------------------------------- +// CNcsComposeViewContainer::FormatAllTextComplete() +// ----------------------------------------------------------------------------- +// +void CNcsComposeViewContainer::FormatAllTextComplete() + { + if ( iReadOnlyQuote && iProcessedField == iMessageField ) + { + iProcessedField = iReadOnlyQuoteField; + if ( iReadOnlyQuote ) + { + TInt dummySeparatorPos; + NcsUtility::LayoutBodyEdwin( iReadOnlyQuoteField, iCmailPaneRect, + iHeader->LayoutLineCount() + iMessageField->LineCount(), + iReadOnlyQuoteField->LineCount(), dummySeparatorPos ); + + RMemReadStream inputStream; + inputStream.Open( iReadOnlyQuote->Ptr(), iReadOnlyQuote->Size() ); + TRAP_IGNORE( iReadOnlyQuoteField->RichText()->ImportTextL( 0, inputStream, + CPlainText::EOrganiseByParagraph ) ); + inputStream.Close(); + + // Activating the field will set the control to the end of the text + TRAP_IGNORE( iReadOnlyQuoteField->ActivateL() ); + TRAP_IGNORE( iReadOnlyQuoteField->SetCursorPosL( 0, EFalse ) ); + + if ( !iAsyncTextFormatter ) + { + TRAP_IGNORE( iAsyncTextFormatter = CFSAsyncTextFormatter::NewL() ); + } + iAsyncTextFormatter->StartFormatting( + iReadOnlyQuoteField->TextLayout(), this ); + } + } + else + { + // Recalculate the size of the body field + iSwitchOffFormattingText = ETrue; + SizeChanged(); + iSwitchOffFormattingText = EFalse; + + iView.SetBodyContentComplete(); + } + } + +// ----------------------------------------------------------------------------- // CNcsComposeViewContainer::GetBodyContentLC() // ----------------------------------------------------------------------------- // @@ -1042,12 +1160,18 @@ { if ( aDesirableEdwinSize.iHeight >= iMessageEditorMinHeigth ) { - aEdwin->SetSize( aDesirableEdwinSize ); + if ( !iSwitchOffFormattingText ) + { + aEdwin->SetSize( aDesirableEdwinSize ); + } } } else { - aEdwin->SetSize( aDesirableEdwinSize ); + if ( !iSwitchOffFormattingText ) + { + aEdwin->SetSize( aDesirableEdwinSize ); + } } if ( aEdwin == iMessageField ) { @@ -1966,14 +2090,14 @@ FUNC_LOG; TInt scrollOffset = aNewPosition.iY - iVisibleAreaHeight / 2; - // when the composer view is overlapped by other view for instance task switcher or screensaver - // physics sends a faulty event to move the composer view down. - // This action is ignored here. - if (aNewPosition.iY != 0) - { - Scroll( scrollOffset, aDrawNow ); + // when the composer view is overlapped by other view for instance task switcher or screensaver + // physics sends a faulty event to move the composer view down. + // This action is ignored here. + if (aNewPosition.iY != 0) + { + Scroll( scrollOffset, aDrawNow ); + } } - } // ----------------------------------------------------------------------------- // CNcsComposeViewContainer::PhysicEmulationEnded @@ -2010,27 +2134,3 @@ FUNC_LOG; return iHeader->IsRemoteSearchInprogress(); } - -// ----------------------------------------------------------------------------- -// CNcsComposeViewContainer::DoUpdateSubjectL -// ----------------------------------------------------------------------------- -// -void CNcsComposeViewContainer::DoUpdateSubjectL() - { - FUNC_LOG; - // fix for ESLX-7Y4C2V, dissapearing subject - // get copy of subject - HBufC* subjectCopy = GetSubjectLC(); - iHeader->SetFocus( EFalse, EDrawNow ); - // get subject after focus lost - HBufC* subject = GetSubjectLC(); - // restore subject from copy if necessary - if ( subject->Length() != subjectCopy->Length() ) - { - iHeader->SetSubjectL( *subjectCopy ); - } - - // restore focus - iHeader->SetFocus( ETrue, EDrawNow ); - CleanupStack::PopAndDestroy( 2, subjectCopy ); - } diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/emailui/src/ncsheadercontainer.cpp --- a/emailuis/emailui/src/ncsheadercontainer.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/emailui/src/ncsheadercontainer.cpp Tue May 25 12:23:16 2010 +0300 @@ -1228,7 +1228,7 @@ { if( aShow ) { - iMenuBar->SetCommandSetL( R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT ); + iMenuBar->SetCommandSetL( R_AVKON_SOFTKEYS_CANCEL ); } else { diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp --- a/emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp Tue May 25 12:23:16 2010 +0300 @@ -1253,13 +1253,11 @@ // If there is no text in the button, center the icon to the button if( !iLabelFirstLine || iLabelFirstLine->Text().Length() == 0 ) { - TSize oldIconSize = iconA.Size(); - iconA.SetRect( TPoint( - ( buttonSize.iWidth - oldIconSize.iWidth ) / 2, - ( buttonSize.iHeight - oldIconSize.iHeight ) / 2 ), - oldIconSize ); + TRect oldIconRect = iconA; + iconA.SetRect( TPoint(( buttonSize.iWidth - oldIconRect.Width())/2, + oldIconRect.iTl.iY), + oldIconRect.Size() ); } - if ( iButtonModel->ContainsElement( ECBElemIconA ) ) { const TSize& size( iconA.Size() ); diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp --- a/emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp Tue May 25 12:23:16 2010 +0300 @@ -241,12 +241,6 @@ mainIconMetrics, rect, mainIconVariety ); - // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK - if (rect.iTl.iY < 15) - { - rect.Move(0, 15 - rect.iTl.iY); - } - // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpMainIconTl.SetTarget(TAlfRealPoint(rect.iTl)); tpMainIconBr.SetTarget(TAlfRealPoint(rect.iBr)); @@ -255,12 +249,6 @@ markIconMetrics, rect, markIconVariety ); - // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK - if (rect.iTl.iY < 15) - { - rect.Move(0, 15 - rect.iTl.iY); - } - // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpMarkIconTl.SetTarget(TAlfRealPoint(rect.iTl)); tpMarkIconBr.SetTarget(TAlfRealPoint(rect.iBr)); @@ -269,12 +257,6 @@ menuIconMetrics, rect, menuIconVariety ); - // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK - if (rect.iTl.iY < 15) - { - rect.Move(0, 15 - rect.iTl.iY); - } - // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpMenuIconTl.SetTarget(TAlfRealPoint(rect.iTl)); tpMenuIconBr.SetTarget(TAlfRealPoint(rect.iBr)); @@ -293,12 +275,6 @@ CFsLayoutManager::LayoutMetricsText(textRect, textMetrics, textInfo, textPaneVariety); - // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK - if (textInfo.iTextRect.iTl.iY < 15) - { - textInfo.iTextRect.Move(0, 15 - textInfo.iTextRect.iTl.iY); - } - // WORKAROUND FIX FOR LAYOUT PROBLEM -- RETURN THIS TO NORMAL WHEN LAYOUT'S ARE OK tpTextTl.SetTarget(TAlfRealPoint(textInfo.iTextRect.iTl)); tpTextBr.SetTarget(TAlfRealPoint(textInfo.iTextRect.iBr)); diff -r b5fbb9b25d57 -r 67369d1b217f emailuis/uicomponents/src/fstreevisualizerbase.cpp --- a/emailuis/uicomponents/src/fstreevisualizerbase.cpp Tue May 11 15:57:15 2010 +0300 +++ b/emailuis/uicomponents/src/fstreevisualizerbase.cpp Tue May 25 12:23:16 2010 +0300 @@ -88,7 +88,8 @@ // check from aknphysicsconstants.h const TInt KFlickMaxDuration( 500000 ); -const TInt KDefaultFriction( 25 ); // avkon default is 10 +//const TInt KDefaultFriction( 25 ); // avkon default is 10 +const TInt KDefaultFriction( 5 ); // avkon default is 10 // ======== LOCAL FUNCTIONS ======== diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssosplugin/group/IPSSosPlugin.mmp --- a/ipsservices/ipssosplugin/group/IPSSosPlugin.mmp Tue May 11 15:57:15 2010 +0300 +++ b/ipsservices/ipssosplugin/group/IPSSosPlugin.mmp Tue May 25 12:23:16 2010 +0300 @@ -65,6 +65,7 @@ SOURCE ipsplgtextsearcher.cpp SOURCE ipsplgconnectandrefreshfolderlist.cpp SOURCE ipsplgsyncstatehandler.cpp +SOURCE cemailsettingsextensionimpl.cpp SOURCEPATH ../data diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssosplugin/group/bld.inf --- a/ipsservices/ipssosplugin/group/bld.inf Tue May 11 15:57:15 2010 +0300 +++ b/ipsservices/ipssosplugin/group/bld.inf Tue May 25 12:23:16 2010 +0300 @@ -32,6 +32,7 @@ ../inc/ipsplgbaseoperation.h |../../inc/ipsplgbaseoperation.h ../inc/ipsplgconnectandrefreshfolderlist.h |../../inc/ipsplgconnectandrefreshfolderlist.h ../inc/ipsplgpropertywatcher.h |../../inc/ipsplgpropertywatcher.h +../inc/cemailsettingsextension.h |../../inc/cemailsettingsextension.h // PRJ_MMPFILES ../group/IPSSosPlugin.mmp diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssosplugin/inc/cemailsettingsextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipsservices/ipssosplugin/inc/cemailsettingsextension.h Tue May 25 12:23:16 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: mailbox settings extension +* +*/ + +#ifndef CEMAILSETTINGSEXTENSION_H +#define CEMAILSETTINGSEXTENSION_H + +#include "cemailextensionbase.h" +#include "emailextensionuids.hrh" + +#include "cfsmailcommon.h" + +// interface UID value passed to CFSMailBox::ExtensionL +_LIT( EmailSyncInterval, "EmailSyncInterval" ); + +/** + * settings extension interface + * + */ +class CEmailSettingsExtension : public CEmailExtension +{ +public: + + /** + * setting value getter + */ + virtual void GetSettingValue( const TDesC& aKey, TDesC8& aValue ) const = 0; + + /** + * setting value setter + */ + virtual void SetSettingValue( const TDesC& aKey, const RBuf8& aValue ) = 0; + + /** + * Test if setting is set + */ + virtual TBool IsSetL( const TDesC& aKey ) = 0; + + /** + * mailbox id getter & setter + */ + virtual void SetMailBoxId( const TFSMailMsgId& aMailBoxId ) = 0; + virtual TFSMailMsgId GetMailBoxId( ) = 0; + +protected: + CEmailSettingsExtension( const TUid& aUid ); +}; + +#endif // CEMAILSETTINGSEXTENSION_H diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssosplugin/inc/cemailsettingsextensionimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipsservices/ipssosplugin/inc/cemailsettingsextensionimpl.h Tue May 25 12:23:16 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: settings extension for mailbox +* +*/ +#ifndef CEMAILSETTINGSEXTENSIONIMPL_H +#define CEMAILSETTINGSEXTENSIONIMPL_H + +#include "cemailsettingsextension.h" +#include "cemailextensionbase.h" + +/** +* Implementation of mailbox settings extension +*/ +NONSHARABLE_CLASS( CEmailSettingsExtensionImpl ) : public CEmailSettingsExtension +{ +public: + + CEmailSettingsExtensionImpl(); + CEmailSettingsExtensionImpl(CMsvSession* iSession); + ~CEmailSettingsExtensionImpl(); + +public: // from CEmailSettingsExtension + /** + * setting value getter + */ + virtual void GetSettingValue( const TDesC& aKey, TDesC8& aValue ) const; + + /** + * setting value setter + */ + virtual void SetSettingValue( const TDesC& aKey, const RBuf8& aValue); + + /** + * Test setting value + */ + virtual TBool IsSetL( const TDesC& aKey ); + + /** + * mailbox id getter & setter + */ + virtual void SetMailBoxId( const TFSMailMsgId& aMailBoxId ); + virtual TFSMailMsgId GetMailBoxId( ); + +private: // data + + // owner mailbox id + TFSMailMsgId iMailBoxId; + + // Symbian message server session + CMsvSession* iSession; + +}; + +#endif // CEMAILSETTINGSEXTENSIONIMPL_H diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssosplugin/inc/ipsplgheaders.h --- a/ipsservices/ipssosplugin/inc/ipsplgheaders.h Tue May 11 15:57:15 2010 +0300 +++ b/ipsservices/ipssosplugin/inc/ipsplgheaders.h Tue May 25 12:23:16 2010 +0300 @@ -73,6 +73,8 @@ // #include "cfsmailcommon.h" #include "cfsmailmessage.h" +#include "cemailsettingsextensionimpl.h" + // sendui #include #include diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h --- a/ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h Tue May 11 15:57:15 2010 +0300 +++ b/ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h Tue May 25 12:23:16 2010 +0300 @@ -230,7 +230,6 @@ TImImap4GetMailInfo iGetMailInfo; TInt iFunctionId; TPckgBuf iProgress; - TMsvId iService; TBool iPopulated; CIpsFetchProgReport* iProgReport; // Temporary fix for handling KErrServerBusy errors from the diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h --- a/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h Tue May 11 15:57:15 2010 +0300 +++ b/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h Tue May 25 12:23:16 2010 +0300 @@ -387,6 +387,8 @@ const TFSMailMsgId& aMailBoxId, const TDesC& aUsername, const TDesC& aPassword ); + + virtual CEmailExtension* ExtensionL( const TUid& aInterfaceUid ); public: diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssosplugin/src/cemailsettingsextensionimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ipsservices/ipssosplugin/src/cemailsettingsextensionimpl.cpp Tue May 25 12:23:16 2010 +0300 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: implementation of settings extension for mailbox +* +*/ + +#include +#include +#include "ipssetdataapi.h" +#include "ipssetdataextension.h" + +#include "emailtrace.h" +#include "cemailsettingsextensionimpl.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CEmailSettingsExtension::CEmailSettingsExtension( const TUid& aUid ) : CEmailExtension( aUid ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CEmailSettingsExtensionImpl::CEmailSettingsExtensionImpl() : + CEmailSettingsExtension( KEmailSettingExtensionUid ) + { + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CEmailSettingsExtensionImpl::CEmailSettingsExtensionImpl(CMsvSession* aSession) : + CEmailSettingsExtension( KEmailSettingExtensionUid ) + { + iSession = aSession; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +CEmailSettingsExtensionImpl::~CEmailSettingsExtensionImpl() + { + FUNC_LOG + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CEmailSettingsExtensionImpl::GetSettingValue( const TDesC& /*aKey*/, TDesC8& /*aValue*/ ) const + { + FUNC_LOG + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CEmailSettingsExtensionImpl::SetSettingValue( const TDesC& /*aKey*/, const RBuf8& /*aValue*/ ) + { + FUNC_LOG + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TBool CEmailSettingsExtensionImpl::IsSetL( const TDesC& aKey ) + { + FUNC_LOG + + TBool ret = EFalse; + if(!aKey.Compare(EmailSyncInterval)) + { + // create account api and setting objects + CEmailAccounts* accounts = CEmailAccounts::NewL(); + CleanupStack::PushL( accounts ); + RArray imapBoxes; + accounts->GetImapAccountsL(imapBoxes); + TMsvId serviceId = iMailBoxId.Id(); + TBool found = EFalse; + for(TInt i=0;i popBoxes; + accounts->GetPopAccountsL(popBoxes); + for(TInt i=0;iLoadExtendedSettingsL(serviceId,*extentedSettings); + TInt syncTime = extentedSettings->InboxRefreshTime(); + if(syncTime == KErrNotFound) + { + ret = ETrue; + } + else + { + ret = EFalse; + } + CleanupStack::PopAndDestroy( 2 ); + } + CleanupStack::PopAndDestroy( ); + } + return ret; + + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +TFSMailMsgId CEmailSettingsExtensionImpl::GetMailBoxId( ) + { + FUNC_LOG + return iMailBoxId; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void CEmailSettingsExtensionImpl::SetMailBoxId( const TFSMailMsgId& aMailBoxId ) + { + FUNC_LOG + iMailBoxId = aMailBoxId; + } diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp --- a/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp Tue May 11 15:57:15 2010 +0300 +++ b/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp Tue May 25 12:23:16 2010 +0300 @@ -231,11 +231,12 @@ { case EStateConnecting: { - TBool connected = STATIC_CAST( - CIpsPlgImap4ConnectOp*, iOperation)->Connected(); - if(!connected) + // get result of connect operation + TInt err = iStatus.Int(); + + if( err != KErrNone ) { - CompleteObserver( KErrCouldNotConnect ); + CompleteObserver( err == KErrCancel ? err : KErrCouldNotConnect ); return; } iRetryCount = 0; diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp --- a/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp Tue May 11 15:57:15 2010 +0300 +++ b/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp Tue May 25 12:23:16 2010 +0300 @@ -2603,4 +2603,24 @@ } } } - +// --------------------------------------------------------------------------- +// finds and returns extension +// --------------------------------------------------------------------------- +// +CEmailExtension* CIpsPlgSosBasePlugin::ExtensionL( const TUid& aInterfaceUid ) + { + FUNC_LOG; + + // search for settings extension + CEmailExtension* extension = CExtendableEmail::ExtensionL( aInterfaceUid ); + + // if not found create settings extension + if ( extension == NULL && aInterfaceUid == KEmailSettingExtensionUid) + { + extension = new (ELeave) CEmailSettingsExtensionImpl(iSession); + CleanupStack::PushL( extension ); + iExtensions.AddL( extension ); + CleanupStack::Pop(); + } + return extension; + } diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssossettings/inc/ipssetview.h --- a/ipsservices/ipssossettings/inc/ipssetview.h Tue May 11 15:57:15 2010 +0300 +++ b/ipsservices/ipssossettings/inc/ipssetview.h Tue May 25 12:23:16 2010 +0300 @@ -24,8 +24,6 @@ #include "esmailsettingsplugin.h" // -// Forward declarations -class CAknLocalScreenClearer; // class declaration class CIpsSetView : public CESMailSettingsPlugin @@ -87,7 +85,6 @@ CAsyncCallBack* iAsyncCallback; TVwsViewId iPrevViewId; HBufC8* iCustomMessage; - CAknLocalScreenClearer* iLocalScreenClearer; }; #endif //IPSSETVIEW_H_ diff -r b5fbb9b25d57 -r 67369d1b217f ipsservices/ipssossettings/src/ipssetview.cpp --- a/ipsservices/ipssossettings/src/ipssetview.cpp Tue May 11 15:57:15 2010 +0300 +++ b/ipsservices/ipssossettings/src/ipssetview.cpp Tue May 25 12:23:16 2010 +0300 @@ -20,7 +20,6 @@ #include #include #include -#include // #include "FreestyleEmailUiConstants.h" // @@ -66,11 +65,6 @@ FUNC_LOG; delete iAsyncCallback; delete iCustomMessage; - if (iLocalScreenClearer != NULL) - { - delete iLocalScreenClearer; - iLocalScreenClearer = NULL; - } } // Constructor @@ -96,17 +90,11 @@ iCustomMessage = NULL; iCustomMessage = aCustomMessage.AllocL(); iAsyncCallback->CallBack(); - iLocalScreenClearer = CAknLocalScreenClearer::NewL( EFalse ); } void CIpsSetView::DoDeactivate() { FUNC_LOG; - if (iLocalScreenClearer != NULL) - { - delete iLocalScreenClearer; - iLocalScreenClearer = NULL; - } } TPtrC CIpsSetView::MailSettingsSubviewCaption( @@ -196,9 +184,6 @@ } else { - //refresh background - self->iLocalScreenClearer->DrawNow(); - //check if composer is active view; needed to handle special case when email is plugin settings and composer is activated externaly TVwsViewId aViewId; self->AppUi()->GetActiveViewId(aViewId); diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/data/esmrgui.rss --- a/meetingrequest/mrgui/data/esmrgui.rss Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/data/esmrgui.rss Tue May 25 12:23:16 2010 +0300 @@ -1801,6 +1801,14 @@ { buf = qtn_calendar_opt_delete_entry; } +RESOURCE TBUF r_meet_req_conflict_text_format + { + buf = "%0U[20]\n%1U[20]\n%2U\n%3U"; // qtn_meet_req_conflict_text_format + } +RESOURCE TBUF r_meet_req_conflict_location_format + { + buf = "(%U)"; // qtn_meet_req_location_parenthesis + } // Viewer context menu bar RESOURCE MENU_BAR r_mr_viewer_context_menu diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/loc/mrui.loc --- a/meetingrequest/mrgui/loc/mrui.loc Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/loc/mrui.loc Tue May 25 12:23:16 2010 +0300 @@ -1266,5 +1266,21 @@ // #define qtn_meet_req_fw_recurrent_series "Forward the series" +// d: Conflict popup display text. Text must be wrapped at given locations. +// d: %0U is replaced with qtn_meet_req_conflicts_with_label +// d: %1U is replaced with conflict time information +// d: %2U is replaced with title. Text may be wrapped to 3 lines. +// d: %3U is replaced with location. Text may be wrapped to 2 lines. +// l: popup_preview_text_window/opt5 +// r: TB9.2 +// +#define qtn_meet_req_conflict_text_format "%0U[20]\n%1U[20]\n%2U\n%3U" + +// d: Conflict popup location text format +// d: %U is replaced with location. Text may be wrapped to 3 lines. +// l: fscal_mr_tooltip_text +// r: TB9.2 +// +#define qtn_meet_req_location_parenthesis "(%U)" // end of file diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/mrfieldbuilderplugin/group/esmrfieldbuilderplugin.mmp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/group/esmrfieldbuilderplugin.mmp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/group/esmrfieldbuilderplugin.mmp Tue May 25 12:23:16 2010 +0300 @@ -119,7 +119,6 @@ LIBRARY cdlengine.lib LIBRARY caleninterimutils2.lib LIBRARY eikcore.lib -LIBRARY npdlib.lib LIBRARY apgrfx.lib LIBRARY efsrv.lib LIBRARY commonui.lib diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentcommandhandler.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentcommandhandler.cpp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentcommandhandler.cpp Tue May 25 12:23:16 2010 +0300 @@ -468,21 +468,23 @@ HandleAttachmentCommandInternalL( EESMRViewerSaveAttachment, attachmentIndex ); - if ( EESMRViewerSaveAllAttachments == iCommandInProgress && - iAttachmentInfo->AttachmentCount() ) + if ( EESMRViewerSaveAllAttachments == iCommandInProgress ) { iCommandInProgress = 0; - // There are more attachments to be downloaded --> Download next - SaveNextRemoteAttachmentL(); + if ( iAttachmentInfo->AttachmentCount() > 0 ) + { + // There are more attachments to be downloaded --> Download next + SaveNextRemoteAttachmentL(); + } + else + { + // All remote attachments have been saved. Show info note. + ShowInfoNoteL( iEntry.AttachmentCountL() ); + } } else { - if ( !iAttachmentInfo->AttachmentCount() ) - { - // All remote attachments have been saved. Show info note. - ShowInfoNoteL( iEntry.AttachmentCountL() ); - } iCommandInProgress = 0; } } @@ -555,7 +557,7 @@ if ( error != KErrCancel ) { User::LeaveIfError( error ); - + if ( aCommandId == EESMRViewerSaveAttachment && iCommandInProgress != EESMRViewerSaveAllAttachments ) { @@ -833,13 +835,13 @@ User::LeaveIfError( error ); // Proceed with remote attachments - if ( iAttachmentInfo->AttachmentCount() > 0 ) + if ( iAttachmentInfo && iAttachmentInfo->AttachmentCount() > 0 ) { SaveNextRemoteAttachmentL(); } else // Show Save all info note { - ShowInfoNoteL( iEntry.AttachmentCountL() ); + ShowInfoNoteL( iEntry.AttachmentCountL() ); } } } @@ -852,7 +854,7 @@ { __ASSERT_DEBUG( iAttachmentInfo->AttachmentCount() > 0, Panic( EMRAttachmentCommandHandlerRemoteAttachmentNotFound ) ); - + // Save first remote attachment of attachment info RPointerArray attachmentArray; CleanupClosePushL( attachmentArray ); diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/mrfieldbuilderplugin/src/cmropenattachmentcommand.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmropenattachmentcommand.cpp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmropenattachmentcommand.cpp Tue May 25 12:23:16 2010 +0300 @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -28,13 +27,6 @@ // DEBUG #include "emailtrace.h" -// Unnamed namespace for local definitions -namespace { // codescanner::namespace - -// Notepad data type -_LIT8( KNotePadTextDataType, "text/plain" ); - -} // ======== MEMBER FUNCTIONS ======== @@ -48,7 +40,7 @@ { FUNC_LOG; } - + // --------------------------------------------------------------------------- // CMROpenAttachmentCommand::CMROpenAttachmentCommand // --------------------------------------------------------------------------- @@ -66,7 +58,7 @@ CDocumentHandler& aDocHandler ) { FUNC_LOG; - + CMROpenAttachmentCommand* self = new (ELeave) CMROpenAttachmentCommand( aDocHandler ); CleanupStack::PushL( self ); @@ -93,35 +85,21 @@ TInt aAttachmentIndex ) { FUNC_LOG; - + // Ownership not gained CCalAttachmentFile* attachmentFile = - aEntry.AttachmentL( aAttachmentIndex )->FileAttachment(); + aEntry.AttachmentL( aAttachmentIndex )->FileAttachment(); RFile file; attachmentFile->FetchFileHandleL( file ); CleanupClosePushL( file ); - - TDataType datatype( + + TDataType datatype( aEntry.AttachmentL( aAttachmentIndex )->MimeType() ); - - TInt err( KErrNone ); - if( datatype == KNotePadTextDataType() ) - { - // Notepad will try to open text/plain type data - err = CNotepadApi::ExecFileViewerL( - file, - NULL, - ETrue, - EFalse, - KCharacterSetIdentifierIso88591 ); - } - else - { - // Doc handler will try to open other than text files - TRAP( err, iDocHandler.OpenFileEmbeddedL( file, datatype ) ); - } - + + // Doc handler will try to open file + TRAPD( err, iDocHandler.OpenFileEmbeddedL( file, datatype ) ); + CleanupStack::PopAndDestroy( &file ); if( err != KErrNone ) diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrsaveandopenattachmentcommand.cpp --- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrsaveandopenattachmentcommand.cpp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrsaveandopenattachmentcommand.cpp Tue May 25 12:23:16 2010 +0300 @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -30,13 +29,6 @@ #include "emailtrace.h" -namespace { // codescanner::namespace - -// Notepad data type -_LIT8( KNotePadTextDataType, "text/plain" ); - -} - // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -134,21 +126,8 @@ TDataType datatype( aEntry.AttachmentL( aAttachmentIndex )->MimeType() ); - if( datatype == KNotePadTextDataType() ) - { - // Notepad will try to open text/plain type data - err = CNotepadApi::ExecFileViewerL( - copiedFile, - NULL, - ETrue, - EFalse, - KCharacterSetIdentifierIso88591 ); - } - else - { - // Doc handler will try to open other than text files - TRAP( err, iDocHandler.OpenFileEmbeddedL( copiedFile, datatype ) ); - } + // Doc handler will try to open file + TRAP( err, iDocHandler.OpenFileEmbeddedL( copiedFile, datatype ) ); CleanupStack::PopAndDestroy( &copiedFile ); CleanupStack::PopAndDestroy( &file ); diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/mrfieldbuilderpluginextension/group/esmrfieldbuilderpluginextension.mmp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/group/esmrfieldbuilderpluginextension.mmp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/group/esmrfieldbuilderpluginextension.mmp Tue May 25 12:23:16 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -42,7 +42,7 @@ //implementations -SOURCEPATH ../src +SOURCEPATH ../src SOURCE cesmrfieldbuilderpluginextensionproxy.cpp SOURCE cesmrfieldbuilderpluginextension.cpp @@ -117,6 +117,7 @@ LIBRARY ws32.lib //RWindowGroup LIBRARY cntmodel.lib //contactitem LIBRARY caleninterimutils2.lib +LIBRARY featdiscovery.lib // needed by XML based LAF components LIBRARY cdlengine.lib diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/mrfieldbuilderpluginextension/src/CESMRFieldBuilderPluginExtension.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/CESMRFieldBuilderPluginExtension.cpp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/CESMRFieldBuilderPluginExtension.cpp Tue May 25 12:23:16 2010 +0300 @@ -32,6 +32,8 @@ #include "cfsmailcommon.h" #include +#include +#include // DEBUG #include "emailtrace.h" @@ -56,7 +58,7 @@ CESMRFieldBuilderPluginExtension::~CESMRFieldBuilderPluginExtension() { FUNC_LOG; - if(iESMRStaticAccessed) + if(iESMRStaticAccessed) { iESMRStatic.Close(); } @@ -81,7 +83,7 @@ TMRCFSMailBoxCapability aCapa ) { FUNC_LOG; - + iESMRStatic.ConnectL(); iESMRStaticAccessed = ETrue; @@ -97,14 +99,14 @@ TMRCFSMailBoxCapability aCapa ) { FUNC_LOG; - + iESMRStatic.ConnectL(); iESMRStaticAccessed = ETrue; CFSMailBox* mailBox = iESMRStatic.MailBoxL( aEmailAddress ); TBool result = HasCapability( *mailBox, aCapa ); delete mailBox; - + return result; } @@ -117,26 +119,29 @@ FUNC_LOG; TBool retValue( EFalse ); - iESMRStatic.ConnectL(); - iESMRStaticAccessed = ETrue; + if ( CFeatureDiscovery::IsFeatureSupportedL( + TUid::Uid( KFeatureIdFfCalMeetingRequestUi ) ) ) + { + iESMRStatic.ConnectL(); + iESMRStaticAccessed = ETrue; - CCalenInterimUtils2* calUtils2 = CCalenInterimUtils2::NewL(); - CleanupStack::PushL( calUtils2 ); - if ( calUtils2->MRViewersEnabledL() ) - { - TRAPD( err, iESMRStatic.DefaultFSMailBoxL() ); + CCalenInterimUtils2* calUtils2 = CCalenInterimUtils2::NewL(); + CleanupStack::PushL( calUtils2 ); + if ( calUtils2->MRViewersEnabledL() ) + { + TRAPD( err, iESMRStatic.DefaultFSMailBoxL() ); - if ( KErrNone == err ) - { - // If can fetch the default FS mailbox --> - // We are able to originate MR as well. - retValue = ETrue; + if ( KErrNone == err ) + { + // If can fetch the default FS mailbox --> + // We are able to originate MR as well. + retValue = ETrue; + } } + + CleanupStack::PopAndDestroy( calUtils2 ); + calUtils2 = NULL; } - - CleanupStack::PopAndDestroy( calUtils2 ); - calUtils2 = NULL; - return retValue; } @@ -285,19 +290,19 @@ EFSMBoxCapaMeetingRequestAttendeeStatus ); break; } - + case EMRCFSRemoveFromCalendar: { response = aMailBox.HasCapability( EFSMBoxCapaRemoveFromCalendar ); break; } - + case EMRCFSSupportsAttachmentsInMR: { response = aMailBox.HasCapability( EFSMboxCapaSupportsAttahmentsInMR ); } break; - + default: { break; diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrconflictpopup.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrconflictpopup.cpp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrconflictpopup.cpp Tue May 25 12:23:16 2010 +0300 @@ -23,6 +23,10 @@ #include #include #include +#include +#include +#include +#include #include "emailtrace.h" @@ -31,26 +35,89 @@ const TInt KTimeDelayBeforeShow(0); // 0 Seconds const TInt KTimeForView(5000); // 5 Seconds -const TInt KZero(0); const TInt KTimeStringLength(20); -const TInt KMaxSummaryLength(25); +const TInt KArrayGranularity( 4 ); + +const TInt KPortraitWindowVariety( 4 ); +const TInt KLandscapeWindowVariety( 7 ); +const TInt KTextLineVariety( 5 ); + +const TInt KNumTitleLines( 1 ); +const TInt KNumLocationLines( 2 ); + +/** + * Clips given text and allocates new buffer if needed. + * @param aSource text to clip + * @param aNumLines number of popup note lines available for visual text. + * @return new buffer or NULL if aSource must not be clipped + */ + +HBufC* ClipTextL( const TDesC& aSource, TInt aNumLines ) + { + TRect mainPane; + AknLayoutUtils::LayoutMetricsRect( + AknLayoutUtils::EMainPane, + mainPane ); + + // Get the correct popup window text line layout + TInt windowVariety( KPortraitWindowVariety ); + if ( Layout_Meta_Data::IsLandscapeOrientation() ) + { + windowVariety = KLandscapeWindowVariety; + } + + TAknWindowComponentLayout popupNoteWindow = + AknLayoutScalable_Avkon::popup_preview_text_window( windowVariety ); + TAknLayoutRect popupNoteRect; + popupNoteRect.LayoutRect( mainPane, popupNoteWindow ); + + TAknTextComponentLayout popupNoteTextLine = + AknLayoutScalable_Avkon::popup_preview_text_window_t3( KTextLineVariety ); + TAknLayoutText textLayout; + textLayout.LayoutText( popupNoteRect.Rect(), popupNoteTextLine ); -_LIT( KNewLine, "\n"); -_LIT( KMessageStart, "("); -_LIT( KMessageEnd, ")"); -_LIT( KStringCont, "...\n"); -_LIT (KSpace , " " ); -const TInt KFullTimeStringSize(256); + TInt lineWidth( textLayout.TextRect().Width() ); + const CFont* font = textLayout.Font(); + + HBufC* text = NULL; + + if ( font->TextWidthInPixels( aSource ) > lineWidth ) + { + // Text must be clipped to fit + // Allocate result buffer and reserve space for line feeds + text = HBufC::NewLC( + aSource.Length() + aNumLines ); + + CArrayFix* lineWidthArray = + new( ELeave ) CArrayFixFlat( aNumLines ); + CleanupStack::PushL( lineWidthArray ); + for ( TInt i = 0; i < aNumLines; ++i ) + { + lineWidthArray->AppendL( lineWidth ); + } -void CalEntryPointerArrayCleanup( TAny* aArray ) - { - RPointerArray* entryArray = - static_cast*>( aArray ); + CPtrC16Array* strings = new( ELeave ) CPtrC16Array( aNumLines ); + CleanupStack::PushL( strings ); + TPtr des( text->Des() ); + + // Wrap string + AknTextUtils::WrapToStringAndClipL( + aSource, + *lineWidthArray, + *font, + des ); - entryArray->ResetAndDestroy(); - entryArray->Close(); + // Trim trailing line feeds + des.TrimRight(); + + CleanupStack::PopAndDestroy( 2, lineWidthArray ); + CleanupStack::Pop( text ); + } + + return text; } + }//namespace // ======== MEMBER FUNCTIONS ======== @@ -118,51 +185,56 @@ void CESMRConflictPopup::PrepareDisplayStringL() { FUNC_LOG; - RPointerArray entryArray; - CleanupStack::PushL( - TCleanupItem( - CalEntryPointerArrayCleanup, - &entryArray ) ); - + RCPointerArray entryArray; + CleanupClosePushL( entryArray ); + TInt ret = iEntry->FetchConflictingEntriesL( entryArray ); if( ret == KErrNotFound ) { User::Leave( KErrNotFound ); } - TInt numEnteries = entryArray.Count(); - TInt dispStrLength(KZero); - TBuf meetingTitle ; - TBuf meetingLocation ; - TTime startTime ; - TTime endTime ; + // Pointer descriptor for R_QTN_MEET_REQ_CONFLICT_UNNAMED + TPtrC unnamedTitle( KNullDesC ); + + // Actual title to shown in popup + TPtrC meetingTitle( KNullDesC ); - if (numEnteries != KZero) + // Location to show in popup + TPtrC meetingLocation( KNullDesC ); + + TTime startTime; + TTime endTime; + + CCoeEnv* env = CCoeEnv::Static(); + + if ( entryArray.Count() > 0 ) {// there is atleast one entry // get the first conflicting entry and set the string for display - meetingTitle = entryArray[KZero]->SummaryL(); - meetingLocation = entryArray[KZero]->LocationL(); + meetingTitle.Set( entryArray[ 0 ]->SummaryL() ); + meetingLocation.Set( entryArray[ 0 ]->LocationL() ); - - if ( ( meetingLocation.Length()== 0 ) && ( meetingTitle.Length() == 0 ) ) + if ( ( meetingLocation.Length() == 0 ) && ( meetingTitle.Length() == 0 ) ) { // if no title, set unnamed text: - HBufC* title = StringLoader::LoadLC ( R_QTN_MEET_REQ_CONFLICT_UNNAMED ); - meetingTitle.Copy( *title ); - CleanupStack::PopAndDestroy( title ); - } - - dispStrLength = meetingTitle.Length() + meetingLocation.Length(); - startTime = entryArray[KZero]->StartTimeL().TimeLocalL(); - endTime = entryArray[KZero]->EndTimeL().TimeLocalL(); + HBufC* title = StringLoader::LoadLC( + R_QTN_MEET_REQ_CONFLICT_UNNAMED, + env ); + unnamedTitle.Set( *title ); + meetingTitle.Set( unnamedTitle ); + } + + startTime = entryArray[ 0 ]->StartTimeL().TimeLocalL(); + endTime = entryArray[ 0 ]->EndTimeL().TimeLocalL(); } - HBufC* stringHolder = - StringLoader::LoadLC(R_QTN_MEET_REQ_CONFLICTS_WITH_LABEL); - dispStrLength = stringHolder->Length() + meetingTitle.Length() - + meetingLocation.Length() + KFullTimeStringSize; + HBufC* conflictLabel = StringLoader::LoadLC( + R_QTN_MEET_REQ_CONFLICTS_WITH_LABEL, + env ); - HBufC* timeFormatString = CCoeEnv::Static()->AllocReadResourceLC(R_QTN_TIME_USUAL_WITH_ZERO); + HBufC* timeFormatString = StringLoader::LoadLC( + R_QTN_TIME_USUAL_WITH_ZERO, + env ); TBuf startBuf; TBuf endBuf; @@ -170,49 +242,103 @@ startTime.FormatL( startBuf, *timeFormatString ); endTime.FormatL( endBuf, *timeFormatString ); - CDesCArrayFlat* strings = new(ELeave) CDesCArrayFlat( 2 ); + CPtrC16Array* strings = new( ELeave ) CPtrC16Array( KArrayGranularity ); CleanupStack::PushL( strings ); - strings->AppendL( startBuf ); //First string - strings->AppendL( endBuf ); //Second string + strings->AppendL( startBuf ); //start time string + strings->AppendL( endBuf ); //end time string HBufC* finalTimeBuf = - StringLoader::LoadL( + StringLoader::LoadLC( R_QTN_MEET_REQ_TIME_SEPARATOR, *strings, - CEikonEnv::Static() ); // codescanner::eikonenvstatic - CleanupStack::PopAndDestroy( strings ); - CleanupStack::PushL( finalTimeBuf ); + env ); - HBufC* displayString = HBufC::NewLC(dispStrLength); - displayString->Des().Append(stringHolder->Des()); - displayString->Des().Append(KNewLine); - displayString->Des().Append(finalTimeBuf->Des()); + if ( meetingLocation.Length() > 0 ) + { + // format Meeting location + HBufC* formatText = StringLoader::LoadLC( + R_MEET_REQ_CONFLICT_LOCATION_FORMAT, + meetingLocation, + env ); + meetingLocation.Set( *formatText ); + } + + // Format final display string + strings->Reset(); + strings->AppendL( *conflictLabel ); + strings->AppendL( *finalTimeBuf ); + + HBufC* titleBuf = NULL; + HBufC* locationBuf = NULL; + if ( meetingTitle.Length() > 0 ) + { + // Prepare title + titleBuf = ClipTextL( meetingTitle, KNumTitleLines ); + if ( titleBuf ) + { + CleanupStack::PushL( titleBuf ); + meetingTitle.Set( *titleBuf ); + } + strings->AppendL( meetingTitle ); - displayString->Des().Append(KMessageStart); - // Check the length of meetingTitle - // If its greater than some KMaxSummaryLength value then - // truncate to some reasonable value & append KStringCont - if ( meetingTitle.Length() > KMaxSummaryLength ) - { - displayString->Des().Append(meetingTitle.Ptr(),KMaxSummaryLength); - displayString->Des().Append(KStringCont); + // Prepare location + locationBuf = ClipTextL( meetingLocation, KNumLocationLines ); + if ( locationBuf ) + { + CleanupStack::PushL( locationBuf ); + meetingLocation.Set( *locationBuf ); + } + strings->AppendL( meetingLocation ); } else { - displayString->Des().Append(meetingTitle); - displayString->Des().Append(KSpace); + // Prepare location + locationBuf = ClipTextL( + meetingLocation, + KNumTitleLines + KNumLocationLines ); + if ( locationBuf ) + { + CleanupStack::PushL( locationBuf ); + meetingLocation.Set( *locationBuf ); + } + strings->AppendL( meetingLocation ); + strings->AppendL( KNullDesC() ); } - displayString->Des().Append(meetingLocation); - displayString->Des().Append(KMessageEnd); + HBufC* displayString = StringLoader::LoadLC( + R_MEET_REQ_CONFLICT_TEXT_FORMAT, + *strings, + env ); - iNote->SetTextL(displayString->Des() ); + // Trim trailing white space + displayString->Des().TrimRight(); + + // Set display string to popup note + iNote->SetTextL( *displayString ); + // Clean allocated buffers CleanupStack::PopAndDestroy( displayString ); + if ( locationBuf ) + { + CleanupStack::PopAndDestroy( locationBuf ); + } + if ( titleBuf ) + { + CleanupStack::PopAndDestroy( titleBuf ); + } + if ( meetingLocation.Length() > 0 ) + { + CleanupStack::PopAndDestroy(); // R_MEET_REQ_CONFLICT_LOCATION_FORMAT + } CleanupStack::PopAndDestroy( finalTimeBuf ); + CleanupStack::PopAndDestroy( strings ); CleanupStack::PopAndDestroy( timeFormatString ); - CleanupStack::PopAndDestroy( stringHolder ); + CleanupStack::PopAndDestroy( conflictLabel ); + if ( unnamedTitle.Length() > 0 ) + { + CleanupStack::PopAndDestroy(); // R_QTN_MEET_REQ_CONFLICT_UNNAMED + } CleanupStack::PopAndDestroy( &entryArray ); } diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/mrlocationplugin/src/cesmrlocationpluginimpl.cpp --- a/meetingrequest/mrgui/mrlocationplugin/src/cesmrlocationpluginimpl.cpp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/mrlocationplugin/src/cesmrlocationpluginimpl.cpp Tue May 25 12:23:16 2010 +0300 @@ -212,6 +212,8 @@ iLandMarks.AppendL( location ); CleanupStack::Pop( location ); + CreateMapViewL(); + iMapView->ResetLandmarksToShow(); iMapView->AddLandmarksToShowL( iLandMarks ); iMapView->ShowMapL(); diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/src/cesmreditordialog.cpp --- a/meetingrequest/mrgui/src/cesmreditordialog.cpp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/src/cesmreditordialog.cpp Tue May 25 12:23:16 2010 +0300 @@ -2050,6 +2050,18 @@ CESMRGlobalNote::EESMRTodoEntrySaved ); note->ExecuteLD(); } + else if( entry->Type() == MESMRCalEntry::EESMRCalEntryMeetingRequest ) + { + MESMRMeetingRequestEntry* mrEntry = + static_cast( entry ); + if( !mrEntry->IsForwardedL() ) + { + CESMRGlobalNote* note = + CESMRGlobalNote::NewL( + CESMRGlobalNote::EESMREntrySaved ); + note->ExecuteLD(); + } + } else { CESMRGlobalNote* note = diff -r b5fbb9b25d57 -r 67369d1b217f meetingrequest/mrgui/src/cesmrviewerdialog.cpp --- a/meetingrequest/mrgui/src/cesmrviewerdialog.cpp Tue May 11 15:57:15 2010 +0300 +++ b/meetingrequest/mrgui/src/cesmrviewerdialog.cpp Tue May 25 12:23:16 2010 +0300 @@ -623,14 +623,11 @@ } } - // If entry is recurring, we want to ask from user, if - // single instance or whole series will be forwarded if( aCommand == EESMRCmdForwardAsMail && iInfoProvider.EntryL()->IsRecurrentEventL() ) { - SetRecurrenceModRuleL( - *( iInfoProvider.EntryL() ), - CESMRListQuery::EESMRForwardThisOccurenceOrSeriesQuery ); + iInfoProvider.EntryL()->SetModifyingRuleL( + MESMRMeetingRequestEntry::EESMRAllInSeries ); } TInt res = iCallback.ProcessCommandWithResultL( aCommand );