# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1266611850 -7200 # Node ID e1b6206813b45acbfb75b77d133344558ff6c40d # Parent e7aa27f58ae164db280eff2d04e79b104e666dd5 Revision: 201003 Kit: 201007 diff -r e7aa27f58ae1 -r e1b6206813b4 email_plat/email_client_api/inc/emailapidefs.h --- a/email_plat/email_client_api/inc/emailapidefs.h Tue Feb 02 00:02:40 2010 +0200 +++ b/email_plat/email_client_api/inc/emailapidefs.h Fri Feb 19 22:37:30 2010 +0200 @@ -91,7 +91,7 @@ inline TFolderId() : TBaseId(), iMailboxId() {} inline TBool operator==( const TFolderId& aFolderId ) const { - return ( iMailboxId.iId == aFolderId.iId && + return ( iMailboxId.iId == aFolderId.iMailboxId.iId && iId == aFolderId.iId ); } inline TBool operator!=( const TFolderId& aFolderId ) const { diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/email_widget_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/email_widget_api.metaxml Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,13 @@ + + + Email widget api + API for 3rd party email clients to provide data for email widget + c++ + email_pub + + + + no + no + + diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,34 @@ +/* +* 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: Build information for widget API for 3rd party email clients +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +../inc/emailobserverinterface.hrh APP_LAYER_PUBLIC_EXPORT_PATH(emailobserverinterface.hrh) +../inc/emailobserverplugin.h APP_LAYER_PUBLIC_EXPORT_PATH(emailobserverplugin.h) +../inc/emailobserverplugin.inl APP_LAYER_PUBLIC_EXPORT_PATH(emailobserverplugin.inl) +../inc/memailobserverlistener.h APP_LAYER_PUBLIC_EXPORT_PATH(memailobserverlistener.h) +../inc/memaildata.h APP_LAYER_PUBLIC_EXPORT_PATH(memaildata.h) +../inc/memailmailboxdata.h APP_LAYER_PUBLIC_EXPORT_PATH(memailmailboxdata.h) +../inc/memailmessagedata.h APP_LAYER_PUBLIC_EXPORT_PATH(memailmessagedata.h) +../inc/memailapplaunchdata.h APP_LAYER_PUBLIC_EXPORT_PATH(memailapplaunchdata.h) + +// End of File \ No newline at end of file diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/inc/emailobserverinterface.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/inc/emailobserverinterface.hrh Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2009 - 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: Interface UID definition for Email Observer. +* +*/ + +#ifndef EMAILOBSERVERINTERFACE_HRH +#define EMAILOBSERVERINTERFACE_HRH + +/** + * Ecom interface uid for email observer plugin. + */ +#define KEmailObserverInterfaceUid 0x2002A5AE + +#endif // EMAILOBSERVERINTERFACE_HRH diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/inc/emailobserverplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/inc/emailobserverplugin.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 - 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: Interface header for Email Observer Plugin API. +* +*/ + +#ifndef EMAILOBSERVERPLUGIN_H +#define EMAILOBSERVERPLUGIN_H + +// System includes +#include + +namespace EmailInterface { + +// Forward declarations +class MEmailObserverListener; +class MEmailData; + +/** + * Class that client of this interface user instantiates + */ +class CEmailObserverPlugin : public CBase + { +public: + /** + * Contructor + * @param aImplUid implementation identifier used by the ECOM framework + * @param aListener callback interface provided by the client/instantiator. + * Plugin should call this when it wants the widget data to be updated + * @return plugin instance + */ + inline static CEmailObserverPlugin* NewL( + TUid aImplUid, + MEmailObserverListener* aListener ); + + /** destructor */ + inline virtual ~CEmailObserverPlugin(); + + /** + * Accessor for data that needs to be published + * Plugin must implement this. + * When client calls this, plugin must ensure that all necessary data is accessible/updated + * @return interface to email data + */ + virtual MEmailData& EmailDataL() = 0; + +private: + /** + * Unique instance identifier key + */ + TUid iDtor_ID_Key; + }; + +// Inline functions +#include "emailobserverplugin.inl" + +} // namespace + +#endif // EMAILOBSERVERPLUGIN_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/inc/emailobserverplugin.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/inc/emailobserverplugin.inl Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 - 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: Ininline definitions for Email Observer Plugin API. +* +*/ + +#include + +// ---------------------------------------------------------------------------- +// CEmailObserverPlugin::NewL +// ---------------------------------------------------------------------------- +// +inline CEmailObserverPlugin* CEmailObserverPlugin::NewL( + TUid aImplUid, + MEmailObserverListener* aListener ) + { + TAny* interface = REComSession::CreateImplementationL( aImplUid, + _FOFF( CEmailObserverPlugin, iDtor_ID_Key ), aListener ); + return reinterpret_cast( interface ); + } + +// ---------------------------------------------------------------------------- +// CEmailObserverPlugin::~CEmailObserverPlugin +// ---------------------------------------------------------------------------- +// +inline CEmailObserverPlugin::~CEmailObserverPlugin() + { + REComSession::DestroyedImplementation( iDtor_ID_Key ); + } diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/inc/memailapplaunchdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/inc/memailapplaunchdata.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper classes for interface. +* +*/ + +#ifndef MEMAILAPPLAUNCHDATA_H +#define MEMAILAPPLAUNCHDATA_H + +#include + +namespace EmailInterface { + +/** + * Container for launch parameters + * When user touches the widget, an application launch is initiated with + * these parameters + * (see MMailboxData::LaunchParameters() ) + */ +class MEmailLaunchParameters + { +public: + /** + * Application UID identifying the application to be launched + */ + virtual TUid ApplicationUid() const = 0; + + /** + * ViewId within the application + */ + virtual TUid ViewId() const = 0; + + /** + * TUid that will be delivered to the launched application + */ + virtual TUid CustomMessageId() const = 0; + + /** + * Data that will be delivered to the launched application + */ + virtual const TDesC8& CustomMessage() const = 0; + }; + +} // namespace + +#endif // MEMAILAPPLAUNCHDATA_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/inc/memaildata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/inc/memaildata.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper classes for interface. +* +*/ + +#ifndef MEMAILDATA_H +#define MEMAILDATA_H + +// System includes +#include + +namespace EmailInterface { + +/** + * Container interface to data that plugin offers + * Plugin must ensure that the data is available when MailboxesL() returns + * Client will access the data always through this API; no direct references are + * stored permanently in the client + */ +class MEmailData + { +public: + /** + * Accessor for mailbox information that this plugin is offering + * @ return pointer array of mailbox data interfaces + */ + virtual RPointerArray& MailboxesL() = 0; + }; + +} // namespace + +#endif // MEMAILDATA_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/inc/memailmailboxdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/inc/memailmailboxdata.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2009 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper classes for interface. +* +*/ + +#ifndef MEMAILMAILBOXDATA_H +#define MEMAILMAILBOXDATA_H + +#include + +namespace EmailInterface { + +class MEmailLaunchParameters; + +/** + * Container interface for mailbox related info + */ +class MMailboxData + { +public: + /** + * Accessor for mailbox id + * @return mailbox identifier + */ + virtual TUint MailboxId() const = 0; + + /** + * Accessor for mailbox name + * @return mailbox name + */ + virtual const TDesC& Name() const = 0; + + /** + * Accessor for mailbox branding icon specifier + * @return path descriptor to branding icon + * e.g. "mif(z:\\resource\\apps\\myemailplugin.mif N1 N2)", + * where N1 is integer specifying the icon number in the mif file, + * and N2 is the number of the respective icon mask + */ + virtual const TDesC& BrandingIcon() const = 0; + + /** + * Is mailbox's outbox empty or not + * @return boolean + */ + virtual TBool IsOutboxEmpty() const = 0; + + /** + * Accessor for seen/unseen status + * i.e. whether user has been to inbox after last message has been received + * @return boolean + */ + virtual TBool Unseen() const = 0; + + /** + * Accessor for launching parameters + * These parameters specify what application is launched when widget is pressed + * @return interface to launch parameters + */ + virtual MEmailLaunchParameters& LaunchParameters() const = 0; + + /** + * Accessor for total count of messages in inbox + * @return total message count + */ + virtual TInt MessageCount() const = 0; + + /** + * Accessor for mailbox's messages. If there are more messages in the array + * than fits the widget, only the newest will be published. + * Assumption: array must be ordered based on timestamp (i.e. newest in index 0) + * Assumption: plugin does not have to upkeep more than 2 latest messages + * @return array of messages + */ + virtual const RPointerArray& LatestMessagesL() const = 0; + }; + +} // namespace + +#endif // EMAILMAILBOXDATA_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/inc/memailmessagedata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/inc/memailmessagedata.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2009 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Helper classes for interface. +* +*/ + +#ifndef MEMAILMESSAGEDATA_H +#define MEMAILMESSAGEDATA_H + +// System includes +#include + +namespace EmailInterface { + +/** Email message priority flag */ +enum TEmailPriority + { + ENormal, + ELow, + EHigh + }; + +/** + * Container interface for message related info + * Plugin implementor make implementation for this + */ +class MMessageData + { +public: + /** + * Accessor for message sender information + * @return sender as descriptor + */ + virtual const TDesC& Sender() const = 0; + + /** + * Accessor for message subject information + * @return message subject + */ + virtual const TDesC& Subject() const = 0; + + /** + * Accessor for message timestamp information + * @return timestamp + */ + virtual TTime TimeStamp() const = 0; + + /** + * Accessor for message read/unread status + * @return boolean + */ + virtual TBool Unread() const = 0; + + /** + * Accessor for message priority status + * @return one of message priority values + */ + virtual TEmailPriority Priority() const = 0; + + /** + * Accessor for message's attachment status + * @return boolean depending whether message has any attachmants or not + */ + virtual TBool Attachments() const = 0; + + /** + * Accessor for info whether this is a calendar message or not + * @return boolean + */ + virtual TBool CalendarMsg() const = 0; + + /** + * Accessor for info whether this message has been replied or not + * @return boolean + */ + virtual TBool Replied() const = 0; + + /** + * Accessor for info whether this message has been forwarded or not + * @return boolean + */ + virtual TBool Forwarded() const = 0; + }; + +} // namespace + +#endif // MEMAILMESSAGEDATA_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/inc/memailobserverlistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/inc/memailobserverlistener.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 - 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: Interface header for event listener. +* +*/ + +#ifndef MEMAILOBSERVERLISTENER_H +#define MEMAILOBSERVERLISTENER_H + +namespace EmailInterface { + +// Forward declarations +class MEmailObserverPlugin; +class MEmailData; + +/** + * Interface class that is implemented by the plugin instantiator + */ +class MEmailObserverListener +{ + public: + /** + * Client callback routine. Client should override this method to implement + * event handling routine. + * Plugin calls this when it wishes to update data on the widget + * @param aEmailData reference to email data provided by the plugin + */ + virtual void EmailObserverEvent( MEmailData& aEmailData ) = 0; +}; + +} // namespace + +#endif // MEMAILOBSERVERLISTENER_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/data/2002C324.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/data/2002C324.rss Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,45 @@ +/* +* 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" +* 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: Dummy 3rd party email testplugin +* +*/ + +#include +#include +#include "t_testpluginconst.hrh" + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KTestPlugin2Uid3; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KEmailObserverInterfaceUid; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KTestPlugin2ImplUid; + version_no = 1; + display_name = "3rd party testplugin 2"; + default_data = ""; + opaque_data = ""; + } + }; + } + }; + } + + diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/ABLD.BAT Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\sf\app\commonemail\email_pub\email_widget_api\tsrc\3rdpartyapitestplugin2\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +//-------------------- +PRJ_TESTEXPORTS +//-------------------- +../rom/3rdpartyapitestplugin2.iby CORE_APP_LAYER_IBY_EXPORT_PATH( 3rdpartyapitestplugin2.iby ) + +//-------------------- +PRJ_MMPFILES +//-------------------- + +//-------------------- +PRJ_TESTMMPFILES +//-------------------- +testplugin2.mmp diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/testplugin2.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/testplugin2.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,50 @@ +/* +* 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" +* 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: Project definition file for 3rd party api testplugin +* +*/ + + +#include // APP_LAYER_SYSTEMINCLUDE +#include // ECOM_RESOURCE_DIR + +#include "../inc/t_testpluginconst.hrh" + +TARGET testplugin2.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KTestPlugin2Uid3 + +CAPABILITY CAP_GENERAL_DLL +VENDORID VID_DEFAULT + +USERINCLUDE . ../inc +USERINCLUDE ../../../../../inc + +APP_LAYER_SYSTEMINCLUDE + +START RESOURCE ../data/2002C324.rss +TARGET testplugin2 +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY cmaillogger.lib + +SOURCEPATH ../src +SOURCE t_testpluginproxy.cpp +SOURCE t_testpluginimpl.cpp +SOURCE emaildataimpl.cpp +SOURCE mailboxdataimpl.cpp +SOURCE applaunchdataimpl.cpp +SOURCE messagedataimpl.cpp diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/applaunchdataimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/applaunchdataimpl.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,49 @@ +/* +* 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" +* 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: 3rd party api testplugin app launcher data +* +*/ + +#ifndef APPLAUNCHDATAIMPL_H +#define APPLAUNCHDATAIMPL_H + +#include +#include + +#include "memailapplaunchdata.h" + +NONSHARABLE_CLASS( CAppLaunchDataImpl ) : public EmailInterface::MEmailLaunchParameters + { + public: + static CAppLaunchDataImpl* NewL( TUid aAppUid, TUid aViewUid ); + virtual ~CAppLaunchDataImpl(); + + public: + virtual TUid ApplicationUid() const; + virtual TUid ViewId() const; + virtual TUid CustomMessageId() const; + virtual const TDesC8& CustomMessage() const; + + private: + CAppLaunchDataImpl( TUid aAppUid, TUid aViewUid ); + void ConstructL(); + + public: // Data + TUid iAppUid; + TUid iViewUid; + TUid iCustMsgUid; + HBufC8* iCustomMessage; + }; + +#endif // APPLAUNCHDATAIMPL_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/emaildataimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/emaildataimpl.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,43 @@ +/* +* 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" +* 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: 3rd party api testplugin email data +* +*/ + +#ifndef EMAILDATAIMPL_H +#define EMAILDATAIMPL_H + +#include +#include + +#include "mailboxdataimpl.h" + +class MMailboxData; + +NONSHARABLE_CLASS( CEmailDataImpl ) : public EmailInterface::MEmailData + { + public: + static CEmailDataImpl* NewL(); + virtual ~CEmailDataImpl(); + virtual RPointerArray& MailboxesL(); + + private: + CEmailDataImpl(); + void ConstructL(); + + public: // Data + RPointerArray iMailboxes; + }; + +#endif // EMAILDATAIMPL_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/mailboxdataimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/mailboxdataimpl.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,59 @@ +/* +* 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" +* 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: 3rd party api testplugin mailbox data +* +*/ + +#ifndef MAILBOXDATAIMPL_H +#define MAILBOXDATAIMPL_H + +#include +#include +#include + + +class MMessageData; +class MEmailLaunchParameters; +class CAppLaunchDataImpl; + +NONSHARABLE_CLASS( CMailboxDataImpl ) : public EmailInterface::MMailboxData + { + public: + static CMailboxDataImpl* NewL(); + virtual ~CMailboxDataImpl(); + + virtual TUint MailboxId() const; + virtual const TDesC& Name() const; + virtual const TDesC& BrandingIcon() const; + virtual TBool IsOutboxEmpty() const; + virtual TBool Unseen() const; + virtual EmailInterface::MEmailLaunchParameters& LaunchParameters() const; + virtual TInt MessageCount() const; + virtual const RPointerArray& LatestMessagesL() const; + + private: + CMailboxDataImpl(); + void ConstructL(); + + public: // Data + TInt iMailboxId; + HBufC* iName; + HBufC* iBrandingIcon; + TBool iIsOutboxEmpty; + TBool iUnseen; + CAppLaunchDataImpl* iAppLaunchParams; + RPointerArray iMessages; + }; + +#endif // MAILBOXDATAIMPL_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/messagedataimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/messagedataimpl.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,58 @@ +/* +* 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" +* 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: 3rd party api testplugin message data +* +*/ + +#ifndef MESSAGEDATAIMPL_H +#define MESSAGEDATAIMPL_H + +#include + +class MMessageData; + +NONSHARABLE_CLASS( CMessageDataImpl ) : public EmailInterface::MMessageData + { + public: + static CMessageDataImpl* NewL(); + virtual ~CMessageDataImpl(); + + virtual const TDesC& Sender() const; + virtual const TDesC& Subject() const; + virtual TTime TimeStamp() const; + virtual TBool Unread() const; + virtual EmailInterface::TEmailPriority Priority() const; + virtual TBool Attachments() const; + virtual TBool CalendarMsg() const; + virtual TBool Replied() const; + virtual TBool Forwarded() const; + + void SetFlagsL( const TInt aFlags ); + + private: + CMessageDataImpl(); + void ConstructL(); + public: // Data + HBufC* iSender; + HBufC* iSubject; + TTime iTimeStamp; + TBool iUnread; + EmailInterface::TEmailPriority iPriority; + TBool iAttachments; + TBool iCalendarMsg; + TBool iReplied; + TBool iForwarded; + }; + +#endif // MESSAGEDATAIMPL_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/t_testpluginconst.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/t_testpluginconst.hrh Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,19 @@ +/* +* 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" +* 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: 3rd party api testplugin constants +* +*/ + +#define KTestPlugin2Uid3 0x2002C324 +#define KTestPlugin2ImplUid 0x2002C325 diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/t_testpluginimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/t_testpluginimpl.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,45 @@ +/* +* 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" +* 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: 3rd party api testplugin +* +*/ + +#ifndef TESTPLUGINIMPL_H +#define TESTPLUGINIMPL_H + +#include +#include +#include + +class MEmailObserverListener; +class CEmailDataImpl; + +NONSHARABLE_CLASS( CEmailObserverPluginImpl ) : public EmailInterface::CEmailObserverPlugin + { + public: + static EmailInterface::CEmailObserverPlugin* NewL( EmailInterface::MEmailObserverListener* aListener ); + virtual ~CEmailObserverPluginImpl(); + virtual EmailInterface::MEmailData& EmailDataL(); + + private: + CEmailObserverPluginImpl( EmailInterface::MEmailObserverListener* aListener ); + void ConstructL(); + void ReadInitialDatafromPubSubL(); + + private: // Data + EmailInterface::MEmailObserverListener* iListener; // not owned + CEmailDataImpl* iData; + }; + +#endif // TESTPLUGINIMPL_H diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/rom/3rdpartyapitestplugin2.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/rom/3rdpartyapitestplugin2.iby Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,24 @@ +/* +* 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" +* 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: Image description file for 3rd party api testplugin +* +*/ + +#ifndef THIRDPARTYAPITESTPLUGIN_IBY +#define THIRDPARTYAPITESTPLUGIN_IBY + +#include +ECOM_PLUGIN( testplugin2.dll, testplugin2.rsc ) + +#endif // THIRDPARTYAPITESTPLUGIN_IBY diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/applaunchdataimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/applaunchdataimpl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,78 @@ +/* +* 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" +* 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: 3rd party api testplugin app launcher data +* +*/ + +#include "applaunchdataimpl.h" + +// --------------------------------------------------------- +// --------------------------------------------------------- +CAppLaunchDataImpl* CAppLaunchDataImpl::NewL( TUid aAppUid, TUid aViewUid ) + { + CAppLaunchDataImpl* self = new(ELeave) CAppLaunchDataImpl( aAppUid, aViewUid ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +CAppLaunchDataImpl::~CAppLaunchDataImpl() + { + delete iCustomMessage; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +CAppLaunchDataImpl::CAppLaunchDataImpl( TUid aAppUid, TUid aViewUid ) : + iAppUid( aAppUid ), iViewUid( aViewUid ), iCustMsgUid( TUid() ), iCustomMessage( NULL ) + { + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +void CAppLaunchDataImpl::ConstructL() + { + iCustomMessage = HBufC8::NewL(1); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TUid CAppLaunchDataImpl::ApplicationUid() const + { + return iAppUid; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TUid CAppLaunchDataImpl::ViewId() const + { + return iViewUid; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TUid CAppLaunchDataImpl::CustomMessageId() const + { + return iCustMsgUid; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +const TDesC8& CAppLaunchDataImpl::CustomMessage() const + { + return *iCustomMessage; + } diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/emaildataimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/emaildataimpl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,68 @@ +/* +* 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" +* 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: 3rd party test plugin email data +* +*/ + +#include + +#include "emailtrace.h" +#include "emaildataimpl.h" +#include "mailboxdataimpl.h" + +// --------------------------------------------------------- +// --------------------------------------------------------- +CEmailDataImpl* CEmailDataImpl::NewL() + { + FUNC_LOG; + CEmailDataImpl* self = new(ELeave) CEmailDataImpl(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +CEmailDataImpl::~CEmailDataImpl() + { + for ( TInt i = 0; i < iMailboxes.Count(); i++ ) + { + delete static_cast(iMailboxes[i]); + iMailboxes.Remove(i); + } + iMailboxes.ResetAndDestroy(); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +CEmailDataImpl::CEmailDataImpl() + { + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +void CEmailDataImpl::ConstructL() + { + CMailboxDataImpl* mailbox = CMailboxDataImpl::NewL(); + iMailboxes.AppendL( mailbox ); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +RPointerArray& CEmailDataImpl::MailboxesL() + { + FUNC_LOG; + return iMailboxes; + } diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/mailboxdataimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/mailboxdataimpl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,145 @@ +/* +* 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" +* 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: 3rd party api testplugin mailbox data +* +*/ + +#include +#include +#include + +#include "emailtrace.h" +#include "mailboxdataimpl.h" +#include "messagedataimpl.h" +#include "t_testpluginconst.hrh" +#include "applaunchdataimpl.h" + +// Hardcoded default values + +// Path to graphics file with icon/mask numbers (client must provide separate file with brand graphics) +_LIT( KDefaultBrandingIcon, "mif(Z:\\resource\\apps\\google_brand_graphics.mif 16384 16385)" ); +_LIT( KDefaultName, "HARDCODED" ); // default mailbox name +const TInt KDefaultMailboxId = 12345; +const TUid KDefaultAppUid = { 0x200009EE }; // App to be launched from widget +const TUid KDefaultViewUid = { 0x00000001 }; // View to be activated from widget +const TBool KDefaultIsOutboxEmpty( ETrue ); +const TBool KDefaultUnseen( EFalse ); + +// --------------------------------------------------------- +// --------------------------------------------------------- +CMailboxDataImpl* CMailboxDataImpl::NewL() + { + FUNC_LOG; + CMailboxDataImpl* self = new(ELeave) CMailboxDataImpl(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +CMailboxDataImpl::~CMailboxDataImpl() + { + delete iName; + + for ( TInt i = 0; i < iMessages.Count(); i++ ) + { + delete static_cast(iMessages[i]); + iMessages.Remove(i); + } + iMessages.ResetAndDestroy(); + delete iAppLaunchParams; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +CMailboxDataImpl::CMailboxDataImpl() : + iName( NULL ), + iBrandingIcon( NULL), + iIsOutboxEmpty( KDefaultIsOutboxEmpty ), + iUnseen( KDefaultUnseen ), + iAppLaunchParams( NULL ) + { + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +void CMailboxDataImpl::ConstructL() + { + iAppLaunchParams = CAppLaunchDataImpl::NewL( KDefaultAppUid, KDefaultViewUid ); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TUint CMailboxDataImpl::MailboxId() const + { + FUNC_LOG; + return KDefaultMailboxId; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +const TDesC& CMailboxDataImpl::Name() const + { + FUNC_LOG; + return KDefaultName; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +const TDesC& CMailboxDataImpl::BrandingIcon() const + { + FUNC_LOG; + return KDefaultBrandingIcon; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TBool CMailboxDataImpl::IsOutboxEmpty() const + { + FUNC_LOG; + return iIsOutboxEmpty; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +const RPointerArray& CMailboxDataImpl::LatestMessagesL() const + { + FUNC_LOG; + return iMessages; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TInt CMailboxDataImpl::MessageCount() const + { + return iMessages.Count(); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TBool CMailboxDataImpl::Unseen() const + { + FUNC_LOG; + return iUnseen; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +EmailInterface::MEmailLaunchParameters& CMailboxDataImpl::LaunchParameters() const + { + FUNC_LOG; + return *( static_cast( iAppLaunchParams ) ); + } diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/messagedataimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/messagedataimpl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,122 @@ +/* +* 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" +* 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: 3rd party api testplugin message data +* +*/ + +#include +#include + +#include "messagedataimpl.h" + +// Hardcoded default values +_LIT( KDefaultSender, "sender@domain.com" ); +_LIT( KDefaultSubject, "Test subject" ); + +// --------------------------------------------------------- +// --------------------------------------------------------- +CMessageDataImpl* CMessageDataImpl::NewL() + { + CMessageDataImpl* self = new(ELeave) CMessageDataImpl(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +CMessageDataImpl::~CMessageDataImpl() + { + delete iSender; + delete iSubject; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +CMessageDataImpl::CMessageDataImpl() : iSender( NULL ), iSubject( NULL ), + iUnread( EFalse ), iPriority( EmailInterface::ENormal ), iAttachments( EFalse ), iCalendarMsg( EFalse ), + iReplied( EFalse ), iForwarded( EFalse ) + { + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +void CMessageDataImpl::ConstructL() + { + iTimeStamp.HomeTime(); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +const TDesC& CMessageDataImpl::Sender() const + { + return KDefaultSender; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +const TDesC& CMessageDataImpl::Subject() const + { + return KDefaultSubject; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TTime CMessageDataImpl::TimeStamp() const + { + return iTimeStamp; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TBool CMessageDataImpl::Unread() const + { + return iUnread; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +EmailInterface::TEmailPriority CMessageDataImpl::Priority() const + { + return iPriority; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TBool CMessageDataImpl::Attachments() const + { + return iAttachments; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TBool CMessageDataImpl::CalendarMsg() const + { + return iCalendarMsg; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TBool CMessageDataImpl::Replied() const + { + return iReplied; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +TBool CMessageDataImpl::Forwarded() const + { + return iForwarded; + } diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/t_testpluginimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/t_testpluginimpl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,67 @@ +/* +* 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" +* 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: 3rd party api testplugin +* +*/ + +#include +#include + +#include "emailtrace.h" +#include "t_testpluginimpl.h" +#include "emaildataimpl.h" +#include "mailboxdataimpl.h" +#include "messagedataimpl.h" + +// --------------------------------------------------------- +// --------------------------------------------------------- +EmailInterface::CEmailObserverPlugin* CEmailObserverPluginImpl::NewL( + EmailInterface::MEmailObserverListener* aListener ) + { + FUNC_LOG; + CEmailObserverPluginImpl* self = new(ELeave) CEmailObserverPluginImpl( aListener ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +CEmailObserverPluginImpl::~CEmailObserverPluginImpl() + { + delete iData; + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +CEmailObserverPluginImpl::CEmailObserverPluginImpl( EmailInterface::MEmailObserverListener* aListener ) : + iListener( aListener ), iData( NULL ) + { + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +void CEmailObserverPluginImpl::ConstructL() + { + iData = CEmailDataImpl::NewL(); + } + +// --------------------------------------------------------- +// --------------------------------------------------------- +EmailInterface::MEmailData& CEmailObserverPluginImpl::EmailDataL() + { + FUNC_LOG; + return *( static_cast( iData ) ); + } diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/t_testpluginproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/t_testpluginproxy.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,42 @@ +/* +* 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" +* 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: 3rd party api testplugin proxy +* +*/ + +#include + +#include "t_testpluginimpl.h" +#include "t_testpluginconst.hrh" + +// --------------------------------------------------------- +// Pairs ECom implementation UIDs with a pointer to the instantiation +// method for that implementation. Required for all ECom implementation +// collections. +// --------------------------------------------------------- +const TImplementationProxy ImplementationTable[] = + { + { {KTestPlugin2ImplUid}, reinterpret_cast( CEmailObserverPluginImpl::NewL ) } + }; + +// --------------------------------------------------------- +// Returns an instance of the proxy table. +// Returns: KErrNone +// --------------------------------------------------------- +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( ImplementationTable) / sizeof( TImplementationProxy ); + return ImplementationTable; + } diff -r e7aa27f58ae1 -r e1b6206813b4 email_pub/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/email_pub/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,18 @@ +/* +* 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: Build information for widget API for 3rd party email clients +* +*/ + +#include "../email_widget_api/group/bld.inf" diff -r e7aa27f58ae1 -r e1b6206813b4 emailcontacts/remotecontactlookup/engine/data/engine.rss --- a/emailcontacts/remotecontactlookup/engine/data/engine.rss Tue Feb 02 00:02:40 2010 +0200 +++ b/emailcontacts/remotecontactlookup/engine/data/engine.rss Fri Feb 19 22:37:30 2010 +0200 @@ -88,7 +88,7 @@ MENU_ITEM { command = ERclCmdNewSearch; txt = qtn_rcl_opt_new_search; }, MENU_ITEM { command = ERclCmdCall; cascade = r_rcl_call_menu_pane; txt = qtn_rcl_opt_call; }, MENU_ITEM { command = ERclCmdSend; cascade = r_rcl_send_menu_pane; txt = qtn_rcl_opt_send; }, - MENU_ITEM { command = ERclCmdHelp; txt = qtn_options_help; }, +// MENU_ITEM { command = ERclCmdHelp; txt = qtn_options_help; }, MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; } }; } diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/group/emailclientapi.mmp --- a/emailservices/emailclientapi/group/emailclientapi.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/group/emailclientapi.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -19,6 +19,7 @@ #include #include "../inc/emailclientapiimpl.hrh" #include "../../../inc/emailtraceconfig.hrh" +#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber TARGET emailclientapi.dll @@ -28,6 +29,9 @@ VENDORID VID_DEFAULT +VERSION KEmailBinaryVersionNumber +KEmailBinaryDemandPaging + SOURCEPATH ../src SOURCE emailclientapiimpl.cpp SOURCE emailinterfacefactoryimpl.cpp @@ -45,12 +49,11 @@ SOURCE emailtextcontent.cpp SOURCE emailmultipart.cpp -//user include +// User include USERINCLUDE ../inc USERINCLUDE ../../../inc -//system include - +// System include APP_LAYER_SYSTEMINCLUDE diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/emailapiutils.h --- a/emailservices/emailclientapi/inc/emailapiutils.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailapiutils.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #define EMAILAPIUTILS_H #include -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include //using namespace EmailInterface; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/emailattachment.h --- a/emailservices/emailclientapi/inc/emailattachment.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailattachment.h Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include #include -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include #include "emailapiutils.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/emailclientapiimpl.h --- a/emailservices/emailclientapi/inc/emailclientapiimpl.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailclientapiimpl.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,6 @@ #include #include "emailapiutils.h" #include "cfsmailcommon.h" -//#include "emailinternalclientapi.h" #include "mfsmaileventobserver.h" #include #include "emailclientpluginmanager.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/emailcontent.h --- a/emailservices/emailclientapi/inc/emailcontent.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailcontent.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include "emailapiutils.h" using namespace EmailInterface; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/emailfolder.h --- a/emailservices/emailclientapi/inc/emailfolder.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailfolder.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #define CEMAILFOLDER_H #include -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include #include "mfsmaileventobserver.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/emailmailbox.h --- a/emailservices/emailclientapi/inc/emailmailbox.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailmailbox.h Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ #ifndef EMAILMAILBOX_H #define EMAILMAILBOX_H -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include #include "mfsmaileventobserver.h" #include "mfsmailrequestobserver.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/emailmessage.h --- a/emailservices/emailclientapi/inc/emailmessage.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailmessage.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #define EMAILMESSAGE_H #include -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "emailapiutils.h" using namespace EmailInterface; @@ -132,6 +132,9 @@ private: + // Copies/moves flag values from iPluginMessage's flags to local flag member variable + void InitializeFlagValues(); + CEmailMessage( CPluginData& aPluginData, CFSMailMessage* aMessage, const TDataOwner aOwner ); void ConstructL(); diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/emailmessagesearch.h --- a/emailservices/emailclientapi/inc/emailmessagesearch.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailmessagesearch.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,8 +22,8 @@ #include #include -#include "CFSMailClient.h" -#include "MFSMailBoxSearchObserver.h" +#include "cfsmailclient.h" +#include "mfsmailboxsearchobserver.h" #include "emailapiutils.h" using namespace EmailInterface; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/emailmultipart.h --- a/emailservices/emailclientapi/inc/emailmultipart.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailmultipart.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #ifndef EMAILMULTIPART_H_ #define EMAILMULTIPART_H_ // INCLUDES -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include #include "emailapiutils.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/emailtextcontent.h --- a/emailservices/emailclientapi/inc/emailtextcontent.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/emailtextcontent.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #define EMAILTEXTCONTENT_H_ // INCLUDES -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include #include "emailapiutils.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/inc/messageiterator.h --- a/emailservices/emailclientapi/inc/messageiterator.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/inc/messageiterator.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include #include "emailapidefs.h" -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" using namespace EmailInterface; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/src/emailaddress.cpp --- a/emailservices/emailclientapi/src/emailaddress.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/src/emailaddress.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,7 +16,7 @@ */ #include "emailaddress.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include "emailclientapi.hrh" CEmailAddress* CEmailAddress::NewL( const TRole aRole, const TDataOwner aOwner ) diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/src/emailapiutils.cpp --- a/emailservices/emailclientapi/src/emailapiutils.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/src/emailapiutils.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,7 +16,7 @@ */ #include -#include "CFSMailPlugin.h" +#include "cfsmailplugin.h" #include "emailapidefs.h" #include "emailclientapiimpldefs.h" #include "emailapiutils.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/src/emailclientapiimpl.cpp --- a/emailservices/emailclientapi/src/emailclientapiimpl.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/src/emailclientapiimpl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -29,8 +29,8 @@ #include "emailapiutils.h" #include "emailmailbox.h" #include -#include "CFSMailPlugin.h" -#include "CFSClientAPI.h" +#include "cfsmailplugin.h" +#include "cfsclientapi.h" #include "emailclientapiimpldefs.h" #include "emailmailboxcache.h" #include "FreestyleEmailUiConstants.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/src/emailcontent.cpp --- a/emailservices/emailclientapi/src/emailcontent.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/src/emailcontent.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ #include #include "emailcontent.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include "emailclientapi.hrh" #include "emailapiutils.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/src/emailfolder.cpp --- a/emailservices/emailclientapi/src/emailfolder.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/src/emailfolder.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -20,8 +20,8 @@ #include "emailapiutils.h" #include "messageiterator.h" #include "emailsorting.h" -#include "CFSMailFolder.h" -#include "CFSMailPlugin.h" +#include "cfsmailfolder.h" +#include "cfsmailplugin.h" #include "emailclientapi.hrh" #include "emailclientapiimpldefs.h" @@ -255,7 +255,7 @@ for ( TInt i=0; i < aSortCriteria.Count(); i++ ) { const TEmailSortCriteria& criteria = aSortCriteria[i]; - __ASSERT_ALWAYS( criteria.iField < sizeof( fieldValues ), + __ASSERT_ALWAYS( criteria.iField < sizeof( fieldValues ) / sizeof (fieldValues [i] ), Panic( EMailPanicSortMapIndexOutOfBounds ) ); TFSMailSortCriteria fsCriteria; fsCriteria.iField = fieldValues[ criteria.iField ]; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp --- a/emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include "emailinterfacefactoryimpl.h" #include "emailcontent.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include "emailclientapiimpldefs.h" #include "emailclientapiimpl.h" #include "emailaddress.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/src/emailmailbox.cpp --- a/emailservices/emailclientapi/src/emailmailbox.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/src/emailmailbox.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -31,11 +31,11 @@ #include "emailfolder.h" #include "emailmessage.h" #include "emailmessagesearch.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include "emailclientapiimpl.h" -#include "CFSMailPlugin.h" -#include "CFSMailbox.h" -#include "CFSMailFolder.h" +#include "cfsmailplugin.h" +#include "cfsmailbox.h" +#include "cfsmailfolder.h" #include "emailclientapi.hrh" #include "FreestyleEmailUiConstants.h" @@ -450,7 +450,7 @@ TMailboxId id( aMailbox.Id() ); // boundary check const TInt index( aEvent ); - if ( index < sizeof( KMailboxEventHandlers ) ) + if ( index < sizeof( KMailboxEventHandlers ) / sizeof( KMailboxEventHandlers[ index ] ) ) { // call event handler function TEventMapFunc method = KMailboxEventHandlers[ index ]; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/src/emailmessage.cpp --- a/emailservices/emailclientapi/src/emailmessage.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/src/emailmessage.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -33,9 +33,9 @@ #include "emailtextcontent.h" #include "emailmultipart.h" #include "emailattachment.h" -#include "CFSMailPlugin.h" +#include "cfsmailplugin.h" #include "FreestyleEmailUiConstants.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" // ----------------------------------------------------------------------------- // @@ -74,6 +74,9 @@ iPluginMessage->GetMessageId().Id(), iPluginMessage->GetFolderId().Id(), iPluginMessage->GetMailBoxId().Id() ); + + // Copy the message flags + InitializeFlagValues(); } } @@ -353,6 +356,142 @@ // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- +void CEmailMessage::InitializeFlagValues() + { + // 1st reset member value, then start copying different flags + iFlags = 0; + + // EFlag_Read + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Read ) ) + { + iFlags |= EFlag_Read; + } + else + { + iFlags &= ~EFlag_Read; + } + // EFlag_Read_Locally + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Read_Locally ) ) + { + iFlags |= EFlag_Read_Locally; + } + else + { + iFlags &= ~EFlag_Read_Locally; + } + // EFlag_Low + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Low ) ) + { + iFlags |= EFlag_Low; + } + else + { + iFlags &= ~EFlag_Low; + } + // EFlag_Important + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Important ) ) + { + iFlags |= EFlag_Important; + } + else + { + iFlags &= ~EFlag_Important; + } + // EFlag_FollowUpComplete + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_FollowUpComplete ) ) + { + iFlags |= EFlag_FollowUpComplete; + } + else + { + iFlags &= ~EFlag_FollowUpComplete; + } + // EFlag_FollowUp + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_FollowUp ) ) + { + iFlags |= EFlag_FollowUp; + } + else + { + iFlags &= ~EFlag_FollowUp; + } + // EFlag_Attachments + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Attachments ) ) + { + iFlags |= EFlag_Attachments; + } + else + { + iFlags &= ~EFlag_Attachments; + } + // EFlag_Multiple + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Multiple ) ) + { + iFlags |= EFlag_Multiple; + } + else + { + iFlags &= ~EFlag_Multiple; + } + // EFlag_CalendarMsg + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_CalendarMsg ) ) + { + iFlags |= EFlag_CalendarMsg; + } + else + { + iFlags &= ~EFlag_CalendarMsg; + } + // EFlag_Answered + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Answered ) ) + { + iFlags |= EFlag_Answered; + } + else + { + iFlags &= ~EFlag_Answered; + } + // EFlag_Forwarded + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Forwarded ) ) + { + iFlags |= EFlag_Forwarded; + } + else + { + iFlags &= ~EFlag_Forwarded; + } + // EFlag_OnlyToMe + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_OnlyToMe ) ) + { + iFlags |= EFlag_OnlyToMe; + } + else + { + iFlags &= ~EFlag_OnlyToMe; + } + // EFlag_RemoteDeleted + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_RemoteDeleted ) ) + { + iFlags |= EFlag_RemoteDeleted; + } + else + { + iFlags &= ~EFlag_RemoteDeleted; + } + // EFlag_HasMsgSender + if ( iPluginMessage->IsFlagSet( EFSMsgFlag_HasMsgSender ) ) + { + iFlags |= EFlag_HasMsgSender; + } + else + { + iFlags &= ~EFlag_HasMsgSender; + } + } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- MEmailMessageContent* CEmailMessage::ContentL() const { if (iTextContent) @@ -382,16 +521,16 @@ iMessageId.iFolderId.iId, iMessageId.iFolderId.iMailboxId ); - if (!contentType.Compare(KFSMailContentTypeTextPlain) || - !contentType.Compare(KFSMailContentTypeTextHtml)) + if (!contentType.Find(KFSMailContentTypeTextPlain) || + !contentType.Find(KFSMailContentTypeTextHtml)) { iTextContent = CEmailTextContent::NewL(iPluginData, msgContentId, part, EAPIOwns ); } - else if (!contentType.Compare(KFSMailContentTypeMultipartMixed) || - !contentType.Compare(KFSMailContentTypeMultipartAlternative) || - !contentType.Compare(KFSMailContentTypeMultipartDigest) || - !contentType.Compare(KFSMailContentTypeMultipartRelated) || - !contentType.Compare(KFSMailContentTypeMultipartParallel)) + else if (!contentType.Find(KFSMailContentTypeMultipartMixed) || + !contentType.Find(KFSMailContentTypeMultipartAlternative) || + !contentType.Find(KFSMailContentTypeMultipartDigest) || + !contentType.Find(KFSMailContentTypeMultipartRelated) || + !contentType.Find(KFSMailContentTypeMultipartParallel)) { iContent = CEmailMultipart::NewL(iPluginData, msgContentId, part, EAPIOwns); } @@ -422,7 +561,10 @@ delete iTextContent; // Destroy old content } iTextContent = dynamic_cast(textContent); - iTextContent->SetOwner( EAPIOwns ); + if ( iTextContent ) + { + iTextContent->SetOwner( EAPIOwns ); + } return; } MEmailMultipart* mPart = aContent->AsMultipartOrNull(); @@ -433,7 +575,10 @@ delete iContent; } iContent = dynamic_cast(mPart); - iContent->SetOwner( EAPIOwns ); + if ( iContent ) + { + iContent->SetOwner( EAPIOwns ); + } } } diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailclientapi/src/messageiterator.cpp --- a/emailservices/emailclientapi/src/messageiterator.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailclientapi/src/messageiterator.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,10 +18,10 @@ #include "emailmessage.h" #include "messageiterator.h" #include "emailapiutils.h" -#include "CFSMailPlugin.h" +#include "cfsmailplugin.h" #include "emailapiutils.h" #include "emailclientapi.hrh" -#include "MFSMailIterator.h" +#include "mfsmailiterator.h" // number of messages in chunk to retrive from protocol plugin. Actual chunk // size is one less because last element is used for reference to next chunk diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emaildebug/inc/emailtrace.h --- a/emailservices/emaildebug/inc/emailtrace.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emaildebug/inc/emailtrace.h Fri Feb 19 22:37:30 2010 +0200 @@ -347,7 +347,7 @@ // #if defined(TIMESTAMP_TRAC) - #if defined(TRACE_INTO_FIL) + #if defined(TRACE_INTO_FILE) #define TIMESTAMP( aCaption )\ {\ @@ -355,9 +355,9 @@ t.HomeTime();\ TDateTime dt = t.DateTime();\ _LIT( KMsg, aCaption );\ - _LIT( KFormat, "[TIMESTAMP] %S %d:%02d:%02d.%d us");\ + _LIT( KFormat, "[TIMESTAMP] %d:%02d:%02d.%06d us %S");\ RFileLogger::WriteFormat( KEmailDir, KEmailTraceFile, EFileLoggingModeAppend, KFormat,\ - &KMsg, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\ + dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond(), &KMsg );\ } #else//TRACE_INTO_FILE not defined @@ -368,9 +368,9 @@ t.HomeTime();\ TDateTime dt = t.DateTime();\ _LIT( KMsg, aCaption );\ - _LIT( KFormat, "[TIMESTAMP] %S %d:%02d:%02d.%d us");\ + _LIT( KFormat, "[TIMESTAMP] %d:%02d:%02d.%06d us %S");\ RDebug::Print( KFormat,\ - &KMsg, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\ + dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond(), &KMsg );\ } #endif//TRACE_INTO_FILE diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emaildebug/inc/emailtraceconfig.hrh --- a/emailservices/emaildebug/inc/emailtraceconfig.hrh Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emaildebug/inc/emailtraceconfig.hrh Fri Feb 19 22:37:30 2010 +0200 @@ -47,4 +47,20 @@ #endif // ENABLE_TRACES +#ifdef ENABLE_TIMESTAMP_TRACES +#ifndef _DEBUG +// Undefine error traces +#undef ERROR_TRACE +// Undefine info traces +#undef INFO_TRACE +// Undefine function traces +#undef FUNC_TRACE +// Trace to file +#define TRACE_INTO_FILE +// Timestamp trace enabled +#define TIMESTAMP_TRAC +#endif // _DEBUG +#endif //ENABLE_TIMESTAMP_TRACES + + #endif // EMAILTRACECONFIG_HRH diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/group/bld.inf --- a/emailservices/emailframework/commonlib/group/bld.inf Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -18,15 +18,15 @@ PRJ_EXPORTS -../inc/CFSMailCommon.h |../../../../inc/CFSMailCommon.h -../inc/CFSMailBox.h |../../../../inc/CFSMailBox.h -../inc/CFSMailBoxBase.h |../../../../inc/CFSMailBoxBase.h -../inc/CFSMailFolder.h |../../../../inc/CFSMailFolder.h -../inc/CFSMailFolderBase.h |../../../../inc/CFSMailFolderBase.h -../inc/CFSMailMessage.h |../../../../inc/CFSMailMessage.h -../inc/CFSMailMessageBase.h |../../../../inc/CFSMailMessageBase.h -../inc/CFSMailMessagePart.h |../../../../inc/CFSMailMessagePart.h -../inc/CFSMailAddress.h |../../../../inc/CFSMailAddress.h +../inc/cfsmailcommon.h |../../../../inc/cfsmailcommon.h +../inc/cfsmailbox.h |../../../../inc/cfsmailbox.h +../inc/cfsmailboxbase.h |../../../../inc/cfsmailboxbase.h +../inc/cfsmailfolder.h |../../../../inc/cfsmailfolder.h +../inc/cfsmailfolderbase.h |../../../../inc/cfsmailfolderbase.h +../inc/cfsmailmessage.h |../../../../inc/cfsmailmessage.h +../inc/cfsmailmessagebase.h |../../../../inc/cfsmailmessagebase.h +../inc/cfsmailmessagepart.h |../../../../inc/cfsmailmessagepart.h +../inc/cfsmailaddress.h |../../../../inc/cfsmailaddress.h ../inc/cemailextensionbase.h |../../../../inc/cemailextensionbase.h ../inc/cmrcalendarinfo.h |../../../../inc/cmrcalendarinfo.h ../inc/cmailmessageext.h |../../../../inc/cmailmessageext.h diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailAddress.h --- a/emailservices/emailframework/commonlib/inc/CFSMailAddress.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailAddress.h Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include #include -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" /** * email address handling diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailBox.h --- a/emailservices/emailframework/commonlib/inc/CFSMailBox.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailBox.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #ifndef CFSMAILBOX_H #define CFSMAILBOX_H -#include "CFSMailBoxBase.h" +#include "cfsmailboxbase.h" // forward declarations class CFSMailPlugin; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailBoxBase.h --- a/emailservices/emailframework/commonlib/inc/CFSMailBoxBase.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailBoxBase.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #ifndef __CFSMAILBOXBASE_H #define __CFSMAILBOXBASE_H -#include "CFSMailFolder.h" +#include "cfsmailfolder.h" #include "mmrinfoprocessor.h" #include "cemailextensionbase.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailFolder.h --- a/emailservices/emailframework/commonlib/inc/CFSMailFolder.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailFolder.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #ifndef __FSMAILFOLDER_H #define __FSMAILFOLDER_H -#include "CFsMailFolderBase.h" +#include "cfsmailfolderbase.h" #include "mfsmailiterator.h" // forward declarations diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailFolderBase.h --- a/emailservices/emailframework/commonlib/inc/CFSMailFolderBase.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailFolderBase.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #ifndef __FSMAILFOLDERBASE_H #define __FSMAILFOLDERBASE_H -#include "CFsMailMessage.h" +#include "cfsmailmessage.h" #include "cemailextensionbase.h" /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailIterator.h --- a/emailservices/emailframework/commonlib/inc/CFSMailIterator.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailIterator.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,8 +21,8 @@ // INCLUDES // -#include "MFSMailIterator.h" -#include "CFSMailMessage.h" +#include "mfsmailiterator.h" +#include "cfsmailmessage.h" // /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailMessage.h --- a/emailservices/emailframework/commonlib/inc/CFSMailMessage.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailMessage.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #define __CFSMAILMESSAGE_H // -#include "CFSMailMessagePart.h" +#include "cfsmailmessagepart.h" // /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailMessageBase.h --- a/emailservices/emailframework/commonlib/inc/CFSMailMessageBase.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailMessageBase.h Fri Feb 19 22:37:30 2010 +0200 @@ -41,7 +41,7 @@ * * @param aMessageId id of the email to be created */ - IMPORT_C static CFSMailMessageBase* NewL(const TFSMailMsgId aMessageId); + IMPORT_C static CFSMailMessageBase* NewL(const TFSMailMsgId aMessageId); /** * Two-phased constructor. @@ -61,21 +61,21 @@ * @return message id */ IMPORT_C TFSMailMsgId GetMessageId() const; - - /** + + /** * if email is related to another email, for example due reply / forward, * related email id is returned * * @return related email id */ - IMPORT_C TFSMailMsgId IsRelatedTo() const; + IMPORT_C TFSMailMsgId IsRelatedTo() const; - /** + /** * set email related to another email, for example due reply / forward * * @param aMessageId related email id */ - IMPORT_C void SetRelatedTo( const TFSMailMsgId aMessageId ); + IMPORT_C void SetRelatedTo( const TFSMailMsgId aMessageId ); /** * email parent folder id accessor @@ -159,7 +159,7 @@ * * @param aRecipient new recipient email address */ - IMPORT_C void AppendBCCRecipient( CFSMailAddress* aRecipient ); + IMPORT_C void AppendBCCRecipient( CFSMailAddress* aRecipient ); /** * clears email TO-recipients list @@ -226,7 +226,7 @@ * * @aFlag email flag to be reset */ - IMPORT_C void ResetFlag(const TInt aFlag); + IMPORT_C void ResetFlag(const TInt aFlag); /** * test email flag is set @@ -253,10 +253,10 @@ IMPORT_C void SetReplyToAddress(CFSMailAddress* aReplyToAddress); /** - * plugin request handler accessor - * - * @return request handler - */ + * plugin request handler accessor + * + * @return request handler + */ IMPORT_C CFSMailRequestHandler& RequestHandler( ); public: // from CExtendableEmail @@ -287,43 +287,43 @@ TFSMailMsgId iMessageId; private: - + /** * ConstructL */ - void ConstructL( const TFSMailMsgId aMessageId ); + void ConstructL( const TFSMailMsgId aMessageId ); protected: // Request handler from tls - CFSMailRequestHandler* iRequestHandler; + CFSMailRequestHandler* iRequestHandler; private: // data - /** + /** * id of another email or part this object is related to * due some reason, like in reply or forward email use cases */ - TFSMailMsgId iRelatedTo; + TFSMailMsgId iRelatedTo; - /** + /** * email mailbox id */ TFSMailMsgId iMailBoxId; - /** + /** * email parent folder id */ TFSMailMsgId iFolderId; - /** + /** * email sender address */ CFSMailAddress* iSender; - /** + /** * email reply-to address */ CFSMailAddress* iReplyTo; - /** + /** * email recipients, to/cc/bcc */ RPointerArray iToRecipients; @@ -334,7 +334,7 @@ * email subject */ HBufC* iSubject; - + /** * email flags */ @@ -343,7 +343,7 @@ /** * email date */ - TTime iDate; + TTime iDate; }; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailPluginData.h --- a/emailservices/emailframework/commonlib/inc/CFSMailPluginData.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailPluginData.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ // INCLUDES // -#include "CFSMailPlugin.h" +#include "cfsmailplugin.h" // /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailRequestHandler.h --- a/emailservices/emailframework/commonlib/inc/CFSMailRequestHandler.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailRequestHandler.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,8 +20,8 @@ #define CFSMAILREQUESTHANDLER_H // INCLUDES -#include "CFSMailPlugin.h" -#include "CFSMailPluginData.h" +#include "cfsmailplugin.h" +#include "cfsmailplugindata.h" // FORWARD DECLARATIONS class CFSMailRequestObserver; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/CFSMailRequestObserver.h --- a/emailservices/emailframework/commonlib/inc/CFSMailRequestObserver.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/CFSMailRequestObserver.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,10 +21,10 @@ // INCLUDES // -#include "MFSMailRequestObserver.h" -#include "CFSMailPlugin.h" +#include "mfsmailrequestobserver.h" +#include "cfsmailplugin.h" // -#include "CFSMailRequestHandler.h" +#include "cfsmailrequesthandler.h" /** * asynchronous request observer diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/inc/mmrinfoprocessor.h --- a/emailservices/emailframework/commonlib/inc/mmrinfoprocessor.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/inc/mmrinfoprocessor.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // // Forward declaration diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailAddress.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailAddress.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailAddress.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ // #include "emailtrace.h" -#include "CFSMailAddress.h" +#include "cfsmailaddress.h" // // ================= MEMBER FUNCTIONS ========================================== @@ -59,11 +59,11 @@ CFSMailAddress::CFSMailAddress() { FUNC_LOG; - iEmailAddress = HBufC::New(1); - iEmailAddress->Des().Copy(KNullDesC()); + iEmailAddress = HBufC::New(1); + iEmailAddress->Des().Copy(KNullDesC()); - iDisplayName = HBufC::New(1); - iDisplayName->Des().Copy(KNullDesC()); + iDisplayName = HBufC::New(1); + iDisplayName->Des().Copy(KNullDesC()); } // ----------------------------------------------------------------------------- @@ -72,17 +72,17 @@ EXPORT_C CFSMailAddress::~CFSMailAddress() { FUNC_LOG; - if(iEmailAddress) - { - delete iEmailAddress; - } - iEmailAddress = NULL; - - if (iDisplayName) - { - delete iDisplayName; - } - iDisplayName = NULL; + if(iEmailAddress) + { + delete iEmailAddress; + } + iEmailAddress = NULL; + + if (iDisplayName) + { + delete iDisplayName; + } + iDisplayName = NULL; } // ----------------------------------------------------------------------------- @@ -91,7 +91,7 @@ EXPORT_C TDesC& CFSMailAddress::GetEmailAddress() const { FUNC_LOG; - return *iEmailAddress; + return *iEmailAddress; } // ----------------------------------------------------------------------------- @@ -100,16 +100,16 @@ EXPORT_C void CFSMailAddress::SetEmailAddress(const TDesC& aAddress) { FUNC_LOG; - // init mailbox name - HBufC* address = HBufC::New(aAddress.Length()); - - // store new mailbox name - if(address) + // init mailbox name + HBufC* address = HBufC::New(aAddress.Length()); + + // store new mailbox name + if(address) { - delete iEmailAddress; - iEmailAddress = address; - iEmailAddress->Des().Copy(aAddress); - } + delete iEmailAddress; + iEmailAddress = address; + iEmailAddress->Des().Copy(aAddress); + } } @@ -119,7 +119,7 @@ EXPORT_C TDesC& CFSMailAddress::GetDisplayName() const { FUNC_LOG; - return *iDisplayName; + return *iDisplayName; } // ----------------------------------------------------------------------------- @@ -128,15 +128,15 @@ EXPORT_C void CFSMailAddress::SetDisplayName(const TDesC& aDisplayName) { FUNC_LOG; - // init mailbox name - HBufC* name = HBufC::New(aDisplayName.Length()); - - // store new mailbox name - if(name) - { - delete iDisplayName; - iDisplayName = name; - iDisplayName->Des().Copy(aDisplayName); + // init mailbox name + HBufC* name = HBufC::New(aDisplayName.Length()); + + // store new mailbox name + if(name) + { + delete iDisplayName; + iDisplayName = name; + iDisplayName->Des().Copy(aDisplayName); } } diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailBox.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailBox.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailBox.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,11 +19,11 @@ #include -#include "CFSMailPlugin.h" +#include "cfsmailplugin.h" #include "cmrcalendarinfoimpl.h" -#include "CFSMailBox.h" -#include "CFSMailRequestObserver.h" +#include "cfsmailbox.h" +#include "cfsmailrequestobserver.h" const TInt KMaxMruEntries( 150 ); @@ -57,8 +57,8 @@ CFSMailBox::CFSMailBox() { FUNC_LOG; - // get requesthandler pointer - iRequestHandler = static_cast(Dll::Tls()); + // get requesthandler pointer + iRequestHandler = static_cast(Dll::Tls()); } // ----------------------------------------------------------------------------- @@ -67,7 +67,7 @@ EXPORT_C CFSMailBox::~CFSMailBox() { FUNC_LOG; - iFolders.ResetAndDestroy(); + iFolders.ResetAndDestroy(); } // ----------------------------------------------------------------------------- @@ -89,11 +89,11 @@ EXPORT_C void CFSMailBox::GoOnlineL() { FUNC_LOG; - - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - plugin->GoOnlineL( GetId() ); - } + + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + plugin->GoOnlineL( GetId() ); + } } // ----------------------------------------------------------------------------- @@ -103,11 +103,11 @@ { FUNC_LOG; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - plugin->GoOfflineL( GetId() ); - } - + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + plugin->GoOfflineL( GetId() ); + } + } // ----------------------------------------------------------------------------- @@ -116,11 +116,11 @@ EXPORT_C void CFSMailBox::CancelSyncL() { FUNC_LOG; - - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - plugin->CancelSyncL( GetId() ); - } + + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + plugin->CancelSyncL( GetId() ); + } } // ----------------------------------------------------------------------------- @@ -130,11 +130,11 @@ { FUNC_LOG; TFSProgress progress; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - progress = plugin->GetLastSyncStatusL( GetId() ); - } - return progress; + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + progress = plugin->GetLastSyncStatusL( GetId() ); + } + return progress; } // ----------------------------------------------------------------------------- @@ -145,21 +145,21 @@ { FUNC_LOG; - TFSPendingRequest request; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - // init asynchronous request - request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(), - aOperationObserver ); - MFSMailRequestObserver* observer = request.iObserver; - TRAPD(err,plugin->RefreshNowL( GetId(), *observer, request.iRequestId)); - if(err != KErrNone) - { - iRequestHandler->CompleteRequest(request.iRequestId); - User::Leave(err); - } - } - return request.iRequestId; + TFSPendingRequest request; + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + // init asynchronous request + request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(), + aOperationObserver ); + MFSMailRequestObserver* observer = request.iObserver; + TRAPD(err,plugin->RefreshNowL( GetId(), *observer, request.iRequestId)); + if(err != KErrNone) + { + iRequestHandler->CompleteRequest(request.iRequestId); + User::Leave(err); + } + } + return request.iRequestId; } @@ -170,22 +170,22 @@ { FUNC_LOG; - TFSPendingRequest request; + TFSPendingRequest request; MFSMailRequestObserver* observer = NULL; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - // init asynchronous request + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + // init asynchronous request request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(), *observer ); - - observer = request.iObserver; - TRAPD(err,plugin->RefreshNowL( GetId(), *observer, request.iRequestId)); - if(err != KErrNone) - { - iRequestHandler->CompleteRequest(request.iRequestId); - User::Leave(err); - } - } - return request.iRequestId; + + observer = request.iObserver; + TRAPD(err,plugin->RefreshNowL( GetId(), *observer, request.iRequestId)); + if(err != KErrNone) + { + iRequestHandler->CompleteRequest(request.iRequestId); + User::Leave(err); + } + } + return request.iRequestId; } @@ -196,60 +196,60 @@ { FUNC_LOG; - CFSMailMessage* message = NULL; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - TRAPD(err,message = plugin->CreateMessageToSendL( GetId() )); - if(err != KErrNone) - { - message = NULL; - } - } - return message; + CFSMailMessage* message = NULL; + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + TRAPD(err,message = plugin->CreateMessageToSendL( GetId() )); + if(err != KErrNone) + { + message = NULL; + } + } + return message; } // ----------------------------------------------------------------------------- // CFSMailBox::CreateForwardMessage // ----------------------------------------------------------------------------- -EXPORT_C CFSMailMessage* CFSMailBox::CreateForwardMessage( TFSMailMsgId aOriginalMessageId, - const TDesC& aHeaderDescriptor ) +EXPORT_C CFSMailMessage* CFSMailBox::CreateForwardMessage( TFSMailMsgId aOriginalMessageId, + const TDesC& aHeaderDescriptor ) { FUNC_LOG; - CFSMailMessage* message = NULL; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - TRAPD(err,message = plugin->CreateForwardMessageL( GetId(), - aOriginalMessageId, - aHeaderDescriptor )); - if(err != KErrNone) - { - message = NULL; - } - } - return message; + CFSMailMessage* message = NULL; + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + TRAPD(err,message = plugin->CreateForwardMessageL( GetId(), + aOriginalMessageId, + aHeaderDescriptor )); + if(err != KErrNone) + { + message = NULL; + } + } + return message; } // ----------------------------------------------------------------------------- // CFSMailBox::CreateReplyMessage // ----------------------------------------------------------------------------- EXPORT_C CFSMailMessage* CFSMailBox::CreateReplyMessage( TFSMailMsgId aOriginalMessageId, - TBool aReplyToAll, - const TDesC& aHeaderDescriptor ) + TBool aReplyToAll, + const TDesC& aHeaderDescriptor ) { FUNC_LOG; - CFSMailMessage* message = NULL; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - TRAPD(err,message = plugin->CreateReplyMessageL( GetId(), - aOriginalMessageId, - aReplyToAll, - aHeaderDescriptor )); - if(err != KErrNone) - { - message = NULL; - } - } - return message; + CFSMailMessage* message = NULL; + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + TRAPD(err,message = plugin->CreateReplyMessageL( GetId(), + aOriginalMessageId, + aReplyToAll, + aHeaderDescriptor )); + if(err != KErrNone) + { + message = NULL; + } + } + return message; } // ----------------------------------------------------------------------------- @@ -259,16 +259,16 @@ { FUNC_LOG; - TFSMailMsgId folderId; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - TRAPD(err, folderId = plugin->GetStandardFolderIdL(GetId(), aFolderType )); - if(err != KErrNone) - { - folderId.SetNullId(); - } - } - return folderId; + TFSMailMsgId folderId; + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + TRAPD(err, folderId = plugin->GetStandardFolderIdL(GetId(), aFolderType )); + if(err != KErrNone) + { + folderId.SetNullId(); + } + } + return folderId; } // ----------------------------------------------------------------------------- @@ -277,50 +277,50 @@ EXPORT_C void CFSMailBox::SendMessageL( CFSMailMessage& aMessage ) { FUNC_LOG; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - UpdateMrusL( aMessage.GetToRecipients(), - aMessage.GetCCRecipients(), - aMessage.GetBCCRecipients() ); - plugin->SendMessageL( aMessage ); - - } + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + UpdateMrusL( aMessage.GetToRecipients(), + aMessage.GetCCRecipients(), + aMessage.GetBCCRecipients() ); + plugin->SendMessageL( aMessage ); + + } } // ----------------------------------------------------------------------------- // CFSMailBox::ListFolders // ----------------------------------------------------------------------------- -EXPORT_C void CFSMailBox::ListFolders( TFSMailMsgId aFolder, - RPointerArray& aFolderList) +EXPORT_C void CFSMailBox::ListFolders( TFSMailMsgId aFolder, + RPointerArray& aFolderList) { FUNC_LOG; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - TRAPD(err, plugin->ListFoldersL(GetId(),aFolder,aFolderList)); - if(err != KErrNone) - { - aFolderList.ResetAndDestroy(); - } - } + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + TRAPD(err, plugin->ListFoldersL(GetId(),aFolder,aFolderList)); + if(err != KErrNone) + { + aFolderList.ResetAndDestroy(); + } + } } // ----------------------------------------------------------------------------- // CFSMailBox::ListFolders // ----------------------------------------------------------------------------- EXPORT_C RPointerArray& CFSMailBox::ListFolders( ) -{ - iFolders.ResetAndDestroy(); - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - TRAPD(err,plugin->ListFoldersL(GetId(),iFolders)); - if(err != KErrNone) - { - iFolders.ResetAndDestroy(); - } - } +{ + iFolders.ResetAndDestroy(); + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + TRAPD(err,plugin->ListFoldersL(GetId(),iFolders)); + if(err != KErrNone) + { + iFolders.ResetAndDestroy(); + } + } - return iFolders; + return iFolders; } // ----------------------------------------------------------------------------- @@ -329,21 +329,21 @@ EXPORT_C TDesC& CFSMailBox::GetBrandingIdL( ) { FUNC_LOG; - return BrandingId(); + return BrandingId(); } // ----------------------------------------------------------------------------- // CFSMailBox::MoveMessagesL // ----------------------------------------------------------------------------- EXPORT_C void CFSMailBox::MoveMessagesL( const RArray& aMessageIds, - const TFSMailMsgId aSourceFolderId, - const TFSMailMsgId aDestinationFolderId ) + const TFSMailMsgId aSourceFolderId, + const TFSMailMsgId aDestinationFolderId ) { FUNC_LOG; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - plugin->MoveMessagesL(GetId(), aMessageIds, aSourceFolderId, aDestinationFolderId); - } + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + plugin->MoveMessagesL(GetId(), aMessageIds, aSourceFolderId, aDestinationFolderId); + } } // ----------------------------------------------------------------------------- @@ -351,25 +351,25 @@ // ----------------------------------------------------------------------------- EXPORT_C TInt CFSMailBox::MoveMessagesL( MFSMailRequestObserver& aOperationObserver, const RArray& aMessageIds, - const TFSMailMsgId aSourceFolderId, - const TFSMailMsgId aDestinationFolderId ) + const TFSMailMsgId aSourceFolderId, + const TFSMailMsgId aDestinationFolderId ) { FUNC_LOG; TFSPendingRequest request; - if( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) - { - // init asynchronous request - request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(), - aOperationObserver ); + if( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) + { + // init asynchronous request + request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(), + aOperationObserver ); - plugin->MoveMessagesL( - GetId(), - aMessageIds, - aSourceFolderId, - aDestinationFolderId, - aOperationObserver, - request.iRequestId ); - } + plugin->MoveMessagesL( + GetId(), + aMessageIds, + aSourceFolderId, + aDestinationFolderId, + aOperationObserver, + request.iRequestId ); + } return request.iRequestId; } @@ -377,118 +377,118 @@ // CFSMailBox::CopyMessagesL // ----------------------------------------------------------------------------- EXPORT_C void CFSMailBox::CopyMessagesL( const RArray& aMessageIds, - RArray& aNewMessages, - const TFSMailMsgId aSourceFolderId, - const TFSMailMsgId aDestinationFolderId ) + RArray& aNewMessages, + const TFSMailMsgId aSourceFolderId, + const TFSMailMsgId aDestinationFolderId ) { FUNC_LOG; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - plugin->CopyMessagesL(GetId(), aMessageIds, aNewMessages, - aSourceFolderId, aDestinationFolderId ); - } + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + plugin->CopyMessagesL(GetId(), aMessageIds, aNewMessages, + aSourceFolderId, aDestinationFolderId ); + } } // ----------------------------------------------------------------------------- // CFSMailBox::SearchL // ----------------------------------------------------------------------------- EXPORT_C void CFSMailBox::SearchL( const RPointerArray& /*aSearchStrings*/, - const TFSMailSortCriteria& /*aSortCriteria*/, - MFSMailBoxSearchObserver& /*aSearchObserver*/, + const TFSMailSortCriteria& /*aSortCriteria*/, + MFSMailBoxSearchObserver& /*aSearchObserver*/, const RArray /*aFolderIds */ ) - { + { FUNC_LOG; - } - + } + // ----------------------------------------------------------------------------- // CFSMailBox::SearchL // ----------------------------------------------------------------------------- EXPORT_C void CFSMailBox::SearchL( const RPointerArray& aSearchStrings, - const TFSMailSortCriteria& aSortCriteria, - MFSMailBoxSearchObserver& aSearchObserver ) - { + const TFSMailSortCriteria& aSortCriteria, + MFSMailBoxSearchObserver& aSearchObserver ) + { FUNC_LOG; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { - // get mailbox folder list - iFolders.ResetAndDestroy(); - plugin->ListFoldersL(GetId(),iFolders); + // get mailbox folder list + iFolders.ResetAndDestroy(); + plugin->ListFoldersL(GetId(),iFolders); - TFSMailMsgId draftsFolderId = GetStandardFolderId( EFSDraftsFolder ); - TFSMailMsgId outboxId = GetStandardFolderId( EFSOutbox ); - - // remove outbox, drafts folder from folder list - RArray folderIds; - folderIds.Reset(); - for(TInt i=0;iGetFolderId(); - if( id != draftsFolderId && id != outboxId ) - { - folderIds.Append(id); - } - } - - // start search - plugin->SearchL( GetId(), folderIds, aSearchStrings, aSortCriteria, aSearchObserver ); - folderIds.Reset(); - } - } + TFSMailMsgId draftsFolderId = GetStandardFolderId( EFSDraftsFolder ); + TFSMailMsgId outboxId = GetStandardFolderId( EFSOutbox ); + + // remove outbox, drafts folder from folder list + RArray folderIds; + folderIds.Reset(); + for(TInt i=0;iGetFolderId(); + if( id != draftsFolderId && id != outboxId ) + { + folderIds.Append(id); + } + } + + // start search + plugin->SearchL( GetId(), folderIds, aSearchStrings, aSortCriteria, aSearchObserver ); + folderIds.Reset(); + } + } // ----------------------------------------------------------------------------- // CFSMailBox::CancelSearch // ----------------------------------------------------------------------------- EXPORT_C void CFSMailBox::CancelSearch() - { + { FUNC_LOG; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - plugin->CancelSearch( GetId() ); - } - } + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + plugin->CancelSearch( GetId() ); + } + } // ----------------------------------------------------------------------------- // CFSMailBox::ClearSearchResultCache // ----------------------------------------------------------------------------- EXPORT_C void CFSMailBox::ClearSearchResultCache() - { + { FUNC_LOG; - if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) - { - plugin->ClearSearchResultCache( GetId() ); - } - } + if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId())) + { + plugin->ClearSearchResultCache( GetId() ); + } + } // ----------------------------------------------------------------------------- // CFSMailBox::ListMrusL // ----------------------------------------------------------------------------- EXPORT_C MDesCArray* CFSMailBox::ListMrusL() const - { + { FUNC_LOG; - MDesCArray* mruList(0); - if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) - { - mruList = plugin->GetMrusL( GetId() ); - } - return mruList; - } + MDesCArray* mruList(0); + if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) + { + mruList = plugin->GetMrusL( GetId() ); + } + return mruList; + } // ----------------------------------------------------------------------------- // CFSMailBox::CurrentSyncState // ----------------------------------------------------------------------------- EXPORT_C TSSMailSyncState CFSMailBox::CurrentSyncState() const - { + { FUNC_LOG; - TSSMailSyncState syncState(Idle); - if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) - { - syncState = plugin->CurrentSyncState( GetId() ); - } - return syncState; - } + TSSMailSyncState syncState(Idle); + if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) + { + syncState = plugin->CurrentSyncState( GetId() ); + } + return syncState; + } // ----------------------------------------------------------------------------- // CFSMailBox::HasCapability @@ -496,16 +496,16 @@ EXPORT_C TBool CFSMailBox::HasCapability( const TFSMailBoxCapabilities aCapability ) const { FUNC_LOG; - TBool capability = EFalse; - if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) - { - TRAPD( err,capability = plugin->MailboxHasCapabilityL( aCapability,GetId() )) ; - if ( err != KErrNone ) - { - capability = EFalse; - } - } - return capability; + TBool capability = EFalse; + if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) ) + { + TRAPD( err,capability = plugin->MailboxHasCapabilityL( aCapability,GetId() )) ; + if ( err != KErrNone ) + { + capability = EFalse; + } + } + return capability; } // ----------------------------------------------------------------------------- @@ -514,12 +514,12 @@ EXPORT_C TFSMailBoxStatus CFSMailBox::GetMailBoxStatus() { FUNC_LOG; - TFSMailBoxStatus status(EFSMailBoxOffline); - if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) - { - status = plugin->GetMailBoxStatus( GetId() ); - } - return status; + TFSMailBoxStatus status(EFSMailBoxOffline); + if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) + { + status = plugin->GetMailBoxStatus( GetId() ); + } + return status; } // ----------------------------------------------------------------------------- @@ -528,10 +528,10 @@ EXPORT_C void CFSMailBox::SetCredentialsL( const TDesC& aUsername, const TDesC& aPassword ) { FUNC_LOG; - if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) - { - plugin->SetCredentialsL( GetId(), aUsername, aPassword ); - } + if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) ) + { + plugin->SetCredentialsL( GetId(), aUsername, aPassword ); + } } // ----------------------------------------------------------------------------- @@ -611,7 +611,7 @@ // whose content we can later alter as we wish MDesCArray* currentMruList( NULL ); - CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()); + CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()); if ( !plugin ) { User::Leave( KErrGeneral ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailBoxBase.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailBoxBase.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailBoxBase.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ #include // AknTextUtils #include "emailtrace.h" -#include "CFSMailBoxBase.h" +#include "cfsmailboxbase.h" _LIT( KCharsToReplace, "\r\n\t\x2028\x2029" ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailFolder.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailFolder.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailFolder.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,12 +18,12 @@ // #include "emailtrace.h" -#include "CFSMailFolder.h" -#include "CFSMailPlugin.h" +#include "cfsmailfolder.h" +#include "cfsmailplugin.h" // -#include "CFSMailIterator.h" -#include "CFSMailRequestObserver.h" +#include "cfsmailiterator.h" +#include "cfsmailrequestobserver.h" // ================= MEMBER FUNCTIONS ========================================== // ----------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailFolderBase.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailFolderBase.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailFolderBase.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ // #include "emailtrace.h" -#include "CFSMailFolderBase.h" +#include "cfsmailfolderbase.h" // // ================= MEMBER FUNCTIONS ========================================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailIterator.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailIterator.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailIterator.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,7 +17,7 @@ #include "emailtrace.h" -#include "CFSMailIterator.h" +#include "cfsmailiterator.h" // ================= MEMBER FUNCTIONS ========================================== // ----------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailMessage.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailMessage.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailMessage.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -20,9 +20,9 @@ #include #include // CleanupResetAndDestroy -#include "CFSMailMessage.h" -#include "CFSMailPlugin.h" -#include "CFSMailRequestHandler.h" +#include "cfsmailmessage.h" +#include "cfsmailplugin.h" +#include "cfsmailrequesthandler.h" // ================= MEMBER FUNCTIONS ========================================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailMessageBase.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailMessageBase.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailMessageBase.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,9 +16,9 @@ */ -#include "CFSMailRequestHandler.h" +#include "cfsmailrequesthandler.h" #include "emailtrace.h" -#include "CFSMailMessageBase.h" +#include "cfsmailmessagebase.h" #include "cmailmessageext.h" // ================= MEMBER FUNCTIONS ========================================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailMessagePart.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailMessagePart.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailMessagePart.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -21,11 +21,11 @@ #include // CleanupResetAndDestroy // -#include "CFSMailMessagePart.h" -#include "CFSMailPlugin.h" +#include "cfsmailmessagepart.h" +#include "cfsmailplugin.h" // -#include "CFSMailRequestObserver.h" +#include "cfsmailrequestobserver.h" // ================= MEMBER FUNCTIONS ========================================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailPluginData.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailPluginData.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailPluginData.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,7 +17,7 @@ #include "emailtrace.h" -#include "CFSMailPluginData.h" +#include "cfsmailplugindata.h" // ----------------------------------------------------------------------------- // CFSMailPluginData::CFSMailPluginData diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailRequestHandler.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailRequestHandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailRequestHandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2008 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" @@ -17,11 +17,11 @@ #include "emailtrace.h" -#include "CFSMailRequestHandler.h" -#include "CFSMailRequestObserver.h" +#include "cfsmailrequesthandler.h" +#include "cfsmailrequestobserver.h" -// ================= MEMBER FUNCTIONS ========================================== +// ================= MEMBER FUNCTIONS ========================================== // ----------------------------------------------------------------------------- // CFSMailRequestHandler::CFSMailRequestHandler // ----------------------------------------------------------------------------- @@ -29,14 +29,14 @@ { FUNC_LOG; - // store pointer to TLS - TInt err = Dll::SetTls(static_cast(this)); + // store pointer to TLS + TInt err = Dll::SetTls(static_cast(this)); - // reset - iPendingRequests.Reset(); - iPluginList.Reset(); - - iTempDirName =NULL; + // reset + iPendingRequests.Reset(); + iPluginList.Reset(); + + iTempDirName =NULL; } // ----------------------------------------------------------------------------- @@ -62,8 +62,8 @@ // CFSMailRequestHandler::NewLC // ----------------------------------------------------------------------------- EXPORT_C CFSMailRequestHandler* CFSMailRequestHandler::NewLC( - RPointerArray& aPluginInfo, - RPointerArray& aPlugins ) + RPointerArray& aPluginInfo, + RPointerArray& aPlugins ) { FUNC_LOG; CFSMailRequestHandler* pluginHandler = new (ELeave) CFSMailRequestHandler(); @@ -76,12 +76,12 @@ // CFSMailRequestHandler::NewL // ----------------------------------------------------------------------------- EXPORT_C CFSMailRequestHandler* CFSMailRequestHandler::NewL( - RPointerArray& aPluginInfo, - RPointerArray& aPlugins ) + RPointerArray& aPluginInfo, + RPointerArray& aPlugins ) { FUNC_LOG; CFSMailRequestHandler* pluginHandler = - CFSMailRequestHandler::NewLC( aPluginInfo, aPlugins ); + CFSMailRequestHandler::NewLC( aPluginInfo, aPlugins ); CleanupStack:: Pop(pluginHandler); return pluginHandler; } @@ -90,8 +90,8 @@ // CFSMailRequestHandler::ConstructL // ----------------------------------------------------------------------------- void CFSMailRequestHandler::ConstructL( - RPointerArray /*aPluginInfo*/, - RPointerArray /*aPlugins*/ ) + RPointerArray /*aPluginInfo*/, + RPointerArray /*aPlugins*/ ) { FUNC_LOG; @@ -102,125 +102,125 @@ // CFSMailRequestHandler::GetPluginByUid // ----------------------------------------------------------------------------- EXPORT_C CFSMailPlugin* CFSMailRequestHandler::GetPluginByUid(TFSMailMsgId aObjectId) - { + { FUNC_LOG; - for(TInt i=0;iiPluginId.iUid == aObjectId.PluginId().iUid) - { - return iPluginList[i]->iPlugin; - } - } + for(TInt i=0;iiPluginId.iUid == aObjectId.PluginId().iUid) + { + return iPluginList[i]->iPlugin; + } + } - return NULL; - } - + return NULL; + } + // ----------------------------------------------------------------------------- // CFSMailRequestHandler::InitAsyncRequestL // ----------------------------------------------------------------------------- EXPORT_C TFSPendingRequest CFSMailRequestHandler::InitAsyncRequestL( - TUid aPluginId, - MFSMailRequestObserver& aOperationObserver) - { + TUid aPluginId, + MFSMailRequestObserver& aOperationObserver) + { FUNC_LOG; - TFSPendingRequest newRequest; - for(TInt i=0;iSetUserObserver(aOperationObserver); - newRequest = iPendingRequests[i]; - return newRequest; - } - } + TFSPendingRequest newRequest; + for(TInt i=0;iSetUserObserver(aOperationObserver); + newRequest = iPendingRequests[i]; + return newRequest; + } + } - newRequest.iRequestId = iPendingRequests.Count(); - newRequest.iPluginId = aPluginId; - newRequest.iRequestStatus = TFSPendingRequest::EFSRequestPending; - CFSMailRequestObserver* observer = - CFSMailRequestObserver::NewL(*this, aOperationObserver); - newRequest.iObserver = observer; - iPendingRequests.Append(newRequest); - - return newRequest; - } + newRequest.iRequestId = iPendingRequests.Count(); + newRequest.iPluginId = aPluginId; + newRequest.iRequestStatus = TFSPendingRequest::EFSRequestPending; + CFSMailRequestObserver* observer = + CFSMailRequestObserver::NewL(*this, aOperationObserver); + newRequest.iObserver = observer; + iPendingRequests.Append(newRequest); + + return newRequest; + } // ----------------------------------------------------------------------------- // CFSMailRequestHandler::CompleteRequest // ----------------------------------------------------------------------------- EXPORT_C void CFSMailRequestHandler::CompleteRequest( TInt aRequestId ) - { + { FUNC_LOG; - for(TInt i=0;iCancelL(aRequestId); - } - iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestCancelled; - break; - } - } - } + for(TInt i=0;iCancelL(aRequestId); + } + iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestCancelled; + break; + } + } + } // ----------------------------------------------------------------------------- // CFSMailRequestHandler::CancelAllRequestsL // ----------------------------------------------------------------------------- EXPORT_C void CFSMailRequestHandler::CancelAllRequestsL( ) - { + { FUNC_LOG; - for(TInt i=0;iCancelL(iPendingRequests[i].iRequestId); - } - iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestCancelled; - } - } - } + for(TInt i=0;iCancelL(iPendingRequests[i].iRequestId); + } + iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestCancelled; + } + } + } // ----------------------------------------------------------------------------- // CFSMailRequestHandler::AddPluginL // ----------------------------------------------------------------------------- EXPORT_C void CFSMailRequestHandler::AddPluginL( TUid aPluginId, CFSMailPlugin* aPlugin ) - { + { FUNC_LOG; - CFSMailPluginData* pluginData = new (ELeave) CFSMailPluginData; - pluginData->iPluginId = aPluginId; - pluginData->iPlugin = aPlugin; - iPluginList.Append(pluginData); + CFSMailPluginData* pluginData = new (ELeave) CFSMailPluginData; + pluginData->iPluginId = aPluginId; + pluginData->iPlugin = aPlugin; + iPluginList.Append(pluginData); - } + } // ----------------------------------------------------------------------------- // CFSMailRequestHandler::RemoveAllRequests diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/commonlib/src/CFSMailRequestObserver.cpp --- a/emailservices/emailframework/commonlib/src/CFSMailRequestObserver.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/commonlib/src/CFSMailRequestObserver.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,8 +17,8 @@ #include "emailtrace.h" -#include "CFSMailRequestObserver.h" -#include "CFSMailRequestHandler.h" +#include "cfsmailrequestobserver.h" +#include "cfsmailrequesthandler.h" // ================= MEMBER FUNCTIONS ========================================== // ----------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/data/fsmailbrandmanager.rss --- a/emailservices/emailframework/data/fsmailbrandmanager.rss Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/data/fsmailbrandmanager.rss Fri Feb 19 22:37:30 2010 +0200 @@ -25,8 +25,8 @@ #include #include -#include "MailBrandManager.hrh" -#include "MailBrandManager.rh" +#include "mailbrandmanager.hrh" +#include "mailbrandmanager.rh" // --------------------------------------------------------- // diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/group/FSMailFramework.mmp --- a/emailservices/emailframework/group/FSMailFramework.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/group/FSMailFramework.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -67,13 +67,8 @@ // LIBRARY cmaillogger.lib -#ifdef TRACE_INTO_FILE -LIBRARY flogger.lib -#endif // TRACE_INTO_FILE - - SOURCEPATH ../data -START RESOURCE fsmailbrandmanager.rss +START RESOURCE fsmailbrandmanager.rss HEADER targetpath RESOURCE_FILES_DIR LANGUAGE_IDS @@ -85,4 +80,4 @@ MACRO DEBUGLOGGER_DEBUG_ASSERTS #endif -LIBRARY flogger.lib +LIBRARY flogger.lib diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/group/bld.inf --- a/emailservices/emailframework/group/bld.inf Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -18,18 +18,18 @@ #include PRJ_EXPORTS -../inc/MFSMailIterator.h |../../../inc/MFSMailIterator.h -../inc/MFSMailEventObserver.h |../../../inc/MFSMailEventObserver.h -../inc/MFSMailRequestObserver.h |../../../inc/MFSMailRequestObserver.h -../inc/MFSMailBoxSearchObserver.h |../../../inc/MFSMailBoxSearchObserver.h -../inc/MFSMailBrandManager.h |../../../inc/MFSMailBrandManager.h -../inc/MailBrandManager.hrh |../../../inc/MailBrandManager.hrh -../inc/CFSMailClient.h |../../../inc/CFSMailClient.h -../inc/CFSClientAPI.h |../../../inc/CFSClientAPI.h -../inc/CFSMailPlugin.h |../../../inc/CFSMailPlugin.h -../inc/CFSMailPlugin.inl |../../../inc/CFSMailPlugin.inl -../inc/CFSMailPlugin.hrh |../../../inc/CFSMailPlugin.hrh -../inc/CFSMailClient.hrh |../../../inc/CFSMailClient.hrh +../inc/mfsmailiterator.h |../../../inc/mfsmailiterator.h +../inc/mfsmaileventobserver.h |../../../inc/mfsmaileventobserver.h +../inc/mfsmailrequestobserver.h |../../../inc/mfsmailrequestobserver.h +../inc/mfsmailboxsearchobserver.h |../../../inc/mfsmailboxsearchobserver.h +../inc/mfsmailbrandmanager.h |../../../inc/mfsmailbrandmanager.h +../inc/mailbrandmanager.hrh |../../../inc/mailbrandmanager.hrh +../inc/cfsmailclient.h |../../../inc/cfsmailclient.h +../inc/cfsclientapi.h |../../../inc/cfsclientapi.h +../inc/cfsmailplugin.h |../../../inc/cfsmailplugin.h +../inc/cfsmailplugin.inl |../../../inc/cfsmailplugin.inl +../inc/cfsmailplugin.hrh |../../../inc/cfsmailplugin.hrh +../inc/cfsmailclient.hrh |../../../inc/cfsmailclient.hrh ../inc/emailversionnumbers.hrh |../../../inc/emailversionnumbers.hrh diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/inc/CFSClientAPIRequestHandler.h --- a/emailservices/emailframework/inc/CFSClientAPIRequestHandler.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/inc/CFSClientAPIRequestHandler.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #define CFSCLIENTAPIREQUESTHANDLER_H // INCLUDES -#include "CFSMailRequestHandler.h" +#include "cfsmailrequesthandler.h" // FORWARD DECLARATIONS class CFSMailRequestObserver; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/inc/CFSMailBrand.h --- a/emailservices/emailframework/inc/CFSMailBrand.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/inc/CFSMailBrand.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #define CFSMAILBRAND_H // INCLUDES -#include "MailBrandManager.hrh" // TFSBrandElement +#include "mailbrandmanager.hrh" // TFSBrandElement #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/inc/CFSMailBrandManagerImpl.h --- a/emailservices/emailframework/inc/CFSMailBrandManagerImpl.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/inc/CFSMailBrandManagerImpl.h Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include #include -#include "MFSMailBrandManager.h" +#include "mfsmailbrandmanager.h" // FORWARD DECLARATIONS class TResourceReader; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/inc/CFSMailClient.h --- a/emailservices/emailframework/inc/CFSMailClient.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/inc/CFSMailClient.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,10 +22,10 @@ #include #include -#include "CFSMailClient.hrh" +#include "cfsmailclient.hrh" #include "cemailextensionbase.h" -#include "MFSMailBrandManager.h" +#include "mfsmailbrandmanager.h" #include "cfsmailplugin.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/inc/CFSMailPlugin.h --- a/emailservices/emailframework/inc/CFSMailPlugin.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/inc/CFSMailPlugin.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include -#include "MFSMailRequestObserver.h" +#include "mfsmailrequestobserver.h" #include "mfsmaileventobserver.h" #include "cfsmailbox.h" #include "cfsmailplugin.hrh" @@ -36,8 +36,8 @@ * and implemented by plugin implementor. * * Plugin implementor inherits from class CFSMailPlugin, - * but plugin load medhods are provided by framework in file CFSMailPlugin.inl - * CFSMailPlugin,CFSMailPlugin.inl are exported by framework + * but plugin load medhods are provided by framework in file cfsmailplugin.inl + * CFSMailPlugin,cfsmailplugin.inl are exported by framework * * @lib FSFWCommonLib * diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/inc/CFSMailPluginManager.h --- a/emailservices/emailframework/inc/CFSMailPluginManager.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/inc/CFSMailPluginManager.h Fri Feb 19 22:37:30 2010 +0200 @@ -25,9 +25,9 @@ #include #include -#include "CFSMailPlugin.h" +#include "cfsmailplugin.h" -#include "CFSMailRequestHandler.h" +#include "cfsmailrequesthandler.h" /** plugin configuration at start up */ enum TFsFwConfiguration diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/inc/MFSMailBoxSearchObserver.h --- a/emailservices/emailframework/inc/MFSMailBoxSearchObserver.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/inc/MFSMailBoxSearchObserver.h Fri Feb 19 22:37:30 2010 +0200 @@ -45,15 +45,15 @@ /** * Notifies the email search API client that the search has completed - * - */ + * + */ virtual void SearchCompletedL() = 0; // /** * server asks client if to change the search priority (i.e. when calling to contact) - * - */ + * + */ virtual void ClientRequiredSearchPriority(TInt *apRequiredSearchPriority) = 0; // }; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/inc/MFSMailBrandManager.h --- a/emailservices/emailframework/inc/MFSMailBrandManager.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/inc/MFSMailBrandManager.h Fri Feb 19 22:37:30 2010 +0200 @@ -48,21 +48,21 @@ */ virtual ~MFSMailBrandManager() { } - /** - * Returns a branded graphical element. - * - * @param aElement Id of the branded element. This identifies which - * graphic user wishes to retrieve. - * @param aMailBoxId mailbox whose branded element is retrieved. - * - * @return A pointer to a CGulIcon object. The caller of this method is - * responsible of destroying the object. Returns NULL if the - * brand doesn't contain the requested branding element. - */ - virtual CGulIcon* GetGraphicL( TFSBrandElement aElement, - const TFSMailMsgId& aMailboxId ) = 0; + /** + * Returns a branded graphical element. + * + * @param aElement Id of the branded element. This identifies which + * graphic user wishes to retrieve. + * @param aMailBoxId mailbox whose branded element is retrieved. + * + * @return A pointer to a CGulIcon object. The caller of this method is + * responsible of destroying the object. Returns NULL if the + * brand doesn't contain the requested branding element. + */ + virtual CGulIcon* GetGraphicL( TFSBrandElement aElement, + const TFSMailMsgId& aMailboxId ) = 0; - /** + /** * Returns a branded graphical element. * * @param aElement Id of the branded element. This identifies which @@ -75,75 +75,75 @@ */ virtual CGulIcon* GetGraphicL( TFSBrandElement aElement, const TDesC& aBrandId ) = 0; - - /** - * Returns a branded text element. - * - * @param aElement Id of the branded element. This identifies which - * text user wishes to retrieve. - * @param aMailBoxId mailbox whose branded element is retrieved. - * - * @return A TPtrC object. Returns TPtrC to a null descriptor if the - * brand doesn't contain the requested branding element. - */ - virtual TPtrC GetTextL( TFSBrandElement aElement, - const TFSMailMsgId& aMailboxId ) = 0; - - /** - * Returns a branded text element. - * This function is for WhiteLabelBranding, because branded mailbox name is - * needed before mailbox creation. - * - * @param aElement Id of the branded element. This identifies which - * text user wishes to retrieve. - * @param aMailBoxId mailbox whose branded element is retrieved. - * - * @return A TPtrC object. Returns TPtrC to a null descriptor if the - * brand doesn't contain the requested branding element. - */ - virtual TPtrC GetTextL( TFSBrandElement aElement, - const TDesC& aBrandId ) = 0; - - /** - * Returns a branded text element. - * - * @param aElement The id of the branded element. This identifies which - * color user wishes to retrieve. - * @param aMailBoxId mailbox whose branded element is retrieved. - * @param aColor A reference to a TRgb object. The color is returned - * using this reference. + + /** + * Returns a branded text element. + * + * @param aElement Id of the branded element. This identifies which + * text user wishes to retrieve. + * @param aMailBoxId mailbox whose branded element is retrieved. + * + * @return A TPtrC object. Returns TPtrC to a null descriptor if the + * brand doesn't contain the requested branding element. + */ + virtual TPtrC GetTextL( TFSBrandElement aElement, + const TFSMailMsgId& aMailboxId ) = 0; + + /** + * Returns a branded text element. + * This function is for WhiteLabelBranding, because branded mailbox name is + * needed before mailbox creation. + * + * @param aElement Id of the branded element. This identifies which + * text user wishes to retrieve. + * @param aMailBoxId mailbox whose branded element is retrieved. * - * @return Error code. KErrNotFound if the brand doesn't contain the requested - * branding element. - */ - virtual TInt GetColorL( TFSBrandElement aElement, - const TFSMailMsgId& aMailboxId, - TRgb& aColor ) = 0; - - /** - * This function will change 'mailbox name' as branded name. - * If aMailboxId is NULL function goes through all mailboxes and check if mailbox is branded. - * If it is, function will change 'mailbox name' as branded name. - * This function should be called after mailbox settings has changed. - * - * @param aMailboxId Id of the mailbox - */ - virtual void UpdateMailboxNamesL( const TFSMailMsgId aMailboxId ) = 0; + * @return A TPtrC object. Returns TPtrC to a null descriptor if the + * brand doesn't contain the requested branding element. + */ + virtual TPtrC GetTextL( TFSBrandElement aElement, + const TDesC& aBrandId ) = 0; + + /** + * Returns a branded text element. + * + * @param aElement The id of the branded element. This identifies which + * color user wishes to retrieve. + * @param aMailBoxId mailbox whose branded element is retrieved. + * @param aColor A reference to a TRgb object. The color is returned + * using this reference. + * + * @return Error code. KErrNotFound if the brand doesn't contain the requested + * branding element. + */ + virtual TInt GetColorL( TFSBrandElement aElement, + const TFSMailMsgId& aMailboxId, + TRgb& aColor ) = 0; + + /** + * This function will change 'mailbox name' as branded name. + * If aMailboxId is NULL function goes through all mailboxes and check if mailbox is branded. + * If it is, function will change 'mailbox name' as branded name. + * This function should be called after mailbox settings has changed. + * + * @param aMailboxId Id of the mailbox + */ + virtual void UpdateMailboxNamesL( const TFSMailMsgId aMailboxId ) = 0; /** * Returns branded graphic element of given type. * * @param aElementId brand element - * @param aMailBoxId mailbox whose branded element is retrieved. + * @param aMailBoxId mailbox whose branded element is retrieved. * @param aIconIds Icon path and ids - * - * @return Error code + * + * @return Error code */ - virtual TInt GetGraphicIdsL( TFSBrandElement aElement, - const TFSMailMsgId& aMailboxId, + virtual TInt GetGraphicIdsL( TFSBrandElement aElement, + const TFSMailMsgId& aMailboxId, TDes& aIconIds ) = 0; - + }; -#endif // MFSMAILBRANDMANAGER_H \ No newline at end of file +#endif // MFSMAILBRANDMANAGER_H \ No newline at end of file diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/inc/MFSMailEventObserver.h --- a/emailservices/emailframework/inc/MFSMailEventObserver.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/inc/MFSMailEventObserver.h Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/inc/MFSMailIterator.h --- a/emailservices/emailframework/inc/MFSMailIterator.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/inc/MFSMailIterator.h Fri Feb 19 22:37:30 2010 +0200 @@ -35,7 +35,7 @@ { public: - + /** * Lists user given count of email objects located after user * given start point. @@ -100,9 +100,9 @@ /** * Destructor. */ - virtual ~MFSMailIterator() { }; - - }; + virtual ~MFSMailIterator() { }; + + }; #endif // MFSMAILITERATOR_H diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/src/CFSClientAPI.cpp --- a/emailservices/emailframework/src/CFSClientAPI.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/src/CFSClientAPI.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,8 +16,8 @@ */ #include "emailtrace.h" -#include "CFSClientAPIRequestHandler.h" -#include "CFSClientAPI.h" +#include "cfsclientapirequesthandler.h" +#include "cfsclientapi.h" #include "emailclientpluginmanager.h" // ----------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/src/CFSClientAPIRequestHandler.cpp --- a/emailservices/emailframework/src/CFSClientAPIRequestHandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/src/CFSClientAPIRequestHandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,8 +17,8 @@ #include "emailtrace.h" -#include "CFSClientAPIRequestHandler.h" -#include "CFSMailRequestObserver.h" +#include "cfsclientapirequesthandler.h" +#include "cfsmailrequestobserver.h" #include "emailclientpluginmanager.h" // ================= MEMBER FUNCTIONS ========================================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/src/CFSFWImplementation.cpp --- a/emailservices/emailframework/src/CFSFWImplementation.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/src/CFSFWImplementation.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,11 +17,11 @@ #include "emailtrace.h" -#include "CFSFWImplementation.h" +#include "cfsfwimplementation.h" // -#include "CFSMailPlugin.h" +#include "cfsmailplugin.h" // -#include "CFSMailPluginManager.h" +#include "cfsmailpluginmanager.h" // ================= MEMBER FUNCTIONS ========================================== // ----------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/src/CFSMailBrand.cpp --- a/emailservices/emailframework/src/CFSMailBrand.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/src/CFSMailBrand.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -22,10 +22,10 @@ #include #include // -#include "FreestyleEmailCenRepKeys.h" +#include "freestyleemailcenrepkeys.h" // -#include "CFSMailBrand.h" +#include "cfsmailbrand.h" const TInt KElementArrayGranularity = 5; const TInt KMaxStringLenFromCenrep = 256; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp --- a/emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -29,11 +29,11 @@ #include // // -#include "CFSMailClient.h" +#include "cfsmailclient.h" // -#include "CFSMailBrandManagerImpl.h" -#include "CFSMailBrand.h" +#include "cfsmailbrandmanagerimpl.h" +#include "cfsmailbrand.h" const TInt KBrandArrayGranularity = 5; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/src/CFSMailClient.cpp --- a/emailservices/emailframework/src/CFSMailClient.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/src/CFSMailClient.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,12 +17,12 @@ #include "emailtrace.h" -#include "CFSMailClient.h" -#include "CFSFWImplementation.h" -#include "CFSMailPluginManager.h" -#include "CFSMailRequestObserver.h" -#include "CFSMailIterator.h" -#include "CFSMailBrandManagerImpl.h" +#include "cfsmailclient.h" +#include "cfsfwimplementation.h" +#include "cfsmailpluginmanager.h" +#include "cfsmailrequestobserver.h" +#include "cfsmailiterator.h" +#include "cfsmailbrandmanagerimpl.h" // ================= MEMBER FUNCTIONS ========================================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailframework/src/CFSMailPluginManager.cpp --- a/emailservices/emailframework/src/CFSMailPluginManager.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailframework/src/CFSMailPluginManager.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,9 +17,9 @@ #include "emailtrace.h" -#include "CFSMailPluginManager.h" -#include "CFSMailRequestObserver.h" -#include "CFSMailRequestHandler.h" +#include "cfsmailpluginmanager.h" +#include "cfsmailrequestobserver.h" +#include "cfsmailrequesthandler.h" // ================= MEMBER FUNCTIONS ========================================== // ----------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/data/iconlist.txt --- a/emailservices/emailserver/cmailhandlerplugin/data/iconlist.txt Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/data/iconlist.txt Fri Feb 19 22:37:30 2010 +0200 @@ -54,5 +54,5 @@ -c16,8 qgn_indi_cmail_calendar_event_read_attachments_high_prio.svg -c16,8 qgn_indi_cmail_calendar_event_read_low_prio.svg -c16,8 qgn_indi_cmail_calendar_event_read_attachments_low_prio.svg --c16,8 qgn_indi_ai_eplg_unread.svg --c16,8 qgn_prop_mce_outbox_small.svg +-c16,8 qgn_stat_message_mail_uni.svg +-c16,8 qgn_indi_cmail_outbox_msg.svg diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/group/cmailhandlerplugin.mmp --- a/emailservices/emailserver/cmailhandlerplugin/group/cmailhandlerplugin.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/group/cmailhandlerplugin.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -37,8 +37,11 @@ SOURCE cmailcpssettings.cpp SOURCE cmailmessagedetails.cpp SOURCE cmailmailboxdetails.cpp +SOURCE cmailcpsutils.cpp #endif // FF_CMAIL_INTEGRATION SOURCE cmaildriveobserver.cpp +SOURCE cmailexternalaccount.cpp +SOURCE cmailpluginproxy.cpp //From server SOURCE fsmailledhandler.cpp diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,6 +20,8 @@ #define __CMAILCPSHANDLER_H__ #include +#include // base class + // FSMailServer classes (base classes and callback interfaces) #include "fsnotificationhandlerbase.h" #include "fsnotificationhandlernotifierinitiator.h" @@ -31,6 +33,9 @@ class CFSMailBox; class CMailMailboxDetails; class CMailCpsSettings; +class CMailExternalAccount; +class CMailPluginProxy; +class CEmailObserverPlugin; /** * CMail ContentPublishingService Handler class @@ -41,7 +46,8 @@ */ NONSHARABLE_CLASS( CMailCpsHandler ) : public CFSNotificationHandlerBase, - public MMailCpsSettingsCallback + public MMailCpsSettingsCallback, + public EmailInterface::MEmailObserverListener { public: @@ -72,6 +78,12 @@ void UpdateMailboxesL(TInt aInstance, const TDesC& aContentId); /** + * Updates external (3rd party) account based on contentId + * @param aContentId specifies the widget and account related to it + */ + void UpdateExtAccountL( const TDesC& aContentId ); + + /** * */ void LaunchWidgetSettingsL( const TDesC& aContentId ); @@ -86,6 +98,13 @@ */ void LaunchEmailWizardL(); /** + * Launches an application based on the given contentId + * This method is for external (3rd party) accounts + * @param aContentId specifies the widget that was pressed by the user + */ + void LaunchExtAppL( const TDesC& aContentId ); + + /** * */ TBool AssociateWidgetToSetting( const TDesC& aContentId ); @@ -96,15 +115,33 @@ void DissociateWidgetFromSettingL( const TDesC& aContentId ); /** - * + * Return total number of mailboxes (native+3rd party) in the system + */ + TInt TotalMailboxCountL(); + + /** + * Return total number of native mailboxes in the system */ - TInt GetMailboxCount(); + TInt TotalIntMailboxCount(); + + /** + * Return total number of 3rd party mailboxes in the system + */ + TInt TotalExtMailboxCountL(); /** * */ void ManualAccountSelectionL( const TDesC& aContentId ); + /** + * Gets correct localised format for time (or date) string + */ + static HBufC* GetMessageTimeStringL( TTime aMessageTime ); + + // From MEmailObserverListener + void EmailObserverEvent( EmailInterface::MEmailData& aData ); + protected: /** * From CFSNotificationHandlerBase @@ -144,10 +181,15 @@ void Reset(); /** - * Initializes everything + * Initializes native accounts */ void InitializeL(); + /** + * Initializes external accounts + */ + void InitializeExternalAccountsL(); + // Creation methods /** * Creates an instance of mailboxdetails based on parameters @@ -178,11 +220,6 @@ const TInt aWidgetInstance, const TInt aMessageNumber, const TInt aFirstRow ); - - /** - * Gets correct localised format for time (or date) string - */ - HBufC* GetMessageTimeStringL( TTime aMessageTime ); /** * @@ -338,12 +375,60 @@ * @return ETrue if duplicate, EFalse if new message */ TBool IsDuplicate( const CMailMailboxDetails& aMailbox, const TFSMailMsgId& aMsgId ); + + // + // Private methods related to 3rd party email widget publishers + // + /** + * Removes all plugin proxies (and plugins) that are not listed in aAccounts + * @param aAccounts up-to-date list of external (3rd party) email accounts + * that are specified in settings + */ + void RemoveUnusedPluginsL( RPointerArray& aAccounts ); + + /** + * Goes through the array of external accounts and instantiates (newly added) + * 3rd party plugins + * @param aAccounts up-to-date list of external (3rd party) email accounts + * that are specified in settings + */ + void AddNewPluginsL( RPointerArray& aAccounts ); /** - * + * Goes through the array of existing 3rd party plugin (proxies) and + * lets them take the accounts given in the param array. + * Plugin proxies also update the widget data. + * @param aAccounts up-to-date list of external (3rd party) email accounts + * that are specified in settings */ + void SelectAndUpdateExtAccountsL( RPointerArray& aAccounts ); + TBool FirstBootL(); + /** + * Checks whether aAccounts array has entries relating to plugin with id aPluginId + * @param aPluginId 3rd party plugin identifier (implementation uid) + * @param aAccounts array of 3rd party email account information + * @return true or false + */ + TBool IsPluginInArray( const TInt aPluginId, RPointerArray& aAccounts ); + + /** + * Checks whether aPlugins array has entries relating to plugin with id aPluginId + * @param aPluginId 3rd party plugin identifier (implementation uid) + * @param aPlugins array of plugin proxies + * @return true or false + */ + TBool IsPluginInArray( const TInt aPluginId, RPointerArray& aPlugins ); + + /** + * Goes through iExternalPlugins array and finds correct entry + * @param aContentId specifying a widget/account + * @return correct plugin proxy instance pointer (ownership not transferred) + * if not found, NULL is retuned + */ + CMailPluginProxy* GetExtPluginL( const TDesC& aContentId ); + private: // data CEikonEnv* iEnv; // pointer to liw wrapper that handles actual publishing @@ -352,6 +437,8 @@ CMailCpsSettings* iSettings; // local cache of mailbox details RPointerArray iAccountsArray; + // array of plugin proxies. One plugin proxy handles one 3rd party plugin and its accounts + RPointerArray iExternalPlugins; }; #endif //__CMAILCPSHANDLER_H__ diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsif.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsif.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsif.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,9 +20,9 @@ #define CMAILCPSIF_H_ // LIW interface -#include -#include -#include +#include +#include +#include #include #include @@ -67,6 +67,18 @@ TFSMailMsgId aFolderId ); /** + * Publishes mailbox name to widget and action related to widget + * @param aInstance specifies the widget instance on homescreen + * @param aMailboxName specifies the text to be published + * @param aAction specifies the action identifier that will be sent back + * when user presses the widget + */ + void PublishMailboxNameL( + const TInt aInstance, + const TDesC& aMailboxName, + const TDesC8& aAction ); + + /** * Resets mailbox name from widget * @param aRowNumber specifies the row on widget UI */ @@ -85,6 +97,23 @@ void PublishMailboxIconL( const TInt aInstance, const TInt aRowNumber, const TInt aIcon, TFSMailMsgId aMailBoxId ); /** + * Publishes mailbox icon based on given resource path + * @param aInstance specifies the widget + * @param aIconResourcePath specifies the icon resource + * (e.g. "mif(z:\\resource\\apps\\myemailplugin.mif 16384 16385)") + */ + void PublishMailboxIconL( const TInt aInstance, const TDesC& aIconPath ); + + /** + * + */ + void PublishIconReferenceL( + const TDesC& aContentId, + const TDesC& aContentType, + const TDesC8& aKey, + const TDesC& aIconPath ); + + /** * */ void PublishMailDetailL( @@ -118,7 +147,7 @@ * */ TInt HandleNotifyL( - TInt aErrorCode, + TInt aCmdId, TInt aEventId, CLiwGenericParamList& aEventParamList, const CLiwGenericParamList& aInParamList ); @@ -153,7 +182,7 @@ /** * adds resource file */ - void CMailCpsIf::AllocateResourcesL(); + void AllocateResourcesL(); /** * initializes the LIW IF @@ -217,6 +246,12 @@ * */ TInt FindWidgetInstanceId(const TDesC& aContentId); + + /** + * Resets all the published content values on HomeScreen database + */ + void ResetPublishedDataL( const TDesC& aContentId ); + public: // RPointerArray iInstIdList; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsifconsts.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsifconsts.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsifconsts.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,6 +21,7 @@ // Hardcoded maximum value for number of rows in widget const TInt KMaxRowCount = 3; +const TInt KMaxMsgCount = 2; // Hardcoded maximum value for number of mailboxes const TInt KMaxMailboxCount = 18; const TInt KMaxUnreadCount = 999; @@ -100,6 +101,7 @@ _LIT8( KDelete, "Delete" ); _LIT( KCpData, "cp_data" ); _LIT8( KFilter, "filter" ); +_LIT8( KData8, "data" ); _LIT8( KId, "id" ); _LIT8( KItem, "item" ); _LIT8( KItemId, "item_id" ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/inc/cmailcpssettings.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpssettings.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpssettings.h Fri Feb 19 22:37:30 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 - 20010 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" @@ -20,6 +20,7 @@ #define CMAILCPSSETTINGS_H_ class CRepository; +class CMailExternalAccount; /* * Callback interface for observer @@ -79,6 +80,13 @@ RArray& Mailboxes(); /** + * Gets array of external mailboxes from widget settings + * @param aAccounts on completion, contains the necessary information of + * external mailboxes that currently should have a widget + */ + void GetExtMailboxesL( RPointerArray& aAccounts ); + + /** * Adds mailbox to widget settings * Method ensures that same mailbox is not added again, if it happens * to exist already in the settings. If already exists, method simply returns without @@ -150,9 +158,10 @@ TInt32 Configuration(); /** - * + * Return total number of all native mailboxes in the system */ - TInt GetTotalMailboxCount(); + TInt TotalIntMailboxCount(); + /** * @@ -169,6 +178,16 @@ */ void RemoveFromContentIdListL( const TDesC& aContentId ); + /** + * + */ + void ToggleWidgetNewMailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox ); + + /** + * + */ + TBool GetNewMailState( const TFSMailMsgId& aMailBox ); + protected: /** * From CActive @@ -228,6 +247,13 @@ * @param aKeys array of keys */ void GetMailboxNonZeroKeysL( RArray& aKeys ); + + /** + * Gets all the external mailbox identifiers + * @param on completion, contains an array of cenrep keys that have an external + * account specified (i.e. not empty) + */ + void GetExtMailboxNonZeroKeysL( RArray& aKeys ); /** * @@ -240,6 +266,8 @@ */ TUint32 GetSettingToAssociate(); + CMailExternalAccount* GetExtMailboxL( TInt aKey ); + private: // data // reference to mailclient CFSMailClient& iMailClient; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsutils.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2008 - 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: Class to handle content publishing for widget +* +*/ + + +#ifndef CMAILCPSUTILS_H +#define CMAILCPSUTILS_H + +#include // TEmailPriority + +/** + * Utility methods for cps handler + * @lib fsmailserver.exe + * @since S60 v5.2 + */ +NONSHARABLE_CLASS( TMailCpsUtils ) + { +public: + + /** + * Two-phased constructor. + * @param aOwner Owner and manager of this handler. + */ + static TInt ResolveIcon( + TBool aUnread, + TBool aCalMsg, + TBool aAttas, + EmailInterface::TEmailPriority aPrio, + TBool aRe, + TBool aFw ); + }; + +#endif // CMAILCPSUTILS_H diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/inc/cmailexternalaccount.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailexternalaccount.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,65 @@ +/* +* 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 "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file defines class CMailMessageDetails. +* +*/ + +#ifndef CMAILEXTERNALACCOUNT_H_ +#define CMAILEXTERNALACCOUNT_H_ + +#include +#include + +/** + * Container class external email account + * + * @lib + * @since S60 v9.2 + */ +NONSHARABLE_CLASS( CMailExternalAccount ) : public CBase + { +public: + /** public constructor */ + static CMailExternalAccount* NewL( + const TInt aMailboxId, + const TInt aPluginId, + HBufC* aContentId ); + + /** destructor */ + virtual ~CMailExternalAccount(); + + // Member accessors + TInt MailboxId(); + TInt PluginId(); + TDesC& ContentId(); + +private: + + void ConstructL(); + + CMailExternalAccount( + const TInt aMailboxId, + const TInt aPluginId, + HBufC* aContentId ); + +private: // data + // actual identifier of the mailbox (unique within plugin context) + TInt iMailboxId; + // identifier for plugin + TInt iPluginId; + // identifier for the widget on homescreen + HBufC* iContentId; + }; + +#endif /* CMAILEXTERNALACCOUNT_H_ */ diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/inc/cmailmessagedetails.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailmessagedetails.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailmessagedetails.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,7 @@ #include #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // class CMailMailboxDetails; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/inc/cmailpluginproxy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailpluginproxy.h Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,133 @@ +/* +* 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" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file defines class CMailMessageDetails. +* +*/ + +#ifndef CMAILPLUGINPROXY_H_ +#define CMAILPLUGINPROXY_H_ + +#include +#include +#include +#include +#include + +class CMailExternalAccount; +class CMailCpsIf; + +/** + * Class that represents the 3rd party email widget plugin to the rest of the cps logic + * Also takes care of all the email accounts that the plugin handles + * @lib cmailhandlerplugin.lib + * @since S60 v9.2 + */ +NONSHARABLE_CLASS( CMailPluginProxy ) : public CBase, public EmailInterface::MEmailObserverListener + { +public: + static CMailPluginProxy* NewL( + const TInt aPluginId, + CMailCpsIf& aPublisher ); + + virtual ~CMailPluginProxy(); + + // From MEmailObserverListener + /** + * Called by 3rd party plugins when there are chnages in the data to be published + * @param aData offers access to all the necessary data needed for publishing data on widget + */ + void EmailObserverEvent( EmailInterface::MEmailData& aData ); + + /** + * Accessor for the plugin id + * @return this plugin's 'implementation id' + */ + TInt PluginId(); + + /** + * Whether this plugin handles the specified contentId (i.e. email account) + * @param aContentId specifying a widget instance and a mailbox related to it + * @return boolean + */ + TBool HasAccount( const TDesC& aContentId ); + + /** + * Looks up the data related to trigger event, and launches the specified application + * @param aContentId content id of the widget that received the key press + */ + void LaunchExtAppL( const TDesC& aContentId ); + + /** + * Picks the accounts that belong to this plugin, and updates the data + * publishing of them all + * @param aAccounts list of external accounts + */ + void SelectAndUpdateAccountsL( RPointerArray& aAccounts ); + + /** + * Handles updating of one account/widget data based on contentId + * @param aContentId content id of the widget + */ + void UpdateAccountL( const TDesC& aContentId ); + +private: + + void ConstructL(); + + CMailPluginProxy( + const TInt aPluginId, + CMailCpsIf& aPublisher ); + + void RemoveAccountsL(); + + void ResetAccountL( const TDesC& aContentId ); + + void ResetMessageRowL( const TInt aWidgetInstanceId, const TInt aRow ); + + void SelectOwnAccountsL( RPointerArray& aAccounts ); + + TInt ResolveWidgetInstance( const TDesC& aContentId ); + + TInt GetMailboxId( const TDesC& aContentId ); + + void PublishAccountsL(); + + void PublishAccountL( const TInt aWidgetInstanceId, const TInt aMailboxId ); + + void PublishAccountL( const TInt aWidgetInstanceId, EmailInterface::MMailboxData& aMailboxData ); + + void PublishFirstRowL( const TInt aWidgetInstanceId, EmailInterface::MMailboxData& aMailboxData ); + + void PublishMessageRowL( const TInt aWidgetInstanceId, EmailInterface::MMessageData& aMessageData, const TInt aRow ); + + HBufC* ConstructMailboxNameWithMessageCountLC( EmailInterface::MMailboxData& aMailboxData ); + + TInt ResolveIndicatorIcon( EmailInterface::MMailboxData& aMailboxData ); + + EmailInterface::MMailboxData& GetMailboxDataL( TInt aMailboxId ); + + TInt UnreadCountL( EmailInterface::MMailboxData& aMailboxData ); + +private: // data + // identifier of the plugin + TInt iPluginId; + // plugin instance where rest of the data is buffered + EmailInterface::CEmailObserverPlugin* iPlugin; + // reference to publisher interface + CMailCpsIf& iPublisher; + // array of accounts that have widget and this plugin is responsible for + RPointerArray iAccounts; + }; + +#endif /* CMAILPLUGINPROXY_H_ */ diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h Fri Feb 19 22:37:30 2010 +0200 @@ -45,4 +45,7 @@ const TUint32 KCMailExtPluginIdOffset = 0x00000100; const TUint32 KCMailExtWidgetCidOffset = 0x00000200; +// Key to store mailboxes where is new messages. Format: ... +const TUint32 KCMailMailboxesWithNewMail = 0x10000003; + #endif // CMAILWIDGETCENREPKEYS_H diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/inc/fsnotificationhandlernotifierinitiator.h --- a/emailservices/emailserver/cmailhandlerplugin/inc/fsnotificationhandlernotifierinitiator.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/inc/fsnotificationhandlernotifierinitiator.h Fri Feb 19 22:37:30 2010 +0200 @@ -24,7 +24,7 @@ #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "fsmailserverconst.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -24,18 +24,27 @@ #include #include #include +#include +#include +#include +#include #include "emailtrace.h" -#include "CFSMailClient.h" -#include "CFSMailBox.h" -#include "CFSMailFolder.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" +#include "cfsmailfolder.h" #include "cmailcpshandler.h" #include "cmailcpssettings.h" #include "cmailcpsif.h" #include "cmailmessagedetails.h" #include "cmailmailboxdetails.h" +#include "cmailexternalaccount.h" #include "cmailcpsifconsts.h" #include "FreestyleEmailUiConstants.h" +#include "cmailpluginproxy.h" +#include "cmailhandlerpluginpanic.h" + +using namespace EmailInterface; // --------------------------------------------------------- // CMailCpsHandler::CMailCpsHandler @@ -81,7 +90,8 @@ iSettings = CMailCpsSettings::NewL( MailClient() ); InitializeL(); - + InitializeExternalAccountsL(); + iSettings->StartObservingL( this ); } @@ -95,6 +105,7 @@ delete iLiwIf; delete iSettings; iAccountsArray.ResetAndDestroy(); + iExternalPlugins.ResetAndDestroy(); } // --------------------------------------------------------- @@ -164,6 +175,120 @@ } // --------------------------------------------------------- +// CMailCpsHandler::InitializeExternalAccountsL +// --------------------------------------------------------- +// +void CMailCpsHandler::InitializeExternalAccountsL() + { + FUNC_LOG; + // Read external account data from settings + RPointerArray extAccounts; + CleanupClosePushL( extAccounts ); + iSettings->GetExtMailboxesL( extAccounts ); + + // Delete removed plugins + RemoveUnusedPluginsL( extAccounts ); + + // Instantiate new plugins + AddNewPluginsL( extAccounts ); + + // Set accounts under correct pluginProxies + SelectAndUpdateExtAccountsL( extAccounts ); + + __ASSERT_DEBUG( extAccounts.Count() == 0, Panic( ECmailHandlerPluginPanicNoFailedState ) ); + CleanupStack::PopAndDestroy(); + } + +// --------------------------------------------------------- +// CMailCpsHandler::RemoveUnusedPluginsL +// --------------------------------------------------------- +// +void CMailCpsHandler::RemoveUnusedPluginsL( RPointerArray& aAccounts ) + { + FUNC_LOG; + for ( TInt i = 0; i < iExternalPlugins.Count(); i++ ) + { + if ( !IsPluginInArray( iExternalPlugins[i]->PluginId(), aAccounts ) ) + { + // all plugin's accounts have been removed from widget settings, unloading resources + CMailPluginProxy* proxy = iExternalPlugins[i]; + iExternalPlugins.Remove(i--); // also change the loop index + delete proxy; + } + } + } + +// --------------------------------------------------------- +// CMailCpsHandler::AddNewPluginsL +// --------------------------------------------------------- +// +void CMailCpsHandler::AddNewPluginsL( RPointerArray& aAccounts ) + { + FUNC_LOG; + for ( TInt i = 0; i < aAccounts.Count(); i++ ) + { + if ( !IsPluginInArray( aAccounts[i]->PluginId(), iExternalPlugins ) ) + { + // new plugin instantiation + INFO_1("Instantiating plugin 0x%x", aAccounts[i]->PluginId() ); + CMailPluginProxy* proxy = CMailPluginProxy::NewL( aAccounts[i]->PluginId(), *iLiwIf ); + CleanupStack::PushL( proxy ); + iExternalPlugins.AppendL( proxy ); + CleanupStack::Pop( proxy ); + } + } + } + +// --------------------------------------------------------- +// CMailCpsHandler::UpdateExtAccountsL +// --------------------------------------------------------- +// +void CMailCpsHandler::SelectAndUpdateExtAccountsL( RPointerArray& aAccounts ) + { + FUNC_LOG; + for ( TInt i = 0; i < iExternalPlugins.Count(); i++ ) + { + iExternalPlugins[i]->SelectAndUpdateAccountsL( aAccounts ); + } + } + +// --------------------------------------------------------- +// CMailCpsHandler::IsPluginInArray +// --------------------------------------------------------- +// +TBool CMailCpsHandler::IsPluginInArray( const TInt aPluginId, RPointerArray& aAccounts ) + { + FUNC_LOG; + TBool found( EFalse ); + for ( TInt i = 0; i < aAccounts.Count(); i++ ) + { + if ( aAccounts[i]->PluginId() == aPluginId ) + { + found = ETrue; + } + } + return found; + } + +// --------------------------------------------------------- +// CMailCpsHandler::IsPluginInArray +// --------------------------------------------------------- +// +TBool CMailCpsHandler::IsPluginInArray( const TInt aPluginId, RPointerArray& aPlugins ) + { + FUNC_LOG; + TBool found( EFalse ); + for ( TInt i = 0; i < aPlugins.Count(); i++ ) + { + if ( aPlugins[i]->PluginId() == aPluginId ) + { + found = ETrue; + } + } + return found; + } + +// --------------------------------------------------------- // CMailCpsHandler::CreateMailboxDetailsL // --------------------------------------------------------- // @@ -186,6 +311,7 @@ Reset(); // Trying to keep callback interface non-leaving TRAP_IGNORE( InitializeL() ); + TRAP_IGNORE( InitializeExternalAccountsL() ); // Update widget contents after settings change TRAP_IGNORE( UpdateFullL() ); } @@ -215,24 +341,30 @@ FUNC_LOG; TInt row(1); // start from first row TInt mailbox(0); - + TBool found( EFalse ); + // try to find mailbox with matching contentId for ( mailbox = 0; mailbox < iAccountsArray.Count(); mailbox++ ) - { - TInt compare = aContentId.Compare(*iAccountsArray[mailbox]->iWidgetInstance); - if (!compare) + { + if ( !aContentId.Compare( *iAccountsArray[mailbox]->iWidgetInstance ) ) { + INFO_1("iAccountsArray.Count() == %d", iAccountsArray.Count()); + found = ETrue; break; } } - // Update fields from left to right - UpdateMailBoxIconL( mailbox, aInstance, row ); - UpdateMailboxNameL( mailbox, aInstance, row ); - UpdateIndicatorIconL( mailbox, aInstance, row ); - row++; - UpdateMessagesL( mailbox, aInstance, 1, row); - row++; - UpdateMessagesL( mailbox, aInstance, 2, row); + // if contentId found from array, update the mailbox + if ( found ) + { + // Update fields from left to right + UpdateMailBoxIconL( mailbox, aInstance, row ); + UpdateMailboxNameL( mailbox, aInstance, row ); + UpdateIndicatorIconL( mailbox, aInstance, row ); + row++; + UpdateMessagesL( mailbox, aInstance, 1, row); + row++; + UpdateMessagesL( mailbox, aInstance, 2, row); + } } // --------------------------------------------------------- @@ -601,18 +733,18 @@ TFSMailMsgId mailBoxId; mailBoxId = iAccountsArray[aMailBoxNumber]->iMailboxId; - if ( GetUnseenCountL(mailBoxId) > 0 ) + if ( iSettings->GetNewMailState( mailBoxId ) ) { iLiwIf->PublishIndicatorIconL( aWidgetInstance, aRowNumber, - EMbmCmailhandlerpluginQgn_indi_ai_eplg_unread ); + EMbmCmailhandlerpluginQgn_stat_message_mail_uni ); } else if( !IsOutboxEmptyL(mailBoxId) ) { iLiwIf->PublishIndicatorIconL( aWidgetInstance, aRowNumber, - EMbmCmailhandlerpluginQgn_prop_mce_outbox_small); + EMbmCmailhandlerpluginQgn_indi_cmail_outbox_msg); } else { @@ -704,11 +836,13 @@ case TFSEventMailboxRenamed: { HandleMailboxRenamedEventL( aMailbox ); + UpdateFullL(); break; } case TFSEventMailboxDeleted: { HandleMailboxDeletedEventL( aMailbox ); + UpdateFullL(); break; } case TFSEventMailboxSettingsChanged: @@ -720,11 +854,13 @@ case TFSEventNewMail: { HandleNewMailEventL( aMailbox, aParam1, aParam2 ); + UpdateFullL(); break; } case TFSEventMailDeleted: { HandleMailDeletedEventL( aMailbox, aParam1, aParam2 ); + UpdateFullL(); break; } case TFSEventMailChanged: @@ -742,7 +878,6 @@ break; } } - UpdateFullL(); } // --------------------------------------------------------- @@ -831,6 +966,7 @@ // Remove from cenrep iSettings->RemoveMailboxL( aMailbox ); + iSettings->ToggleWidgetNewMailIconL( EFalse, aMailbox ); break; } } @@ -844,6 +980,9 @@ TFSMailMsgId aMailbox, TAny* aParam1, TAny* aParam2 ) { FUNC_LOG; + + iSettings->ToggleWidgetNewMailIconL( ETrue, aMailbox ); + // Basic assertions if ( !aParam1 || !aParam2 ) { @@ -1589,28 +1728,38 @@ { FUNC_LOG; - TUid mailBoxUid; - mailBoxUid.iUid = iSettings->GetMailboxUidByContentId(aContentId); - TFSMailMsgId mailBoxId; - mailBoxId.SetId(mailBoxUid.iUid); - TUid pluginUid; - pluginUid.iUid = iSettings->GetPluginUidByContentId(aContentId); - mailBoxId.SetPluginId(pluginUid); - CFSMailBox* mailBox = MailClient().GetMailBoxByUidL( mailBoxId ); - CleanupStack::PushL( mailBox ); - if ( mailBox ) + TInt nativeMailboxId( iSettings->GetMailboxUidByContentId( aContentId ) ); + // Is the contentId related to internal mailbox or external? + if( nativeMailboxId ) { - TFSMailMsgId inboxFolderId = mailBox->GetStandardFolderId( EFSInbox ); + TUid mailBoxUid; + mailBoxUid.iUid = nativeMailboxId; - TMailListActivationData tmp; - tmp.iFolderId = inboxFolderId; - tmp.iMailBoxId = mailBoxId; - const TPckgBuf pkgOut( tmp ); - iEnv->EikAppUi()->ActivateViewL( TVwsViewId(KUidEmailUi, KMailListId), - KStartListWithFolderId, - pkgOut); + TFSMailMsgId mailBoxId; + mailBoxId.SetId(mailBoxUid.iUid); + TUid pluginUid; + pluginUid.iUid = iSettings->GetPluginUidByContentId(aContentId); + mailBoxId.SetPluginId(pluginUid); + CFSMailBox* mailBox = MailClient().GetMailBoxByUidL( mailBoxId ); + CleanupStack::PushL( mailBox ); + if ( mailBox ) + { + TFSMailMsgId inboxFolderId = mailBox->GetStandardFolderId( EFSInbox ); + + TMailListActivationData tmp; + tmp.iFolderId = inboxFolderId; + tmp.iMailBoxId = mailBoxId; + const TPckgBuf pkgOut( tmp ); + iEnv->EikAppUi()->ActivateViewL( TVwsViewId(KUidEmailUi, KMailListId), + KStartListWithFolderId, + pkgOut); + } + CleanupStack::PopAndDestroy( mailBox ); } - CleanupStack::PopAndDestroy( mailBox ); + else + { + LaunchExtAppL( aContentId ); + } } // ----------------------------------------------------------------------------- @@ -1625,6 +1774,55 @@ viewUid, KNullDesC8); } + +// ----------------------------------------------------------------------------- +// CMailCpsHandler::LaunchExtAppL() +// ----------------------------------------------------------------------------- +// +void CMailCpsHandler::LaunchExtAppL( const TDesC& aContentId ) + { + FUNC_LOG; + CMailPluginProxy* plugin = GetExtPluginL( aContentId ); + if ( plugin ) + { + plugin->LaunchExtAppL( aContentId ); + } + } + +// ----------------------------------------------------------------------------- +// CMailCpsHandler::GetExtPluginL +// ----------------------------------------------------------------------------- +// +CMailPluginProxy* CMailCpsHandler::GetExtPluginL( const TDesC& aContentId ) + { + FUNC_LOG; + CMailPluginProxy* plugin( NULL ); + for( TInt i = 0; i < iExternalPlugins.Count(); i++ ) + { + if ( iExternalPlugins[i]->HasAccount( aContentId ) ) + { + plugin = iExternalPlugins[i]; + } + } + return plugin; + } + +// ----------------------------------------------------------------------------- +// CMailCpsHandler::UpdateExtAccountL +// ----------------------------------------------------------------------------- +// +void CMailCpsHandler::UpdateExtAccountL( const TDesC& aContentId ) + { + FUNC_LOG; + // Look up plugin that handles this account + CMailPluginProxy* plugin = GetExtPluginL( aContentId ); + if ( plugin ) + { + // Publish its data + plugin->UpdateAccountL( aContentId ); + } + } + // --------------------------------------------------------------------------- // CMailCpsHandler::AssociateWidget // --------------------------------------------------------------------------- @@ -1652,13 +1850,50 @@ } // --------------------------------------------------------------------------- +// CMailCpsHandler::TotalMailboxCount +// --------------------------------------------------------------------------- +// +TInt CMailCpsHandler::TotalMailboxCountL() + { + FUNC_LOG; + return TotalIntMailboxCount() + TotalExtMailboxCountL(); + } + +// --------------------------------------------------------------------------- // CMailCpsHandler::GetMailboxCount // --------------------------------------------------------------------------- // -TInt CMailCpsHandler::GetMailboxCount() +TInt CMailCpsHandler::TotalIntMailboxCount() + { + FUNC_LOG; + return iSettings->TotalIntMailboxCount(); + } + +// --------------------------------------------------------- +// CMailCpsHandler::TotalExtMailboxCount +// --------------------------------------------------------- +// +TInt CMailCpsHandler::TotalExtMailboxCountL() { FUNC_LOG; - return iSettings->GetTotalMailboxCount(); + TInt totalMailboxCount( 0 ); + TUid interfaceUid = TUid::Uid( KEmailObserverInterfaceUid ); + RImplInfoPtrArray plugins; + CleanupClosePushL( plugins ); + REComSession::ListImplementationsL( interfaceUid, plugins); + + for ( TInt i = 0; i < plugins.Count(); i++ ) + { + TUid implUid = plugins[i]->ImplementationUid(); + INFO_1("Instantiating plugin %d", implUid.iUid); + EmailInterface::CEmailObserverPlugin* plugin = + EmailInterface::CEmailObserverPlugin::NewL( implUid, this ); + MEmailData& data( plugin->EmailDataL() ); + totalMailboxCount += data.MailboxesL().Count(); + } + + CleanupStack::PopAndDestroy(); // plugins + return totalMailboxCount; } // --------------------------------------------------------------------------- @@ -1681,7 +1916,7 @@ if (!iSettings->FindFromContentIdListL(aContentId)) { iSettings->AddToContentIdListL(aContentId); - if (GetMailboxCount()) + if ( TotalMailboxCountL() ) { LaunchWidgetSettingsL(aContentId); } @@ -1719,3 +1954,10 @@ return ret; } +// --------------------------------------------------------------------------- +// CMailCpsHandler::EmailObserverEvent +// --------------------------------------------------------------------------- +void CMailCpsHandler::EmailObserverEvent( EmailInterface::MEmailData& /*aData*/ ) + { + // Nothing to do + } diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 - 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" @@ -23,7 +23,7 @@ #include #include "emailtrace.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include "cmailcpsif.h" #include "cmailcpsifconsts.h" #include "FreestyleEmailUiConstants.h" @@ -74,6 +74,8 @@ iMsgInterface = GetMessagingInterfaceL(); RegisterForObserverL(); PublisherRegisteryActionL(); + + ResetPublishedDataL( KCPAll ); } // --------------------------------------------------------------------------- @@ -232,6 +234,31 @@ } // --------------------------------------------------------------------------- +// CMailCpsIf::PublishActiveMailboxNameL +// --------------------------------------------------------------------------- +// +void CMailCpsIf::PublishMailboxNameL( + const TInt aInstance, + const TDesC& aMailboxName, + const TDesC8& aAction ) + { + FUNC_LOG; + + TBuf contentType; + contentType.Copy(KContTypeBodyText); + contentType.Append(_L("1")); + + TBuf textKey; + textKey.Copy(KKeyBodyText); + textKey.Append(_L("1")); + + TFSMailMsgId dummy; + + PublishDescriptorL( KPubId, contentType, iInstIdList[aInstance]->Des(), + aMailboxName, textKey, aAction, 0, dummy, dummy ); + } + +// --------------------------------------------------------------------------- // CMailCpsIf::PublishIndicatorIconL // --------------------------------------------------------------------------- // @@ -300,6 +327,71 @@ } // --------------------------------------------------------------------------- +// CMailCpsIf::PublishMailboxIconL +// --------------------------------------------------------------------------- +// +void CMailCpsIf::PublishMailboxIconL( const TInt aInstance, const TDesC& aIconPath ) + { + FUNC_LOG; + + TBuf contentType; + contentType.Copy(KContTypeMailboxIcons); + contentType.Append(_L("1")); + + TBuf8 key; + key.Copy(KKeyMailboxIcons); + key.Append(_L8("1")); + + User::LeaveIfNull( iInstIdList[aInstance] ); + PublishIconReferenceL( + iInstIdList[aInstance]->Des(), + contentType, + key, + aIconPath ); + } + +// --------------------------------------------------------------------------- +// CMailCpsIf::PublishIconReferenceL +// --------------------------------------------------------------------------- +// +void CMailCpsIf::PublishIconReferenceL( + const TDesC& aContentId, + const TDesC& aContentType, + const TDesC8& aKey, + const TDesC& aIconPath ) + { + FUNC_LOG; + CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL()); + CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL()); + + TLiwGenericParam type( KType, TLiwVariant( KCpData ) ); + inparam->AppendL( type ); + + CLiwDefaultMap* pdatamap = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC(); + + pdatamap->InsertL( KPublisherId, TLiwVariant( KPubId ) ); + pdatamap->InsertL( KContentType, TLiwVariant( aContentType ) ); + pdatamap->InsertL( KContentId, TLiwVariant( aContentId ) ); + + datamap->InsertL( aKey, TLiwVariant( aIconPath ) ); + + pdatamap->InsertL( KDataMap, TLiwVariant(datamap) ); + TLiwGenericParam item( KItem, TLiwVariant( pdatamap ) ); + inparam->AppendL( item ); + + iMsgInterface->ExecuteCmdL( KAdd, *inparam, *outparam ); + + CleanupStack::PopAndDestroy( datamap ); + CleanupStack::PopAndDestroy( pdatamap ); + + item.Reset(); + type.Reset(); + outparam->Reset(); + inparam->Reset(); + } + +// --------------------------------------------------------------------------- // CMailCpsIf::PublishMailDetailL // --------------------------------------------------------------------------- // @@ -492,6 +584,7 @@ iconIds.Append( KSpace ); id.Num( aBitmapMaskId ); iconIds.Append( id ); + iconIds.Append( _L(")") ); } // The actual image publishing part starts here @@ -668,14 +761,14 @@ // --------------------------------------------------------------------------- // TInt CMailCpsIf::HandleNotifyL( - TInt aErrorCode, + TInt /*aCmdId*/, TInt /*aEventId*/, CLiwGenericParamList& aEventParamList, const CLiwGenericParamList& /*aInParamList*/ ) { FUNC_LOG; PublisherStatusL ( aEventParamList); - return aErrorCode; + return KErrNone; } // --------------------------------------------------------------------------- @@ -751,6 +844,7 @@ TInt widgetInstance = FindWidgetInstanceId(cid->Des()); PublishSetupWizardL(widgetInstance); iMailCpsHandler->UpdateMailboxesL(widgetInstance, cid->Des()); + iMailCpsHandler->UpdateExtAccountL( cid->Des() ); // Widget visible on the homescreen. Publishing allowed. iAllowedToPublish[widgetInstance] = ETrue; iInactive[widgetInstance] = EFalse; @@ -776,6 +870,7 @@ { // Widget removed from homescreen. HBufC* cid = contentid.AllocLC(); + ResetPublishedDataL( cid->Des() ); TInt widgetInstance = FindWidgetInstanceId(cid->Des()); if (widgetInstance != KErrNotFound ) { @@ -799,7 +894,7 @@ { // If no accounts are created launch email wizard // otherwice launch widget settings app - if (iMailCpsHandler->GetMailboxCount()) + if ( iMailCpsHandler->TotalMailboxCountL() ) { HBufC* cid = contentid.AllocLC(); iMailCpsHandler->LaunchWidgetSettingsL(cid->Des()); @@ -877,3 +972,35 @@ return instance; } +// --------------------------------------------------------------------------- +// CMailCpsIf::ResetPublishedDataL +// --------------------------------------------------------------------------- +// +void CMailCpsIf::ResetPublishedDataL( const TDesC& aContentId ) + { + FUNC_LOG; + // Clean up all published data + if( !iMsgInterface ) GetMessagingInterfaceL(); + CLiwGenericParamList* inParam = &(iServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(iServiceHandler->OutParamListL()); + + // Fill input param + TLiwGenericParam cptype( KType, TLiwVariant( KCpData )); + inParam->AppendL( cptype ); + + CLiwDefaultMap* cpData = CLiwDefaultMap::NewLC(); + cpData->InsertL( KPublisherId, TLiwVariant( KPubId ) ); + cpData->InsertL( KContentType, TLiwVariant( KCPAll ) ); + cpData->InsertL( KContentId, TLiwVariant( aContentId ) ); + TLiwGenericParam item( KData8, TLiwVariant( cpData ) ); + inParam->AppendL( item ); + + // Execute command + iMsgInterface->ExecuteCmdL( KDelete , *inParam, *outParam ); + + CleanupStack::PopAndDestroy( cpData ); + item.Reset(); + cptype.Reset(); + outParam->Reset(); + inParam->Reset(); + } diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 - 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 - 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" @@ -20,17 +20,19 @@ #include // CRepository #include + // Email Framework APIs // -#include "CFSMailCommon.h" -#include "CFSMailClient.h" -#include "CFSMailBox.h" -#include "CFSMailFolder.h" +#include "cfsmailcommon.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" +#include "cfsmailfolder.h" // #include "cmailcpssettings.h" #include "cmailwidgetcenrepkeysinternal.h" #include "cmailcpsifconsts.h" +#include "cmailexternalaccount.h" // ======== MEMBER FUNCTIONS ======== @@ -96,10 +98,10 @@ void CMailCpsSettings::RunL() { FUNC_LOG; + StartObservingL(); LoadSettingsL(); // mailboxes etc. user changeable data LoadConfigurationL(); // internal configuration data iObserver->SettingsChangedCallback(); - StartObservingL(); } // --------------------------------------------------------------------------- @@ -192,6 +194,20 @@ } // --------------------------------------------------------------------------- +// CMailCpsSettings::GetMailboxNonZeroKeysL +// --------------------------------------------------------------------------- +// +void CMailCpsSettings::GetExtMailboxNonZeroKeysL( RArray& aKeys ) + { + FUNC_LOG; + TInt ret = iCenRep->FindNeqL( KCmailExtMailboxKeyRange, KCmailExtMailboxRangeMask, 0, aKeys ); + if ( ret != KErrNone && ret != KErrNotFound ) + { + User::Leave( ret ); + } + } + +// --------------------------------------------------------------------------- // CMailCpsSettings::ResolveMailbox // --------------------------------------------------------------------------- // @@ -266,10 +282,53 @@ // RArray& CMailCpsSettings::Mailboxes() { + FUNC_LOG; return iMailboxArray; } // --------------------------------------------------------------------------- +// CMailCpsSettings::ExternalMailboxes +// --------------------------------------------------------------------------- +// +void CMailCpsSettings::GetExtMailboxesL( RPointerArray& aAccounts ) + { + FUNC_LOG; + RArray keys; + CleanupClosePushL( keys ); + GetExtMailboxNonZeroKeysL( keys ); + + for ( TInt i = 0; i < keys.Count(); i++ ) + { + CMailExternalAccount* account = GetExtMailboxL( keys[i] ); + CleanupStack::PushL( account ); + aAccounts.AppendL( account ); + CleanupStack::Pop( account ); + } + + CleanupStack::PopAndDestroy(); // keys + } + +// --------------------------------------------------------------------------- +// CMailCpsSettings::GetExtMailboxL +// --------------------------------------------------------------------------- +// +CMailExternalAccount* CMailCpsSettings::GetExtMailboxL( TInt aKey ) + { + FUNC_LOG; + TInt mailboxId( 0 ); + TInt pluginId( 0 ); + HBufC* contentIdBuf = HBufC::NewL( KMaxDescLen ); + TPtr contentId = contentIdBuf->Des(); + + User::LeaveIfError( iCenRep->Get( aKey, mailboxId ) ); + User::LeaveIfError( iCenRep->Get( aKey + KCMailExtPluginIdOffset, pluginId ) ); + User::LeaveIfError( iCenRep->Get( aKey + KCMailExtWidgetCidOffset, contentId ) ); + + return CMailExternalAccount::NewL( + mailboxId, pluginId, contentIdBuf ); + } + +// --------------------------------------------------------------------------- // CMailCpsSettings::AddMailboxL // --------------------------------------------------------------------------- // @@ -579,10 +638,10 @@ } // --------------------------------------------------------------------------- -// CMailCpsSettings::GetTotalMailboxCount +// CMailCpsSettings::TotalIntMailboxCount // --------------------------------------------------------------------------- // -TInt CMailCpsSettings::GetTotalMailboxCount() +TInt CMailCpsSettings::TotalIntMailboxCount() { FUNC_LOG; RPointerArray mailboxarray; @@ -661,3 +720,68 @@ iCenRep->Set( key, value ); } } + +// ----------------------------------------------------------------------------- +// CMailCpsSettings::ToggleWidgetNewMailIconL +// ----------------------------------------------------------------------------- +void CMailCpsSettings::ToggleWidgetNewMailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox ) + { + FUNC_LOG; + TBuf mailbox; + mailbox.Num(aMailBox.Id()); + + TBuf str; + str.Copy(KStartSeparator); + str.Append(mailbox); + str.Append(KEndSeparator); + + TBuf stored; + TUint32 key(KCMailMailboxesWithNewMail); + iCenRep->Get( key, stored ); + + TInt result = stored.Find(str); + + if (aIconOn) + { + if (result < 0) // Not found + { + stored.Append(str); + iCenRep->Set( key, stored ); + } + } + else + { + if (result >= 0) + { + stored.Delete(result, str.Length()); + iCenRep->Set( key, stored ); + } + } + } + +// ----------------------------------------------------------------------------- +// CMailCpsSettings::GetNewMailState +// ----------------------------------------------------------------------------- +TBool CMailCpsSettings::GetNewMailState( const TFSMailMsgId& aMailBox ) + { + FUNC_LOG; + TBool ret(EFalse); + TBuf mailbox; + mailbox.Num(aMailBox.Id()); + + TBuf str; + str.Copy(KStartSeparator); + str.Append(mailbox); + str.Append(KEndSeparator); + + TBuf stored; + TUint32 key(KCMailMailboxesWithNewMail); + iCenRep->Get( key, stored ); + + TInt result = stored.Find(str); + if (result >= 0) + { + ret = ETrue; + } + return ret; + } diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/cmailcpsutils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsutils.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,93 @@ +/* +* 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" +* 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: Class to handle content publishing for widget +* +*/ + +#include "emailtrace.h" +#include "cmailcpsutils.h" +#include "cmailhandlerplugin.mbg" + +using namespace EmailInterface; + +// --------------------------------------------------------- +// CMailCpsUtils::ResolveIndicatorIcon +// --------------------------------------------------------- +// +TInt TMailCpsUtils::ResolveIcon( + TBool aUnread, + TBool aCalMsg, + TBool aAttas, + EmailInterface::TEmailPriority aPrio, + TBool aRe, + TBool aFw ) + { + FUNC_LOG; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read; + if ( !aUnread && !aCalMsg && aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_attach; + if ( !aUnread && !aCalMsg && aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_attach_high_prio; + if ( !aUnread && !aCalMsg && aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_attach_low_prio; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == ENormal && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded; + if ( !aUnread && !aCalMsg && aAttas && aPrio == ENormal && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded_attach; + if ( !aUnread && !aCalMsg && aAttas && aPrio == EHigh && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded_attach_high_prio; + if ( !aUnread && !aCalMsg && aAttas && aPrio == ELow && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded_attach_low_prio; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == EHigh && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded_high_prio; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == ELow && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded_low_prio; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_high_prio; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_low_prio; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == ENormal && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied; + if ( !aUnread && !aCalMsg && aAttas && aPrio == ENormal && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_attach; + if ( !aUnread && !aCalMsg && aAttas && aPrio == EHigh && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_attach_high_prio; + if ( !aUnread && !aCalMsg && aAttas && aPrio == ELow && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_attach_low_prio; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == ENormal && aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_forwarded; + if ( !aUnread && !aCalMsg && aAttas && aPrio == ENormal && aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_forwarded_attach; + if ( !aUnread && !aCalMsg && aAttas && aPrio == EHigh && aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_forwarded_attach_high_prio; + if ( !aUnread && !aCalMsg && aAttas && aPrio == ELow && aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_forwarded_attach_low_prio; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == EHigh && aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_forwarded_high_prio; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == EHigh && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_high_prio; + if ( !aUnread && !aCalMsg && !aAttas && aPrio == ELow && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_low_prio; + if ( aUnread && !aCalMsg && !aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread; + if ( aUnread && !aCalMsg && aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_attach; + if ( aUnread && !aCalMsg && aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_attach_high_prio; + if ( aUnread && !aCalMsg && aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_attach_low_prio; + if ( aUnread && !aCalMsg && !aAttas && aPrio == ENormal && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded; + if ( aUnread && !aCalMsg && aAttas && aPrio == ENormal && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded_attach; + if ( aUnread && !aCalMsg && aAttas && aPrio == EHigh && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded_attach_high_prio; + if ( aUnread && !aCalMsg && aAttas && aPrio == ELow && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded_attach_low_prio; + if ( aUnread && !aCalMsg && !aAttas && aPrio == EHigh && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded_high_prio; + if ( aUnread && !aCalMsg && !aAttas && aPrio == ELow && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded_low_prio; + if ( aUnread && !aCalMsg && !aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_high_prio; + if ( aUnread && !aCalMsg && !aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_low_prio; + if ( aUnread && !aCalMsg && !aAttas && aPrio == ENormal && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied; + if ( aUnread && !aCalMsg && aAttas && aPrio == ENormal && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied_attach; + if ( aUnread && !aCalMsg && aAttas && aPrio == EHigh && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied_attach_high_prio; + if ( aUnread && !aCalMsg && aAttas && aPrio == ELow && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied_attach_low_prio; + if ( aUnread && !aCalMsg && !aAttas && aPrio == EHigh && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied_high_prio; + if ( aUnread && !aCalMsg && !aAttas && aPrio == ELow && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied_low_prio; + if ( aUnread && aCalMsg && !aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread; + if ( aUnread && aCalMsg && aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread_attachments; + if ( aUnread && aCalMsg && !aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread_high_prio; + if ( aUnread && aCalMsg && aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread_attachments_high_prio; + if ( aUnread && aCalMsg && !aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread_low_prio; + if ( aUnread && aCalMsg && aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread_attachments_low_prio; + if ( !aUnread && aCalMsg && !aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read; + if ( !aUnread && aCalMsg && aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read_attachments; + if ( !aUnread && aCalMsg && !aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read_high_prio; + if ( !aUnread && aCalMsg && aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read_attachments_high_prio; + if ( !aUnread && aCalMsg && !aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read_low_prio; + if ( !aUnread && aCalMsg && aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read_attachments_low_prio; + + // default + return EMbmCmailhandlerpluginQgn_indi_cmail_read; + } diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/cmailexternalaccount.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailexternalaccount.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,97 @@ +/* +* 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" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file implements class CMailMailboxDetails. +* +*/ + +#include "emailtrace.h" +#include "cmailexternalaccount.h" + +// --------------------------------------------------------- +// CMailExternalAccount::NewL +// --------------------------------------------------------- +// +CMailExternalAccount* CMailExternalAccount::NewL( + const TInt aMailboxId, + const TInt aPluginId, + HBufC* aContentId ) + { + FUNC_LOG; + CMailExternalAccount* self = new(ELeave) CMailExternalAccount( aMailboxId, aPluginId, aContentId ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CMailExternalAccount::CMailExternalAccount +// --------------------------------------------------------- +// +CMailExternalAccount::CMailExternalAccount( + const TInt aMailboxId, + const TInt aPluginId, + HBufC* aContentId ) : + iMailboxId( aMailboxId ), + iPluginId( aPluginId ), + iContentId( aContentId ) + { + FUNC_LOG; + } + +// --------------------------------------------------------- +// CMailExternalAccount::~CMailExternalAccount +// --------------------------------------------------------- +// +CMailExternalAccount::~CMailExternalAccount() + { + FUNC_LOG; + delete iContentId; + } + +// --------------------------------------------------------- +// CMailExternalAccount::ConstructL +// --------------------------------------------------------- +// +void CMailExternalAccount::ConstructL() + { + FUNC_LOG; + } + +// --------------------------------------------------------- +// CMailExternalAccount::MailboxId +// --------------------------------------------------------- +// +TInt CMailExternalAccount::MailboxId() + { + return iMailboxId; + } + +// --------------------------------------------------------- +// CMailExternalAccount::PluginId +// --------------------------------------------------------- +// +TInt CMailExternalAccount::PluginId() + { + return iPluginId; + } + +// --------------------------------------------------------- +// CMailExternalAccount::ContentId +// --------------------------------------------------------- +// +TDesC& CMailExternalAccount::ContentId() + { + return *iContentId; + } diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/cmailmessagedetails.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/cmailmessagedetails.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailmessagedetails.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,8 +18,8 @@ // #include "emailtrace.h" -#include "CFSMailBox.h" -#include "CFSMailFolder.h" +#include "cfsmailbox.h" +#include "cfsmailfolder.h" // #include "cmailmessagedetails.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/cmailpluginproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailpluginproxy.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -0,0 +1,483 @@ +/* +* 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" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file implements class CMailMailboxDetails. +* +*/ + +#include // icons +#include +#include + +#include +#include +#include +#include + +#include "emailtrace.h" +#include "cmailpluginproxy.h" +#include "cmailexternalaccount.h" +#include "cmailcpsif.h" +#include "cmailcpsutils.h" + +using namespace EmailInterface; + +// --------------------------------------------------------- +// CMailPluginProxy::NewL +// --------------------------------------------------------- +// +CMailPluginProxy* CMailPluginProxy::NewL( + const TInt aPluginId, + CMailCpsIf& aPublisher ) + { + FUNC_LOG; + CMailPluginProxy* self = new(ELeave) CMailPluginProxy( aPluginId, aPublisher ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// CMailPluginProxy::CMailPluginProxy +// --------------------------------------------------------- +// +CMailPluginProxy::CMailPluginProxy( + const TInt aPluginId, + CMailCpsIf& aPublisher ) : + iPluginId( aPluginId ), + iPublisher( aPublisher ) + { + FUNC_LOG; + } + +// --------------------------------------------------------- +// CMailPluginProxy::~CMailPluginProxy +// --------------------------------------------------------- +// +CMailPluginProxy::~CMailPluginProxy() + { + FUNC_LOG; + delete iPlugin; + TRAP_IGNORE( RemoveAccountsL() ); + iAccounts.ResetAndDestroy(); + } + +// --------------------------------------------------------- +// CMailPluginProxy::ConstructL +// --------------------------------------------------------- +// +void CMailPluginProxy::ConstructL() + { + FUNC_LOG; + TUid implUid = TUid::Uid( iPluginId ); + iPlugin = EmailInterface::CEmailObserverPlugin::NewL( implUid, this ); + } + +// --------------------------------------------------------- +// CMailPluginProxy::EmailObserverEvent +// --------------------------------------------------------- +// +void CMailPluginProxy::EmailObserverEvent( MEmailData& /*aData*/ ) + { + FUNC_LOG; + TRAP_IGNORE( PublishAccountsL() ); + } + +// --------------------------------------------------------- +// CMailPluginProxy::PluginId +// --------------------------------------------------------- +// +TInt CMailPluginProxy::PluginId() + { + FUNC_LOG; + return iPluginId; + } + +// --------------------------------------------------------- +// CMailPluginProxy::RemoveAccountsL +// --------------------------------------------------------- +// +void CMailPluginProxy::RemoveAccountsL() + { + FUNC_LOG; + while ( iAccounts.Count() ) + { + ResetAccountL( iAccounts[0]->ContentId() ); + delete iAccounts[0]; + iAccounts.Remove(0); + } + } + +// --------------------------------------------------------- +// CMailPluginProxy::ResetAccountL +// --------------------------------------------------------- +// +void CMailPluginProxy::ResetAccountL( const TDesC& aContentId ) + { + FUNC_LOG; + TInt instId = ResolveWidgetInstance( aContentId ); + if ( instId >= 0 ) + { + TFSMailMsgId dummy; + iPublisher.PublishMailboxIconL( instId, KNullDesC ); + iPublisher.PublishActiveMailboxNameL( instId, 1, KNullDesC, 0, dummy, dummy ); + iPublisher.PublishIndicatorIconL( instId, 1, KNullIcon ); + + ResetMessageRowL( instId, 2 ); // 1st message row + ResetMessageRowL( instId, 3 ); // 2nd.. + } + } + +// --------------------------------------------------------- +// CMailPluginProxy::ResetMessageRowL +// --------------------------------------------------------- +// +void CMailPluginProxy::ResetMessageRowL( const TInt aWidgetInstanceId, const TInt aRow ) + { + FUNC_LOG; + TFSMailMsgId dummy; + iPublisher.PublishMailboxIconL( aWidgetInstanceId, aRow, KNullIcon, dummy ); + iPublisher.PublishMailDetailL( aWidgetInstanceId, aRow, KNullDesC, ESender ); + iPublisher.PublishMailDetailL( aWidgetInstanceId, aRow, KNullDesC, ETime ); + } + +// --------------------------------------------------------- +// CMailPluginProxy::SelectOwnAccountsL +// --------------------------------------------------------- +// +void CMailPluginProxy::SelectOwnAccountsL( RPointerArray& aAccounts ) + { + FUNC_LOG; + for ( TInt i = 0; i < aAccounts.Count(); i++ ) + { + if ( aAccounts[i]->PluginId() == iPluginId ) + { + // own account, take ownership + iAccounts.AppendL( aAccounts[i] ); + aAccounts.Remove(i); + i--; // update loop indexing + } + } + } + +// --------------------------------------------------------- +// CMailPluginProxy::PublishAccountsL +// --------------------------------------------------------- +// +void CMailPluginProxy::PublishAccountsL() + { + FUNC_LOG; + // Loops through all external accounts of this plugin (that are configured + // to be published), and calls publish on them + for ( TInt i = 0; i < iAccounts.Count(); i++ ) + { + TInt instId = ResolveWidgetInstance( iAccounts[i]->ContentId() ); + if ( instId != KErrNotFound && iPublisher.AllowedToPublish( instId ) ) + { + PublishAccountL( instId, iAccounts[i]->MailboxId() ); + } + else + { + INFO("Correct widget not found, not publishing.."); + } + } + } + +// --------------------------------------------------------- +// CMailPluginProxy::PublishAccountL +// --------------------------------------------------------- +// +void CMailPluginProxy::PublishAccountL( const TInt aWidgetInstanceId, const TInt aMailboxId ) + { + FUNC_LOG; + // Loops through plugin's mailbox array and finds matching mailbox + MEmailData& data( iPlugin->EmailDataL() ); + RPointerArray mailboxes = data.MailboxesL(); + for ( TInt j = 0; j < mailboxes.Count(); j++ ) + { + if ( mailboxes[j]->MailboxId() == aMailboxId ) + { + PublishAccountL( aWidgetInstanceId, *(mailboxes[j]) ); + } + } + } + +// --------------------------------------------------------- +// CMailPluginProxy::PublishAccountL +// --------------------------------------------------------- +// +void CMailPluginProxy::PublishAccountL( const TInt aWidgetInstanceId, MMailboxData& aMailboxData ) + { + FUNC_LOG; + // 1st row + PublishFirstRowL( aWidgetInstanceId, aMailboxData ); + + // message rows + TInt msgCount = aMailboxData.LatestMessagesL().Count(); + for ( TInt i = 0; i < KMaxMsgCount; i++ ) + { + if ( msgCount > i ) + { + // enough messages for this row + PublishMessageRowL( aWidgetInstanceId, *(aMailboxData.LatestMessagesL()[i]), i+2 ); // message-rows start from 2 + } + else + { + // make sure this row is empty + TFSMailMsgId dummy; + iPublisher.PublishMailboxIconL( aWidgetInstanceId, i+2, KNullIcon, dummy ); + iPublisher.PublishMailDetailL( aWidgetInstanceId, i+2, KNullDesC, ESender ); + iPublisher.PublishMailDetailL( aWidgetInstanceId, i+2, KNullDesC, ETime ); + } + } + } + +// --------------------------------------------------------- +// CMailPluginProxy::PublishMessageL +// --------------------------------------------------------- +// +void CMailPluginProxy::PublishMessageRowL( const TInt aWidgetInstanceId, EmailInterface::MMessageData& aMessageData, const TInt aRow ) + { + FUNC_LOG; + TFSMailMsgId dummy; + TInt iconId = TMailCpsUtils::ResolveIcon( + aMessageData.Unread(), + aMessageData.CalendarMsg(), + aMessageData.Attachments(), + aMessageData.Priority(), + aMessageData.Replied(), + aMessageData.Forwarded() ); + + iPublisher.PublishMailboxIconL( aWidgetInstanceId, aRow, iconId, dummy ); + iPublisher.PublishMailDetailL( aWidgetInstanceId, aRow, aMessageData.Sender(), ESender ); + HBufC* timeString = CMailCpsHandler::GetMessageTimeStringL( aMessageData.TimeStamp() ); + CleanupStack::PushL( timeString ); + iPublisher.PublishMailDetailL( aWidgetInstanceId, aRow, *timeString, ETime ); + CleanupStack::PopAndDestroy( timeString ); + } + +// --------------------------------------------------------- +// CMailPluginProxy::PublishFirstRowL +// --------------------------------------------------------- +// +void CMailPluginProxy::PublishFirstRowL( const TInt aWidgetInstanceId, EmailInterface::MMailboxData& aMailboxData ) + { + FUNC_LOG; + HBufC* firstLineText = ConstructMailboxNameWithMessageCountLC( aMailboxData ); + TInt indicator = ResolveIndicatorIcon( aMailboxData ); + iPublisher.PublishMailboxIconL( aWidgetInstanceId, aMailboxData.BrandingIcon() ); + iPublisher.PublishMailboxNameL( aWidgetInstanceId, *firstLineText, KTriggerEmailUi8 ); + iPublisher.PublishIndicatorIconL( aWidgetInstanceId, 1, indicator ); + CleanupStack::PopAndDestroy( firstLineText ); + } + +// --------------------------------------------------------- +// CMailPluginProxy::ConstructMailboxNameWithMessageCountLC +// --------------------------------------------------------- +// +HBufC* CMailPluginProxy::ConstructMailboxNameWithMessageCountLC( MMailboxData& aMailboxData ) + { + FUNC_LOG; + HBufC* mailboxAndCount( NULL ); + TInt unreadCount = UnreadCountL( aMailboxData ); + if ( unreadCount > 0 ) + { + // Arrays must be used when loc string contains indexed parameters + CDesCArrayFlat* strings = new CDesCArrayFlat( 1 ); + CleanupStack::PushL( strings ); + strings->AppendL( aMailboxData.Name() ); // replace "%0U" with mailbox name + + CArrayFix* ints = new(ELeave) CArrayFixFlat( 1 ); + CleanupStack::PushL( ints ); + ints->AppendL( unreadCount ); // replace "%1N" with number of unread messages + + mailboxAndCount = StringLoader::LoadL( R_EMAILWIDGET_TEXT_MAILBOX_AND_MAILCOUNT, *strings, *ints ); + CleanupStack::PopAndDestroy(ints); + CleanupStack::PopAndDestroy(strings); + CleanupStack::PushL( mailboxAndCount ); + } + else + { + // if 0 messages, first line text is pure mailbox name + mailboxAndCount = aMailboxData.Name().AllocLC(); + } + INFO_1("first line: %S", mailboxAndCount); + return mailboxAndCount; + } + +// --------------------------------------------------------- +// CMailPluginProxy::UnreadCountL +// --------------------------------------------------------- +// +TInt CMailPluginProxy::UnreadCountL( EmailInterface::MMailboxData& aMailboxData ) + { + FUNC_LOG; + TInt count( 0 ); + for ( TInt i = 0; i < aMailboxData.LatestMessagesL().Count(); i++ ) + { + if ( aMailboxData.LatestMessagesL()[i]->Unread() ) + { + count++; + } + } + return count; + } + +// --------------------------------------------------------------------------- +// CMailPluginProxy::ResolveIndicatorIcon +// --------------------------------------------------------------------------- +// +TInt CMailPluginProxy::ResolveIndicatorIcon( EmailInterface::MMailboxData& aMailboxData ) + { + FUNC_LOG; + TInt indicator( 0 ); + if ( aMailboxData.Unseen() ) + { + indicator = EMbmCmailhandlerpluginQgn_stat_message_mail_uni; + } + else if ( !aMailboxData.IsOutboxEmpty() ) + { + indicator = EMbmCmailhandlerpluginQgn_indi_cmail_outbox_msg; + } + else + { + indicator = KNullIcon; + } + return indicator; + } + +// --------------------------------------------------------------------------- +// CMailPluginProxy::ResolveWidgetInstance +// --------------------------------------------------------------------------- +// +TInt CMailPluginProxy::ResolveWidgetInstance( const TDesC& aContentId ) + { + FUNC_LOG; + TInt id( KErrNotFound ); + for ( TInt i = 0; i < iPublisher.iInstIdList.Count(); i++ ) + { + if ( aContentId.Compare( *(iPublisher.iInstIdList[i]) ) == 0 ) + { + id = i; + } + } + return id; + } + +// --------------------------------------------------------------------------- +// CMailPluginProxy::HasAccount +// --------------------------------------------------------------------------- +// +TBool CMailPluginProxy::HasAccount( const TDesC& aContentId ) + { + FUNC_LOG; + TBool found( EFalse ); + for ( TInt i = 0; i < iAccounts.Count(); i++ ) + { + if ( !( iAccounts[i]->ContentId().Compare( aContentId ) ) ) + { + found = ETrue; + } + } + return found; + } + +// --------------------------------------------------------------------------- +// CMailPluginProxy::LaunchExtAppL +// --------------------------------------------------------------------------- +// +void CMailPluginProxy::LaunchExtAppL( const TDesC& aContentId ) + { + FUNC_LOG; + MMailboxData& mailbox = GetMailboxDataL( GetMailboxId( aContentId ) ); + MEmailLaunchParameters& launchParams = mailbox.LaunchParameters(); + + CEikonEnv* env = CEikonEnv::Static(); + TVwsViewId view( launchParams.ApplicationUid(), launchParams.ViewId() ); + if ( launchParams.CustomMessageId().iUid == 0 ) + { + env->EikAppUi()->ActivateViewL( view, launchParams.CustomMessageId(), launchParams.CustomMessage() ); + } + else + { + env->EikAppUi()->ActivateViewL( view ); + } + } + +// --------------------------------------------------------------------------- +// CMailPluginProxy::ResolveMailboxId +// --------------------------------------------------------------------------- +// +TInt CMailPluginProxy::GetMailboxId( const TDesC& aContentId ) + { + FUNC_LOG; + TInt mailboxId( 0 ); + for ( TInt i = 0; i < iAccounts.Count(); i++ ) + { + if ( !(iAccounts[i]->ContentId().Compare( aContentId )) ) + { + mailboxId = iAccounts[i]->MailboxId(); + } + } + return mailboxId; + } + +// --------------------------------------------------------------------------- +// CMailPluginProxy::GetMailboxDataL +// --------------------------------------------------------------------------- +// +EmailInterface::MMailboxData& CMailPluginProxy::GetMailboxDataL( TInt aMailboxId ) + { + FUNC_LOG; + TInt index( KErrNotFound ); + RPointerArray mailboxes = iPlugin->EmailDataL().MailboxesL(); + for ( TInt i = 0; i < mailboxes.Count(); i++ ) + { + if ( mailboxes[i]->MailboxId() == aMailboxId ) + { + index = i; + } + } + + if ( index == KErrNotFound ) + { + User::Leave( KErrNotFound ); + } + + return *(mailboxes[index]); + } + +// --------------------------------------------------------------------------- +// CMailPluginProxy::SelectAndUpdateAccountsL +// --------------------------------------------------------------------------- +// +void CMailPluginProxy::SelectAndUpdateAccountsL( RPointerArray& aAccounts ) + { + FUNC_LOG; + RemoveAccountsL(); + SelectOwnAccountsL( aAccounts ); + PublishAccountsL(); + } + +// --------------------------------------------------------------------------- +// CMailPluginProxy::UpdateAccountL +// --------------------------------------------------------------------------- +// +void CMailPluginProxy::UpdateAccountL( const TDesC& aContentId ) + { + FUNC_LOG; + PublishAccountL( + ResolveWidgetInstance( aContentId ), + GetMailboxId( aContentId ) ); + } diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/emailsoundhandler.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/emailsoundhandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/emailsoundhandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -229,7 +229,7 @@ TBool vibraEnabled = profile->ProfileTones().ToneSettings().iEmailVibratingAlert; - TInt preference = KAudioPrefNewSMS; + TInt preference = KAudioPrefNewSpecialMessage; if ( !vibraEnabled ) { preference = EMdaPriorityPreferenceTimeAndQuality; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/fsmailauthenticationhandler.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/fsmailauthenticationhandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/fsmailauthenticationhandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ // #include "emailtrace.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include "fsmailauthenticationhandler.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/fsmailmessagequeryhandler.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/fsmailmessagequeryhandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/fsmailmessagequeryhandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ // #include "emailtrace.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include "fsmailmessagequeryhandler.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/fsmailmtmhandler.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/fsmailmtmhandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/fsmailmtmhandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ // #include "emailtrace.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include // needed because of the following hrh #include // KDC_MTM_INFO_FILE_DIR @@ -36,8 +36,8 @@ // FREESTYLE EMAIL FRAMEWORK INCLUDES // -#include "CFSMailClient.h" -#include "MFSMailBrandManager.h" +#include "cfsmailclient.h" +#include "mfsmailbrandmanager.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/fsmailoutofmemoryhandler.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/fsmailoutofmemoryhandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/fsmailoutofmemoryhandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ // #include "emailtrace.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp --- a/emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ // #include "emailtrace.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include "fsnotificationhandlermgr.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/group/fsmailserver.mmp --- a/emailservices/emailserver/group/fsmailserver.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/group/fsmailserver.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -99,9 +99,8 @@ LIBRARY sysutil.lib LIBRARY liwservicehandler.lib LIBRARY cmaillogger.lib -DEBUGLIBRARY flogger.lib #ifdef TRACE_INTO_FILE -LIBRARY flogger.lib +LIBRARY flogger.lib #endif // TRACE_INTO_FILE diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/inc/fsnotificationhandlerbase.h --- a/emailservices/emailserver/inc/fsnotificationhandlerbase.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/inc/fsnotificationhandlerbase.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #include // -#include "MFSMailEventObserver.h" +#include "mfsmaileventobserver.h" // class CFSMailClient; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/inc/fsnotificationhandlermgrimpl.h --- a/emailservices/emailserver/inc/fsnotificationhandlermgrimpl.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/inc/fsnotificationhandlermgrimpl.h Fri Feb 19 22:37:30 2010 +0200 @@ -23,8 +23,8 @@ #include // -#include "CFSMailCommon.h" -#include "MFSMailEventObserver.h" +#include "cfsmailcommon.h" +#include "mfsmaileventobserver.h" // #include "fsnotificationhandlermgr.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/mailserverautostart/group/fsmailserverautostart.mmp --- a/emailservices/emailserver/mailserverautostart/group/fsmailserverautostart.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/mailserverautostart/group/fsmailserverautostart.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -46,5 +46,5 @@ USERINCLUDE ../../../../inc LIBRARY euser.lib -DEBUGLIBRARY flogger.lib +LIBRARY flogger.lib LIBRARY cmaillogger.lib diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailserver/src/fsnotificationhandlermgrimpl.cpp --- a/emailservices/emailserver/src/fsnotificationhandlermgrimpl.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailserver/src/fsnotificationhandlermgrimpl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #include "emailtrace.h" #include // FinalClose() // -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include // diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailservermonitor/group/emailservermonitor.mmp --- a/emailservices/emailservermonitor/group/emailservermonitor.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailservermonitor/group/emailservermonitor.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -35,7 +35,7 @@ USERINCLUDE ../inc USERINCLUDE ../../../inc -USERINCLUDE ../../emailstore/inc // EmailStoreUids.hrh +USERINCLUDE ../../emailstore/inc // emailstoreuids.hrh APP_LAYER_SYSTEMINCLUDE @@ -59,4 +59,4 @@ LIBRARY PsServerClientAPI.lib // PCS engine client-side API LIBRARY estor.lib // RDesRead/WriteStream LIBRARY cmaillogger.lib -DEBUGLIBRARY flogger.lib +LIBRARY flogger.lib diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailservermonitor/src/emailshutter.cpp --- a/emailservices/emailservermonitor/src/emailshutter.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailservermonitor/src/emailshutter.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -29,11 +29,11 @@ #include // RAlwaysOnlineClientSession #include // CPSRequestHandler #include // CRepository -#include // HomeScreen UIDs +#include // HomeScreen UIDs #include "FreestyleEmailUiConstants.h" // FS Email UI UID #include "fsmtmsconstants.h" // MCE, Phonebook & Calendar UIDs -#include "EmailStoreUids.hrh" // KUidMessageStoreExe +#include "emailstoreuids.hrh" // KUidMessageStoreExe #include "emailtrace.h" #include "emailshutdownconst.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/group/BasePlugin.mmp --- a/emailservices/emailstore/base_plugin/group/BasePlugin.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/group/BasePlugin.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber #include "../../../../inc/emailtraceconfig.hrh" -#include "../../inc/EmailStoreUids.hrh" +#include "../../inc/emailstoreuids.hrh" TARGET baseplugin.dll TARGETTYPE dll diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/group/bld.inf --- a/emailservices/emailstore/base_plugin/group/bld.inf Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -21,11 +21,11 @@ DEFAULT PRJ_EXPORTS -../inc/BasePlugin.h |../../../../inc/BasePlugin.h -../inc/SafePointerArray.h |../../../../inc/SafePointerArray.h -../inc/Map.inl |../../../../inc/Map.inl -../inc/Map.h |../../../../inc/Map.h -../inc/BaseMrInfoObject.h |../../../../inc/basemrinfoobject.h +../inc/baseplugin.h |../../../../inc/baseplugin.h +../inc/safepointerarray.h |../../../../inc/safepointerarray.h +../inc/map.inl |../../../../inc/map.inl +../inc/map.h |../../../../inc/map.h +../inc/basemrinfoobject.h |../../../../inc/basemrinfoobject.h ../inc/baseplugincommonutils.h |../../../../inc/baseplugincommonutils.h ../inc/baseplugindelayedops.h |../../../../inc/baseplugindelayedops.h diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/inc/BaseMrInfoObject.h --- a/emailservices/emailstore/base_plugin/inc/BaseMrInfoObject.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/inc/BaseMrInfoObject.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #define __BASEMRINFOOBJECT_H__ #include -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "mmrinfoobject.h" #include "mmrorganizer.h" #include "mmrattendee.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/inc/BasePlugin.h --- a/emailservices/emailstore/base_plugin/inc/BasePlugin.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/inc/BasePlugin.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,20 +22,20 @@ #include #include -#include "CFSMailPlugin.h" +#include "cfsmailplugin.h" #include "mmrorganizer.h" // -#include "MsgStoreFolderUtils.h" -#include "MsgStoreMailBox.h" -#include "MsgStoreMailBoxObserver.h" -#include "MsgStoreMessage.h" -#include "MsgStoreObserver.h" -#include "DebugLogMacros.h" +#include "msgstorefolderutils.h" +#include "msgstoremailbox.h" +#include "msgstoremailboxobserver.h" +#include "msgstoremessage.h" +#include "msgstoreobserver.h" +#include "debuglogmacros.h" // -#include "BaseMrInfoObject.h" -#include "Map.h" +#include "basemrinfoobject.h" +#include "map.h" class CMsgStore; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/inc/MailIterator.h --- a/emailservices/emailstore/base_plugin/inc/MailIterator.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/inc/MailIterator.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,12 +20,12 @@ #define __MAILITERATOR_H__ // -#include "MFSMailIterator.h" -#include "MsgStoreSortResultIterator.h" -#include "DebugLogMacros.h" +#include "mfsmailiterator.h" +#include "msgstoresortresultiterator.h" +#include "debuglogmacros.h" // -#include "BasePlugin.h" +#include "baseplugin.h" /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/inc/Map.h --- a/emailservices/emailstore/base_plugin/inc/Map.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/inc/Map.h Fri Feb 19 22:37:30 2010 +0200 @@ -36,7 +36,7 @@ } ****************************************************************/ -#include "SafePointerArray.h" +#include "safepointerarray.h" template class RMap @@ -168,6 +168,6 @@ */ -#include "Map.inl" +#include "map.inl" #endif //__MAP_H__ diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/inc/baseplugindelayedops.h --- a/emailservices/emailstore/base_plugin/inc/baseplugindelayedops.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/inc/baseplugindelayedops.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,9 +21,9 @@ #include -#include "CFSMailCommon.h" -#include "BasePlugin.h" -#include "DebugLogMacros.h" +#include "cfsmailcommon.h" +#include "baseplugin.h" +#include "debuglogmacros.h" class CBasePlugin; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp --- a/emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,8 +18,8 @@ -#include "BaseMrInfoObject.h" -#include "BasePlugin.h" +#include "basemrinfoobject.h" +#include "baseplugin.h" /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/src/BasePlugin.cpp --- a/emailservices/emailstore/base_plugin/src/BasePlugin.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/BasePlugin.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,24 +18,24 @@ //MsgStore. // -#include "MsgStore.h" -#include "MsgStoreAccount.h" -#include "MsgStoreMailBox.h" -#include "MsgStoreMessage.h" -#include "MsgStoreFolder.h" -#include "MsgStorePropertyContainer.h" -#include "MsgStorePropertyKeys.h" -#include "MsgStoreSortCriteria.h" -#include "MsgStoreSortResultIterator.h" +#include "msgstore.h" +#include "msgstoreaccount.h" +#include "msgstoremailbox.h" +#include "msgstoremessage.h" +#include "msgstorefolder.h" +#include "msgstorepropertycontainer.h" +#include "msgstorepropertykeys.h" +#include "msgstoresortcriteria.h" +#include "msgstoresortresultiterator.h" //Freestyle. -#include "CFSMailCommon.h" -#include "CFSMailMessage.h" +#include "cfsmailcommon.h" +#include "cfsmailmessage.h" // //Base plugin. -#include "BasePlugin.h" -#include "BasePluginPanic.h" +#include "baseplugin.h" +#include "basepluginpanic.h" #include "baseplugincommonutils.h" -#include "MailIterator.h" +#include "mailiterator.h" #include "baseplugindelayedopsprivate.h" // Other #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/src/BasePluginPanic.cpp --- a/emailservices/emailstore/base_plugin/src/BasePluginPanic.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/BasePluginPanic.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,7 +17,7 @@ #include -#include "BasePluginPanic.h" +#include "basepluginpanic.h" _LIT( KBasePluginCategory, "BasePlugin" ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/src/MailIterator.cpp --- a/emailservices/emailstore/base_plugin/src/MailIterator.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/MailIterator.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include #include "baseplugincommonutils.h" -#include "MailIterator.h" +#include "mailiterator.h" /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp --- a/emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -14,7 +14,7 @@ * Description: Email interface implementation. * */ -#include "MsgStoreWritablePropertyContainer.h" +#include "msgstorewritablepropertycontainer.h" #include "baseplugindelayedops.h" #include "baseplugindelayedopsprivate.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/src/basepluginfetch.cpp --- a/emailservices/emailstore/base_plugin/src/basepluginfetch.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/basepluginfetch.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,7 +17,7 @@ -#include "BasePlugin.h" +#include "baseplugin.h" /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/src/basepluginmisc.cpp --- a/emailservices/emailstore/base_plugin/src/basepluginmisc.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/basepluginmisc.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,13 +18,13 @@ // -#include "MsgStore.h" -#include "MsgStoreSearchCriteria.h" -#include "MFSMailBoxSearchObserver.h" +#include "msgstore.h" +#include "msgstoresearchcriteria.h" +#include "mfsmailboxsearchobserver.h" // -#include "BasePlugin.h" -#include "BasePluginPanic.h" +#include "baseplugin.h" +#include "basepluginpanic.h" #include "baseplugincommonutils.h" #include "baseplugindelayedopsprivate.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/src/basepluginnotifications.cpp --- a/emailservices/emailstore/base_plugin/src/basepluginnotifications.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/basepluginnotifications.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,11 +18,11 @@ // -#include "MsgStore.h" -#include "MsgStoreFolder.h" +#include "msgstore.h" +#include "msgstorefolder.h" // -#include "BasePlugin.h" +#include "baseplugin.h" #include "baseplugincommonutils.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/src/basepluginparts.cpp --- a/emailservices/emailstore/base_plugin/src/basepluginparts.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/basepluginparts.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -14,7 +14,7 @@ * Description: Multi-part support. * */ -#include "BasePlugin.h" +#include "baseplugin.h" #include "baseplugincommonutils.h" #include "baseplugindelayedopsprivate.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/base_plugin/src/baseplugintranslator.cpp --- a/emailservices/emailstore/base_plugin/src/baseplugintranslator.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/base_plugin/src/baseplugintranslator.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,9 +17,9 @@ -#include "BasePlugin.h" +#include "baseplugin.h" #include "baseplugincommonutils.h" -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" static void TranslateMsgStoreAttendeeL( @@ -1112,7 +1112,7 @@ * when dealing with rule translation. * * @param aDayOfWeekMask day of week mask in the MsgStore format, see - * MsgStorePropertyKeys.h for information. + * msgstorepropertykeys.h for information. * @param aFtor translation ftor. */ void CBasePlugin::TranslateMsgStoreDayOfWeek( diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/group/bld.inf --- a/emailservices/emailstore/group/bld.inf Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -25,7 +25,7 @@ PRJ_EXPORTS ../inc/emailstorepskeys.h |../../../inc/emailstorepskeys.h -../inc/EmailStoreUids.hrh |../../../inc/EmailStoreUids.hrh +../inc/emailstoreuids.hrh |../../../inc/emailstoreuids.hrh ../rom/emailstore.iby CORE_APP_LAYER_IBY_EXPORT_PATH(emailstore.iby) ../sis/emailstore_stub.sis /epoc32/data/z/system/install/emailstore_stub.sis diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/inc/emailstorepskeys.h --- a/emailservices/emailstore/inc/emailstorepskeys.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/inc/emailstorepskeys.h Fri Feb 19 22:37:30 2010 +0200 @@ -17,7 +17,7 @@ #ifndef _EMAILSTOREPSKEYS_H_ #define _EMAILSTOREPSKEYS_H_ -#include "EmailStoreUids.hrh" +#include "emailstoreuids.hrh" /** * EmailStore Upgrade P/S Category UID @@ -30,4 +30,9 @@ */ const TInt KProperty_EmailStore_Upgrade = 115; + +// Copied from emailshutter.h +// Value to be set in shutdown P&S key. +const TInt KEmailShutterPsValue = 1; + #endif //_EMAILSTOREPSKEYS_H_ diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/MsgStoreRfsPlugin/data/RfsMsgStorePlugin.rss --- a/emailservices/emailstore/message_store/MsgStoreRfsPlugin/data/RfsMsgStorePlugin.rss Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/MsgStoreRfsPlugin/data/RfsMsgStorePlugin.rss Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ NAME EAXP #include -#include "EmailStoreUids.hrh" +#include "emailstoreuids.hrh" RESOURCE REGISTRY_INFO theInfo { diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/MsgStoreRfsPlugin/group/RfsMsgStorePlugin.mmp --- a/emailservices/emailstore/message_store/MsgStoreRfsPlugin/group/RfsMsgStorePlugin.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/MsgStoreRfsPlugin/group/RfsMsgStorePlugin.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -17,7 +17,7 @@ #include #include -#include "../../../inc/EmailStoreUids.hrh" +#include "../../../inc/emailstoreuids.hrh" TARGET RfsMsgStorePlugin.dll TARGETTYPE PLUGIN diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStorePlugin.cpp --- a/emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStorePlugin.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStorePlugin.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #include #include "RfsMsgStorePlugin.h" -#include "EmailStoreUids.hrh" +#include "emailstoreuids.hrh" #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStoreProxy.cpp --- a/emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStoreProxy.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStoreProxy.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #include #include -#include "EmailStoreUids.hrh" +#include "emailstoreuids.hrh" #include "RfsMsgStorePlugin.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/PointSecMonitor/Group/ImsPointsecMonitor.mmp --- a/emailservices/emailstore/message_store/PointSecMonitor/Group/ImsPointsecMonitor.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/PointSecMonitor/Group/ImsPointsecMonitor.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #include #include "../../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../inc/EmailStoreUids.hrh" +#include "../../../inc/emailstoreuids.hrh" TARGET ImsPointSecMonitor.dll TARGETTYPE dll diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/PointSecMonitor/Inc/ImsPointsecMonitor.h --- a/emailservices/emailstore/message_store/PointSecMonitor/Inc/ImsPointsecMonitor.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/PointSecMonitor/Inc/ImsPointsecMonitor.h Fri Feb 19 22:37:30 2010 +0200 @@ -26,7 +26,7 @@ #include // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // class MImsPointsecObserver; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStore.h --- a/emailservices/emailstore/message_store/client/api/MsgStore.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStore.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,7 @@ #include // -#include "MsgStoreTypes.h" +#include "msgstoretypes.h" // // ==================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreAddress.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreAddress.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreAddress.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,9 +21,7 @@ #define __MSG_STORE_ADDRESS_H__ #include -// -#include "MsgStoreTypes.h" -// +#include "msgstoretypes.h" /** Simple convinent on-stack class to encapsulate the {email address, display name} pair used * as address fields (From, Sender, To, Cc, Bcc) in a message. diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreFolder.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreFolder.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreFolder.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,8 +21,8 @@ #define __MSG_STORE_FOLDER_H__ // -#include "MsgStoreTypes.h" -#include "MsgStoreWritablePropertyContainer.h" +#include "msgstoretypes.h" +#include "msgstorewritablepropertycontainer.h" // //forward declaration diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreFolderUtils.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreFolderUtils.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreFolderUtils.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,9 +21,9 @@ #define __MSGSTOREFOLDERUTILS_H__ // -#include "MsgStoreMailBox.h" -#include "MsgStorePropertyKeys.h" -#include "MsgStoreTypes.h" +#include "msgstoremailbox.h" +#include "msgstorepropertykeys.h" +#include "msgstoretypes.h" // /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreMailBox.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreMailBox.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreMailBox.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,8 +22,8 @@ #include // -#include "MsgStoreTypes.h" -#include "MsgStoreWritablePropertyContainer.h" +#include "msgstoretypes.h" +#include "msgstorewritablepropertycontainer.h" // class CMsgStoreMessage; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreMailBoxObserver.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreMailBoxObserver.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreMailBoxObserver.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #define __MSG_STORE_MAILBOX_OBSERVER_H__ // -#include "MsgStoreTypes.h" +#include "msgstoretypes.h" // class CMsgStoreObserverHandler; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreMessage.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreMessage.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreMessage.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #define __MSG_STORE_MESSAGE_H__ // -#include "MsgStoreMessagePart.h" +#include "msgstoremessagepart.h" // /** This class represents a message in the message store. diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreMessagePart.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreMessagePart.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreMessagePart.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,8 +21,8 @@ #define __MSG_STORE_MESSAGE_PART_H__ // -#include "MsgStoreTypes.h" -#include "MsgStorePropertyContainerWithContent.h" +#include "msgstoretypes.h" +#include "msgstorepropertycontainerwithcontent.h" // class CMsgStoreMessage; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreObserver.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreObserver.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreObserver.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,8 +21,8 @@ #define __MSG_STORE_OBSERVER_H__ // -#include "MsgStoreTypes.h" -#include "MsgStoreAccount.h" +#include "msgstoretypes.h" +#include "msgstoreaccount.h" // /** This class defines the message store observation API. diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStorePropertyContainer.h --- a/emailservices/emailstore/message_store/client/api/MsgStorePropertyContainer.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStorePropertyContainer.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,8 +22,8 @@ #include // -#include "MsgStoreTypes.h" -#include "MsgStoreAddress.h" +#include "msgstoretypes.h" +#include "msgstoreaddress.h" // /** diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStorePropertyContainerWithContent.h --- a/emailservices/emailstore/message_store/client/api/MsgStorePropertyContainerWithContent.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStorePropertyContainerWithContent.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,7 @@ #include // -#include "MsgStoreWritablePropertyContainer.h" +#include "msgstorewritablepropertycontainer.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStorePropertyKeys.h --- a/emailservices/emailstore/message_store/client/api/MsgStorePropertyKeys.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStorePropertyKeys.h Fri Feb 19 22:37:30 2010 +0200 @@ -29,7 +29,7 @@ ************************************************************************/ /** The property key for status flags field. Its property value type is EMsgStoreTypeUint32. - * The values are defined in email fw's TFSMsgFlag enum (CFSMailCommon.h). + * The values are defined in email fw's TFSMsgFlag enum (cfsmailcommon.h). * * The following code updates the "flags" field with the local read flag * diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreSearchCriteria.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreSearchCriteria.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreSearchCriteria.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #define __MSG_STORE_SEARCH_CRITERIA_H__ // -#include "MsgStoreTypes.h" +#include "msgstoretypes.h" // /** This class represents the criteria for a search request diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreSortCriteria.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreSortCriteria.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreSortCriteria.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #define __MSG_STORE_SORT_CRITERIA_H__ // -#include "MsgStoreTypes.h" +#include "msgstoretypes.h" // /** This class represents the criteria for a sorting request diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreSortResultIterator.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreSortResultIterator.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreSortResultIterator.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,8 +21,8 @@ #define __MSG_STORE_SORT_RESULT_ITERATOR_H__ // -#include "MsgStoreTypes.h" -#include "MsgStorePropertyContainer.h" +#include "msgstoretypes.h" +#include "msgstorepropertycontainer.h" // class TMsgStoreIdAndFlag diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/api/MsgStoreWritablePropertyContainer.h --- a/emailservices/emailstore/message_store/client/api/MsgStoreWritablePropertyContainer.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/api/MsgStoreWritablePropertyContainer.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #define __MSG_STORE_WRITABLE_PROPERTY_CONTAINER_H__ // -#include "MsgStorePropertyContainer.h" +#include "msgstorepropertycontainer.h" // class CMsgStoreSessionContext; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/group/MessageStoreClient.mmp --- a/emailservices/emailstore/message_store/client/group/MessageStoreClient.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/group/MessageStoreClient.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #include #include "../../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../inc/EmailStoreUids.hrh" +#include "../../../inc/emailstoreuids.hrh" TARGET MessageStoreClient.dll TARGETTYPE dll @@ -42,7 +42,7 @@ USERINCLUDE ../../../inc USERINCLUDE ../../common/inc -// TEMPORARY MOVED STUFF FROM IsMsgStorePropertyKeys.h USED BY MSGSTORE TO MsgStorePropertyKeys.h +// TEMPORARY MOVED STUFF FROM IsMsgStorePropertyKeys.h USED BY MSGSTORE TO msgstorepropertykeys.h //because of the IsMsgStorePropertyKeys.h there is now dependency and I'd rather keep it in its //original location because of the merges and the fact that it logically belongs there. //USERINCLUDE ../../../../Intellisyncengine/client_symbian_s60_freestyle/sync/inc diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/group/bld.inf --- a/emailservices/emailstore/message_store/client/group/bld.inf Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -19,25 +19,25 @@ PRJ_EXPORTS -../api/MsgStoreTypes.h |../../../../../inc/MsgStoreTypes.h -../api/MsgStorePropertyKeys.h |../../../../../inc/MsgStorePropertyKeys.h -../api/MsgStorePropertyContainer.h |../../../../../inc/MsgStorePropertyContainer.h -../api/MsgStoreWritablePropertyContainer.h |../../../../../inc/MsgStoreWritablePropertyContainer.h -../api/MsgStorePropertyContainerWithContent.h |../../../../../inc/MsgStorePropertyContainerWithContent.h -../api/MsgStoreAccount.h |../../../../../inc/MsgStoreAccount.h -../api/MsgStoreObserver.h |../../../../../inc/MsgStoreObserver.h -../api/MsgStoreMailBoxObserver.h |../../../../../inc/MsgStoreMailBoxObserver.h -../api/MsgStoreMessagePart.h |../../../../../inc/MsgStoreMessagePart.h -../api/MsgStoreMessage.h |../../../../../inc/MsgStoreMessage.h -../api/MsgStoreFolder.h |../../../../../inc/MsgStoreFolder.h -../api/MsgStoreSearchCriteria.h |../../../../../inc/MsgStoreSearchCriteria.h -../api/MsgStoreSortCriteria.h |../../../../../inc/MsgStoreSortCriteria.h -../api/MsgStoreSortResultIterator.h |../../../../../inc/MsgStoreSortResultIterator.h -../api/MsgStoreMailBox.h |../../../../../inc/MsgStoreMailBox.h -../api/MsgStore.h |../../../../../inc/MsgStore.h -../api/MsgStoreAPI.h |../../../../../inc/MsgStoreAPI.h -../api/MsgStoreFolderUtils.h |../../../../../inc/MsgStoreFolderUtils.h -../api/MsgStoreAddress.h |../../../../../inc/MsgStoreAddress.h +../api/msgstoretypes.h |../../../../../inc/msgstoretypes.h +../api/msgstorepropertykeys.h |../../../../../inc/msgstorepropertykeys.h +../api/msgstorepropertycontainer.h |../../../../../inc/msgstorepropertycontainer.h +../api/msgstorewritablepropertycontainer.h |../../../../../inc/msgstorewritablepropertycontainer.h +../api/msgstorepropertycontainerwithcontent.h |../../../../../inc/msgstorepropertycontainerwithcontent.h +../api/msgstoreaccount.h |../../../../../inc/msgstoreaccount.h +../api/msgstoreobserver.h |../../../../../inc/msgstoreobserver.h +../api/msgstoremailboxobserver.h |../../../../../inc/msgstoremailboxobserver.h +../api/msgstoremessagepart.h |../../../../../inc/msgstoremessagepart.h +../api/msgstoremessage.h |../../../../../inc/msgstoremessage.h +../api/msgstorefolder.h |../../../../../inc/msgstorefolder.h +../api/msgstoresearchcriteria.h |../../../../../inc/msgstoresearchcriteria.h +../api/msgstoresortcriteria.h |../../../../../inc/msgstoresortcriteria.h +../api/msgstoresortresultiterator.h |../../../../../inc/msgstoresortresultiterator.h +../api/msgstoremailbox.h |../../../../../inc/msgstoremailbox.h +../api/msgstore.h |../../../../../inc/msgstore.h +../api/msgstoreapi.h |../../../../../inc/msgstoreapi.h +../api/msgstorefolderutils.h |../../../../../inc/msgstorefolderutils.h +../api/msgstoreaddress.h |../../../../../inc/msgstoreaddress.h PRJ_MMPFILES MessageStoreClient.mmp diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/inc/MsgStoreObserverHandler.h --- a/emailservices/emailstore/message_store/client/inc/MsgStoreObserverHandler.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/inc/MsgStoreObserverHandler.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,11 +21,11 @@ #include // -#include "MsgStoreTypes.h" -#include "MsgStoreObserver.h" -#include "MsgStoreMailBoxObserver.h" +#include "msgstoretypes.h" +#include "msgstoreobserver.h" +#include "msgstoremailboxobserver.h" // -#include "RMessageStoreSession.h" +#include "rmessagestoresession.h" #include "MessageStoreClientServer.h" const TUint KEventBufferLength = 30; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/inc/MsgStorePropertyContainersArray.h --- a/emailservices/emailstore/message_store/client/inc/MsgStorePropertyContainersArray.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/inc/MsgStorePropertyContainersArray.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #ifndef _MSG_STORE_PROPERTY_CONTAINERS_ARRAY_H_ #define _MSG_STORE_PROPERTY_CONTAINERS_ARRAY_H_ -#include "RMessageStoreSession.h" +#include "rmessagestoresession.h" class CMsgStorePropertyContainer; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/inc/MsgStoreSearchHandler.h --- a/emailservices/emailstore/message_store/client/inc/MsgStoreSearchHandler.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/inc/MsgStoreSearchHandler.h Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ // ======== #include // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // class RMessageStoreSession; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/inc/MsgStoreSessionContext.h --- a/emailservices/emailstore/message_store/client/inc/MsgStoreSessionContext.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/inc/MsgStoreSessionContext.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,10 +21,10 @@ #define _MSG_STORE_SESSION_CONTEXT_H_ // -#include "MsgStoreTypes.h" -#include "DebugLogMacros.h" +#include "msgstoretypes.h" +#include "debuglogmacros.h" // -#include "RMessageStoreSession.h" +#include "rmessagestoresession.h" class CMsgStoreObserverHandler; class CMsgStoreSearchHandler; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/inc/RMessageStoreSession.h --- a/emailservices/emailstore/message_store/client/inc/RMessageStoreSession.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/inc/RMessageStoreSession.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,10 +27,10 @@ #include #include // -#include "MsgStoreTypes.h" -#include "DebugLogMacros.h" +#include "msgstoretypes.h" +#include "debuglogmacros.h" #include "MessageStoreClientServer.h" -#include "MsgStoreSortResultIterator.h" +#include "msgstoresortresultiterator.h" // // ==================== // FORWARD DECLARATIONS diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MessageStoreClient.cpp --- a/emailservices/emailstore/message_store/client/src/MessageStoreClient.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MessageStoreClient.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,7 @@ // ======== #include -#include +#include //#include // #include "msgstoretypes.h" @@ -30,12 +30,12 @@ // #include "MessageStoreClientServer.h" -#include "EmailStoreUids.hrh" +#include "emailstoreuids.hrh" #include "PropertiesSerializer.h" -#include "MsgStoreFolder.h" -#include "MsgStoreObserver.h" -#include "MsgStorePropertyContainerWithContent.h" -#include "MsgStoreSessionContext.h" +#include "msgstorefolder.h" +#include "msgstoreobserver.h" +#include "msgstorepropertycontainerwithcontent.h" +#include "msgstoresessioncontext.h" // ========= // CONSTANTS @@ -46,34 +46,34 @@ /** This class defines the message store search client API. - This class is used to notify the search client of the completion of an asynchronous search of the - message store. + This class is used to notify the search client of the completion of an asynchronous search of the + message store. */ class MMsgStoreSearchClient - { - public: + { + public: - virtual void MatchFound( TMsgStoreId aMessageId ) = 0; - - virtual void SearchCompleted() = 0; - - }; // end class MMsgStoreSearchClient + virtual void MatchFound( TMsgStoreId aMessageId ) = 0; + + virtual void SearchCompleted() = 0; + + }; // end class MMsgStoreSearchClient /** This class defines the message store quick property client API. - This class is used to notify the client when a quick property is ready to be processed, or + This class is used to notify the client when a quick property is ready to be processed, or to notify the client something has changed, restart building the list */ class MMsgStoreQuickPropertyClient - { - public: + { + public: - virtual void ProcessQuickProperty( const CMsgStorePropertyContainer& aContainer ) = 0; - - virtual void Reset() = 0; - - }; // end class MMsgStoreSearchClient + virtual void ProcessQuickProperty( const CMsgStorePropertyContainer& aContainer ) = 0; + + virtual void Reset() = 0; + + }; // end class MMsgStoreSearchClient @@ -84,10 +84,10 @@ { public: - // ============== - // PUBLIC METHODS - // ============== - + // ============== + // PUBLIC METHODS + // ============== + TPropertyContainerProxy( MMsgStoreQuickPropertyClient& aClient ); // inherited from MPropertiesArray @@ -96,10 +96,10 @@ private: - // ================== - // PRIVATE ATTRIBUTES - // ================== - + // ================== + // PRIVATE ATTRIBUTES + // ================== + MMsgStoreQuickPropertyClient& iClient; }; // end class TPropertyContainerProxy @@ -118,209 +118,209 @@ // FUNCTION: CopyAttachmentL // ========================================================================== EXPORT_C TMsgStoreId CMsgStoreSession::CopyAttachmentL( TMsgStoreId aAttachmentId, - TMsgStoreId aSourceMessageId, - TMsgStoreId aSourceFolderId, - TMsgStoreId aDestinationMessageId, - TMsgStoreId aDestinationFolderId ) - { - iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits ); - iContext->VerifyTypeL( aSourceMessageId, EMsgStoreMessageBits ); - iContext->VerifyTypeL( aSourceFolderId, EMsgStoreFolderBits ); - iContext->VerifyTypeL( aDestinationMessageId, EMsgStoreMessageBits ); - iContext->VerifyTypeL( aDestinationFolderId, EMsgStoreFolderBits ); - - return iContext->iSession.CopyContainerL( aAttachmentId, - aSourceMessageId, - aSourceFolderId, - aDestinationMessageId, - aDestinationFolderId ); - } // end CopyAttachmentL + TMsgStoreId aSourceMessageId, + TMsgStoreId aSourceFolderId, + TMsgStoreId aDestinationMessageId, + TMsgStoreId aDestinationFolderId ) + { + iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits ); + iContext->VerifyTypeL( aSourceMessageId, EMsgStoreMessageBits ); + iContext->VerifyTypeL( aSourceFolderId, EMsgStoreFolderBits ); + iContext->VerifyTypeL( aDestinationMessageId, EMsgStoreMessageBits ); + iContext->VerifyTypeL( aDestinationFolderId, EMsgStoreFolderBits ); + + return iContext->iSession.CopyContainerL( aAttachmentId, + aSourceMessageId, + aSourceFolderId, + aDestinationMessageId, + aDestinationFolderId ); + } // end CopyAttachmentL // ========================================================================== // FUNCTION: QuickMessagePropertiesL // ========================================================================== EXPORT_C void CMsgStoreSession::QuickMessagePropertiesL( TMsgStoreId aFolderId, RPointerArray& aQuickProperties ) - { - iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); - - TPropertyContainersArray containersArray( aQuickProperties ); - - iContext->iSession.ChildrenPropertiesL( aFolderId, // aId - KMsgStoreInvalidId, // aParentId (do not need to check parent ID) - EMsgStoreMessageBits, // aContainerType - ETrue, // aQuickProperties - EFalse, // aRecursive - containersArray ); - } // end QuickMessagePropertiesL - + { + iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); + + TPropertyContainersArray containersArray( aQuickProperties ); + + iContext->iSession.ChildrenPropertiesL( aFolderId, // aId + KMsgStoreInvalidId, // aParentId (do not need to check parent ID) + EMsgStoreMessageBits, // aContainerType + ETrue, // aQuickProperties + EFalse, // aRecursive + containersArray ); + } // end QuickMessagePropertiesL + // ========================================================================== // FUNCTION: QuickMessagePropertiesL overloaded // ========================================================================== EXPORT_C void CMsgStoreSession::QuickMessagePropertiesL( TMsgStoreId aFolderId, MMsgStoreQuickPropertyClient& aClient ) - { - iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); - - TPropertyContainerProxy containerProxy( aClient ); - - iContext->iSession.ChildrenPropertiesL( aFolderId, // aId - KMsgStoreInvalidId, // aParentId (do not need to check parent ID) - EMsgStoreMessageBits, // aContainerType - ETrue, // aQuickProperties - EFalse, // aRecursive - containerProxy ); - } // end QuickMessagePropertiesL + { + iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); + + TPropertyContainerProxy containerProxy( aClient ); + + iContext->iSession.ChildrenPropertiesL( aFolderId, // aId + KMsgStoreInvalidId, // aParentId (do not need to check parent ID) + EMsgStoreMessageBits, // aContainerType + ETrue, // aQuickProperties + EFalse, // aRecursive + containerProxy ); + } // end QuickMessagePropertiesL // ========================================================================== // FUNCTION: AttachmentsL // ========================================================================== EXPORT_C void CMsgStoreSession::AttachmentsL( TMsgStoreId aMessageId, - TMsgStoreId aFolderId, - RPointerArray& aAttachmentsList ) - { - iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits ); - iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); + TMsgStoreId aFolderId, + RPointerArray& aAttachmentsList ) + { + iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits ); + iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); -// TAttachmentsArray attachmentsArray( *iContext, aAttachmentsList ); - - iContext->iSession.ChildrenPropertiesL( aMessageId, // aId - aFolderId, // aParentId - EMsgStoreAttachmentBits, // aContainerType - EFalse, // aQuickProperties - EFalse, // aRecursive - attachmentsArray ); - } // end AttachmentsL +// TAttachmentsArray attachmentsArray( *iContext, aAttachmentsList ); + + iContext->iSession.ChildrenPropertiesL( aMessageId, // aId + aFolderId, // aParentId + EMsgStoreAttachmentBits, // aContainerType + EFalse, // aQuickProperties + EFalse, // aRecursive + attachmentsArray ); + } // end AttachmentsL // ========================================================================== // FUNCTION: AttachmentL // ========================================================================== EXPORT_C CMsgStoreAttachment* CMsgStoreSession::AttachmentL( TMsgStoreId aAttachmentId, - TMsgStoreId aMessageId, - TMsgStoreId aFolderId ) - { - iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits ); - iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits ); - iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); - - RBuf8 propertiesBuf; - CleanupClosePushL( propertiesBuf ); - - iContext->iSession.ContainerPropertiesL( aAttachmentId, aMessageId, aFolderId, propertiesBuf ); + TMsgStoreId aMessageId, + TMsgStoreId aFolderId ) + { + iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits ); + iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits ); + iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); + + RBuf8 propertiesBuf; + CleanupClosePushL( propertiesBuf ); + + iContext->iSession.ContainerPropertiesL( aAttachmentId, aMessageId, aFolderId, propertiesBuf ); - CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, aAttachmentId, aMessageId, propertiesBuf ); - - CleanupStack::PopAndDestroy( &propertiesBuf ); - - return attachment; - } // end AttachmentL + CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, aAttachmentId, aMessageId, propertiesBuf ); + + CleanupStack::PopAndDestroy( &propertiesBuf ); + + return attachment; + } // end AttachmentL // ========================================================================== // FUNCTION: AddAttachmentL // ========================================================================== EXPORT_C CMsgStoreAttachment* CMsgStoreSession::AddAttachmentL( TMsgStoreId aMessageId, - TMsgStoreId aFolderId, - const TDesC& aFilename, - const CMsgStorePropertyContainer& aProperties ) - { - iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits ); - iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); - - if( aFilename.Length() == 0 ) - { - __LOG_STATIC_ENTER( "msg", "AddAttachmentL" ) - __LOG_WRITE_ERROR( "zero length file name" ) - __LOG_STATIC_EXIT - User::Leave( KErrArgument ); - } // end if - - RBuf8 serializedProperties; - CleanupClosePushL( serializedProperties ); - aProperties.SerializeL( serializedProperties ); - - TInt id = iContext->iSession.CreateContainerL( aMessageId, - aFolderId, - EMsgStoreAttachmentBits, - serializedProperties, - ETrue, - aFilename ); - - CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, id, aMessageId, serializedProperties ); - - CleanupStack::PopAndDestroy( &serializedProperties ); - - return attachment; - } // end AddAttachmentL + TMsgStoreId aFolderId, + const TDesC& aFilename, + const CMsgStorePropertyContainer& aProperties ) + { + iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits ); + iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); + + if( aFilename.Length() == 0 ) + { + __LOG_STATIC_ENTER( "msg", "AddAttachmentL" ) + __LOG_WRITE_ERROR( "zero length file name" ) + __LOG_STATIC_EXIT + User::Leave( KErrArgument ); + } // end if + + RBuf8 serializedProperties; + CleanupClosePushL( serializedProperties ); + aProperties.SerializeL( serializedProperties ); + + TInt id = iContext->iSession.CreateContainerL( aMessageId, + aFolderId, + EMsgStoreAttachmentBits, + serializedProperties, + ETrue, + aFilename ); + + CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, id, aMessageId, serializedProperties ); + + CleanupStack::PopAndDestroy( &serializedProperties ); + + return attachment; + } // end AddAttachmentL // ========================================================================== // FUNCTION: AddAttachmentL // ========================================================================== EXPORT_C CMsgStoreAttachment* CMsgStoreSession::AddAttachmentL( TMsgStoreId aMessageId, - TMsgStoreId aFolderId, - const CMsgStorePropertyContainer& aProperties ) - { - iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits ); - iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); - - RBuf8 serializedProperties; - CleanupClosePushL( serializedProperties ); - aProperties.SerializeL( serializedProperties ); - - TInt id = iContext->iSession.CreateContainerL( aMessageId, - aFolderId, - EMsgStoreAttachmentBits, - serializedProperties ); - - CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, id, aMessageId, serializedProperties ); - - CleanupStack::PopAndDestroy( &serializedProperties ); - - return attachment; - } // end AddAttachmentL + TMsgStoreId aFolderId, + const CMsgStorePropertyContainer& aProperties ) + { + iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits ); + iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); + + RBuf8 serializedProperties; + CleanupClosePushL( serializedProperties ); + aProperties.SerializeL( serializedProperties ); + + TInt id = iContext->iSession.CreateContainerL( aMessageId, + aFolderId, + EMsgStoreAttachmentBits, + serializedProperties ); + + CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, id, aMessageId, serializedProperties ); + + CleanupStack::PopAndDestroy( &serializedProperties ); + + return attachment; + } // end AddAttachmentL // ========================================================================== // FUNCTION: RemoveAttachmentL // ========================================================================== EXPORT_C void CMsgStoreSession::RemoveAttachmentL( TMsgStoreId aAttachmentId, - TMsgStoreId aMessageId, - TMsgStoreId aFolderId ) - { - iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits ); - iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); - iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits ); - - iContext->iSession.DeleteContainerL( aAttachmentId, aMessageId, aFolderId ); - } // end RemoveAttachmentL - + TMsgStoreId aMessageId, + TMsgStoreId aFolderId ) + { + iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits ); + iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); + iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits ); + + iContext->iSession.DeleteContainerL( aAttachmentId, aMessageId, aFolderId ); + } // end RemoveAttachmentL + // ========================================================================== // FUNCTION: SearchL // ========================================================================== EXPORT_C void CMsgStoreSession::SearchL( TMsgStoreId aFolderId, TMsgStoreSearchType aSearchType, - const TDesC& aSearchString, - MMsgStoreSearchClient& aSearchClient ) + const TDesC& aSearchString, + MMsgStoreSearchClient& aSearchClient ) { - iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); + iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits ); - if( aSearchString.Length() == 0 ) - { - __LOG_STATIC_ENTER( "msg", "SearchL" ) - __LOG_WRITE_ERROR( "zero length search string" ) + if( aSearchString.Length() == 0 ) + { + __LOG_STATIC_ENTER( "msg", "SearchL" ) + __LOG_WRITE_ERROR( "zero length search string" ) __LOG_STATIC_EXIT User::Leave( KErrArgument ); - } // end if + } // end if if( iContext->iSearchHandler ) { - __LOG_STATIC_ENTER( "msg", "SearchL" ) - __LOG_WRITE_ERROR( "search already in progress" ) + __LOG_STATIC_ENTER( "msg", "SearchL" ) + __LOG_WRITE_ERROR( "search already in progress" ) __LOG_STATIC_EXIT User::Leave( KErrInUse ); } // end if - + iContext->iSearchHandler = CMsgStoreSearchHandler::NewL( iContext->iSession, aFolderId, aSearchType, aSearchString, *this ); iContext->iSearchClient = &aSearchClient; } // end SearchL - + // ========================================================================== // FUNCTION: CancelSearch // ========================================================================== @@ -363,8 +363,8 @@ CMsgStoreSearchHandler* CMsgStoreSearchHandler::NewL( RMessageStoreSession& aSession, TMsgStoreId aFolderId, TMsgStoreSearchType aSearchType, - const TDesC& aSearchString, - MMsgStoreSearchClient& aSearchClient ) + const TDesC& aSearchString, + MMsgStoreSearchClient& aSearchClient ) { CMsgStoreSearchHandler* self = new(ELeave) CMsgStoreSearchHandler( aSession, aSearchClient ); CleanupStack::PushL( self ); @@ -372,27 +372,27 @@ CleanupStack::Pop( self ); return self; } // end NewL - + // ========================================================================== // FUNCTION: Constructor // ========================================================================== CMsgStoreSearchHandler::CMsgStoreSearchHandler( RMessageStoreSession& aSession, MMsgStoreSearchClient& aSearchClient ) : - CActive( EPriorityStandard ), - iSession( aSession ), + CActive( EPriorityStandard ), + iSession( aSession ), iSearchClient( aSearchClient ) { __LOG_CONSTRUCT( "msg", "CMsgStoreSearchHandler" ) - CActiveScheduler::Add(this); + CActiveScheduler::Add(this); } // end constructor - + // ========================================================================== // FUNCTION: ConstructL // ========================================================================== void CMsgStoreSearchHandler::ConstructL( TMsgStoreId aFolderId, TMsgStoreSearchType aSearchType, - const TDesC& aSearchString ) + const TDesC& aSearchString ) { iMatchBuffer[0].CreateL( sizeof(TMsgStoreId) * KSearchBufferLength ); iMatchBuffer[1].CreateL( sizeof(TMsgStoreId) * KSearchBufferLength ); @@ -420,7 +420,7 @@ __LOG_DESTRUCT } // end destructor - + // ========================================================================== // FUNCTION: RunL // ========================================================================== @@ -431,12 +431,12 @@ RBuf8& currentMatchBuffer = iMatchBuffer[iMatchBufferIndex]; if( iStatus == KErrNone && currentMatchBuffer.Length() > 0 ) - { - // Switch to the other match buffer for the next call to the session. Make this call before - // calling the search client with matches, just in case the client cancels the search during - // the callback. This will cause DoCancel to be called during this object's destruction, which - // will cancel the server-side search. - iMatchBufferIndex = (iMatchBufferIndex + 1) % 2; + { + // Switch to the other match buffer for the next call to the session. Make this call before + // calling the search client with matches, just in case the client cancels the search during + // the callback. This will cause DoCancel to be called during this object's destruction, which + // will cancel the server-side search. + iMatchBufferIndex = (iMatchBufferIndex + 1) % 2; iSession.GetMatchesL( iStatus, iMatchBuffer[iMatchBufferIndex] ); SetActive(); @@ -445,13 +445,13 @@ TBool thisObjectHasBeenDeleted = EFalse; iThisObjectHasBeenDeleted = &thisObjectHasBeenDeleted; - TBool atEndOfIds = (currentMatchBuffer.Length() == 0); - TUint offset = 0; + TBool atEndOfIds = (currentMatchBuffer.Length() == 0); + TUint offset = 0; - while( !thisObjectHasBeenDeleted && !atEndOfIds ) - { - const TMsgStoreId& currentId = *reinterpret_cast( currentMatchBuffer.Ptr() + offset ); - + while( !thisObjectHasBeenDeleted && !atEndOfIds ) + { + const TMsgStoreId& currentId = *reinterpret_cast( currentMatchBuffer.Ptr() + offset ); + __LOG_WRITE8_FORMAT1_INFO( "match found (%i)", currentId ) offset += sizeof(TMsgStoreId); @@ -463,22 +463,22 @@ // Note that the client may cancel the search during this callback. iSearchClient.MatchFound( currentId ); - } // end while + } // end while if( !thisObjectHasBeenDeleted ) { iThisObjectHasBeenDeleted = NULL; } // end if - } + } else - { + { __LOG_WRITE8_FORMAT1_INFO( "Search completed, iStatus=%d", iStatus.Int() ); iSearchClient.SearchCompleted(); - } // end if + } // end if - // __LOG_EXIT was removed because it crashes in cases where thisObjectHasBeenDeleted is true + // __LOG_EXIT was removed because it crashes in cases where thisObjectHasBeenDeleted is true } // end RunL diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStore.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStore.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStore.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,16 +18,16 @@ // -#include "MsgStore.h" -#include "MsgStoreMailBox.h" -#include "MsgStoreAccount.h" -#include "MsgStoreObserver.h" -#include "MsgStorePropertyContainer.h" -#include "MsgStorePropertyKeys.h" +#include "msgstore.h" +#include "msgstoremailbox.h" +#include "msgstoreaccount.h" +#include "msgstoreobserver.h" +#include "msgstorepropertycontainer.h" +#include "msgstorepropertykeys.h" // -#include "MsgStoreSessionContext.h" -#include "MsgStoreObserverHandler.h" +#include "msgstoresessioncontext.h" +#include "msgstoreobserverhandler.h" // //#include "IsMsgStorePropertyKeys.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreAccount.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreAccount.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreAccount.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ // -#include "MsgStoreAccount.h" +#include "msgstoreaccount.h" // EXPORT_C CMsgStoreAccount* CMsgStoreAccount::NewL( const TInt32 aOwnerUid, const TDesC& aName ) diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreAddress.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreAddress.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreAddress.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ // -#include "MsgStoreAddress.h" +#include "msgstoreaddress.h" // // -------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreFolder.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreFolder.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreFolder.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,10 +18,10 @@ // -#include "MsgStoreFolder.h" -#include "MsgStorePropertyKeys.h" +#include "msgstorefolder.h" +#include "msgstorepropertykeys.h" // -#include "MsgStoreSessionContext.h" +#include "msgstoresessioncontext.h" CMsgStoreFolder* CMsgStoreFolder::NewL( CMsgStoreSessionContext& aSessionContext, TMsgStoreId aId, diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreFolderUtils.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreFolderUtils.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreFolderUtils.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,9 +17,9 @@ -#include "MsgStoreFolderUtils.h" +#include "msgstorefolderutils.h" // -#include "MsgStoreFolder.h" +#include "msgstorefolder.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreMailBox.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreMailBox.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreMailBox.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,19 +18,19 @@ // -#include "MsgStoreMailBox.h" -#include "DebugLogMacros.h" -#include "RMessageStoreSession.h" -#include "MsgStoreSessionContext.h" -#include "MsgStoreFolder.h" -#include "MsgStoreMessage.h" -#include "MsgStorePropertyKeys.h" -#include "MsgStoreObserverHandler.h" -#include "MsgStorePropertyContainersArray.h" -#include "MsgStoreSortCriteria.h" -#include "MsgStoreSortResultIterator.h" -#include "MsgStoreSearchHandler.h" -#include "MsgStoreSearchCriteria.h" +#include "msgstoremailbox.h" +#include "debuglogmacros.h" +#include "rmessagestoresession.h" +#include "msgstoresessioncontext.h" +#include "msgstorefolder.h" +#include "msgstoremessage.h" +#include "msgstorepropertykeys.h" +#include "msgstoreobserverhandler.h" +#include "msgstorepropertycontainersarray.h" +#include "msgstoresortcriteria.h" +#include "msgstoresortresultiterator.h" +#include "msgstoresearchhandler.h" +#include "msgstoresearchcriteria.h" //#include "IsMsgStorePropertyKeys.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreMessage.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreMessage.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreMessage.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,9 +18,9 @@ // -#include "MsgStoreMessage.h" +#include "msgstoremessage.h" // -#include "MsgStoreSessionContext.h" +#include "msgstoresessioncontext.h" /** Commits a newly created message to the message store. diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreMessagePart.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreMessagePart.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreMessagePart.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,13 +18,13 @@ // -#include "MsgStoreMessagePart.h" -#include "MsgStorePropertyKeys.h" +#include "msgstoremessagepart.h" +#include "msgstorepropertykeys.h" // -#include "MsgStoreSessionContext.h" -#include "RMessageStoreSession.h" +#include "msgstoresessioncontext.h" +#include "rmessagestoresession.h" #include "MessageStoreClientServer.h" -#include "MsgStoreMessage.h" +#include "msgstoremessage.h" //_LIT( KTextPlain, "text/plain" ); //_LIT( KTextHTML, "text/html" ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreObserverHandler.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreObserverHandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreObserverHandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,10 +16,10 @@ */ -#include "MsgStoreObserverHandler.h" -#include "RMessageStoreSession.h" +#include "msgstoreobserverhandler.h" +#include "rmessagestoresession.h" // -#include "MsgStoreObserver.h" +#include "msgstoreobserver.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStorePropertyContainer.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainer.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainer.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,10 +17,10 @@ -#include "MsgStorePropertyContainer.h" +#include "msgstorepropertycontainer.h" // -#include "DebugLogMacros.h" -#include "MsgStorePropertyKeys.h" +#include "debuglogmacros.h" +#include "msgstorepropertykeys.h" // #include "PropertiesSerializer.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStorePropertyContainerWithContent.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainerWithContent.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainerWithContent.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,8 +16,8 @@ */ -#include "MsgStorePropertyContainerWithContent.h" -#include "MsgStoreSessionContext.h" +#include "msgstorepropertycontainerwithcontent.h" +#include "msgstoresessioncontext.h" // ------------------------------------- // CMsgStorePropertyContainerWithContent diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStorePropertyContainersArray.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainersArray.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainersArray.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,9 +17,9 @@ -#include "MsgStorePropertyContainersArray.h" +#include "msgstorepropertycontainersarray.h" // -#include "MsgStorePropertyContainer.h" +#include "msgstorepropertycontainer.h" // // ------------------------ diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreSearchCriteria.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreSearchCriteria.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreSearchCriteria.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -15,7 +15,7 @@ * */ -#include "MsgStoreSearchCriteria.h" +#include "msgstoresearchcriteria.h" // -------------------------- // RMsgStoreAddress diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreSearchHandler.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreSearchHandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreSearchHandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,12 +17,12 @@ -#include "MsgStoreSearchHandler.h" +#include "msgstoresearchhandler.h" // -#include "MsgStoreTypes.h" -#include "MsgStoreMailBox.h" +#include "msgstoretypes.h" +#include "msgstoremailbox.h" // -#include "RMessageStoreSession.h" +#include "rmessagestoresession.h" const TInt KInitialPropertiesTransferBufferLength = 10000; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreSessionContext.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreSessionContext.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreSessionContext.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -15,7 +15,7 @@ * */ -#include "MsgStoreSessionContext.h" +#include "msgstoresessioncontext.h" // ========================================================================== // FUNCTION: Constructor diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreSortCriteria.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreSortCriteria.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreSortCriteria.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ // -#include "MsgStoreSortCriteria.h" +#include "msgstoresortcriteria.h" // // -------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreSortResultIterator.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreSortResultIterator.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreSortResultIterator.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,9 +17,9 @@ -#include "MsgStoreSortResultIterator.h" -#include "MsgStoreSessionContext.h" -#include "MsgStorePropertyContainersArray.h" +#include "msgstoresortresultiterator.h" +#include "msgstoresessioncontext.h" +#include "msgstorepropertycontainersarray.h" // ---------------------------------- // CMsgStoreSortResultIterator diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/MsgStoreWritablePropertyContainer.cpp --- a/emailservices/emailstore/message_store/client/src/MsgStoreWritablePropertyContainer.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/MsgStoreWritablePropertyContainer.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,8 +16,8 @@ */ -#include "MsgStoreWritablePropertyContainer.h" -#include "MsgStoreSessionContext.h" +#include "msgstorewritablepropertycontainer.h" +#include "msgstoresessioncontext.h" // ---------------------------------- // CMsgStoreWritablePropertyContainer diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/client/src/RMessageStoreSession.cpp --- a/emailservices/emailstore/message_store/client/src/RMessageStoreSession.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/client/src/RMessageStoreSession.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -24,17 +24,17 @@ #include // for descriptor read/write streams #include -#include "RMessageStoreSession.h" +#include "rmessagestoresession.h" -#include "EmailStoreUids.hrh" +#include "emailstoreuids.hrh" #include "MessageStoreClientServer.h" -#include "RMessageStoreSession.h" +#include "rmessagestoresession.h" // -#include "MsgStoreAccount.h" +#include "msgstoreaccount.h" #include "AccountsSerializer.h" -#include "MsgStoreSortCriteria.h" -#include "MsgStoreSearchCriteria.h" -#include "MsgStoreAddress.h" +#include "msgstoresortcriteria.h" +#include "msgstoresearchcriteria.h" +#include "msgstoreaddress.h" // // ========= diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/common/inc/MessageStoreClientServer.h --- a/emailservices/emailstore/message_store/common/inc/MessageStoreClientServer.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/common/inc/MessageStoreClientServer.h Fri Feb 19 22:37:30 2010 +0200 @@ -26,8 +26,8 @@ #include // -#include "MsgStoreTypes.h" -#include "MsgStoreAccount.h" +#include "msgstoretypes.h" +#include "msgstoreaccount.h" // // ========= diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/debuglog/group/DebugLog.mmp --- a/emailservices/emailstore/message_store/debuglog/group/DebugLog.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/debuglog/group/DebugLog.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #include #include "../../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../inc/EmailStoreUids.hrh" +#include "../../../inc/emailstoreuids.hrh" TARGET DebugLog.dll TARGETTYPE dll diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/debuglog/group/bld.inf --- a/emailservices/emailstore/message_store/debuglog/group/bld.inf Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/debuglog/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -21,9 +21,9 @@ // Support all platforms for now PRJ_EXPORTS -../inc/DebugLogMacros.h |../../../../../inc/DebugLogMacros.h -../inc/DebugLogConst.h |../../../../../inc/DebugLogConst.h -../inc/DebugLog.h |../../../../../inc/DebugLog.h +../inc/debuglogmacros.h |../../../../../inc/debuglogmacros.h +../inc/debuglogconst.h |../../../../../inc/debuglogconst.h +../inc/debuglog.h |../../../../../inc/debuglog.h ../inc/GlobalDebugLoggingOptions.h |../../../../../inc/GlobalDebugLoggingOptions.h PRJ_MMPFILES diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/debuglog/inc/DebugLogConst.h --- a/emailservices/emailstore/message_store/debuglog/inc/DebugLogConst.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/debuglog/inc/DebugLogConst.h Fri Feb 19 22:37:30 2010 +0200 @@ -25,7 +25,7 @@ #include #include -#include "DebugLog.h" +#include "debuglog.h" // ======== // LITERALS @@ -171,7 +171,7 @@ #define DEBUG_USE_VAR(var) if ( &var ) {}; // These are the basic logging macros - they are NOT intended to be called directly. -// Instead use the logging MACROS defined in DebugLogMacros.h +// Instead use the logging MACROS defined in debuglogmacros.h #define __INTERNAL_LOG_DECLARATION RDebugLog iLogger; #define __INTERNAL_LOG_CLOSE_BETWEEN_WRITES \ @@ -620,4 +620,4 @@ #endif // _DEBUG_LOG_CONST_H_ -// END FILE DebugLogConst.h +// END FILE debuglogconst.h diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/debuglog/inc/DebugLogMacros.h --- a/emailservices/emailstore/message_store/debuglog/inc/DebugLogMacros.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/debuglog/inc/DebugLogMacros.h Fri Feb 19 22:37:30 2010 +0200 @@ -52,7 +52,7 @@ // PRINTING: (NOTE: The following is just a reference example) // // // Include the debug logging header file -// #include "DebugLogMacros.h" +// #include "debuglogmacros.h" // // class CTestClass // { @@ -181,7 +181,7 @@ // DEBUG BUILD // =========== - #include "DebugLogConst.h" + #include "debuglogconst.h" // ===================================================================== // Utility Logging Macros @@ -457,5 +457,5 @@ #endif // _DEBUG_LOG_MACROS_H_ -// END FILE DebugLogMacros.h +// END FILE debuglogmacros.h diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/debuglog/src/DebugLog.cpp --- a/emailservices/emailstore/message_store/debuglog/src/DebugLog.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/debuglog/src/DebugLog.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -25,8 +25,8 @@ #include #include -#include "DebugLog.h" -#include "DebugLogConst.h" +#include "debuglog.h" +#include "debuglogconst.h" // This takes a lot more memory to use, so it is defaulted to off. If the code is crashing // in DoLogLeakedObjects then uncomment this line to help find the problem. It is most likely diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/exe/group/MessageStoreExe.mmp --- a/emailservices/emailstore/message_store/exe/group/MessageStoreExe.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/exe/group/MessageStoreExe.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #include #include "../../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../inc/EmailStoreUids.hrh" +#include "../../../inc/emailstoreuids.hrh" TARGET MessageStoreExe.exe TARGETTYPE exe diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/group/MessageStoreServer.mmp --- a/emailservices/emailstore/message_store/server/group/MessageStoreServer.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/group/MessageStoreServer.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #include #include "../../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../../inc/EmailStoreUids.hrh" +#include "../../../inc/emailstoreuids.hrh" TARGET MessageStoreServer.dll TARGETTYPE dll diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/BackupRestoreObserver.h --- a/emailservices/emailstore/message_store/server/inc/BackupRestoreObserver.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/BackupRestoreObserver.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,7 +27,7 @@ #include #include // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // // ======= diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStore.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStore.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStore.h Fri Feb 19 22:37:30 2010 +0200 @@ -28,7 +28,7 @@ #include #include // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "MessageStoreClientServer.h" #include "EncryptableTable.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreAccountTable.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreAccountTable.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreAccountTable.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,7 +27,7 @@ #include #include // database // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "ContainerStoreTable.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreContainersTable.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreContainersTable.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreContainersTable.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,7 +27,7 @@ #include #include // database // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "ContainerStoreTable.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreContentManager.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreContentManager.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreContentManager.h Fri Feb 19 22:37:30 2010 +0200 @@ -25,7 +25,7 @@ #include // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "ContainerStore.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreDeleteHandler.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreDeleteHandler.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreDeleteHandler.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,7 +27,7 @@ #include #include // database // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "ContainerStore.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreEncryption.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreEncryption.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreEncryption.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,7 +27,7 @@ #include #include // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "ContainerStoreGeneralTable.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreGeneralTable.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreGeneralTable.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreGeneralTable.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,7 +27,7 @@ #include #include // database // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "ContainerStoreTable.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreMRUAddressTable.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreMRUAddressTable.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreMRUAddressTable.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,7 +27,7 @@ #include #include // database // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "ContainerStoreTable.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreSearchResultTable.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreSearchResultTable.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreSearchResultTable.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,12 +27,12 @@ #include #include // database // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "ContainerStoreTable.h" #include "ContainerStore.h" -#include "MsgStoreTypes.h" +#include "msgstoretypes.h" // ======= // CLASSES diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreSortingTable.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreSortingTable.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreSortingTable.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,12 +27,12 @@ #include #include // database // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "ContainerStoreTable.h" #include "ContainerStore.h" -#include "MsgStoreTypes.h" +#include "msgstoretypes.h" #include "EncryptableTable.h" enum TSortableFieldsMasks diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreTable.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreTable.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreTable.h Fri Feb 19 22:37:30 2010 +0200 @@ -27,7 +27,7 @@ #include #include // database // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // class CContainerStoreUtils; diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ContainerStoreUtils.h --- a/emailservices/emailstore/message_store/server/inc/ContainerStoreUtils.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreUtils.h Fri Feb 19 22:37:30 2010 +0200 @@ -29,7 +29,7 @@ #include // database #include // stream store // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // // ==================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/MessageStoreServer.h --- a/emailservices/emailstore/message_store/server/inc/MessageStoreServer.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/MessageStoreServer.h Fri Feb 19 22:37:30 2010 +0200 @@ -26,7 +26,7 @@ #include // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" #include "ImsPointsecObserver.h" #include "ImsPointsecMonitor.h" #include "StoreDriveMonitor.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/MessageStoreSession.h --- a/emailservices/emailstore/message_store/server/inc/MessageStoreSession.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/MessageStoreSession.h Fri Feb 19 22:37:30 2010 +0200 @@ -26,7 +26,7 @@ #include // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "MessageStoreClientServer.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/MsgStoreSortResultRowSet.h --- a/emailservices/emailstore/message_store/server/inc/MsgStoreSortResultRowSet.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/MsgStoreSortResultRowSet.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #define MSGSTORE_SORT_RESULT_ROWSET_ #include "ContainerStoreSortingTable.h" -#include "MsgStoreTypes.h" +#include "msgstoretypes.h" // ================================== // CLASS: CMsgStoreSortResultRowSet diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/inc/ShutdownServer.h --- a/emailservices/emailstore/message_store/server/inc/ShutdownServer.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/inc/ShutdownServer.h Fri Feb 19 22:37:30 2010 +0200 @@ -26,7 +26,7 @@ #include // -#include "DebugLogMacros.h" +#include "debuglogmacros.h" // #include "ContainerStore.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/src/ContainerStore.cpp --- a/emailservices/emailstore/message_store/server/src/ContainerStore.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/src/ContainerStore.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include -#include "MsgStoreTypes.h" +#include "msgstoretypes.h" #include "ContainerStore.h" #include "ContainerStoreContainersTable.h" #include "ContainerStoreContentManager.h" @@ -40,7 +40,7 @@ #include "ContainerStoreSearchResultTable.h" #include "MessageStoreEncryptHandler.h" #include "ContainerStoreMRUAddressTable.h" -#include "MsgStorePropertyKeys.h" +#include "msgstorepropertykeys.h" // ========= // CONSTANTS diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/src/ContainerStoreSearchHandler.cpp --- a/emailservices/emailstore/message_store/server/src/ContainerStoreSearchHandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/src/ContainerStoreSearchHandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -29,7 +29,7 @@ #include "MsgStoreSortResultRowSet.h" #include "PropertiesSerializer.h" // -#include "MsgStorePropertyKeys.h" +#include "msgstorepropertykeys.h" // // ========= diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/src/ContainerStoreSortingTable.cpp --- a/emailservices/emailstore/message_store/server/src/ContainerStoreSortingTable.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/src/ContainerStoreSortingTable.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ #include "ContainerStoreSortingTable.h" -#include "MsgStoreTypes.h" +#include "msgstoretypes.h" #include "MessageStoreClientServer.h" #include "ContainerStoreDefs.h" #include "MsgStoreSortResultRowSet.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/message_store/server/src/MessageStoreServer.cpp --- a/emailservices/emailstore/message_store/server/src/MessageStoreServer.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/message_store/server/src/MessageStoreServer.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -26,9 +26,9 @@ #include #include -#include "MsgStoreTypes.h" -#include "MsgStorePropertyKeys.h" -#include "EmailStoreUids.hrh" +#include "msgstoretypes.h" +#include "msgstorepropertykeys.h" +#include "emailstoreuids.hrh" #include "MessageStoreServer.h" #include "MessageStoreSession.h" #include "ContainerStore.h" @@ -38,6 +38,7 @@ #include "ImsPointsecMonitor.h" #include "ImsPointsecObserver.h" #include "emailstorepskeys.h" // Support for on-the-fly upgrade +#include "emailshutdownconst.h" // // ========= @@ -328,9 +329,9 @@ TSecurityPolicy readPolicy( ECapabilityReadDeviceData ); TSecurityPolicy writePolicy( ECapabilityWriteDeviceData ); iUpgradePropertyWatcher = CPSIntPropertyWatcher::NewL( this ); - iUpgradePropertyWatcher->StartL( KEmailStoreUpgradePSCategory, - KProperty_EmailStore_Upgrade, - process.SecureId(), + iUpgradePropertyWatcher->StartL( KEmailShutdownPsCategory, + EEmailPsKeyShutdownMsgStore, + KEmailShutterPsValue, /*ETrue*/EFalse, readPolicy, writePolicy ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/preinstall/group/EmailStorePreInstall.mmp --- a/emailservices/emailstore/preinstall/group/EmailStorePreInstall.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/preinstall/group/EmailStorePreInstall.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #include //needed for APP_LAYER_SYSTEMINCLUDE #include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber -#include "../../inc/EmailStoreUids.hrh" +#include "../../inc/emailstoreuids.hrh" TARGET EmailStorePreInstall.exe TARGETTYPE exe diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/preinstall/inc/EmailStorePreInstall.h --- a/emailservices/emailstore/preinstall/inc/EmailStorePreInstall.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/preinstall/inc/EmailStorePreInstall.h Fri Feb 19 22:37:30 2010 +0200 @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "ProcessTimer.h" // ======== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/preinstall/inc/ProcessTimer.h --- a/emailservices/emailstore/preinstall/inc/ProcessTimer.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/preinstall/inc/ProcessTimer.h Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ #define PROCESSTIMER_H_ #include -#include +#include /** * Timeout observer interface. diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/preinstall/src/EmailStorePreInstall.cpp --- a/emailservices/emailstore/preinstall/src/EmailStorePreInstall.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/preinstall/src/EmailStorePreInstall.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #include #include "EmailStorePreInstall.h" -#include "EmailStoreUids.hrh" +#include "emailstoreuids.hrh" #include "emailstorepskeys.h" // Timeout for process exit. diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/tsrc/message_store_test/src/ContentTests.cpp --- a/emailservices/emailstore/tsrc/message_store_test/src/ContentTests.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/tsrc/message_store_test/src/ContentTests.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,9 +16,8 @@ */ -#include +#include #include "ContentTests.h" -//#include #include "messagestoreclientserver.h" // ============================ MEMBER FUNCTIONS =============================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/tsrc/message_store_test/src/DbCorruptTests.cpp --- a/emailservices/emailstore/tsrc/message_store_test/src/DbCorruptTests.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/tsrc/message_store_test/src/DbCorruptTests.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,11 +16,11 @@ */ -#include -#include -#include +#include +#include +#include #include "DbCorruptTests.h" -#include +#include //these must match those defined in ContainerStoreDefs. _LIT( KDbFilename, "message_store.db" ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/tsrc/message_store_test/src/EncryptionTests.cpp --- a/emailservices/emailstore/tsrc/message_store_test/src/EncryptionTests.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/tsrc/message_store_test/src/EncryptionTests.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,10 +16,7 @@ */ -//#include #include "EncryptionTests.h" -//#include -//#include "messagestoreclientserver.h" // This must match that's defined in ContainerStoreDefs.h enum TEncryptionState diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/tsrc/message_store_test/src/MruTests.cpp --- a/emailservices/emailstore/tsrc/message_store_test/src/MruTests.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/tsrc/message_store_test/src/MruTests.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,9 +16,7 @@ */ -//#include #include "MruTests.h" -//#include #include "messagestoreclientserver.h" // ============================ MEMBER FUNCTIONS =============================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/tsrc/message_store_test/src/SearchTests.cpp --- a/emailservices/emailstore/tsrc/message_store_test/src/SearchTests.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/tsrc/message_store_test/src/SearchTests.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,10 +16,7 @@ */ -//#include #include "SearchTests.h" -//#include -//#include "messagestoreclientserver.h" _LIT(KHigh, "High"); _LIT(KNormal, "Normal"); diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/tsrc/message_store_test/src/ShutdownServerTest.cpp --- a/emailservices/emailstore/tsrc/message_store_test/src/ShutdownServerTest.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/tsrc/message_store_test/src/ShutdownServerTest.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,10 +16,7 @@ */ -//#include #include "ShutdownServerTest.h" -//#include -//#include "messagestoreclientserver.h" // ============================ MEMBER FUNCTIONS =============================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/tsrc/message_store_test/src/SizeTests.cpp --- a/emailservices/emailstore/tsrc/message_store_test/src/SizeTests.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/tsrc/message_store_test/src/SizeTests.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,10 +16,7 @@ */ -//#include #include "SizeTests.h" -//#include -//#include "messagestoreclientserver.h" // ============================ MEMBER FUNCTIONS =============================== diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/emailstore/tsrc/message_store_test/src/SortTests.cpp --- a/emailservices/emailstore/tsrc/message_store_test/src/SortTests.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/emailstore/tsrc/message_store_test/src/SortTests.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,12 +16,9 @@ */ -//#include #include #include #include "SortTests.h" -//#include -//#include "messagestoreclientserver.h" const TInt32 KOwner1 = 1234; _LIT(KAccount1, "My Account"); diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/psmruadapter/inc/CPsMruAdapter.h --- a/emailservices/psmruadapter/inc/CPsMruAdapter.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/psmruadapter/inc/CPsMruAdapter.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,13 +22,15 @@ // INCLUDES #include // -#include "MFSMailEventObserver.h" +#include "mfsmaileventobserver.h" // // FORWARD DECLARATION class CPsData; class CFSMailClient; +class MDesCArray; +class CDelayMailboxCreationHelper; // CLASS DECLARATION /** @@ -39,24 +41,24 @@ * @since S60 v3.2 */ class CPsMruAdapter : public CPsDataPlugin, public MFSMailEventObserver - { - public: - - /** - * Two phase construction - */ - static CPsMruAdapter* NewL(TAny* aPsDataPluginParameters); - - /** - * Destructor - */ - virtual ~CPsMruAdapter(); - - /** - * Returns the additional data for given item id - * Returns NULL (in current implementation) - */ - TAny* RequestForDataExtensionL( TInt ItemId ); + { + public: + + /** + * Two phase construction + */ + static CPsMruAdapter* NewL(TAny* aPsDataPluginParameters); + + /** + * Destructor + */ + virtual ~CPsMruAdapter(); + + /** + * Returns the additional data for given item id + * Returns NULL (in current implementation) + */ + TAny* RequestForDataExtensionL( TInt ItemId ); // from base class CPsDataPlugin @@ -97,92 +99,157 @@ void EventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 ); + /** + * If problem with NewMailbox this function will be called + * by CDelayMailboxCreationHelper to try it after some delay + */ + TBool DeleayedMailboxCreationEventL(); + + /** + * If problem with NewMailbox this function will be called + * by CDelayMailboxCreationHelper to try it after some delay + */ + void DeleayMailboxCreationEventL( TFSMailMsgId &aMailbox ); + private: - /** - * Constructor - */ - CPsMruAdapter(); - - /** - * 2nd phase construtor - */ - void ConstructL(MDataStoreObserver* aObserverForDataStore, - MStoreListObserver* aStoreListObserver); - - /** - * Updates given data store - */ - TBool FillDataStoreL( TDesC& aDataStoreURI ); - - /** - * Updates given data store - */ - TBool FillDataStoreL( TFSMailMsgId& aId ); - - /** - * Updates a list of supported data stores - */ - void UpdateSupportedDataStoresList(); - - /** - * Starts observing mailbox - */ - TBool AddMailboxObserverL( TFSMailMsgId& aId ); - - /** - * Stops observing mailbox - */ - TBool RemoveMailboxObserver( TFSMailMsgId& aId ); - - /** - * Stops all mailbox observers - */ - void RemoveAllMailboxObservers(); - - /** - * Converts Uri to TFsMailMsgId - */ - TBool GetMailboxIdentifierFromUri( TDesC& aUri, TFSMailMsgId& aId ); - - /** - * Converts TFsMailMsgId to Uri - */ - TBool GetUriFromMailboxIdentifier( TFSMailMsgId& aId, HBufC& aUri ); - - /** - * Updates given data store - */ - TBool FillDataStoreL( TFSMailMsgId& aId, TDesC& aDataStoreURI ); + /** + * Constructor + */ + CPsMruAdapter(); + + /** + * 2nd phase construtor + */ + void ConstructL(MDataStoreObserver* aObserverForDataStore, + MStoreListObserver* aStoreListObserver); + + /** + * Updates given data store + */ + TBool FillDataStoreL( TDesC& aDataStoreURI ); + + /** + * Updates given data store + */ + TBool FillDataStoreL( TFSMailMsgId& aId ); + + /** + * Updates a list of supported data stores + */ + void UpdateSupportedDataStoresList(); + + /** + * Starts observing mailbox + */ + TBool AddMailboxObserverL( TFSMailMsgId& aId ); + + /** + * Stops observing mailbox + */ + TBool RemoveMailboxObserver( TFSMailMsgId& aId ); + + /** + * Stops all mailbox observers + */ + void RemoveAllMailboxObservers(); + + /** + * Converts Uri to TFsMailMsgId + */ + TBool GetMailboxIdentifierFromUri( TDesC& aUri, TFSMailMsgId& aId ); + + /** + * Converts TFsMailMsgId to Uri + */ + TBool GetUriFromMailboxIdentifier( TFSMailMsgId& aId, HBufC& aUri ); + + /** + * Updates given data store + */ + TBool FillDataStoreL( TFSMailMsgId& aId, TDesC& aDataStoreURI ); + + /** + * Calls MDataStoreObserver::AddData for every mru email - used for trapping + */ + void AddMruEmailsL( MDesCArray* aMruList, TDesC& aDataStoreURI ); private: // data - /** - * Holds the observer object to communicate add/modify/delete of contacts - * Not owned. - */ - MDataStoreObserver* iDataStoreObserver; - - /** - * An observer instance used to send the datastore to the adapter - */ - MStoreListObserver* iStoreListObserver; - - /** + /** + * Holds the observer object to communicate add/modify/delete of contacts + * Not owned. + */ + MDataStoreObserver* iDataStoreObserver; + + /** + * An observer instance used to send the datastore to the adapter + */ + MStoreListObserver* iStoreListObserver; + + /** * Supported Uris(data stores) */ - RPointerArray iSupportedUris; - - /** - * List of mailboxes currently being observed - */ - RArray iObservedMailboxes; - - /** + RPointerArray iSupportedUris; + + /** + * List of mailboxes currently being observed + */ + RArray iObservedMailboxes; + + /** * Fs Email framework client */ - CFSMailClient* iMailClient; - }; - + CFSMailClient* iMailClient; + + /** + * Class for postponing the mailbox creation in MRU list - Event may come beforet the mailbox exists + */ + CDelayMailboxCreationHelper *iDelayMailboxCreationPtr; + + /** + * This mailboxes should be handled by CDelayMailboxCreationHelper + */ + RArray iDelayedCreatedMailboxes; + + }; // class CPsMruAdapter + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + + +// Helper class for thread synchronization +// used when mailbox is not ready when TFSEventNewMailbox event comes +// Waits 30*0.5 sec to try posponed mailbox registration + +// wait 500 ms to try adding the mailbox - because sync problems +#define KDelayToRunAddMailbox 500 +// try it 15 second - 30 times +#define KNumberOfDelayedTrials 30 + + +class CDelayMailboxCreationHelper : public CTimer + { + public: + static CDelayMailboxCreationHelper* NewLC( CPsMruAdapter *aPsMruAdapterPtr ); + static CDelayMailboxCreationHelper* NewL( CPsMruAdapter *aPsMruAdapterPtr ); + // d-tor + virtual ~CDelayMailboxCreationHelper(); + // Start timer to call CPsMruAdapter::DeleayedMailboxCreationEventL by RunL + void StartDelayedCall(); + protected: + // on timer event - calls CPsMruAdapter::DeleayedMailboxCreationEventL + virtual void RunL(); + // when leave from RunL, if err handled return KErrNone + TInt RunError( TInt aError ); + // two phase constr. + void ConstructL(); + private: + CDelayMailboxCreationHelper( CPsMruAdapter *aPsMruAdapterPtr ); // EPriorityLow, EPriorityIdle + // callback not owning pointer assigned during construction + CPsMruAdapter *iPsMruAdapterPtr; + // unsuccessful calls still allowed counter + TInt iNumberOfDelayedTrials; + }; // class CDelayMailboxCreationHelper #endif // C_PS_MRU_ADAPTER_H diff -r e7aa27f58ae1 -r e1b6206813b4 emailservices/psmruadapter/src/CPsMruAdapter.cpp --- a/emailservices/psmruadapter/src/CPsMruAdapter.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailservices/psmruadapter/src/CPsMruAdapter.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include #include // -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include "CPsMruAdapter.h" // #include // CleanupResetAndDestroy @@ -31,6 +31,8 @@ #define PRINT(x) +#include "emailtrace.h" + // ============================== MEMBER FUNCTIONS ============================ // Identifier for mailbox Uri @@ -45,57 +47,61 @@ // Two Phase Construction // ---------------------------------------------------------------------------- CPsMruAdapter* CPsMruAdapter::NewL( TAny* aPsDataPluginParameters ) - { - PRINT ( _L( "Enter CPsMruAdapter::NewL" ) ); - - // Get the PsData plugin parametrs - TPsDataPluginParams* params = - reinterpret_cast(aPsDataPluginParameters ); - CPsMruAdapter* self = new ( ELeave ) CPsMruAdapter(); - CleanupStack::PushL(self); - self->ConstructL( params->iDataStoreObserver, params->iStoreListObserver ); - CleanupStack::Pop( self ); - - PRINT ( _L( "End CPsMruAdapter::NewL" ) ); - - return self; - } + { + FUNC_LOG; + PRINT ( _L( "Enter CPsMruAdapter::NewL" ) ); + + // Get the PsData plugin parametrs + TPsDataPluginParams* params = + reinterpret_cast(aPsDataPluginParameters ); + CPsMruAdapter* self = new ( ELeave ) CPsMruAdapter(); + CleanupStack::PushL(self); + self->ConstructL( params->iDataStoreObserver, params->iStoreListObserver ); + CleanupStack::Pop( self ); + + PRINT ( _L( "End CPsMruAdapter::NewL" ) ); + + return self; + } // ---------------------------------------------------------------------------- // CPsMruAdapter::CPsMruAdapter // Two Phase Construction // ---------------------------------------------------------------------------- CPsMruAdapter::CPsMruAdapter() - { - PRINT ( _L( "Enter CPsMruAdapter::CPsMruAdapter" ) ); - PRINT ( _L( "End CPsMruAdapter::CPsMruAdapter" ) ); - } + { + FUNC_LOG; + PRINT ( _L( "Enter CPsMruAdapter::CPsMruAdapter" ) ); + iDelayMailboxCreationPtr = NULL; + PRINT ( _L( "End CPsMruAdapter::CPsMruAdapter" ) ); + } // ---------------------------------------------------------------------------- // CPsMruAdapter::ConstructL // Two Phase Construction // ---------------------------------------------------------------------------- void CPsMruAdapter::ConstructL( MDataStoreObserver* aObserverForDataStore, - MStoreListObserver* aStoreListObserver ) - { - PRINT ( _L( "Enter CPsMruAdapter::ConstructL" ) ); + MStoreListObserver* aStoreListObserver ) + { + FUNC_LOG; + PRINT ( _L( "Enter CPsMruAdapter::ConstructL" ) ); - // Mail client for FS Email framework - iMailClient = CFSMailClient::NewL(); + // Mail client for FS Email framework + iMailClient = CFSMailClient::NewL(); - // Register as observer for mail client, we'll need this to observe MRU list changes - // When i.e mail is sent - iMailClient->AddObserverL( *this ); + // Register as observer for mail client, we'll need this to observe MRU list changes + // When i.e mail is sent + iMailClient->AddObserverL( *this ); - // This updates the list of all the supported datastores - UpdateSupportedDataStoresList(); + // This updates the list of all the supported datastores + UpdateSupportedDataStoresList(); - // Store these for later use - iDataStoreObserver = aObserverForDataStore; - iStoreListObserver = aStoreListObserver; + // Store these for later use + iDataStoreObserver = aObserverForDataStore; + iStoreListObserver = aStoreListObserver; - PRINT ( _L( "End CPsMruAdapter::ConstructL" ) ); - } + PRINT ( _L( "End CPsMruAdapter::ConstructL" ) ); + } // ---------------------------------------------------------------------------- // CPsMruAdapter::~CPsMruAdapter @@ -103,6 +109,7 @@ // ---------------------------------------------------------------------------- CPsMruAdapter::~CPsMruAdapter() { + FUNC_LOG; PRINT ( _L( "Enter CPsMruAdapter::~CPsMruAdapter" ) ); iSupportedUris.ResetAndDestroy(); @@ -116,7 +123,15 @@ iMailClient->RemoveObserver( *this ); iMailClient->Close(); } - + if(iDelayMailboxCreationPtr) + { + iDelayMailboxCreationPtr->Deque(); + delete iDelayMailboxCreationPtr; + } + + iDelayedCreatedMailboxes.Reset(); + iDelayedCreatedMailboxes.Close(); + PRINT ( _L( "End CPsMruAdapter::~CPsMruAdapter" ) ); } @@ -126,13 +141,14 @@ // ---------------------------------------------------------------------------- void CPsMruAdapter::RequestForDataL( TDesC& aDataStoreURI ) { - PRINT ( _L( "Enter CPsMruAdapter::RequestForDataL" ) ); + FUNC_LOG; + PRINT ( _L( "Enter CPsMruAdapter::RequestForDataL" ) ); - // Add data to datastore, fill only requested one - FillDataStoreL( aDataStoreURI ); + // Add data to datastore, fill only requested one + FillDataStoreL( aDataStoreURI ); - PRINT ( _L( "Enter CPsMruAdapter::RequestForDataL" ) ); - } + PRINT ( _L( "Enter CPsMruAdapter::RequestForDataL" ) ); + } // ---------------------------------------------------------------------------- // CPsMruAdapter::GetSupportedDataStoresL @@ -140,378 +156,554 @@ // ---------------------------------------------------------------------------- void CPsMruAdapter::GetSupportedDataStoresL( - RPointerArray &aDataStoresURIs ) - { - for ( TInt i = 0; i < iSupportedUris.Count(); i++ ) - { - aDataStoresURIs.Append( iSupportedUris[i] ); - } - } + RPointerArray &aDataStoresURIs ) + { + FUNC_LOG; + for ( TInt i = 0; i < iSupportedUris.Count(); i++ ) + { + aDataStoresURIs.Append( iSupportedUris[i] ); + } + } // ---------------------------------------------------------------------------- // CPsMruAdapter::RequestForDataExtensionL // // ---------------------------------------------------------------------------- TAny* CPsMruAdapter::RequestForDataExtensionL(TInt /*aItemId*/) - { - // No extention required for this since we have and interger as itemId - // Simply return NULL - return NULL; - } + { + FUNC_LOG; + // No extention required for this since we have and interger as itemId + // Simply return NULL + return NULL; + } // ---------------------------------------------------------------------------- // CPsMruAdapter::UpdateSupportedDataStoresList // // ---------------------------------------------------------------------------- void CPsMruAdapter::UpdateSupportedDataStoresList() - { - // Mailboxes will be fetched to this array - RPointerArray mailBoxes; - - // List all mailboxes - TFSMailMsgId plugin; - iMailClient->ListMailBoxes( plugin, mailBoxes ); + { + FUNC_LOG; + // Mailboxes will be fetched to this array + RPointerArray mailBoxes; - iSupportedUris.ResetAndDestroy(); + // List all mailboxes + TFSMailMsgId plugin; + iMailClient->ListMailBoxes( plugin, mailBoxes ); + + iSupportedUris.ResetAndDestroy(); - // Add all mailboxes as data stores - for ( TInt i = 0; i < mailBoxes.Count(); i++ ) - { - // Get id of mailbox - TFSMailMsgId id = mailBoxes[i]->GetId(); + // Add all mailboxes as data stores + for ( TInt i = 0; i < mailBoxes.Count(); i++ ) + { + // Get id of mailbox + TFSMailMsgId id = mailBoxes[i]->GetId(); - // Convert it to string, this will be the unique identifier for this mailbox - HBufC* identifier = HBufC::New( KMaximumMailboxUriLength ); - if ( identifier && GetUriFromMailboxIdentifier( id, *identifier ) ) - { - // Add to supported Uris list - if ( iSupportedUris.Append( identifier ) == KErrNone ) - { - // Ownership of the string is successfully moved to the array - identifier = NULL; - } - } - delete identifier; - } + // Convert it to string, this will be the unique identifier for this mailbox + HBufC* identifier = HBufC::New( KMaximumMailboxUriLength ); + if ( identifier && GetUriFromMailboxIdentifier( id, *identifier ) ) + { + // Add to supported Uris list + if ( iSupportedUris.Append( identifier ) == KErrNone ) + { + // Ownership of the string is successfully moved to the array + identifier = NULL; + } + } + delete identifier; + } - // Release allocated memory - mailBoxes.ResetAndDestroy(); - } + // Release allocated memory + mailBoxes.ResetAndDestroy(); + } // ---------------------------------------------------------------------------- // CPsMruAdapter::FillDataStoreL // ---------------------------------------------------------------------------- TBool CPsMruAdapter::FillDataStoreL( TDesC& aDataStoreURI ) - { - TBool result = EFalse; + { + FUNC_LOG; + TBool result = EFalse; - TFSMailMsgId dataStoreId; + TFSMailMsgId dataStoreId; - if ( GetMailboxIdentifierFromUri( aDataStoreURI, dataStoreId ) ) - { - result = FillDataStoreL( dataStoreId, aDataStoreURI ); - } + if ( GetMailboxIdentifierFromUri( aDataStoreURI, dataStoreId ) ) + { + result = FillDataStoreL( dataStoreId, aDataStoreURI ); + } - return result; - } + return result; + } TBool CPsMruAdapter::FillDataStoreL( TFSMailMsgId& aId ) - { - TBool result = EFalse; + { + FUNC_LOG; + TBool result = EFalse; + + // Create Uri for this mailbox + HBufC* identifier = HBufC::NewLC( KMaximumMailboxUriLength ); + if ( GetUriFromMailboxIdentifier( aId, *identifier ) ) + { + result = FillDataStoreL( aId, *identifier ); + } + CleanupStack::PopAndDestroy( identifier ); + return result; + } - // Create Uri for this mailbox - HBufC* identifier = HBufC::NewLC( KMaximumMailboxUriLength ); - if ( GetUriFromMailboxIdentifier( aId, *identifier ) ) - { - result = FillDataStoreL( aId, *identifier ); - } - CleanupStack::PopAndDestroy( identifier ); - return result; - } +void CPsMruAdapter::AddMruEmailsL( MDesCArray* aMruList, TDesC& aDataStoreURI ) + { + FUNC_LOG; + TInt entryIndex = 0; + // Add all data to data store, the format is: + // index0: displayname + // index1: email + // index2: next displayname + // index3: next email + // etc.. + for ( int mruIndex = 0; mruIndex < aMruList->MdcaCount(); mruIndex += 2 ) + { + TPtrC displayName = aMruList->MdcaPoint( mruIndex ); + TPtrC emailAddress = aMruList->MdcaPoint( mruIndex + 1 ); + + CPsData* mruData = CPsData::NewL(); + CleanupStack::PushL(mruData); + mruData->SetId( entryIndex++ ); + + // Set the data + mruData->SetDataL( 0, displayName ); + mruData->SetDataL( 1, KNullDesC ); + mruData->SetDataL( 2, emailAddress ); + + iDataStoreObserver->AddData( aDataStoreURI, mruData ); + CleanupStack::Pop(mruData); // transferred ownership + } + } TBool CPsMruAdapter::FillDataStoreL( TFSMailMsgId& aId, TDesC& aDataStoreURI ) - { - TBool result = EFalse; - - // Mailboxes will be fetched to this array - RPointerArray mailBoxes; - CleanupResetAndDestroyPushL( mailBoxes ); - - // List all mailboxes - TFSMailMsgId plugin; - iMailClient->ListMailBoxes( plugin, mailBoxes ); - - // Find the requested mailbox - for ( TInt i = 0; i < mailBoxes.Count(); i++ ) - { - // Get id of mailbox - TFSMailMsgId id = mailBoxes[i]->GetId(); - - // Check that this is the requested mailbox - if ( id == aId ) - { - AddMailboxObserverL( aId ); - - // update the caching status as InProgress - iDataStoreObserver->UpdateCachingStatus( aDataStoreURI, - ECachingInProgress ); - - // Update datastore contents, first reset - iDataStoreObserver->RemoveAll( aDataStoreURI ); - - // Get MRU list for this mailbox - MDesCArray* mruList = mailBoxes[i]->ListMrusL(); + { + FUNC_LOG; + TBool result = EFalse; +// code was simplified not to trace all mailboxes +// function has trap in Event() -case> TFSEventNewMailbox and in DeleayedMailboxCreationEventL() +// should not leave when new mailbox only when new mail address + CFSMailBox *mailBox = iMailClient->GetMailBoxByUidL(aId); + if (mailBox) + { + AddMailboxObserverL( aId ); + + // Get MRU list for this mailbox + MDesCArray* mruList = mailBox->ListMrusL(); + mailBox = NULL; + + // update the caching status as InProgress + iDataStoreObserver->UpdateCachingStatus( aDataStoreURI, + ECachingInProgress ); - if ( mruList ) - { - TInt entryIndex = 0; - - // Add all data to data store, the format is: - // index0: displayname - // index1: email - // index2: next displayname - // index3: next email - // etc.. - for ( int mruIndex = 0; mruIndex < mruList->MdcaCount(); mruIndex += 2 ) - { - TPtrC displayName = mruList->MdcaPoint( mruIndex ); - TPtrC emailAddress = mruList->MdcaPoint( mruIndex + 1 ); - - CPsData* mruData = CPsData::NewL(); - mruData->SetId( entryIndex++ ); - - // Set the data - mruData->SetDataL( 0, displayName ); - mruData->SetDataL( 1, KNullDesC ); - mruData->SetDataL( 2, emailAddress ); - - iDataStoreObserver->AddData( aDataStoreURI, mruData ); - } - - delete mruList; - } - // update the caching status as Complete - iDataStoreObserver->UpdateCachingStatus( aDataStoreURI, - ECachingComplete ); + // Update datastore contents, first reset + iDataStoreObserver->RemoveAll( aDataStoreURI ); - result = ETrue; - break; - } - } - - CleanupStack::PopAndDestroy( &mailBoxes ); - return result; - } + TInt trap_err; // for trap macro + if ( mruList ) + { + // trap the error to enable returning status back + TRAP(trap_err, AddMruEmailsL( mruList, aDataStoreURI ) ); + delete mruList; + } + // update the caching status as Complete + iDataStoreObserver->UpdateCachingStatus( aDataStoreURI, + ECachingComplete ); + if ( trap_err != KErrNone ) // check for error leave code + { + User::Leave(trap_err); + } + result = ETrue; + } // if (mailBox) + return result; + } // ---------------------------------------------------------------------------- // CPsContactDataAdapter::IsDataStoresSupportedL // // ---------------------------------------------------------------------------- TBool CPsMruAdapter::IsDataStoresSupportedL( TDesC& aDataStoreURI ) - { - for ( TInt i = 0; i < iSupportedUris.Count(); i++ ) - { - if ( iSupportedUris[i]->Compare( aDataStoreURI ) == 0 ) - return ETrue; - } - - return EFalse; - } + { + FUNC_LOG; + for ( TInt i = 0; i < iSupportedUris.Count(); i++ ) + { + if ( iSupportedUris[i]->Compare( aDataStoreURI ) == 0 ) + return ETrue; + } + return EFalse; + } // ---------------------------------------------------------------------------- // CPsContactDataAdapter::GetSupportedDataFieldsL // // ---------------------------------------------------------------------------- void CPsMruAdapter::GetSupportedDataFieldsL( RArray& aDataFields ) - { - aDataFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME ); - aDataFields.Append( R_VPBK_FIELD_TYPE_LASTNAME ); - aDataFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN ); - } + { + FUNC_LOG; + aDataFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME ); + aDataFields.Append( R_VPBK_FIELD_TYPE_LASTNAME ); + aDataFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN ); + } TBool CPsMruAdapter::GetMailboxIdentifierFromUri( TDesC& aUri, TFSMailMsgId& aId ) - { - // Find first separator in reverse order - TInt lastSeparator = aUri.LocateReverseF( KDefaultMailBoxURISeparator ); - if ( lastSeparator == KErrNotFound ) - return EFalse; + { + FUNC_LOG; + // Find first separator in reverse order + TInt lastSeparator = aUri.LocateReverseF( KDefaultMailBoxURISeparator ); + if ( lastSeparator == KErrNotFound ) + return EFalse; - // This is where plugin id string starts - TInt pluginIdStartPosition = KDefaultMailBoxURI().Length(); - TInt mailboxIdStartPosition = lastSeparator + 1; + // This is where plugin id string starts + TInt pluginIdStartPosition = KDefaultMailBoxURI().Length(); + TInt mailboxIdStartPosition = lastSeparator + 1; - // It cannot be further than mailbox id - if ( pluginIdStartPosition >= mailboxIdStartPosition ) - return EFalse; + // It cannot be further than mailbox id + if ( pluginIdStartPosition >= mailboxIdStartPosition ) + return EFalse; - // Use TLex to convert string to integer - TLex pluginIdConverter( aUri.Mid( pluginIdStartPosition, - mailboxIdStartPosition - pluginIdStartPosition - 1 ) ); + // Use TLex to convert string to integer + TLex pluginIdConverter( aUri.Mid( pluginIdStartPosition, + mailboxIdStartPosition - pluginIdStartPosition - 1 ) ); - // Use TLex to convert string to integer - TLex mailboxIdConverter( aUri.Mid( mailboxIdStartPosition, aUri.Length() - - mailboxIdStartPosition ) ); + // Use TLex to convert string to integer + TLex mailboxIdConverter( aUri.Mid( mailboxIdStartPosition, aUri.Length() + - mailboxIdStartPosition ) ); - TInt pluginId; - TInt mailboxId; + TInt pluginId; + TInt mailboxId; - // Get plugin ID - if ( pluginIdConverter.Val( pluginId ) != KErrNone) - return EFalse; + // Get plugin ID + if ( pluginIdConverter.Val( pluginId ) != KErrNone) + return EFalse; - // Get mailbox ID - if ( mailboxIdConverter.Val( mailboxId ) != KErrNone) - return EFalse; + // Get mailbox ID + if ( mailboxIdConverter.Val( mailboxId ) != KErrNone) + return EFalse; - // Store and we're ready - aId.SetPluginId( TUid::Uid( pluginId ) ); - aId.SetId( mailboxId ); + // Store and we're ready + aId.SetPluginId( TUid::Uid( pluginId ) ); + aId.SetId( mailboxId ); - return ETrue; - } + return ETrue; + } TBool CPsMruAdapter::GetUriFromMailboxIdentifier( TFSMailMsgId& aId, HBufC& aUri ) - { - // Add the uri identifier - aUri.Des().Copy( KDefaultMailBoxURI ); - // Add plugin ID - aUri.Des().AppendNum( aId.PluginId().iUid ); - // Add separator - aUri.Des().Append( KDefaultMailBoxURISeparator ); - // Add mailbox id - aUri.Des().AppendNum( aId.Id() ); - - return true; - } + { + FUNC_LOG; + // Add the uri identifier + aUri.Des().Copy( KDefaultMailBoxURI ); + // Add plugin ID + aUri.Des().AppendNum( aId.PluginId().iUid ); + // Add separator + aUri.Des().Append( KDefaultMailBoxURISeparator ); + // Add mailbox id + aUri.Des().AppendNum( aId.Id() ); + + return true; + } void CPsMruAdapter::EventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox, - TAny* /*aParam1*/, TAny* aParam2, TAny* /*aParam3*/ ) - { - switch ( aEvent ) - { - case TFSEventMailMoved: - case TFSEventMailCopied: - case TFSEventNewMail: - { - // Check the new parent folder id for this message - // For all these events, param2 indicates the new parent folder - TFSMailMsgId* parentFolderId = - static_cast< TFSMailMsgId* >( aParam2 ); - if ( parentFolderId ) - { - // Get the parent folder object - CFSMailFolder* parentFolder = iMailClient->GetFolderByUidL( - aMailbox, *parentFolderId ); - if ( parentFolder ) - { - CleanupStack::PushL( parentFolder ); + TAny* /*aParam1*/, TAny* aParam2, TAny* /*aParam3*/ ) + { + FUNC_LOG; + switch ( aEvent ) + { + case TFSEventMailMoved: + case TFSEventMailCopied: + case TFSEventNewMail: + { + // Check the new parent folder id for this message + // For all these events, param2 indicates the new parent folder + TFSMailMsgId* parentFolderId = + static_cast< TFSMailMsgId* >( aParam2 ); + if ( parentFolderId ) + { + // Get the parent folder object + CFSMailFolder* parentFolder = iMailClient->GetFolderByUidL( + aMailbox, *parentFolderId ); + if ( parentFolder ) + { + CleanupStack::PushL( parentFolder ); + + // If it's sent/outbox folder, + // we'll consider that as a new message being sent + // and therefore we'll update the MRU list here + if ( ( parentFolder->GetFolderType() == EFSSentFolder ) || + ( parentFolder->GetFolderType() == EFSOutbox ) ) + { + FillDataStoreL( aMailbox ); + } + CleanupStack::PopAndDestroy( parentFolder ); + } + } + } + break; + + case TFSEventNewMailbox: + { + CFSMailBox *mailboxPtr(NULL); + // if mailbox is not ready it may leave here + TRAPD(trap_err, mailboxPtr = iMailClient->GetMailBoxByUidL( aMailbox )); + if ( trap_err != KErrNone ) + { + mailboxPtr = NULL; + } + if (NULL == mailboxPtr) // mailbox still does not exist + { + DeleayMailboxCreationEventL( aMailbox ); // start timer to postpone creation + break; + } + mailboxPtr = NULL; + HBufC* identifier = HBufC::NewLC( KMaximumMailboxUriLength ); // new string ident + if ( GetUriFromMailboxIdentifier( aMailbox, *identifier ) ) + { + // Add to supported Uri list + iSupportedUris.AppendL( identifier ); - // If it's sent/outbox folder, - // we'll consider that as a new message being sent - // and therefore we'll update the MRU list here - if ( ( parentFolder->GetFolderType() == EFSSentFolder ) || - ( parentFolder->GetFolderType() == EFSOutbox ) ) - { - FillDataStoreL( aMailbox ); - } - CleanupStack::PopAndDestroy( parentFolder ); - } - } - } - break; - - case TFSEventNewMailbox: - { - HBufC* identifier = HBufC::NewLC( KMaximumMailboxUriLength ); - if ( GetUriFromMailboxIdentifier( aMailbox, *identifier ) ) - { - // Add to supported Uri list - iSupportedUris.AppendL( identifier ); + // Add new data store to cache + iStoreListObserver->AddDataStore( *identifier ); + + // Add all data to data store + // FillDataStoreL( *identifier ); + // FillDataStoreL removed - called by AddDataStore through RequestForDataL callback - // Add new data store to cache - iStoreListObserver->AddDataStore( *identifier ); + // In case there is a problem with transferring strings to - should be obsolete + AddMailboxObserverL( aMailbox ); // will be added by FillDataStoreL - // Add all data to data store - FillDataStoreL( *identifier ); + CleanupStack::Pop( identifier ); + } + else + { + CleanupStack::PopAndDestroy( identifier ); + } + } + break; - CleanupStack::Pop( identifier ); - } - else - { - CleanupStack::PopAndDestroy( identifier ); - } - } - break; + case TFSEventMailboxDeleted: + { + HBufC* identifier = HBufC::NewL( KMaximumMailboxUriLength ); + if ( GetUriFromMailboxIdentifier( aMailbox, *identifier ) ) + { + RemoveMailboxObserver( aMailbox ); + + // Remove data store from cache + iStoreListObserver->RemoveDataStore( *identifier ); - case TFSEventMailboxDeleted: - { - HBufC* identifier = HBufC::NewL( KMaximumMailboxUriLength ); - if ( GetUriFromMailboxIdentifier( aMailbox, *identifier ) ) - { - RemoveMailboxObserver( aMailbox ); - - // Remove data store from cache - iStoreListObserver->RemoveDataStore( *identifier ); - - // Remove from supported Uri list - for ( TInt i = 0; i < iSupportedUris.Count(); i++ ) - { - if ( iSupportedUris[i]->Compare( *identifier ) == 0 ) - { - delete iSupportedUris[i]; - iSupportedUris.Remove( i ); - break; - } - } - } - delete identifier; - } - break; - } - } + // Remove from supported Uri list + for ( TInt i = 0; i < iSupportedUris.Count(); i++ ) + { + if ( iSupportedUris[i]->Compare( *identifier ) == 0 ) + { + delete iSupportedUris[i]; + iSupportedUris.Remove( i ); + break; + } + } + } + delete identifier; + } + break; + } + } TBool CPsMruAdapter::AddMailboxObserverL( TFSMailMsgId& aId ) - { - for( TInt index = 0; index < iObservedMailboxes.Count(); index++ ) - { - if( iObservedMailboxes[index] == aId ) - { - // Already observing - return EFalse; - } - } - - iMailClient->SubscribeMailboxEventsL( aId, *this ); - iObservedMailboxes.Append( aId ); - return ETrue; - } + { + FUNC_LOG; + for( TInt index = 0; index < iObservedMailboxes.Count(); index++ ) + { + if( iObservedMailboxes[index] == aId ) + { + // Already observing + return EFalse; + } + } + + iMailClient->SubscribeMailboxEventsL( aId, *this ); + iObservedMailboxes.Append( aId ); + return ETrue; + } TBool CPsMruAdapter::RemoveMailboxObserver( TFSMailMsgId& aId ) - { - for( TInt index = 0; index < iObservedMailboxes.Count(); index++ ) - { - if( iObservedMailboxes[index] == aId ) - { - iMailClient->UnsubscribeMailboxEvents( aId, *this ); - iObservedMailboxes.Remove( index ); - return ETrue; - } - } - - return EFalse; - } + { + FUNC_LOG; + for( TInt index = 0; index < iObservedMailboxes.Count(); index++ ) + { + if( iObservedMailboxes[index] == aId ) + { + iMailClient->UnsubscribeMailboxEvents( aId, *this ); + iObservedMailboxes.Remove( index ); + return ETrue; + } + } + + return EFalse; + } void CPsMruAdapter::RemoveAllMailboxObservers() + { + FUNC_LOG; + for( TInt index = 0; index < iObservedMailboxes.Count(); index++ ) + { + iMailClient->UnsubscribeMailboxEvents( iObservedMailboxes[index], *this ); + } + + iObservedMailboxes.Reset(); + } + +/** + * If problem with NewMailbox this function will be called + * by CDelayMailboxCreationHelper timer to try it after some delay + */ +TBool CPsMruAdapter::DeleayedMailboxCreationEventL() { - for( TInt index = 0; index < iObservedMailboxes.Count(); index++ ) - { - iMailClient->UnsubscribeMailboxEvents( iObservedMailboxes[index], *this ); - } + FUNC_LOG; + for ( int i = iDelayedCreatedMailboxes.Count()-1; i>=0; i-- ) + { + CFSMailBox *mailboxPtr(NULL); + // if mailbox is not ready it may leave there + TRAPD(trap_err, mailboxPtr = iMailClient->GetMailBoxByUidL( iDelayedCreatedMailboxes[i] )); + if ( trap_err != KErrNone ) + { + mailboxPtr = NULL; + } + if ( mailboxPtr ) + { + HBufC* identifier = HBufC::NewLC( KMaximumMailboxUriLength ); // new string ident + if ( GetUriFromMailboxIdentifier( iDelayedCreatedMailboxes[i], *identifier ) ) + { + + // Add to supported Uri list + iSupportedUris.AppendL( identifier ); + + // Add new data store to cache + iStoreListObserver->AddDataStore( *identifier ); + + // Add all data to data store + // removed because this is called by AddDataStore through RequestForDataL callback + // FillDataStoreL( *identifier ); + + // In case there is a problem with transferring strings to - should be obsolete + AddMailboxObserverL( iDelayedCreatedMailboxes[i] ); // will be added by FillDataStoreL + + CleanupStack::Pop( identifier ); + iDelayedCreatedMailboxes.Remove( i ); + } + else + { + CleanupStack::PopAndDestroy( identifier ); + } + } + } + return ( 0 == iDelayedCreatedMailboxes.Count() ); + } + +/** + * If problem with NewMailbox this function will use + * CDelayMailboxCreationHelper to try it after some delay + */ +void CPsMruAdapter::DeleayMailboxCreationEventL( TFSMailMsgId &aMailbox ) + { + FUNC_LOG; + if ( NULL == iDelayMailboxCreationPtr ) + { + iDelayMailboxCreationPtr = CDelayMailboxCreationHelper::NewL( this ); + } + iDelayedCreatedMailboxes.Append( aMailbox ); + iDelayMailboxCreationPtr->StartDelayedCall(); + } + +// --------------------------------------------------------------------------------------------------- +// class CDelayMailboxCreationHelper : public CTimer +// --------------------------------------------------------------------------------------------------- + +// static construction leaving on the stack +CDelayMailboxCreationHelper* CDelayMailboxCreationHelper::NewLC( CPsMruAdapter *aPsMruAdapterPtr ) + { + FUNC_LOG; + CDelayMailboxCreationHelper* self = new ( ELeave ) CDelayMailboxCreationHelper( aPsMruAdapterPtr ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } - iObservedMailboxes.Reset(); - } +// static construction leaving +CDelayMailboxCreationHelper* CDelayMailboxCreationHelper::NewL( CPsMruAdapter *aPsMruAdapterPtr ) + { + FUNC_LOG; + CDelayMailboxCreationHelper* self = CDelayMailboxCreationHelper::NewLC( aPsMruAdapterPtr ); + CleanupStack::Pop( self ); + return self; + } + +// used by MruAdapter when delayed datasource adding is needed +void CDelayMailboxCreationHelper::StartDelayedCall() + { + FUNC_LOG; + if( IsActive() ) // don't call again in case the timer rq is pending + { + Cancel(); + } + iNumberOfDelayedTrials = KNumberOfDelayedTrials; + After( KDelayToRunAddMailbox ); // CTimer::After contains SetActive() + } +// Limited unsuccesful call repeating +void CDelayMailboxCreationHelper::RunL() + { + FUNC_LOG; + iNumberOfDelayedTrials --; + User::LeaveIfError( iStatus.Int() ); + TBool Handled = iPsMruAdapterPtr->DeleayedMailboxCreationEventL(); + if (( Handled ) || ( 0 >= iNumberOfDelayedTrials )) + { // no need to call again + Cancel(); + } + else + { // wait once more +// SetActive is called by After + After( KDelayToRunAddMailbox ); + } + } + +// when leave from RunL, if err handled return KErrNone +TInt CDelayMailboxCreationHelper::RunError( TInt aError ) + { + FUNC_LOG; + if ( KErrNone != aError ) + { + Cancel(); // stop pending requiest + } + return KErrNone; //not desired to panic the thread in case of error returned + } + +// 2nd phase of construction +void CDelayMailboxCreationHelper::ConstructL() + { + FUNC_LOG; + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + } + +// c-tor +CDelayMailboxCreationHelper::CDelayMailboxCreationHelper( + CPsMruAdapter *aPsMruAdapterPtr ) + : CTimer( EPriorityStandard ) //possible also EPriorityLow, EPriorityIdle + , iPsMruAdapterPtr ( aPsMruAdapterPtr ) // not ownink ptr + , iNumberOfDelayedTrials ( KNumberOfDelayedTrials ) //limited repeating num. + { + FUNC_LOG; + } + +// d-tor +CDelayMailboxCreationHelper::~CDelayMailboxCreationHelper() + { + FUNC_LOG; + iPsMruAdapterPtr = NULL; // not owning interface ptr + Cancel(); // stop pending request + Deque(); // remove from CActiveScheduler + } // End of file - - diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/data/FreestyleEmailUi.rss --- a/emailuis/emailui/data/FreestyleEmailUi.rss Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/data/FreestyleEmailUi.rss Fri Feb 19 22:37:30 2010 +0200 @@ -1116,6 +1116,8 @@ RESOURCE TBUF r_freestyle_email_ui_folder_list_sent { buf=qtn_fse_folder_list_sent; } RESOURCE TBUF r_freestyle_email_ui_folder_list_deleted { buf=qtn_fse_folder_list_deleted_items; } +RESOURCE TBUF r_freestyle_email_ui_folder_list_folder_with_unread { buf=qtn_fse_folder_list_folder_with_unread; } + RESOURCE TBUF r_freestyle_email_ui_dropdown_list_inbox { buf=qtn_fse_message_list_inbox; } RESOURCE TBUF r_freestyle_email_ui_dropdown_list_outbox { buf=qtn_fse_message_list_outbox; } RESOURCE TBUF r_freestyle_email_ui_dropdown_list_drafts { buf=qtn_fse_message_list_draft; } @@ -1297,6 +1299,7 @@ MENU_ITEM { command = EFsEmailUiCmdActionsForward; txt = qtn_fse_message_list_options_forward; }, MENU_ITEM { command = EFsEmailUiCmdMailActions; txt = qtn_cmail_message_list_options_actions; cascade=r_fsemailui_maillist_submenu_mail_actions;}, MENU_ITEM { command = EFsEmailUiCmdSync; txt = qtn_cmail_message_list_options_send_receive; }, + MENU_ITEM { command = EFsEmailUiCmdCancelSync; txt = qtn_fse_launcher_options_cancel_sync; }, MENU_ITEM { command = EFsEmailUiCmdSubMenuMark; txt = qtn_fse_message_list_options_mark; cascade=r_fsemailui_maillist_submenu_mark;}, MENU_ITEM { command = EFsEmailUiCmdSubMenuUnmark; txt = qtn_fse_message_list_options_unmark; cascade=r_fsemailui_maillist_submenu_unmark;}, MENU_ITEM { command = EFsEmailUiCmdSettings; txt = qtn_fse_message_list_options_settings; }, @@ -2856,6 +2859,11 @@ }, STYLUS_POPUP_MENU_ITEM { + txt = qtn_fse_viewer_options_contact_details; // contact details + command = EFsEmailUiCmdActionsContactDetails; + }, + STYLUS_POPUP_MENU_ITEM + { txt = qtn_cmail_popup_search_server; // Search from server command = EFsEmailUiCmdActionsRemoteLookup; }, diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/data/html/email_rtl.html --- a/emailuis/emailui/data/html/email_rtl.html Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/data/html/email_rtl.html Fri Feb 19 22:37:30 2010 +0200 @@ -5,7 +5,7 @@ { var bodyFrame = document.getElementById("body_frame"); bodyFrame.contentWindow.document.body.dir = "rtl"; - bodyFrame.contentWindow.document.body.align = "left" + bodyFrame.contentWindow.document.body.align = "right" } onload=setEmailBodyDirection; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/group/FreestyleEmailUi.mmp --- a/emailuis/emailui/group/FreestyleEmailUi.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/group/FreestyleEmailUi.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -218,4 +218,4 @@ LIBRARY MsgEditorModel.lib LIBRARY touchfeedback.lib - +LIBRARY ccaclient.lib diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/group/bld.inf --- a/emailuis/emailui/group/bld.inf Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -91,14 +91,14 @@ ../sis/commonemailstub.sis /epoc32/data/z/system/install/commonemailstub.sis /* Plugin settings exports */ -../inc/ESMailSettingsPlugin.h |../../../inc/ESMailSettingsPlugin.h -../inc/ESMailSettingsPlugin.inl |../../../inc/ESMailSettingsPlugin.inl -../inc/ESMailSettingsPluginUids.hrh |../../../inc/ESMailSettingsPluginUids.hrh/* Required by MCE and Integration MTM*/ +../inc/esmailsettingsplugin.h |../../../inc/esmailsettingsplugin.h +../inc/esmailsettingsplugin.inl |../../../inc/esmailsettingsplugin.inl +../inc/esmailsettingspluginuids.hrh |../../../inc/esmailsettingspluginuids.hrh/* Required by MCE and Integration MTM*/ ../inc/FreestyleEmailUiConstants.h |../../../inc/FreestyleEmailUiConstants.h /* Central Repository for White Label Branding */ -../inc/FreestyleEmailCenRepKeys.h |../../../inc/FreestyleEmailCenRepKeys.h +../inc/freestyleemailcenrepkeys.h |../../../inc/freestyleemailcenrepkeys.h // Generic configuration interface for component cenrep settings ../conf/freestyleemailui.confml APP_LAYER_CONFML(freestyleemailui.confml) diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/ESMailSettingsPlugin.h --- a/emailuis/emailui/inc/ESMailSettingsPlugin.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/ESMailSettingsPlugin.h Fri Feb 19 22:37:30 2010 +0200 @@ -158,6 +158,6 @@ TUid iDtor_ID_Key; }; -#include "ESMailSettingsPlugin.inl" +#include "esmailsettingsplugin.inl" #endif /*_ESMAILSESETTINGSPLUGIN_H_*/ diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailDownloadInformationMediator.h --- a/emailuis/emailui/inc/FreestyleEmailDownloadInformationMediator.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailDownloadInformationMediator.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ // INCLUDES #include // -#include "MFSMailRequestObserver.h" +#include "mfsmailrequestobserver.h" // #include #include "FreestyleEmailUiConstants.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiAknStatusIndicator.h --- a/emailuis/emailui/inc/FreestyleEmailUiAknStatusIndicator.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiAknStatusIndicator.h Fri Feb 19 22:37:30 2010 +0200 @@ -1,10 +1,16 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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 "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: +* */ diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiAppui.h --- a/emailuis/emailui/inc/FreestyleEmailUiAppui.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiAppui.h Fri Feb 19 22:37:30 2010 +0200 @@ -34,14 +34,14 @@ #include #include // For flip change status. // -#include "MFSMailRequestObserver.h" -#include "MFSMailEventObserver.h" +#include "mfsmailrequestobserver.h" +#include "mfsmaileventobserver.h" #include "FreestyleEmailUiUtilities.h" // #include #include #include -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "cmailcustomstatuspaneindicators.h" // INTERNAL INCLUDES diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiConstants.h --- a/emailuis/emailui/inc/FreestyleEmailUiConstants.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiConstants.h Fri Feb 19 22:37:30 2010 +0200 @@ -25,7 +25,7 @@ #define PBKX_DEBUG_LEVEL 3 // Print errors, warnings, traces, infos, details // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiContactHandler.h --- a/emailuis/emailui/inc/FreestyleEmailUiContactHandler.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiContactHandler.h Fri Feb 19 22:37:30 2010 +0200 @@ -23,6 +23,10 @@ #include #include #include + +// CCA Launcher view +#include + // #include "cpbkxremotecontactlookupserviceuicontext.h" // @@ -95,7 +99,8 @@ public MFSEmailUiClsListsObserver, public MVPbkSingleContactOperationObserver, public MVPbkContactStoreListObserver, - public MAiwNotifyCallback + public MAiwNotifyCallback, + public MCCAObserver { public: @@ -339,6 +344,9 @@ void ClearObservers(); +// from MCCAObserver + void CCASimpleNotifyL( TNotifyType aType, TInt aReason ); + private: CFSEmailUiContactHandler( RFs& aSession ); @@ -446,10 +454,11 @@ /// Flag for indicating that caching error was received TBool iCachingInProgressError; - // video call // Flag for making video call TBool iVideoCall; - // + + // connection to CCMA launcher + MCCAConnection* iConnection; }; #endif /*FREESTYLEEMAILUICONTACTHANDLER_H_*/ diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiControlBarCallback.h --- a/emailuis/emailui/inc/FreestyleEmailUiControlBarCallback.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiControlBarCallback.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #define M_FREESTYLEEMAILUICONTROLBARCALLBACK_H // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // // FORWARD DECLARATIONS diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiGlobalSettingsListView.h --- a/emailuis/emailui/inc/FreestyleEmailUiGlobalSettingsListView.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiGlobalSettingsListView.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ // SYSTEM INCLUDES // -#include "CFSMailCommon.h" // for email constants +#include "cfsmailcommon.h" // for email constants // // LOCAL INCLUDES diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h --- a/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,8 +22,8 @@ #include -#include -#include +#include +#include #include "FreestyleEmailDownloadInformationMediator.h" #include "OverlayControl.h" @@ -135,12 +135,15 @@ // Copies given file to temporary HTML folder and returns an open file // handle to the created copy. // - void CopyFileToHtmlFileL( RFile& aFile, const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart ); + void CopyToHtmlFileL( CFSMailMessagePart& aHtmlBodyPart, const TDesC& aFileName ); + void ConvertToHtmlFileL( CFSMailMessagePart& aTextBodyPart, const TDesC& aHtmlFileName ); + // Reads given file content to buffer and return pointer to it HBufC8* ReadContentFromFileLC( RFile& aFile ); // Writes buffer to given file void WriteContentToFileL( const TDesC8& aContent, const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart ); + void PrepareBodyHtmlL( const TDesC& aFileName ); void WriteEmptyBodyHtmlL( const TDesC& aFileName ); // @@ -166,14 +169,11 @@ void CopyHTMLResourceL(); // Ensure all resource files (eg. images) required by HTML display to be ready in C:\[private]\HtmlFile void EnsureHTMLResourceL(); - void ConvertPlainTextToHTML(CFSMailMessagePart* aTextBodyPart, RFile htmlFile); - void CopyFileToHtmlFileL( const TDesC8& aBuffer, - const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart ); void ConvertToHTML( const TDesC8& aContent, const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart ); HBufC8* GetCharacterSetL( CFSMailMessagePart& aHtmlBodyPart ); TBool IsMessageBodyURL(const TDesC& aUrl); - void CreateHyperlinksFromUrlsL( CBufBase& aSource ); + void CreateHyperlinksFromUrlsL( CBufBase& aSource ); //Returns ETrue of clicking on a link requires a browser to be launched TBool NeedToLaunchBrowserL( const TDesC& aUrl ); //Launch the browser as a standalone app diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h --- a/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #define __FREESTYLEEMAILUI_HTML_VIEWER_VIEW_H__ #include -#include "MFSMailRequestObserver.h" +#include "mfsmailrequestobserver.h" #include "mesmricalviewercallback.h" #include "mesmricalviewerobserver.h" #include "FreestyleEmailUiViewBase.h" @@ -263,6 +263,9 @@ void OpenLinkInBrowserL( const TDesC& aUrl) const; void SaveWebAddressToFavouritesL( const TDesC& aUrl ) const; void SetScrollPosition(TInt aPosition); + + void CheckMessageBodyL( CFSMailMessage& aMessage, TBool& aMessageBodyStructurePresent, TBool& aMessageBodyContentPresent); + private: // Constructors void ConstructL(); diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiLauncherGridModel.h --- a/emailuis/emailui/inc/FreestyleEmailUiLauncherGridModel.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiLauncherGridModel.h Fri Feb 19 22:37:30 2010 +0200 @@ -24,7 +24,7 @@ #include // #include "FSEmailLauncherItem.h" -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" enum TItemType diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiListModel.h --- a/emailuis/emailui/inc/FreestyleEmailUiListModel.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiListModel.h Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include // -#include "CFSMailMessage.h" +#include "cfsmailmessage.h" // // LIST ITEM MODEL DEFINITION diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h Fri Feb 19 22:37:30 2010 +0200 @@ -25,8 +25,8 @@ // #include "fscontrolbarobserver.h" #include "fstreelistobserver.h" -#include "CFSMailCommon.h" -#include "MFSMailEventObserver.h" +#include "cfsmailcommon.h" +#include "mfsmaileventobserver.h" #include "fsccontactactionmenudefines.h" // #include "FSEmailBuildFlags.h" @@ -287,7 +287,7 @@ void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ); void HandleDynamicVariantSwitchOnBackgroundL( CFsEmailUiViewBase::TDynamicSwitchType aType ); // Handle foregroundevent - void HandleForegroundEventL(); + void HandleForegroundEventL( TBool aForeground ); // Sets softkeys void SetViewSoftkeysL( TInt aResourceId ); void SetMskL(); @@ -785,6 +785,8 @@ TBool iConsumeStdKeyYes_KeyUp; CMailListModelUpdater* iMailListModelUpdater; TBool iForceRefresh; + // true if message viewer/editor is open to disable background list updates + TBool iMailOpened; }; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiMailViewerVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiMailViewerVisualiser.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiMailViewerVisualiser.h Fri Feb 19 22:37:30 2010 +0200 @@ -30,7 +30,7 @@ #include // // -#include "MFSMailRequestObserver.h" +#include "mfsmailrequestobserver.h" #include "mesmricalviewercallback.h" #include "mesmricalviewerobserver.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiMsgDetailsVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiMsgDetailsVisualiser.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiMsgDetailsVisualiser.h Fri Feb 19 22:37:30 2010 +0200 @@ -33,6 +33,8 @@ #include "FreestyleEmailUiConstants.h" #include "FreestyleEmailUiContactHandlerObserver.h" +#include "mfsmailrequestobserver.h" +#include // forward declarations class CFSEmailUiMsgDetailsControl; class CFSEmailUiMsgDetailsModel; @@ -50,12 +52,17 @@ class CFsTreePlainOneLineNodeVisualizer; class CFsTreePlainOneLineItemVisualizer; class CFsTreePlainTwoLineItemVisualizer; +class MFSMailRequestObserver; // +class MProgressDialogCallback; // +class CAknWaitDialog; // // Touch class CFSEmailUiMsgDetailsVisualiser : public CFsEmailUiViewBase, public MFSEmailUiContactHandlerObserver, public MFsTreeListObserver, - public MFsActionMenuPositionGiver + public MFsActionMenuPositionGiver, + public MFSMailRequestObserver, + public MProgressDialogCallback // { @@ -119,6 +126,45 @@ TPoint ActionMenuPosition(); // + // +public: + /** + * MFSMailRequestObserver interface implementation + */ + void RequestResponseL( TFSProgress aEvent, TInt aRequestId ); + + /** + * MProgressDialogCallback interface implementation + */ + void DialogDismissedL( TInt aButtonId); + +private: + /// data related to fetching message structure + TInt iCurrentStructureFetchRequestId; + TBool iFetchingMessageStructure; + TBool iAsyncProcessComplete; + TInt iWaitNoteId; + /// Wait note stuff + CAknWaitDialog* iWaitDialog; + TBool iDialogNotDismissed; + + /** + * Update our message pointer and saves its status + */ + void UpdateMessagePtrL( TFSMailMsgId aNewMailboxId, + TFSMailMsgId aNewFolderId, + TFSMailMsgId aNewMessageId ); + + /** + * Fetching the Message Structure. It is necessary for POP protocol in order to read recipients + */ + void StartFetchingMessageStructureL( CFSMailMessage* aMsg ); + + /** + * Cancel fetching of the message structureCancel fetching of the message structure + */ + void CancelFetching(); + // // Toolbar private: // from diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h --- a/emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,8 +22,8 @@ #include // -#include "CFSMailCommon.h" -#include "MFSMailBoxSearchObserver.h" +#include "cfsmailcommon.h" +#include "mfsmailboxsearchobserver.h" #include "fstreevisualizerobserver.h" #include "fstreelistobserver.h" #include "fsccontactactionmenudefines.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiSettingsList.h --- a/emailuis/emailui/inc/FreestyleEmailUiSettingsList.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiSettingsList.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ // SYSTEM INCLUDES #include #include -#include "MFSMailRequestObserver.h" +#include "mfsmailrequestobserver.h" #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiUtilities.h --- a/emailuis/emailui/inc/FreestyleEmailUiUtilities.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiUtilities.h Fri Feb 19 22:37:30 2010 +0200 @@ -231,6 +231,7 @@ // Set new email message icon on/off static void ToggleEmailIconL( TBool aIconOn ); + static void ToggleEmailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox ); static HBufC* DateTextFromMsgLC( const CFSMailMessage* aMessage, TBool aAddYearNumer = ETrue ); static HBufC* TimeTextFromMsgLC( const CFSMailMessage* aMessage ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiViewBase.h --- a/emailuis/emailui/inc/FreestyleEmailUiViewBase.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiViewBase.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,7 @@ #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // // Toolbar #include "akntoolbarobserver.h" @@ -123,7 +123,7 @@ * Inherited classes may override this to react to FsEmail application * being brougt to foreground while that particular view is active. */ - virtual void HandleForegroundEventL(); + virtual void HandleForegroundEventL( TBool aForeground ); /** * Inherited classes should override this instead of DoDeactivate() diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleEmailUiWizardObserver.h --- a/emailuis/emailui/inc/FreestyleEmailUiWizardObserver.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleEmailUiWizardObserver.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,7 @@ // INCLUDES #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleMessageHeaderHTML.h --- a/emailuis/emailui/inc/FreestyleMessageHeaderHTML.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleMessageHeaderHTML.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,8 +21,8 @@ #include #include -#include "CFSMailMessage.h" -#include "CFSMailAddress.h" +#include "cfsmailmessage.h" +#include "cfsmailaddress.h" #include "FreestyleMessageHeaderURLFactory.h" class RWriteStream; @@ -81,6 +81,12 @@ void HTMLBodyStartL() const; void HTMLBodyEndL() const; + /* + * Writes the subject to iWriteStream and also + * takes care of the urls and marks them as hotspots + */ + void WriteSubjectL(TDesC& aText ) const; + void ExportSubjectL() const; void ExportFromL() const; void ExportToL() const; @@ -147,6 +153,7 @@ TInt iVisibleWidth; TInt iScrollPosition; TBidiText::TDirectionality iDirectionality; + TBool iMirrorLayout; RPointerArray iAttachments; }; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleMessageHeaderURL.h --- a/emailuis/emailui/inc/FreestyleMessageHeaderURL.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleMessageHeaderURL.h Fri Feb 19 22:37:30 2010 +0200 @@ -31,6 +31,7 @@ _LIT( KURLHttpPrefix, "http://" ); _LIT( KURLHttpsPrefix, "https://" ); _LIT( KURLMailToPrefix, "mailto:" ); +_LIT( KURLTypeSubject, "subject" ); class CFreestyleMessageHeaderURL : public CBase { diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/FreestyleMessageHeaderURLFactory.h --- a/emailuis/emailui/inc/FreestyleMessageHeaderURLFactory.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/FreestyleMessageHeaderURLFactory.h Fri Feb 19 22:37:30 2010 +0200 @@ -35,7 +35,8 @@ }; public: IMPORT_C static CFreestyleMessageHeaderURL* CreateEmailAddressUrlL( TEmailAddressType aEmailType, const CFSMailAddress& aEmailAddress ); - IMPORT_C static CFreestyleMessageHeaderURL* CreateAttachmentUrlL( const TDesC& aAttachmentItemId ); + IMPORT_C static CFreestyleMessageHeaderURL* CreateAttachmentUrlL( const TDesC& aAttachmentItemId ); + IMPORT_C static CFreestyleMessageHeaderURL* CreateEmailSubjectUrlL( const TDesC& aSubject ); }; #endif //__CFREESTYLE_MESSAGE_HEADER_URL_FACTORY_H__ diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/OverlayControl.h --- a/emailuis/emailui/inc/OverlayControl.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/OverlayControl.h Fri Feb 19 22:37:30 2010 +0200 @@ -74,12 +74,6 @@ void HandlePointerEventL(const TPointerEvent& aPointerEvent); void MakeVisible( TBool aVisible ); - - /** - * Update visual state - * @param aButtonDown ETrue if button is in down state - */ - void UpdateButtonState( TBool aButtonDown ); private: @@ -94,30 +88,10 @@ */ void ConstructL( CCoeControl* aParent, const TRect& aRect, TInt aBitmapId, TInt aMaskId ); - /** - * Make a copy of bitmap - */ - void CopyBitmapL( const CFbsBitmap& aSource, CFbsBitmap& aDest ); - - /** - * Adjust alpha for the bitmap - * @param aBitmap bitmap to adjust - * @param aFactor factor to apply - */ - void AdjustAlpha( CFbsBitmap& aBitmap, TReal aFactor ); - - /** - * Update used mask according to current button state - */ - void UpdateMask(); - private: CFbsBitmap* iBitmap; CFbsBitmap* iMask; - CFbsBitmap* iSolidMask; - TBool iDownState; - MOverlayControlObserver* iObserver; }; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/freestyleemailuimailboxdeleter.h --- a/emailuis/emailui/inc/freestyleemailuimailboxdeleter.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/freestyleemailuimailboxdeleter.h Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include // INTERNAL INCLUDE FILES -#include "MFSMailRequestObserver.h" +#include "mfsmailrequestobserver.h" // FORWARD DECLARATIONS class CFSMailClient; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/ncscomposeview.h --- a/emailuis/emailui/inc/ncscomposeview.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/ncscomposeview.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,8 +20,8 @@ #ifndef __CNCSCOMPOSEVIEW_H__ #define __CNCSCOMPOSEVIEW_H__ -#include "CFSMailCommon.h" -#include "MFSMailRequestObserver.h" +#include "cfsmailcommon.h" +#include "mfsmailrequestobserver.h" #include #include "AknServerApp.h" #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/ncssubjectfield.h --- a/emailuis/emailui/inc/ncssubjectfield.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/ncssubjectfield.h Fri Feb 19 22:37:30 2010 +0200 @@ -177,8 +177,6 @@ TRgb iBgColor; - CAsyncCallBack* iFocusChangeHandler; - TBool iDrawAfterFocusChange; // Platform layout changes diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/inc/ncsutility.h --- a/emailuis/emailui/inc/ncsutility.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/inc/ncsutility.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #define NCSUTILITY_H #include -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "ncsaddressinputfield.h" class CNcsEmailAddressObject; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/loc/freestyleemailui.loc --- a/emailuis/emailui/loc/freestyleemailui.loc Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/loc/freestyleemailui.loc Fri Feb 19 22:37:30 2010 +0200 @@ -955,7 +955,7 @@ // l:popup_note_window/opt2 // r:TB9.1 // -#define qtn_fse_confirm_note_sending_queued "E-mail queued for sending" +#define qtn_fse_confirm_note_sending_queued "Sending mail" // d:Information note. Informs that e-mail is in Outbox until status is online. // l:popup_note_window/opt2 @@ -1600,6 +1600,12 @@ // #define qtn_fse_folder_list_deleted_items "Deleted items" +// d:Folder list item with unread count +// l:list_single_large_graphic_pane_t1 +// r:5250+ +// +#define qtn_fse_folder_list_folder_with_unread "%0U (%1N)" + // d:Options menu item in folder list // l:list_single_pane_t1_cp2 // r:TB9.1 diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sendasmtm/fsmtms/client/inc/cfsclientmtm.h --- a/emailuis/emailui/sendasmtm/fsmtms/client/inc/cfsclientmtm.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sendasmtm/fsmtms/client/inc/cfsclientmtm.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #include #include -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include enum TEasEmailMTMCmds diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sendasmtm/fsmtms/client/src/cfsclientmtm.cpp --- a/emailuis/emailui/sendasmtm/fsmtms/client/src/cfsclientmtm.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sendasmtm/fsmtms/client/src/cfsclientmtm.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -32,7 +32,7 @@ #include -#include "FreestyleEmailCenRepKeys.h" +#include "freestyleemailcenrepkeys.h" #include #include "cfssendashelper.h" #include "fsmtmsconstants.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sendasmtm/fsmtms/server/src/cfsservermtm.cpp --- a/emailuis/emailui/sendasmtm/fsmtms/server/src/cfsservermtm.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sendasmtm/fsmtms/server/src/cfsservermtm.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include "emailtrace.h" #include #include -#include "FreestyleEmailCenRepKeys.h" +#include "freestyleemailcenrepkeys.h" #include "cfsservermtm.h" #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sendasmtm/fsmtms/uidata/src/cfsuidatamtm.cpp --- a/emailuis/emailui/sendasmtm/fsmtms/uidata/src/cfsuidatamtm.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sendasmtm/fsmtms/uidata/src/cfsuidatamtm.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -33,13 +33,13 @@ #include "cfsuidatamtm.h" // FREESTYLE EMAIL FRAMEWORK INCLUDES -#include "CFSMailCommon.h" -#include "CFSMailClient.h" -#include "CFSMailBox.h" +#include "cfsmailcommon.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" #include -#include "MFSMailBrandManager.h" +#include "mfsmailbrandmanager.h" // GLOBAL EXPORTS. @@ -139,77 +139,77 @@ // Support for White label branding added CFSMailClient* mailClient = CFSMailClient::NewL(); CleanupClosePushL(*mailClient); - MFSMailBrandManager& brandManager = mailClient->GetBrandManagerL(); - RPointerArray mailboxes; - CleanupResetAndDestroyClosePushL( mailboxes ); - TFSMailMsgId id; + MFSMailBrandManager& brandManager = mailClient->GetBrandManagerL(); + RPointerArray mailboxes; + CleanupResetAndDestroyClosePushL( mailboxes ); + TFSMailMsgId id; - mailClient->ListMailBoxes( id, mailboxes ); + mailClient->ListMailBoxes( id, mailboxes ); - iIconArrays->Reset(); - iMailboxIds.Reset(); + iIconArrays->Reset(); + iMailboxIds.Reset(); - for ( TInt i = 0; i <= mailboxes.Count(); i++ ) // Last round is for setting the default mb icon at the end of the list - { - CFbsBitmap* bitmap(0); - CFbsBitmap* bitmapMask(0); - CArrayPtrFlat* array = new (ELeave) CArrayPtrFlat( 2 ); - CleanupStack::PushL( array ); // +2 array - array->SetReserveL( 2 ); // AppendLs will not LEAVE - - CGulIcon* brandedIcon( NULL ); - TInt err; + for ( TInt i = 0; i <= mailboxes.Count(); i++ ) // Last round is for setting the default mb icon at the end of the list + { + CFbsBitmap* bitmap(0); + CFbsBitmap* bitmapMask(0); + CArrayPtrFlat* array = new (ELeave) CArrayPtrFlat( 2 ); + CleanupStack::PushL( array ); // +2 array + array->SetReserveL( 2 ); // AppendLs will not LEAVE + + CGulIcon* brandedIcon( NULL ); + TInt err; - if ( i < mailboxes.Count() ) // Do not execute for the last round - { - TRAP( err, brandedIcon = brandManager.GetGraphicL( EFSMailboxIcon, mailboxes[i]->GetId() ) ); - } - if ( err == KErrNone && brandedIcon ) - { - bitmap = brandedIcon->Bitmap(); - bitmapMask = brandedIcon->Mask(); - brandedIcon->SetBitmapsOwnedExternally( ETrue ); - CleanupStack::PushL( bitmap ); - array->AppendL( bitmap ); - CleanupStack::Pop( bitmap ); - bitmap = 0; - CleanupStack::PushL( bitmapMask ); - array->AppendL( bitmapMask ); - CleanupStack::Pop( bitmapMask ); - bitmapMask = 0; - iIconArrays->AppendL( array ); - iMailboxIds.Append( (mailboxes[i]->GetId()).Id() ); + if ( i < mailboxes.Count() ) // Do not execute for the last round + { + TRAP( err, brandedIcon = brandManager.GetGraphicL( EFSMailboxIcon, mailboxes[i]->GetId() ) ); + } + if ( err == KErrNone && brandedIcon ) + { + bitmap = brandedIcon->Bitmap(); + bitmapMask = brandedIcon->Mask(); + brandedIcon->SetBitmapsOwnedExternally( ETrue ); + CleanupStack::PushL( bitmap ); + array->AppendL( bitmap ); + CleanupStack::Pop( bitmap ); + bitmap = 0; + CleanupStack::PushL( bitmapMask ); + array->AppendL( bitmapMask ); + CleanupStack::Pop( bitmapMask ); + bitmapMask = 0; + iIconArrays->AppendL( array ); + iMailboxIds.Append( (mailboxes[i]->GetId()).Id() ); } - else - { - // Icon was not found from the branding manager or last round for the default icon - TRAPD( err, AknIconUtils::CreateIconL( bitmap, bitmapMask, bitmapFileName, - EMbmFsuidatamtmQgn_prop_cmail_inbox_small, EMbmFsuidatamtmQgn_prop_cmail_inbox_small + 1 )); - if( err != KErrNone ) - { - } - CleanupStack::PushL( bitmap ); - array->AppendL( bitmap ); - CleanupStack::Pop( bitmap ); - bitmap = 0; - CleanupStack::PushL( bitmapMask ); - array->AppendL( bitmapMask ); - CleanupStack::Pop( bitmapMask ); - bitmapMask = 0; - // INFO: This is not working for some reason, otherwise above code is not required. - // CreateBitmapsL(2, KFsUiDataMtmUdBitmapFile, EMbmFsuidatamtmFsmailbox, - // EMbmFsuidatamtmLastElement); - iIconArrays->AppendL( array ); - iMailboxIds.Append(0); - } - if ( brandedIcon ) - { - delete brandedIcon; - } - CleanupStack::Pop( array ); - } - - CleanupStack::PopAndDestroy( &mailboxes ); + else + { + // Icon was not found from the branding manager or last round for the default icon + TRAPD( err, AknIconUtils::CreateIconL( bitmap, bitmapMask, bitmapFileName, + EMbmFsuidatamtmQgn_prop_cmail_inbox_small, EMbmFsuidatamtmQgn_prop_cmail_inbox_small + 1 )); + if( err != KErrNone ) + { + } + CleanupStack::PushL( bitmap ); + array->AppendL( bitmap ); + CleanupStack::Pop( bitmap ); + bitmap = 0; + CleanupStack::PushL( bitmapMask ); + array->AppendL( bitmapMask ); + CleanupStack::Pop( bitmapMask ); + bitmapMask = 0; + // INFO: This is not working for some reason, otherwise above code is not required. + // CreateBitmapsL(2, KFsUiDataMtmUdBitmapFile, EMbmFsuidatamtmFsmailbox, + // EMbmFsuidatamtmLastElement); + iIconArrays->AppendL( array ); + iMailboxIds.Append(0); + } + if ( brandedIcon ) + { + delete brandedIcon; + } + CleanupStack::Pop( array ); + } + + CleanupStack::PopAndDestroy( &mailboxes ); CleanupStack::PopAndDestroy( mailClient ); } @@ -251,12 +251,12 @@ { FUNC_LOG; for ( TInt i = 0; i < iIconArrays->Count() - 1; i++ ) - { + { if ( iMailboxIds[i] == aContext.iMtmData2 ) - { - return *(iIconArrays->At( i )); - } - } + { + return *(iIconArrays->At( i )); + } + } return *(iIconArrays->At( iIconArrays->Count() - 1)); // Default icon } @@ -339,11 +339,11 @@ FUNC_LOG; if ((aNewEntry.iMtm == KUidMsgValTypeFsMtmVal) && (aNewEntry.iType == KUidMsvServiceEntry) ) - { - aReasonResourceId=0; + { + aReasonResourceId=0; // --- Can create services if they are off root --- return (aParent.Id() == KMsvRootIndexEntryIdValue); - } + } aReasonResourceId = R_FS_NOT_SUPPORTED; return EFalse; @@ -532,7 +532,7 @@ // defined in aknsconstants.hrh. //Disabling SendAs for Calendar is removed. - aResponse=ETrue; + aResponse=ETrue; break; default: diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sendasmtm/inc/cfssendashelper.h --- a/emailuis/emailui/sendasmtm/inc/cfssendashelper.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sendasmtm/inc/cfssendashelper.h Fri Feb 19 22:37:30 2010 +0200 @@ -24,7 +24,7 @@ #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // // --------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sendasmtm/sendashelper/inc/cfssendashelper.h --- a/emailuis/emailui/sendasmtm/sendashelper/inc/cfssendashelper.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sendasmtm/sendashelper/inc/cfssendashelper.h Fri Feb 19 22:37:30 2010 +0200 @@ -24,7 +24,7 @@ #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // // --------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sendasmtm/sendashelper/src/cfssendashelper.cpp --- a/emailuis/emailui/sendasmtm/sendashelper/src/cfssendashelper.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sendasmtm/sendashelper/src/cfssendashelper.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -31,19 +31,19 @@ #include // -#include "CFSMailCommon.h" -#include "CFSMailClient.h" -#include "CFSMailMessage.h" -#include "CFSMailBox.h" -#include "CFSMailAddress.h" -#include "CFSMailMessageBase.h" -#include "CFSMailMessagePart.h" +#include "cfsmailcommon.h" +#include "cfsmailclient.h" +#include "cfsmailmessage.h" +#include "cfsmailbox.h" +#include "cfsmailaddress.h" +#include "cfsmailmessagebase.h" +#include "cfsmailmessagepart.h" #include "FreestyleEmailUiConstants.h" -#include "ESMailSettingsPlugin.h" +#include "esmailsettingsplugin.h" // #include "cfssendashelper.h" #include "fsmtmsconstants.h" -#include "FreestyleEmailCenRepKeys.h" +#include "freestyleemailcenrepkeys.h" _LIT( KFreestyleEmailUiResourceFileName, "FreestyleEmailUi.rsc" ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sis/commonemail.pkg --- a/emailuis/emailui/sis/commonemail.pkg Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sis/commonemail.pkg Fri Feb 19 22:37:30 2010 +0200 @@ -256,4 +256,4 @@ ; emailservices / emailservermonitor "\epoc32\release\armv5\urel\emailservermonitor.exe" - "c:\sys\bin\emailservermonitor.exe" -"\epoc32\release\armv5\urel\fsmailserverautostart.exe" - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNBOTH +"\epoc32\release\armv5\urel\fsmailserverautostart.exe" - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNINSTALL diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sis/commonemail_loc.pkg --- a/emailuis/emailui/sis/commonemail_loc.pkg Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sis/commonemail_loc.pkg Fri Feb 19 22:37:30 2010 +0200 @@ -1222,4 +1222,4 @@ ; emailservices / emailservermonitor "\epoc32\release\armv5\urel\emailservermonitor.exe" - "c:\sys\bin\emailservermonitor.exe" -"\epoc32\release\armv5\urel\fsmailserverautostart.exe" - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNBOTH +"\epoc32\release\armv5\urel\fsmailserverautostart.exe" - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNINSTALL diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sis/commonemail_udeb.pkg --- a/emailuis/emailui/sis/commonemail_udeb.pkg Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sis/commonemail_udeb.pkg Fri Feb 19 22:37:30 2010 +0200 @@ -244,4 +244,4 @@ ; emailservices / emailservermonitor "\epoc32\release\armv5\udeb\emailservermonitor.exe" - "c:\sys\bin\emailservermonitor.exe" -"\epoc32\release\armv5\udeb\fsmailserverautostart.exe" - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNBOTH +"\epoc32\release\armv5\udeb\fsmailserverautostart.exe" - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNINSTALL diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sis/commonemail_udeb_loc.pkg --- a/emailuis/emailui/sis/commonemail_udeb_loc.pkg Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sis/commonemail_udeb_loc.pkg Fri Feb 19 22:37:30 2010 +0200 @@ -1210,4 +1210,4 @@ ; emailservices / emailservermonitor "\epoc32\release\armv5\udeb\emailservermonitor.exe" - "c:\sys\bin\emailservermonitor.exe" -"\epoc32\release\armv5\udeb\fsmailserverautostart.exe" - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNBOTH +"\epoc32\release\armv5\udeb\fsmailserverautostart.exe" - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNINSTALL diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/sis/pkg-localizer.py --- a/emailuis/emailui/sis/pkg-localizer.py Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/sis/pkg-localizer.py Fri Feb 19 22:37:30 2010 +0200 @@ -14,8 +14,8 @@ * Contributors: * * Description: -* Python script that can be used to make localized pkg-files -* based on Engineering English pkg-files +* Python script that can be used to make localized pkg-files based on +* Engineering English pkg-files. Meant only for internal use in Email. * */ """ diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FSComposerFetchLogic.cpp --- a/emailuis/emailui/src/FSComposerFetchLogic.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FSComposerFetchLogic.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,8 +18,8 @@ // #include "emailtrace.h" -#include "CFSMailClient.h" -#include "CFSMailCommon.h" +#include "cfsmailclient.h" +#include "cfsmailcommon.h" // #include //#include // diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailCenRepHandler.cpp --- a/emailuis/emailui/src/FreestyleEmailCenRepHandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailCenRepHandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -22,8 +22,8 @@ #include #include // for note -#include "FreestyleEmailCenRepHandler.h" -#include "FreestyleEmailCenRepKeys.h" +#include "freestyleemailcenrephandler.h" +#include "freestyleemailcenrepkeys.h" // CONSTANTS //_LIT( KFsCrHandlerDelimiter, "," ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp --- a/emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include "emailtrace.h" #include // -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include #include @@ -29,7 +29,7 @@ #include "FreestyleEmailUiLiterals.h" #include "FreestyleEmailUiUtilities.h" #include "FreestyleEmailDownloadInformationMediator.h" -#include "FreestyleEmailCenRepHandler.h" +#include "freestyleemailcenrephandler.h" #include "FreestyleEmailUiAppui.h" #include "FSEmail.pan" diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiAknStatusIndicator.cpp --- a/emailuis/emailui/src/FreestyleEmailUiAknStatusIndicator.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiAknStatusIndicator.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -1,17 +1,23 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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 "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: +* */ #include "FreestyleEmailUiAknStatusIndicator.h" #include -#include -#include +#include +#include const TInt KImageMargin = 8; const TInt KTextMargin = 4; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiAppui.cpp --- a/emailuis/emailui/src/FreestyleEmailUiAppui.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiAppui.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -32,12 +32,12 @@ #include #include // -#include "CFSMailClient.h" -#include "CFSMailBox.h" -#include "CFSMailFolder.h" -#include "CFSMailMessage.h" -#include "CFSMailAddress.h" -#include "CFSMailCommon.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" +#include "cfsmailfolder.h" +#include "cfsmailmessage.h" +#include "cfsmailaddress.h" +#include "cfsmailcommon.h" // #include #include @@ -169,6 +169,7 @@ { FUNC_LOG; iEnv = &aEnv; + TIMESTAMP( "Application starting" ); } // --------------------------------------------------------------------------- @@ -381,6 +382,7 @@ // until a certain callback event is received // -> thus keep this last in this method! iWizardObserver->DoWizardStartupActionsL(); + TIMESTAMP( "Application started" ); } // Functions loads some views as delayed to reduce startup time @@ -531,6 +533,7 @@ delete iNaviDecorator2MailViewer; delete iConnectionStatusIconAnimTimer; + TIMESTAMP( "Application exit" ); } @@ -634,6 +637,14 @@ iCurrentActiveView = iNavigationHistory->Pop(); } } + // may be tricky; added here to handle activation of composer view from external app when email is plugin settings view + // in this case also duplictaed view needs to be poped up, but iSettingsViewActive is already set to EFalse + // other solution would need to expand api of this class to handle directly this case + else + if ( iPreviousActiveView->Id() == SettingsViewId || iPreviousActiveView->Id() == MailListId ) + { + iCurrentActiveView = iNavigationHistory->Pop(); + } } void CFreestyleEmailUiAppUi::ViewActivatedExternallyL( TUid aViewId ) @@ -668,7 +679,7 @@ iCurrentActiveView = static_cast( View(aViewId) ); } } - + TIMESTAMP( "View activated" ); } void CFreestyleEmailUiAppUi::SetSwitchingToBackground( TBool aValue ) @@ -700,6 +711,7 @@ { ReturnToPreviousViewL(); } + TIMESTAMP( "Returned from html viewer view to previous view" ); } TUid CFreestyleEmailUiAppUi::ReturnToPreviousViewL( const TDesC8& aCustomMessage /*= KNullDesC8*/ ) @@ -725,6 +737,7 @@ if ( viewId == AppGridId ) { ActivateLocalViewL( AppGridId ); + TIMESTAMP( "Return to application grid view" ); } else if ( viewId == MailListId ) { @@ -737,6 +750,7 @@ const TPckgBuf pkgOut; ActivateLocalViewL( MailListId, KStartListReturnToPreviousFolder, pkgOut ); } + TIMESTAMP( "Return to message list view" ); } else if ( viewId == SearchListViewId ) { @@ -755,10 +769,12 @@ // launch html viewer const TPckgBuf pkgOut; ActivateLocalViewL( HtmlViewerId, KHtmlViewerReturnToPrevious, pkgOut ); + TIMESTAMP( "Return to html viewer view" ); } else if ( viewId == MailEditorId ) { ActivateLocalViewL( MailEditorId, TUid::Uid(KEditorCmdReturnToPrevious), aCustomMessage ); + TIMESTAMP( "Return to email editor view" ); } else if ( viewId == MsgDetailsViewId ) { @@ -772,6 +788,7 @@ { // Generic case where the view does not need any startup parameters ActivateLocalViewL( viewId ); + TIMESTAMP( "Return to previous view" ); } return viewId; @@ -824,6 +841,7 @@ { ActivateLocalViewL( iCurrentActiveView->Id() ); } + TIMESTAMP( "Return to earlier view" ); } void CFreestyleEmailUiAppUi::ShowFolderListInPopupL( @@ -897,6 +915,7 @@ void CFreestyleEmailUiAppUi::Exit() { FUNC_LOG; + TIMESTAMP ("Exiting from email application"); g_ApplicationExitOnGoing = ETrue; if ( iExitGuardian->ExitApplication() == KRequestPending ) { @@ -1741,23 +1760,40 @@ // Force Sync on active mailbox. void CFreestyleEmailUiAppUi::SyncActiveMailBoxL() - { - FUNC_LOG; - if ( iActiveMailbox ) - { - iSyncStatusReqId = iActiveMailbox->RefreshNowL( *this ); - } - } - + { + FUNC_LOG; + if( iActiveMailbox ) + { + // Start sync automatically if not syncing already + TSSMailSyncState latestSyncstate = iActiveMailbox->CurrentSyncState(); + if( latestSyncstate != InboxSyncing && latestSyncstate != StartingSync && latestSyncstate != EmailSyncing ) + { + iSyncStatusReqId = iActiveMailbox->RefreshNowL( *this ); + } + } + } void CFreestyleEmailUiAppUi::StopActiveMailBoxSyncL() - { - FUNC_LOG; - if ( iActiveMailbox ) - { - iActiveMailbox->CancelSyncL(); - } - } - + { + FUNC_LOG; + if ( iActiveMailbox && iActiveMailbox->GetMailBoxStatus()==EFSMailBoxOnline) + { + TSSMailSyncState latestSyncstate = iActiveMailbox->CurrentSyncState(); + if(latestSyncstate == InboxSyncing || + latestSyncstate == EmailSyncing || + latestSyncstate == OutboxSyncing || + latestSyncstate == SentItemsSyncing || + latestSyncstate == DraftsSyncing || + latestSyncstate == CalendarSyncing || + latestSyncstate == ContactsSyncing || + latestSyncstate == TasksSyncing || + latestSyncstate == NotesSyncing || + latestSyncstate == FilesSyncing || + latestSyncstate == DataSyncStarting ) + { + iActiveMailbox->CancelSyncL(); + } + } + } MCoeMessageObserver::TMessageResponse CFreestyleEmailUiAppUi::HandleMessageL( TUint32 aClientHandleOfTargetWindowGroup, @@ -1883,7 +1919,9 @@ { case StartingSync: { + TIMESTAMP( "Starting sync" ); //If syncs were started by user, show the synchoronisation indicator + TIMESTAMP( "Sync error" ); if(iManualMailBoxSyncAll) { ManualMailBoxSyncAll(EFalse); @@ -1910,6 +1948,7 @@ case SyncCancelled: case Idle: { + TIMESTAMP( "Sync finished" ); ManualMailBoxSync( EFalse ); } break; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp --- a/emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ // SYSTEM INCLUDEfS // #include "emailtrace.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiAttachmentsListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiAttachmentsListVisualiser.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiAttachmentsListVisualiser.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ // SYSTEM INCLUDES #include "emailtrace.h" -#include "CFSMailBox.h" +#include "cfsmailbox.h" #include #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp --- a/emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include // CRepository #include // KCRUidAknFep // -#include "CFSMailBox.h" // cfsmailbox +#include "cfsmailbox.h" // cfsmailbox // #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp --- a/emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -35,13 +35,16 @@ #include #include +// CCA Launcher view +#include +#include +#include + // Phonebook 2 #include #include #include -#include -#include // Send UI #include @@ -70,7 +73,7 @@ #include // FS Email framework -#include "CFSMailBox.h" +#include "cfsmailbox.h" // #include @@ -106,8 +109,8 @@ CFSEmailUiContactHandler::~CFSEmailUiContactHandler() { FUNC_LOG; - delete iContactForMsgCreation; - if (iPersistentSetting) + delete iContactForMsgCreation; + if (iPersistentSetting) { iPersistentSetting->Close(); delete iPersistentSetting; @@ -128,6 +131,11 @@ delete iLinkOperationFetch; delete iCurrentLink; delete iLastClsItem; + + if ( iConnection ) + { + iConnection->Close(); + } } // ----------------------------------------------------------------------------- @@ -140,72 +148,72 @@ { FUNC_LOG; if ( iState == EContactHandlerIdle ) //Check that there are no other request on going - { - iState = EContactHandlerAddToContacts; - iHandlerObserver = aObserver; //Can be null - TUint assignFlags = 0; - if ( aAddToContactsType == EContactHandlerCreateNewContact ) - { - // In case of EUpdateExisting, we don't have to do anything as default is updateexisting - assignFlags = AiwContactAssign::ECreateNewContact; - } + { + iState = EContactHandlerAddToContacts; + iHandlerObserver = aObserver; //Can be null + TUint assignFlags = 0; + if ( aAddToContactsType == EContactHandlerCreateNewContact ) + { + // In case of EUpdateExisting, we don't have to do anything as default is updateexisting + assignFlags = AiwContactAssign::ECreateNewContact; + } - CAiwGenericParamList& inParamList = - iServiceHandler->InParamListL(); + CAiwGenericParamList& inParamList = + iServiceHandler->InParamListL(); - inParamList.AppendL( - TAiwGenericParam( - EGenericParamContactAssignData, - TAiwVariant(AiwContactAssign::TAiwSingleContactAssignDataV1Pckg( - AiwContactAssign::TAiwSingleContactAssignDataV1().SetFlags(assignFlags))))); - - TGenericParamIdValue updateType; - if ( aUpdateType == EContactUpdateEmail ) - { - updateType = EGenericParamEmailAddress; - } - else // EContactUpdateNumber - { - updateType = EGenericParamPhoneNumber; - } - - inParamList.AppendL( - TAiwGenericParam( - updateType, - TAiwVariant(aDes) - )); + inParamList.AppendL( + TAiwGenericParam( + EGenericParamContactAssignData, + TAiwVariant(AiwContactAssign::TAiwSingleContactAssignDataV1Pckg( + AiwContactAssign::TAiwSingleContactAssignDataV1().SetFlags(assignFlags))))); + + TGenericParamIdValue updateType; + if ( aUpdateType == EContactUpdateEmail ) + { + updateType = EGenericParamEmailAddress; + } + else // EContactUpdateNumber + { + updateType = EGenericParamPhoneNumber; + } + + inParamList.AppendL( + TAiwGenericParam( + updateType, + TAiwVariant(aDes) + )); - //Async call, CallBack is HandleNotify - iServiceHandler->ExecuteServiceCmdL( - KAiwCmdAssign, - inParamList, - iServiceHandler->OutParamListL(), - 0, - this); - } + //Async call, CallBack is HandleNotify + iServiceHandler->ExecuteServiceCmdL( + KAiwCmdAssign, + inParamList, + iServiceHandler->OutParamListL(), + 0, + this); + } } // ----------------------------------------------------------------------------- // CFSEmailUiContactHandler::AddToContactsQueryL // ----------------------------------------------------------------------------- TBool CFSEmailUiContactHandler::AddtoContactsQueryL( TAddToContactsType& aType ) - { + { FUNC_LOG; - // create popup list dialog asking new/update - // Costruct listbox and popup list - CEikTextListBox* listbox = new ( ELeave ) CAknSinglePopupMenuStyleListBox(); - CleanupStack::PushL( listbox ); + // create popup list dialog asking new/update + // Costruct listbox and popup list + CEikTextListBox* listbox = new ( ELeave ) CAknSinglePopupMenuStyleListBox(); + CleanupStack::PushL( listbox ); - CAknPopupList* popupList = CAknPopupList::NewL( listbox, - R_AVKON_SOFTKEYS_SELECT_BACK ); + CAknPopupList* popupList = CAknPopupList::NewL( listbox, + R_AVKON_SOFTKEYS_SELECT_BACK ); - CleanupStack::PushL( popupList ); - listbox->ConstructL( popupList, CEikListBox::ELeftDownInViewRect ); + CleanupStack::PushL( popupList ); + listbox->ConstructL( popupList, CEikListBox::ELeftDownInViewRect ); - listbox->CreateScrollBarFrameL(ETrue); - listbox->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EAuto ); + listbox->CreateScrollBarFrameL(ETrue); + listbox->ScrollBarFrame()->SetScrollBarVisibilityL( + CEikScrollBarFrame::EOff, + CEikScrollBarFrame::EAuto ); // Get list item array and put all removable theme names in it. MDesCArray* itemList = listbox->Model()->ItemTextArray(); @@ -216,7 +224,7 @@ popupList->SetTitleL( *resource ); CleanupStack::PopAndDestroy( resource ); - // Load and append actual selection lines + // Load and append actual selection lines resource = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_CREATE_NEW_CONTACT ); listitems->AppendL( *resource ); CleanupStack::PopAndDestroy( resource ); @@ -228,23 +236,23 @@ TBool returnValue = EFalse; // Execute popup list. if ( popupList->ExecuteLD() ) - { - if ( !listbox->CurrentItemIndex() ) - { - aType = EContactHandlerCreateNewContact; - } - else - { - //UpdateExisting is "default" so no flags are needed - aType = EContactHandlerUpdateExisting; - } - returnValue = ETrue; //User pressed OK - } + { + if ( !listbox->CurrentItemIndex() ) + { + aType = EContactHandlerCreateNewContact; + } + else + { + //UpdateExisting is "default" so no flags are needed + aType = EContactHandlerUpdateExisting; + } + returnValue = ETrue; //User pressed OK + } CleanupStack::Pop( popupList ); - CleanupStack::PopAndDestroy( listbox ); + CleanupStack::PopAndDestroy( listbox ); - return returnValue; - } + return returnValue; + } // --------------------------------------------------------------------------- // CFSEmailUiContactHandler::FindAndCallToContactByEmailL @@ -273,22 +281,22 @@ // CFSEmailUiContactHandler::FindAndCreateMsgToContactByEmailL // ----------------------------------------------------------------------------- void CFSEmailUiContactHandler::FindAndCreateMsgToContactByEmailL( const TDesC& aEmailAddress, - CFSMailBox* aMailBox ) + CFSMailBox* aMailBox ) { FUNC_LOG; if ( iOpenComplete && (iState == EContactHandlerIdle) ) //If contact stores all ready - { - - iState = EContactHandlerCreateMessage; - iMailBox = aMailBox; + { + + iState = EContactHandlerCreateMessage; + iMailBox = aMailBox; - FindContactLinkL( aEmailAddress ); - - } + FindContactLinkL( aEmailAddress ); + + } } - + // --------------------------------------------------------------------------- // Searches for the contact if necessary and shows the contact details. // --------------------------------------------------------------------------- @@ -306,8 +314,8 @@ void CFSEmailUiContactHandler::MakeAiwCallL(MVPbkContactLink* aContactLink, - const TDesC& aContactNumber, - TBool aVoipOverride ) + const TDesC& aContactNumber, + TBool aVoipOverride ) { FUNC_LOG; CAiwDialDataExt* dialData = CAiwDialDataExt::NewLC(); @@ -316,22 +324,22 @@ HBufC8* linkBuffer(NULL); if( aContactLink ) - { - linkBuffer = aContactLink->PackLC(); - dialData->SetContactLinkL( *linkBuffer ); - // Contact link exists, check if voip is preferred - // Create iPersistentSetting here only when needed for the first time - if ( !iPersistentSetting ) - { - iPersistentSetting = - PbkGlobalSettingFactory::CreatePersistentSettingL(); - iPersistentSetting-> - ConnectL(MPbkGlobalSetting::ERichCallSettingsCategory); - } - if ( aVoipOverride || SelectBetweenCsAndVoip() == EAiwVoIPCall ) - { - dialData->SetCallType( CAiwDialData::EAIWVoiP ); - } + { + linkBuffer = aContactLink->PackLC(); + dialData->SetContactLinkL( *linkBuffer ); + // Contact link exists, check if voip is preferred + // Create iPersistentSetting here only when needed for the first time + if ( !iPersistentSetting ) + { + iPersistentSetting = + PbkGlobalSettingFactory::CreatePersistentSettingL(); + iPersistentSetting-> + ConnectL(MPbkGlobalSetting::ERichCallSettingsCategory); + } + if ( aVoipOverride || SelectBetweenCsAndVoip() == EAiwVoIPCall ) + { + dialData->SetCallType( CAiwDialData::EAIWVoiP ); + } // video call else if ( iVideoCall ) { @@ -339,17 +347,17 @@ dialData->SetCallType( CAiwDialData::EAIWForcedVideo ); } // - else - { - dialData->SetCallType( CAiwDialData::EAIWVoice ); - } - } + else + { + dialData->SetCallType( CAiwDialData::EAIWVoice ); + } + } else - { - if ( aVoipOverride ) - { - dialData->SetCallType( CAiwDialData::EAIWVoiP ); - } + { + if ( aVoipOverride ) + { + dialData->SetCallType( CAiwDialData::EAIWVoiP ); + } // video call else if ( iVideoCall ) { @@ -357,19 +365,19 @@ dialData->SetCallType( CAiwDialData::EAIWForcedVideo ); } // - else - { - dialData->SetCallType( CAiwDialData::EAIWVoice ); - } - dialData->SetPhoneNumberL( aContactNumber ); - } + else + { + dialData->SetCallType( CAiwDialData::EAIWVoice ); + } + dialData->SetPhoneNumberL( aContactNumber ); + } CAiwGenericParamList& inParamList = iServiceHandler->InParamListL(); dialData->FillInParamListL( inParamList ); if( aContactLink ) - { - CleanupStack::PopAndDestroy( linkBuffer ); - } + { + CleanupStack::PopAndDestroy( linkBuffer ); + } CleanupStack::PopAndDestroy( dialData ); @@ -380,12 +388,12 @@ 0, NULL ); if ( iHandlerObserver ) - { - RPointerArray emptyArray; - iHandlerObserver->OperationCompleteL( EFindAndCallToContactByEmailL, emptyArray ); - emptyArray.Close(); - iHandlerObserver = NULL; - } + { + RPointerArray emptyArray; + iHandlerObserver->OperationCompleteL( EFindAndCallToContactByEmailL, emptyArray ); + emptyArray.Close(); + iHandlerObserver = NULL; + } iState = EContactHandlerIdle; } @@ -396,12 +404,12 @@ // Default to voice call TInt ret = EAiwVoice; - TInt preferred = KErrNotFound; + TInt preferred = KErrNotFound; if ( iPersistentSetting ) - { - iPersistentSetting->Get - (MPbkGlobalSetting::EPreferredTelephony, preferred); - } + { + iPersistentSetting->Get + (MPbkGlobalSetting::EPreferredTelephony, preferred); + } // VoIP type is preferred only if the setting is, // KInternetCallPreferred. In other cases, like when the setting @@ -430,16 +438,16 @@ { FUNC_LOG; if ( (iState == EContactHandlerIdle) || - (iState == EContactHandlerSearchMatches) ) - { - iState = EContactHandlerSearchMatches; - iHandlerObserver = aObserver; - - iClsListHandler->SetCurrentMailboxL( aMailBox ); - - //Async call, CallBack is ArrayUpdatedL (when error: OperationErrorL) - iClsListHandler->SearchMatchesL( aText ); - } + (iState == EContactHandlerSearchMatches) ) + { + iState = EContactHandlerSearchMatches; + iHandlerObserver = aObserver; + + iClsListHandler->SetCurrentMailboxL( aMailBox ); + + //Async call, CallBack is ArrayUpdatedL (when error: OperationErrorL) + iClsListHandler->SearchMatchesL( aText ); + } } TBool CFSEmailUiContactHandler::IsLanguageSupportedL() @@ -449,48 +457,48 @@ } CVPbkContactManager* CFSEmailUiContactHandler::GetContactManager() - { + { FUNC_LOG; - return iContactManager; - } + return iContactManager; + } void CFSEmailUiContactHandler::GetAddressesFromPhonebookL( MFSEmailUiContactHandlerObserver* aObserver ) - { + { FUNC_LOG; - if ( iState == EContactHandlerIdle ) - { - if ( !aObserver ) - { - //Request can't be fulfilled without observer - return; - } - iHandlerObserver = aObserver; - iState = EContactHandlerGetAddressesFromPhonebook; - TUint fetchFlags = 0; + if ( iState == EContactHandlerIdle ) + { + if ( !aObserver ) + { + //Request can't be fulfilled without observer + return; + } + iHandlerObserver = aObserver; + iState = EContactHandlerGetAddressesFromPhonebook; + TUint fetchFlags = 0; - iContactObjects.ResetAndDestroy(); + iContactObjects.ResetAndDestroy(); - CAiwGenericParamList& inParamList = iServiceHandler->InParamListL(); - inParamList.AppendL( - TAiwGenericParam( - EGenericParamContactSelectionData, - TAiwVariant(TAiwMultipleItemSelectionDataV1Pckg( - TAiwMultipleItemSelectionDataV1(). - SetAddressSelectType(EAiwEMailSelect). - SetFlags( fetchFlags ))))); + CAiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + inParamList.AppendL( + TAiwGenericParam( + EGenericParamContactSelectionData, + TAiwVariant(TAiwMultipleItemSelectionDataV1Pckg( + TAiwMultipleItemSelectionDataV1(). + SetAddressSelectType(EAiwEMailSelect). + SetFlags( fetchFlags ))))); - //Async call, CallBack is HandleNotify - iServiceHandler->ExecuteServiceCmdL( - KAiwCmdSelect, - inParamList, - iServiceHandler->OutParamListL(), - 0, - this); - } - } + //Async call, CallBack is HandleNotify + iServiceHandler->ExecuteServiceCmdL( + KAiwCmdSelect, + inParamList, + iServiceHandler->OutParamListL(), + 0, + this); + } + } // video call // --------------------------------------------------------------------------- @@ -508,22 +516,22 @@ // ///////////////////////////////////////////////////////////////////////////// void CFSEmailUiContactHandler::GetSmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink ) - { + { FUNC_LOG; - if ( iState == EContactHandlerIdle ) - { - iState = EContactHandlerGetSmsAddressFromPhonebook; + if ( iState == EContactHandlerIdle ) + { + iState = EContactHandlerGetSmsAddressFromPhonebook; - CAiwGenericParamList& inParamList = iServiceHandler->InParamListL(); - // Set data type select - TAiwSingleItemSelectionDataV3 dataSelect; + CAiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + // Set data type select + TAiwSingleItemSelectionDataV3 dataSelect; dataSelect.SetAddressSelectType( EAiwPhoneNumberSelect ); TAiwSingleItemSelectionDataV3Pckg dataPckg( dataSelect ); inParamList.AppendL( TAiwGenericParam( EGenericParamContactSelectionData, TAiwVariant( dataPckg ))); - - // Append contact links - CVPbkContactLinkArray* links = CVPbkContactLinkArray::NewLC(); + + // Append contact links + CVPbkContactLinkArray* links = CVPbkContactLinkArray::NewLC(); links->AppendL( aContactLink ); // Clone ownership is transferred HBufC8* packedLinks = links->PackLC(); inParamList.AppendL( TAiwGenericParam( EGenericParamContactLinkArray, @@ -532,60 +540,60 @@ CleanupStack::PopAndDestroy( links ); //Async call, CallBack is HandleNotify - iServiceHandler->ExecuteServiceCmdL( - KAiwCmdSelect, - inParamList, - iServiceHandler->OutParamListL(), - 0, - this); - } - } + iServiceHandler->ExecuteServiceCmdL( + KAiwCmdSelect, + inParamList, + iServiceHandler->OutParamListL(), + 0, + this); + } + } ///////////////////////////////////////////////////////////////////////////// // CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL // ///////////////////////////////////////////////////////////////////////////// void CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink, - TBool aIsVoiceMessage ) - { + TBool aIsVoiceMessage ) + { FUNC_LOG; - if ( iState == EContactHandlerIdle ) - { - if ( aIsVoiceMessage ) - { - iState = EContactHandlerGetVoiceMsgAddressFromPhonebook; - } - else - { - iState = EContactHandlerGetMmsAddressFromPhonebook; - } + if ( iState == EContactHandlerIdle ) + { + if ( aIsVoiceMessage ) + { + iState = EContactHandlerGetVoiceMsgAddressFromPhonebook; + } + else + { + iState = EContactHandlerGetMmsAddressFromPhonebook; + } - CAiwGenericParamList& inParamList = iServiceHandler->InParamListL(); - // Set data type select - TAiwSingleItemSelectionDataV3 dataSelect; + CAiwGenericParamList& inParamList = iServiceHandler->InParamListL(); + // Set data type select + TAiwSingleItemSelectionDataV3 dataSelect; dataSelect.SetAddressSelectType( EAiwMMSSelect ); TAiwSingleItemSelectionDataV3Pckg dataPckg( dataSelect ); inParamList.AppendL( TAiwGenericParam( EGenericParamContactSelectionData, TAiwVariant( dataPckg ))); - - // Append contact links - CVPbkContactLinkArray* links = CVPbkContactLinkArray::NewLC(); + + // Append contact links + CVPbkContactLinkArray* links = CVPbkContactLinkArray::NewLC(); links->AppendL( aContactLink ); // Clone ownership is transferred - HBufC8* packedLinks = links->PackLC(); + HBufC8* packedLinks = links->PackLC(); inParamList.AppendL( TAiwGenericParam( EGenericParamContactLinkArray, TAiwVariant(*packedLinks))); CleanupStack::PopAndDestroy( packedLinks ); CleanupStack::PopAndDestroy( links ); //Async call, CallBack is HandleNotify - iServiceHandler->ExecuteServiceCmdL( - KAiwCmdSelect, - inParamList, - iServiceHandler->OutParamListL(), - 0, - this); - } - } + iServiceHandler->ExecuteServiceCmdL( + KAiwCmdSelect, + inParamList, + iServiceHandler->OutParamListL(), + 0, + this); + } + } ///////////////////////////////////////////////////////////////////////////// // CFSEmailUiContactHandler::ArrayUpdatedL @@ -598,56 +606,56 @@ switch ( iState ) { - case EContactHandlerCreateMessage: - CreateMessageL( aMatchingItems ); - break; - case EContactHandlerCallToContactByEmail: - if ( aMatchingItems.Count() ) - { - delete iLastClsItem; - iLastClsItem = NULL; - iLastClsItem = aMatchingItems[0]->CloneLC(); - CleanupStack::Pop(); - } - HandleCallL( aMatchingItems ); - break; - case EContactHandlerShowContactDetails: - ShowDetailsL( aMatchingItems ); - break; - case EContactHandlerSearchMatches: - if ( aMatchingItems.Count() == 1 ) - { - if ( !iSearchMatch ) - { - iSearchMatch = CFSEmailUiClsItem::NewL(); - } - iSearchMatch->SetDisplayNameL( aMatchingItems[0]->DisplayName() ); - iSearchMatch->SetEmailAddressL( aMatchingItems[0]->EmailAddress() ); - } - else - { - delete iSearchMatch; - iSearchMatch = NULL; - } - - // The ownership of the array content is transferred to observer. - iState = EContactHandlerIdle; - if ( iHandlerObserver ) - { - iHandlerObserver->OperationCompleteL( ESearchContacts, aMatchingItems ); - } - break; - default: - break; + case EContactHandlerCreateMessage: + CreateMessageL( aMatchingItems ); + break; + case EContactHandlerCallToContactByEmail: + if ( aMatchingItems.Count() ) + { + delete iLastClsItem; + iLastClsItem = NULL; + iLastClsItem = aMatchingItems[0]->CloneLC(); + CleanupStack::Pop(); + } + HandleCallL( aMatchingItems ); + break; + case EContactHandlerShowContactDetails: + ShowDetailsL( aMatchingItems ); + break; + case EContactHandlerSearchMatches: + if ( aMatchingItems.Count() == 1 ) + { + if ( !iSearchMatch ) + { + iSearchMatch = CFSEmailUiClsItem::NewL(); + } + iSearchMatch->SetDisplayNameL( aMatchingItems[0]->DisplayName() ); + iSearchMatch->SetEmailAddressL( aMatchingItems[0]->EmailAddress() ); + } + else + { + delete iSearchMatch; + iSearchMatch = NULL; + } + + // The ownership of the array content is transferred to observer. + iState = EContactHandlerIdle; + if ( iHandlerObserver ) + { + iHandlerObserver->OperationCompleteL( ESearchContacts, aMatchingItems ); + } + break; + default: + break; } } void CFSEmailUiContactHandler::OperationErrorL( TInt aErrorCode ) - { + { FUNC_LOG; - if ( iHandlerObserver ) - { + if ( iHandlerObserver ) + { // KerrNotReady --> caching in progress, KErrNotFound --> caching not started yet if ( (aErrorCode == KErrNotReady) || (aErrorCode == KErrNotFound) ) { @@ -662,9 +670,9 @@ { iCachingInProgressError = EFalse; iState = EContactHandlerIdle; - iHandlerObserver->OperationErrorL( ESearchContacts, aErrorCode ); - } - } + iHandlerObserver->OperationErrorL( ESearchContacts, aErrorCode ); + } + } else { iState = EContactHandlerIdle; @@ -679,373 +687,373 @@ void CFSEmailUiContactHandler::VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& aOperation, - MVPbkStoreContact* aContact ) - { + MVPbkContactOperationBase& aOperation, + MVPbkStoreContact* aContact ) + { FUNC_LOG; //inform also client in case of error to enable client's actions (i.e. return search priority) -// TRAP_IGNORE( VPbkSingleContactOperationCompleteL( aOperation, aContact) ); +// TRAP_IGNORE( VPbkSingleContactOperationCompleteL( aOperation, aContact) ); TRAPD(error, VPbkSingleContactOperationCompleteL( aOperation, aContact) ); if ( error != KErrNone ) { TRAP_IGNORE(ObserverOperationErrorL( CurrentCommand(), error )); } // - } + } void CFSEmailUiContactHandler::VPbkSingleContactOperationCompleteL( - MVPbkContactOperationBase& aOperation, - MVPbkStoreContact* aContact ) - { + MVPbkContactOperationBase& aOperation, + MVPbkStoreContact* aContact ) + { FUNC_LOG; - - if ( (iLinkOperationFetch == &aOperation) && iState == EContactHandlerGetAddressesFromPhonebook ) - { - CleanupDeletePushL( aContact ); - - RPointerArray firstname; - CleanupResetAndDestroyClosePushL( firstname ); - RPointerArray lastname; - CleanupResetAndDestroyClosePushL( lastname ); - RPointerArray emailAddresses; - CleanupResetAndDestroyClosePushL( emailAddresses ); - GetContactFieldsL( iFirstnameFields, firstname, aContact ); - GetContactFieldsL( iLastnameFields, lastname, aContact ); - - // Create display name, this will be used in UI. - TInt dispNameLength = 1; - if ( firstname.Count() ) dispNameLength += firstname[0]->Length(); - if ( lastname.Count() ) dispNameLength += lastname[0]->Length(); - HBufC* displayname = HBufC::NewLC( dispNameLength ); - - if ( firstname.Count() ) - { - displayname->Des().Copy( *firstname[0] ); - displayname->Des().Append( KSpace ); - } - if ( lastname.Count() ) - { - displayname->Des().Append( *lastname[0] ); - } - - // retrieve selected email address - MVPbkStoreContactFieldCollection& fields = aContact->Fields(); - MVPbkBaseContactField* selectedField = fields.RetrieveField( *iCurrentLink ); - HBufC* selectedEmailAddress = MVPbkContactFieldTextData::Cast( - selectedField->FieldData() ).Text().AllocLC(); + + if ( (iLinkOperationFetch == &aOperation) && iState == EContactHandlerGetAddressesFromPhonebook ) + { + CleanupDeletePushL( aContact ); + + RPointerArray firstname; + CleanupResetAndDestroyClosePushL( firstname ); + RPointerArray lastname; + CleanupResetAndDestroyClosePushL( lastname ); + RPointerArray emailAddresses; + CleanupResetAndDestroyClosePushL( emailAddresses ); + GetContactFieldsL( iFirstnameFields, firstname, aContact ); + GetContactFieldsL( iLastnameFields, lastname, aContact ); + + // Create display name, this will be used in UI. + TInt dispNameLength = 1; + if ( firstname.Count() ) dispNameLength += firstname[0]->Length(); + if ( lastname.Count() ) dispNameLength += lastname[0]->Length(); + HBufC* displayname = HBufC::NewLC( dispNameLength ); + + if ( firstname.Count() ) + { + displayname->Des().Copy( *firstname[0] ); + displayname->Des().Append( KSpace ); + } + if ( lastname.Count() ) + { + displayname->Des().Append( *lastname[0] ); + } + + // retrieve selected email address + MVPbkStoreContactFieldCollection& fields = aContact->Fields(); + MVPbkBaseContactField* selectedField = fields.RetrieveField( *iCurrentLink ); + HBufC* selectedEmailAddress = MVPbkContactFieldTextData::Cast( + selectedField->FieldData() ).Text().AllocLC(); //check number of email addreses GetContactFieldsL( iEmailFields, emailAddresses, aContact ); - // create contact object - CFSEmailUiClsItem* item = CFSEmailUiClsItem::NewLC(); + // create contact object + CFSEmailUiClsItem* item = CFSEmailUiClsItem::NewLC(); if ( emailAddresses.Count() > 1 ) { item->SetMultipleEmails( ETrue ); } - item->SetDisplayNameL( displayname->Des() ); - item->SetEmailAddressL( *selectedEmailAddress ); - CleanupStack::Pop( item ); - iContactObjects.Append( item ); + item->SetDisplayNameL( displayname->Des() ); + item->SetEmailAddressL( *selectedEmailAddress ); + CleanupStack::Pop( item ); + iContactObjects.Append( item ); - CleanupStack::PopAndDestroy( selectedEmailAddress ); - selectedEmailAddress = NULL; + CleanupStack::PopAndDestroy( selectedEmailAddress ); + selectedEmailAddress = NULL; - - CleanupStack::PopAndDestroy( displayname ); - CleanupStack::PopAndDestroy( &emailAddresses ); - CleanupStack::PopAndDestroy( &lastname ); - CleanupStack::PopAndDestroy( &firstname ); - CleanupStack::PopAndDestroy( aContact ); - - // Get index of Next ContactLink if there's no LinkSet - // or iCurrenLink index is set to 0 - TInt index = (iLinksSet && iCurrentLink ? iLinksSet->Find - (*iCurrentLink) + 1 : 0); - - if (iLinksSet && index < iLinksSet->Count()) - { - iCurrentLink = &iLinksSet->At(index); - delete iLinkOperationFetch; - iLinkOperationFetch = NULL; + + CleanupStack::PopAndDestroy( displayname ); + CleanupStack::PopAndDestroy( &emailAddresses ); + CleanupStack::PopAndDestroy( &lastname ); + CleanupStack::PopAndDestroy( &firstname ); + CleanupStack::PopAndDestroy( aContact ); + + // Get index of Next ContactLink if there's no LinkSet + // or iCurrenLink index is set to 0 + TInt index = (iLinksSet && iCurrentLink ? iLinksSet->Find + (*iCurrentLink) + 1 : 0); + + if (iLinksSet && index < iLinksSet->Count()) + { + iCurrentLink = &iLinksSet->At(index); + delete iLinkOperationFetch; + iLinkOperationFetch = NULL; - //Async operation, callback VPbkSingleContactOperationCompleteL - //Error situations: VPbkSingleContactOperationFailed - iLinkOperationFetch = iContactManager->RetrieveContactL( - *iCurrentLink, *this); - } - else - { - delete iLinkOperationFetch; - iLinkOperationFetch = NULL; + //Async operation, callback VPbkSingleContactOperationCompleteL + //Error situations: VPbkSingleContactOperationFailed + iLinkOperationFetch = iContactManager->RetrieveContactL( + *iCurrentLink, *this); + } + else + { + delete iLinkOperationFetch; + iLinkOperationFetch = NULL; - iCurrentLink = NULL; - iState = EContactHandlerIdle; - delete iLinksSet; - iLinksSet = NULL; + iCurrentLink = NULL; + iState = EContactHandlerIdle; + delete iLinksSet; + iLinksSet = NULL; - if ( iHandlerObserver ) - { - iHandlerObserver->OperationCompleteL( EGetAddressesFromPhonebook, iContactObjects ); - iContactObjects.ResetAndDestroy(); - iHandlerObserver = NULL; - } - } - } - - else if ( (iLinkOperationFetch == &aOperation) && (iState == EContactHandlerCallToContactByEmail ) ) - { - CleanupDeletePushL( aContact ); - - RPointerArray phonenumbers; - CleanupResetAndDestroyClosePushL( phonenumbers ); - GetContactFieldsL( iPhoneNumberFields, phonenumbers, aContact ); - TInt phoneNumbersAvailable = phonenumbers.Count(); - CleanupStack::PopAndDestroy( &phonenumbers ); - - if ( phoneNumbersAvailable ) - { - if ( CallQueryL( iLastClsItem->DisplayName() ) ) - { - MakeAiwCallL( iLastClsItem->ContactLink(), KNullDesC ); - } - else - { + if ( iHandlerObserver ) + { + iHandlerObserver->OperationCompleteL( EGetAddressesFromPhonebook, iContactObjects ); + iContactObjects.ResetAndDestroy(); + iHandlerObserver = NULL; + } + } + } + + else if ( (iLinkOperationFetch == &aOperation) && (iState == EContactHandlerCallToContactByEmail ) ) + { + CleanupDeletePushL( aContact ); + + RPointerArray phonenumbers; + CleanupResetAndDestroyClosePushL( phonenumbers ); + GetContactFieldsL( iPhoneNumberFields, phonenumbers, aContact ); + TInt phoneNumbersAvailable = phonenumbers.Count(); + CleanupStack::PopAndDestroy( &phonenumbers ); + + if ( phoneNumbersAvailable ) + { + if ( CallQueryL( iLastClsItem->DisplayName() ) ) + { + MakeAiwCallL( iLastClsItem->ContactLink(), KNullDesC ); + } + else + { // user cancelled operation - inform client to enable its actions (i.e. return search priority) ObserverOperationErrorL( EFindAndCallToContactByEmailL, KErrCancel ); - iState = EContactHandlerIdle; - } - } - else - { - if ( IsRemoteLookupSupported() ) - { - RemoteContactQueryL(); - } - else - { - TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); + iState = EContactHandlerIdle; + } + } + else + { + if ( IsRemoteLookupSupported() ) + { + RemoteContactQueryL(); + } + else + { + TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); //no phone number found - inform client to enable its actions (i.e. return search priority) ObserverOperationErrorL( EFindAndCallToContactByEmailL, KErrNotFound ); - } - iState = EContactHandlerIdle; - } - - CleanupStack::PopAndDestroy( aContact ); - } - // Addition to get contact for message creation. - else if ( (iLinkOperationFetch == &aOperation) && ( iMsgCreationHelperState == EContactHandlerGetSmsAddressFromPhonebook || - iMsgCreationHelperState == EContactHandlerGetMmsAddressFromPhonebook || iMsgCreationHelperState == EContactHandlerGetVoiceMsgAddressFromPhonebook ) ) - { - if ( iContactForMsgCreation ) - { - delete iContactForMsgCreation; - iContactForMsgCreation = NULL; - } - // Check that we have a contact for message creatiun - if ( aContact ) - { - // State is now idle. - iState = EContactHandlerIdle; - // Store contact - iContactForMsgCreation = aContact; - // Create clonelink for address selection - MVPbkContactLink* cloneLink = iCurrentLink->CloneLC(); - CleanupStack::Pop(); - switch ( iMsgCreationHelperState ) - { - case EContactHandlerGetSmsAddressFromPhonebook: - // Select SMS address, sending is done when callback completes - GetSmsAddressFromPhonebookAndSendL( cloneLink ); - break; - case EContactHandlerGetMmsAddressFromPhonebook: - // Select MMS address, sending is done when callback completes - GetMmsAddressFromPhonebookAndSendL( cloneLink, EFalse ); - break; - case EContactHandlerGetVoiceMsgAddressFromPhonebook: - // Select Voice MSG address, sending is done when callback completes - GetMmsAddressFromPhonebookAndSendL( cloneLink, ETrue ); - break; - default: - iState = EContactHandlerIdle; - iMsgCreationHelperState = EContactHandlerIdle; - break; - } - } - else - { - iMsgCreationHelperState = EContactHandlerIdle; - iState = EContactHandlerIdle; - } - } - - } + } + iState = EContactHandlerIdle; + } + + CleanupStack::PopAndDestroy( aContact ); + } + // Addition to get contact for message creation. + else if ( (iLinkOperationFetch == &aOperation) && ( iMsgCreationHelperState == EContactHandlerGetSmsAddressFromPhonebook || + iMsgCreationHelperState == EContactHandlerGetMmsAddressFromPhonebook || iMsgCreationHelperState == EContactHandlerGetVoiceMsgAddressFromPhonebook ) ) + { + if ( iContactForMsgCreation ) + { + delete iContactForMsgCreation; + iContactForMsgCreation = NULL; + } + // Check that we have a contact for message creatiun + if ( aContact ) + { + // State is now idle. + iState = EContactHandlerIdle; + // Store contact + iContactForMsgCreation = aContact; + // Create clonelink for address selection + MVPbkContactLink* cloneLink = iCurrentLink->CloneLC(); + CleanupStack::Pop(); + switch ( iMsgCreationHelperState ) + { + case EContactHandlerGetSmsAddressFromPhonebook: + // Select SMS address, sending is done when callback completes + GetSmsAddressFromPhonebookAndSendL( cloneLink ); + break; + case EContactHandlerGetMmsAddressFromPhonebook: + // Select MMS address, sending is done when callback completes + GetMmsAddressFromPhonebookAndSendL( cloneLink, EFalse ); + break; + case EContactHandlerGetVoiceMsgAddressFromPhonebook: + // Select Voice MSG address, sending is done when callback completes + GetMmsAddressFromPhonebookAndSendL( cloneLink, ETrue ); + break; + default: + iState = EContactHandlerIdle; + iMsgCreationHelperState = EContactHandlerIdle; + break; + } + } + else + { + iMsgCreationHelperState = EContactHandlerIdle; + iState = EContactHandlerIdle; + } + } + + } void CFSEmailUiContactHandler::VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& aOperation, TInt aError ) - { + MVPbkContactOperationBase& aOperation, TInt aError ) + { FUNC_LOG; - TRAP_IGNORE( VPbkSingleContactOperationFailedL( aOperation, aError ) ); - } + TRAP_IGNORE( VPbkSingleContactOperationFailedL( aOperation, aError ) ); + } void CFSEmailUiContactHandler::VPbkSingleContactOperationFailedL( - MVPbkContactOperationBase& /*aOperation*/, TInt aError ) - { + MVPbkContactOperationBase& /*aOperation*/, TInt aError ) + { FUNC_LOG; - iState = EContactHandlerIdle; - if ( iHandlerObserver ) - { - iHandlerObserver->OperationErrorL( EFindAndCallToContactByEmailL, aError ); - iHandlerObserver = NULL; - } - } + iState = EContactHandlerIdle; + if ( iHandlerObserver ) + { + iHandlerObserver->OperationErrorL( EFindAndCallToContactByEmailL, aError ); + iHandlerObserver = NULL; + } + } void CFSEmailUiContactHandler::OpenComplete() - { + { FUNC_LOG; - if ( iStoreReady ) - { - iOpenComplete = ETrue; - } - } + if ( iStoreReady ) + { + iOpenComplete = ETrue; + } + } void CFSEmailUiContactHandler::StoreReady(MVPbkContactStore& /*aContactStore*/) - { + { FUNC_LOG; - iStoreReady = ETrue; - } + iStoreReady = ETrue; + } void CFSEmailUiContactHandler::StoreUnavailable(MVPbkContactStore& /*aContactStore*/, TInt /*aReason*/) - { + { FUNC_LOG; - iStoreReady = EFalse; - } + iStoreReady = EFalse; + } void CFSEmailUiContactHandler::HandleStoreEventL( MVPbkContactStore& /*aContactStore*/, - TVPbkContactStoreEvent /*aStoreEvent*/) - { + TVPbkContactStoreEvent /*aStoreEvent*/) + { FUNC_LOG; - - } + + } // ----------------------------------------------------------------------------- // CFSEmailUiContactHandler::HandleNotifyL // ----------------------------------------------------------------------------- TInt CFSEmailUiContactHandler::HandleNotifyL( TInt aCmdId, TInt aEventId, - CAiwGenericParamList& aEventParamList, - const CAiwGenericParamList& /*aInParamList*/) - { + CAiwGenericParamList& aEventParamList, + const CAiwGenericParamList& /*aInParamList*/) + { FUNC_LOG; - TInt result = 0; - if ( (aCmdId == KAiwCmdAssign) && (iState == EContactHandlerAddToContacts) && - (aEventId == KAiwEventCompleted) ) - { - // Add to contacts function is completed - iState = EContactHandlerIdle; - if ( iHandlerObserver ) - { - RPointerArray emptyItems; - iHandlerObserver->OperationCompleteL( EAddToContactL, emptyItems ); - emptyItems.Close(); - iHandlerObserver = NULL; - } - - } - else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetAddressesFromPhonebook) && - (aEventId == KAiwEventCompleted)) - { + TInt result = 0; + if ( (aCmdId == KAiwCmdAssign) && (iState == EContactHandlerAddToContacts) && + (aEventId == KAiwEventCompleted) ) + { + // Add to contacts function is completed + iState = EContactHandlerIdle; + if ( iHandlerObserver ) + { + RPointerArray emptyItems; + iHandlerObserver->OperationCompleteL( EAddToContactL, emptyItems ); + emptyItems.Close(); + iHandlerObserver = NULL; + } + + } + else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetAddressesFromPhonebook) && + (aEventId == KAiwEventCompleted)) + { - TInt index = 0; - const TAiwGenericParam* param = - aEventParamList.FindFirst(index, EGenericParamContactLinkArray); - if (param) - { - TPtrC8 contactLinks = param->Value().AsData(); + TInt index = 0; + const TAiwGenericParam* param = + aEventParamList.FindFirst(index, EGenericParamContactLinkArray); + if (param) + { + TPtrC8 contactLinks = param->Value().AsData(); - iLinksSet = iContactManager->CreateLinksLC(contactLinks); - CleanupStack::Pop(); - if ( iLinksSet->Count() ) - { - iCurrentLink = &iLinksSet->At(0); - //Async operation, callback VPbkSingleContactOperationCompleteL - //Error situations: VPbkSingleContactOperationFailed - iLinkOperationFetch = iContactManager->RetrieveContactL( iLinksSet->At(0), *this ); - } + iLinksSet = iContactManager->CreateLinksLC(contactLinks); + CleanupStack::Pop(); + if ( iLinksSet->Count() ) + { + iCurrentLink = &iLinksSet->At(0); + //Async operation, callback VPbkSingleContactOperationCompleteL + //Error situations: VPbkSingleContactOperationFailed + iLinkOperationFetch = iContactManager->RetrieveContactL( iLinksSet->At(0), *this ); + } - iContactManager->ContactStoresL().OpenAllL( *this ); - } + iContactManager->ContactStoresL().OpenAllL( *this ); + } - } - else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetSmsAddressFromPhonebook) && - (aEventId == KAiwEventCompleted)) - { - iState = EContactHandlerIdle; - SendMessageL( aEventParamList, EContactHandlerGetSmsAddressFromPhonebook ); - } - else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetMmsAddressFromPhonebook) && - (aEventId == KAiwEventCompleted)) - { - iState = EContactHandlerIdle; - // Send SMS to contact address - SendMessageL( aEventParamList, EContactHandlerGetMmsAddressFromPhonebook ); - } - else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetVoiceMsgAddressFromPhonebook) && - (aEventId == KAiwEventCompleted)) - { - iState = EContactHandlerIdle; - // Send Voice MSG to contact address - SendMessageL( aEventParamList, EContactHandlerGetVoiceMsgAddressFromPhonebook ); - } - - //Notify caller of the error - else if ( aEventId == KAiwEventError ) - { - iState = EContactHandlerIdle; - if ( iHandlerObserver ) - { - iHandlerObserver->OperationErrorL( CurrentCommand(), KErrGeneral ); - iHandlerObserver = NULL; - } - } + } + else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetSmsAddressFromPhonebook) && + (aEventId == KAiwEventCompleted)) + { + iState = EContactHandlerIdle; + SendMessageL( aEventParamList, EContactHandlerGetSmsAddressFromPhonebook ); + } + else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetMmsAddressFromPhonebook) && + (aEventId == KAiwEventCompleted)) + { + iState = EContactHandlerIdle; + // Send SMS to contact address + SendMessageL( aEventParamList, EContactHandlerGetMmsAddressFromPhonebook ); + } + else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetVoiceMsgAddressFromPhonebook) && + (aEventId == KAiwEventCompleted)) + { + iState = EContactHandlerIdle; + // Send Voice MSG to contact address + SendMessageL( aEventParamList, EContactHandlerGetVoiceMsgAddressFromPhonebook ); + } + + //Notify caller of the error + else if ( aEventId == KAiwEventError ) + { + iState = EContactHandlerIdle; + if ( iHandlerObserver ) + { + iHandlerObserver->OperationErrorL( CurrentCommand(), KErrGeneral ); + iHandlerObserver = NULL; + } + } - // We don't need to check outParams, or do anything special during the exit - else if ( (aEventId == KAiwEventQueryExit) ) - { - result = ETrue; - } - - else if ( aEventId == KAiwEventOutParamCheck ) - { - result = 1; - } - else if ( aEventId == KAiwEventCanceled ) - { - iState = EContactHandlerIdle; - if ( iHandlerObserver ) - { - RPointerArray emptyItems; - iHandlerObserver->OperationCompleteL( CurrentCommand(), emptyItems ); - emptyItems.Close(); - iHandlerObserver = NULL; - } - } + // We don't need to check outParams, or do anything special during the exit + else if ( (aEventId == KAiwEventQueryExit) ) + { + result = ETrue; + } + + else if ( aEventId == KAiwEventOutParamCheck ) + { + result = 1; + } + else if ( aEventId == KAiwEventCanceled ) + { + iState = EContactHandlerIdle; + if ( iHandlerObserver ) + { + RPointerArray emptyItems; + iHandlerObserver->OperationCompleteL( CurrentCommand(), emptyItems ); + emptyItems.Close(); + iHandlerObserver = NULL; + } + } return result; } CFSEmailUiContactHandler::CFSEmailUiContactHandler( RFs& aSession ): - iState(EContactHandlerIdle), + iState(EContactHandlerIdle), iHandlerObserver(NULL), - iOpenComplete(EFalse), - iStoreReady(EFalse), - iUseSenderText(EFalse), - iFs( aSession ), - iCachingInProgressError(EFalse), + iOpenComplete(EFalse), + iStoreReady(EFalse), + iUseSenderText(EFalse), + iFs( aSession ), + iCachingInProgressError(EFalse), // video call iVideoCall( EFalse ) // @@ -1092,13 +1100,13 @@ } else { - TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); + TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER ); } // video call flag needs to be cleared iVideoCall = EFalse; // iState = EContactHandlerIdle; - } + } else if ( aMatchingItems.Count() > 0 ) // Call to one directly { // Create contact item in which to copy number or address, async operation. @@ -1108,26 +1116,26 @@ iCurrentLink = aMatchingItems[0]->ContactLink()->CloneLC(); CleanupStack::Pop(); if ( iLinkOperationFetch ) - { - delete iLinkOperationFetch; - iLinkOperationFetch = NULL; - } + { + delete iLinkOperationFetch; + iLinkOperationFetch = NULL; + } //Async operation, callback VPbkSingleContactOperationCompleteL //Error situations: VPbkSingleContactOperationFailed iLinkOperationFetch = iContactManager->RetrieveContactL - (*iCurrentLink, *this); + (*iCurrentLink, *this); } } void CFSEmailUiContactHandler::CreateMessageL( const RPointerArray& aMatchingItems ) - { + { FUNC_LOG; - iState = EContactHandlerIdle; - - if ( aMatchingItems.Count() == 0 ) - { + iState = EContactHandlerIdle; + + if ( aMatchingItems.Count() == 0 ) + { // /*if ( IsRemoteLookupSupported() ) { @@ -1147,179 +1155,179 @@ // no Text message available - subset of Multimedia and Voice message is displayed TFsEmailUiUtility::ShowCreateMessageQueryL( *iPreviousEmailAddress, ETrue ); // - iState = EContactHandlerIdle; - } - else if ( aMatchingItems.Count() > 0 ) - { - CSendUi* sendUi = CSendUi::NewLC(); + iState = EContactHandlerIdle; + } + else if ( aMatchingItems.Count() > 0 ) + { + CSendUi* sendUi = CSendUi::NewLC(); - CArrayFix* showedServicesUidArray = new( ELeave ) CArrayFixFlat(4); - CleanupStack::PushL( showedServicesUidArray ); + CArrayFix* showedServicesUidArray = new( ELeave ) CArrayFixFlat(4); + CleanupStack::PushL( showedServicesUidArray ); - CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 2 ); - CleanupStack::PushL( array ); + CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 2 ); + CleanupStack::PushL( array ); - TSendingCapabilities noCapabilities(0,0,0); - - if( sendUi->ValidateServiceL( KSenduiMtmSmsUid, noCapabilities ) ) - { - HBufC* textMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_TEXT_MESSAGE ); - array->AppendL( *textMessage ); - CleanupStack::PopAndDestroy( textMessage ); - showedServicesUidArray->AppendL( KSenduiMtmSmsUid ); - } - if( sendUi->ValidateServiceL( KSenduiMtmMmsUid, noCapabilities ) ) - { - HBufC* multimediaMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_MULTIMEDIA_MESSAGE ); - array->AppendL( *multimediaMessage ); - CleanupStack::PopAndDestroy( multimediaMessage ); - showedServicesUidArray->AppendL( KSenduiMtmMmsUid ); - } - if( sendUi->ValidateServiceL( KSenduiMtmAudioMessageUid, noCapabilities ) ) - { - HBufC* voiceMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_VOICE_MESSAGE ); - array->AppendL( *voiceMessage ); - CleanupStack::PopAndDestroy( voiceMessage ); - showedServicesUidArray->AppendL( KSenduiMtmAudioMessageUid ); - } + TSendingCapabilities noCapabilities(0,0,0); + + if( sendUi->ValidateServiceL( KSenduiMtmSmsUid, noCapabilities ) ) + { + HBufC* textMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_TEXT_MESSAGE ); + array->AppendL( *textMessage ); + CleanupStack::PopAndDestroy( textMessage ); + showedServicesUidArray->AppendL( KSenduiMtmSmsUid ); + } + if( sendUi->ValidateServiceL( KSenduiMtmMmsUid, noCapabilities ) ) + { + HBufC* multimediaMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_MULTIMEDIA_MESSAGE ); + array->AppendL( *multimediaMessage ); + CleanupStack::PopAndDestroy( multimediaMessage ); + showedServicesUidArray->AppendL( KSenduiMtmMmsUid ); + } + if( sendUi->ValidateServiceL( KSenduiMtmAudioMessageUid, noCapabilities ) ) + { + HBufC* voiceMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_VOICE_MESSAGE ); + array->AppendL( *voiceMessage ); + CleanupStack::PopAndDestroy( voiceMessage ); + showedServicesUidArray->AppendL( KSenduiMtmAudioMessageUid ); + } - TInt selectedOption; - CAknListQueryDialog* dlg = new ( ELeave ) CAknListQueryDialog( &selectedOption ); - dlg->PrepareLC( R_MAIL_VIEWER_CREATE_MESSAGE_DIALOG ); - - dlg->SetItemTextArray( array ); - dlg->SetOwnershipType( ELbmDoesNotOwnItemArray ); - TInt ret = dlg->RunLD(); - CleanupStack::PopAndDestroy( array ); - CleanupStack::PopAndDestroy( showedServicesUidArray ); - CleanupStack::PopAndDestroy( sendUi ); - - // Continue sending process if query is not cancelled - if( ret ) - { - switch ( selectedOption ) - { - case 0: - // Select SMS address, sending is done when callback completes - iMsgCreationHelperState = EContactHandlerGetSmsAddressFromPhonebook; - break; - case 1: - // Select MMS address, sending is done when callback completes - iMsgCreationHelperState = EContactHandlerGetMmsAddressFromPhonebook; - break; - case 2: - // Select Voice MSG address, sending is done when callback completes - iMsgCreationHelperState = EContactHandlerGetVoiceMsgAddressFromPhonebook; - break; - default: - iMsgCreationHelperState = EContactHandlerIdle; - break; - } - // Create contact item in which to copy number or address, async operation. - delete iCurrentLink; - iCurrentLink = NULL; - - iCurrentLink = aMatchingItems[0]->ContactLink()->CloneLC(); - CleanupStack::Pop(); - if ( iLinkOperationFetch ) - { - delete iLinkOperationFetch; - iLinkOperationFetch = NULL; - } - - //Async operation, callback VPbkSingleContactOperationCompleteL - //Error situations: VPbkSingleContactOperationFailed - iLinkOperationFetch = iContactManager->RetrieveContactL - (*iCurrentLink, *this); - } - } - } + TInt selectedOption; + CAknListQueryDialog* dlg = new ( ELeave ) CAknListQueryDialog( &selectedOption ); + dlg->PrepareLC( R_MAIL_VIEWER_CREATE_MESSAGE_DIALOG ); + + dlg->SetItemTextArray( array ); + dlg->SetOwnershipType( ELbmDoesNotOwnItemArray ); + TInt ret = dlg->RunLD(); + CleanupStack::PopAndDestroy( array ); + CleanupStack::PopAndDestroy( showedServicesUidArray ); + CleanupStack::PopAndDestroy( sendUi ); + + // Continue sending process if query is not cancelled + if( ret ) + { + switch ( selectedOption ) + { + case 0: + // Select SMS address, sending is done when callback completes + iMsgCreationHelperState = EContactHandlerGetSmsAddressFromPhonebook; + break; + case 1: + // Select MMS address, sending is done when callback completes + iMsgCreationHelperState = EContactHandlerGetMmsAddressFromPhonebook; + break; + case 2: + // Select Voice MSG address, sending is done when callback completes + iMsgCreationHelperState = EContactHandlerGetVoiceMsgAddressFromPhonebook; + break; + default: + iMsgCreationHelperState = EContactHandlerIdle; + break; + } + // Create contact item in which to copy number or address, async operation. + delete iCurrentLink; + iCurrentLink = NULL; + + iCurrentLink = aMatchingItems[0]->ContactLink()->CloneLC(); + CleanupStack::Pop(); + if ( iLinkOperationFetch ) + { + delete iLinkOperationFetch; + iLinkOperationFetch = NULL; + } + + //Async operation, callback VPbkSingleContactOperationCompleteL + //Error situations: VPbkSingleContactOperationFailed + iLinkOperationFetch = iContactManager->RetrieveContactL + (*iCurrentLink, *this); + } + } + } // ----------------------------------------------------------------------------- // CFSEmailUiContactHandler::SendMessageL // ----------------------------------------------------------------------------- void CFSEmailUiContactHandler::SendMessageL( CAiwGenericParamList& aEventParamList, TInt aServiceType ) - { + { FUNC_LOG; - TInt paramIndex(0); - iState = EContactHandlerIdle; + TInt paramIndex(0); + iState = EContactHandlerIdle; - const TAiwGenericParam* param = + const TAiwGenericParam* param = aEventParamList.FindFirst( paramIndex, EGenericParamContactLinkArray ); if ( param ) { TPtrC8 packedLinks = param->Value().AsData(); if ( packedLinks.Length() > 0 ) { - CSendUi* sendUi = CSendUi::NewLC(); - CMessageData* messageData = CMessageData::NewLC(); + CSendUi* sendUi = CSendUi::NewLC(); + CMessageData* messageData = CMessageData::NewLC(); MVPbkContactLinkArray* linkArray = GetContactManager()->CreateLinksLC(packedLinks); MVPbkStoreContactField* field = iContactForMsgCreation->Fields().RetrieveField(linkArray->At(0)); MVPbkContactFieldData& data = field->FieldData(); if (data.DataType() == EVPbkFieldStorageTypeText) { - const TDesC& dataText = MVPbkContactFieldTextData::Cast(data).Text(); - // Get contact alias to message data if there is name data + const TDesC& dataText = MVPbkContactFieldTextData::Cast(data).Text(); + // Get contact alias to message data if there is name data //RFs& rFs = CEikonEnv::Static()->FsSession(); - //User::LeaveIfError(rFs.Connect()); - CPbk2SortOrderManager* sortOrderManager = - CPbk2SortOrderManager::NewL(iContactManager->FieldTypes(), &iFs); - MPbk2ContactNameFormatter* nameFormatter = - Pbk2ContactNameFormatterFactory::CreateL(iContactManager->FieldTypes(), *sortOrderManager, &iFs); - HBufC* nameBuffer = nameFormatter->GetContactTitleL( iContactForMsgCreation->Fields(), 0); - - delete sortOrderManager; - sortOrderManager = NULL; - delete nameFormatter; - nameFormatter = NULL; - - //rFs.Close(); - if ( nameBuffer ) - { - CleanupStack::PushL( nameBuffer ); - messageData->AppendToAddressL( dataText, *nameBuffer ); - CleanupStack::PopAndDestroy( nameBuffer ); - } - else - { - messageData->AppendToAddressL( dataText ); - } - // Send selected message - TSendingCapabilities noCapabilities(0,0,0); - switch ( aServiceType ) - { - case EContactHandlerGetSmsAddressFromPhonebook: - { - if( sendUi->ValidateServiceL( KSenduiMtmSmsUid, noCapabilities ) ) - { - sendUi->CreateAndSendMessageL( KSenduiMtmSmsUid, messageData, KNullUid, EFalse ); - } - } - break; - case EContactHandlerGetMmsAddressFromPhonebook: - { - if( sendUi->ValidateServiceL( KSenduiMtmMmsUid, noCapabilities ) ) - { - sendUi->CreateAndSendMessageL( KSenduiMtmMmsUid, messageData, KNullUid, EFalse ); - } - } - break; - case EContactHandlerGetVoiceMsgAddressFromPhonebook: - { - if( sendUi->ValidateServiceL( KSenduiMtmAudioMessageUid, noCapabilities ) ) - { - sendUi->CreateAndSendMessageL( KSenduiMtmAudioMessageUid, messageData, KNullUid, EFalse ); - } - } - break; - default: - break; - } - } + //User::LeaveIfError(rFs.Connect()); + CPbk2SortOrderManager* sortOrderManager = + CPbk2SortOrderManager::NewL(iContactManager->FieldTypes(), &iFs); + MPbk2ContactNameFormatter* nameFormatter = + Pbk2ContactNameFormatterFactory::CreateL(iContactManager->FieldTypes(), *sortOrderManager, &iFs); + HBufC* nameBuffer = nameFormatter->GetContactTitleL( iContactForMsgCreation->Fields(), 0); + + delete sortOrderManager; + sortOrderManager = NULL; + delete nameFormatter; + nameFormatter = NULL; + + //rFs.Close(); + if ( nameBuffer ) + { + CleanupStack::PushL( nameBuffer ); + messageData->AppendToAddressL( dataText, *nameBuffer ); + CleanupStack::PopAndDestroy( nameBuffer ); + } + else + { + messageData->AppendToAddressL( dataText ); + } + // Send selected message + TSendingCapabilities noCapabilities(0,0,0); + switch ( aServiceType ) + { + case EContactHandlerGetSmsAddressFromPhonebook: + { + if( sendUi->ValidateServiceL( KSenduiMtmSmsUid, noCapabilities ) ) + { + sendUi->CreateAndSendMessageL( KSenduiMtmSmsUid, messageData, KNullUid, EFalse ); + } + } + break; + case EContactHandlerGetMmsAddressFromPhonebook: + { + if( sendUi->ValidateServiceL( KSenduiMtmMmsUid, noCapabilities ) ) + { + sendUi->CreateAndSendMessageL( KSenduiMtmMmsUid, messageData, KNullUid, EFalse ); + } + } + break; + case EContactHandlerGetVoiceMsgAddressFromPhonebook: + { + if( sendUi->ValidateServiceL( KSenduiMtmAudioMessageUid, noCapabilities ) ) + { + sendUi->CreateAndSendMessageL( KSenduiMtmAudioMessageUid, messageData, KNullUid, EFalse ); + } + } + break; + default: + break; + } + } CleanupStack::PopAndDestroy( 3 ); // Sendui, messageData and linkArray. } } - } + } // --------------------------------------------------------------------------- // CFSEmailUiContactHandler::IsRemoteLookupSupported // --------------------------------------------------------------------------- @@ -1335,33 +1343,33 @@ void CFSEmailUiContactHandler::GetContactFieldsL( RArray& aFieldIds, RPointerArray& aNumbers, MVPbkStoreContact* aContact) - { + { FUNC_LOG; - for (TInt i = 0; i < aFieldIds.Count(); i++ ) - { - const MVPbkFieldType* myContactDataField = - iContactManager->FieldTypes().Find( aFieldIds[i] ); + for (TInt i = 0; i < aFieldIds.Count(); i++ ) + { + const MVPbkFieldType* myContactDataField = + iContactManager->FieldTypes().Find( aFieldIds[i] ); - CVPbkBaseContactFieldTypeIterator* itrNumber = - CVPbkBaseContactFieldTypeIterator::NewLC( *myContactDataField, - aContact->Fields() ); + CVPbkBaseContactFieldTypeIterator* itrNumber = + CVPbkBaseContactFieldTypeIterator::NewLC( *myContactDataField, + aContact->Fields() ); - // Iterate through each of the data fields - while ( itrNumber->HasNext() ) - { - const MVPbkBaseContactField* field = itrNumber->Next(); + // Iterate through each of the data fields + while ( itrNumber->HasNext() ) + { + const MVPbkBaseContactField* field = itrNumber->Next(); - if ( (field->FieldData()).DataType() == EVPbkFieldStorageTypeText ) - { - HBufC* toAppend = MVPbkContactFieldTextData::Cast( - field->FieldData() ).Text().AllocL(); - - aNumbers.Append( toAppend ); - } - } - CleanupStack::PopAndDestroy( itrNumber ); - } - } + if ( (field->FieldData()).DataType() == EVPbkFieldStorageTypeText ) + { + HBufC* toAppend = MVPbkContactFieldTextData::Cast( + field->FieldData() ).Text().AllocL(); + + aNumbers.Append( toAppend ); + } + } + CleanupStack::PopAndDestroy( itrNumber ); + } + } // --------------------------------------------------------------------------- // Activates phonebook view to show details of give contact @@ -1375,23 +1383,33 @@ aMatchingItems[0]->ContactLink() ) { MVPbkContactLink* contact = aMatchingItems[0]->ContactLink(); - CPbk2ViewState* pbk2ViewParam = CPbk2ViewState::NewLC(); - pbk2ViewParam->SetFocusedContact( contact->CloneLC() ); - CleanupStack::Pop(); // Cloned contact - pbk2ViewParam->SetFocusedFieldIndex( 3 ); - HBufC8* paramBuf = pbk2ViewParam->PackLC(); + HBufC8* packed = contact->PackLC(); + + HBufC16* link16 = HBufC16::NewLC(packed->Length()); + link16->Des().Copy(packed->Des()); + + MCCAParameter* param = TCCAFactory::NewParameterL(); + CleanupClosePushL( *param ); + + delete iConnection; + iConnection = NULL; + iConnection = TCCAFactory::NewConnectionL(); - // Make view id with Phonebook2's app UID3 and Contact Info View's id - const TVwsViewId viewId( TUid::Uid(0x101f4cce), - TUid::Uid(EPbk2ContactInfoViewId) ); + // Setting up the contact link parameter, ownership transfers + param->SetConnectionFlag(MCCAParameter::ENormal); + param->SetContactDataFlag(MCCAParameter::EContactLink); + param->SetContactDataL( link16->Des() ); - // Activate the view - CEikonEnv::Static()->AppUi()->ActivateViewL( viewId, - CPbk2ViewState::Uid(), *paramBuf ); + // switch to details view + const TUid uid = TUid::Uid( 0x200159E7 ); + param->SetLaunchedViewUid( uid); - // Cleanup - CleanupStack::PopAndDestroy( paramBuf ); - CleanupStack::PopAndDestroy( pbk2ViewParam ); + // Launching the CCA application + iConnection->LaunchAppL( *param, this ); + + CleanupStack::Pop( param ); // parameter is taken care by MCCAConnection + CleanupStack::PopAndDestroy( link16 ); + CleanupStack::PopAndDestroy( packed ); } else { @@ -1420,32 +1438,32 @@ } void CFSEmailUiContactHandler::FormatFieldIds() - { + { FUNC_LOG; - iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN ); - iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILWORK ); - iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILHOME ); - - iFirstnameFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME ); - iLastnameFields.Append( R_VPBK_FIELD_TYPE_LASTNAME ); - - iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEHOME ); - iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEWORK ); - iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEHOME ); - iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEWORK ); - iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEGEN ); - iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEGEN ); - - } + iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN ); + iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILWORK ); + iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILHOME ); + + iFirstnameFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME ); + iLastnameFields.Append( R_VPBK_FIELD_TYPE_LASTNAME ); + + iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEHOME ); + iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEWORK ); + iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEHOME ); + iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEWORK ); + iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEGEN ); + iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEGEN ); + + } void CFSEmailUiContactHandler::ResetFieldIds() - { + { FUNC_LOG; - iLastnameFields.Reset(); - iFirstnameFields.Reset(); - iEmailFields.Reset(); - iPhoneNumberFields.Reset(); - } + iLastnameFields.Reset(); + iFirstnameFields.Reset(); + iEmailFields.Reset(); + iPhoneNumberFields.Reset(); + } // ----------------------------------------------------------------------------- @@ -1453,98 +1471,98 @@ // ----------------------------------------------------------------------------- TBool CFSEmailUiContactHandler::GetNameAndEmailFromRemoteLookupL( CFSMailBox& aMailBox, const TDesC& aQueryString, TDes& aDisplayname, TDes& aEmailAddress ) - { + { FUNC_LOG; - CPbkxRemoteContactLookupServiceUiContext::TResult result; - DoRemoteLookupL( aMailBox, aQueryString, result, - CPbkxRemoteContactLookupServiceUiContext::EModeContactSelector); + CPbkxRemoteContactLookupServiceUiContext::TResult result; + DoRemoteLookupL( aMailBox, aQueryString, result, + CPbkxRemoteContactLookupServiceUiContext::EModeContactSelector); - if ( result.iExitReason == - CPbkxRemoteContactLookupServiceUiContext::TResult::EExitContactSelected ) - { - GetNameAndEmail( aDisplayname, aEmailAddress, *(result.iSelectedContactItem) ); - return ETrue; - } + if ( result.iExitReason == + CPbkxRemoteContactLookupServiceUiContext::TResult::EExitContactSelected ) + { + GetNameAndEmail( aDisplayname, aEmailAddress, *(result.iSelectedContactItem) ); + return ETrue; + } - return EFalse; - } + return EFalse; + } // ----------------------------------------------------------------------------- // CFSEmailUiContactHandler::LaunchRemoteLookupL // ----------------------------------------------------------------------------- void CFSEmailUiContactHandler::LaunchRemoteLookupL( CFSMailBox& aMailBox ) - { + { FUNC_LOG; - CPbkxRemoteContactLookupServiceUiContext::TResult result; - DoRemoteLookupL( aMailBox, KNullDesC , result, - CPbkxRemoteContactLookupServiceUiContext::EModeNormal ); + CPbkxRemoteContactLookupServiceUiContext::TResult result; + DoRemoteLookupL( aMailBox, KNullDesC , result, + CPbkxRemoteContactLookupServiceUiContext::EModeNormal ); - } + } // ----------------------------------------------------------------------------- // CFSEmailUiContactHandler::LaunchRemoteLookupL // ----------------------------------------------------------------------------- HBufC* CFSEmailUiContactHandler::GetNameAndNumberFromRemoteLookupL( CFSMailBox& aMailBox, const TDesC& aQuery, - RBuf& aPhoneNumber ) - { + RBuf& aPhoneNumber ) + { FUNC_LOG; - CPbkxRemoteContactLookupServiceUiContext::TResult result; - DoRemoteLookupL( aMailBox, aQuery , result, - CPbkxRemoteContactLookupServiceUiContext::EModeContactSelector ); + CPbkxRemoteContactLookupServiceUiContext::TResult result; + DoRemoteLookupL( aMailBox, aQuery , result, + CPbkxRemoteContactLookupServiceUiContext::EModeContactSelector ); - HBufC* displayName = NULL; - - if ( result.iExitReason == - CPbkxRemoteContactLookupServiceUiContext::TResult::EExitContactSelected ) - { - displayName = GetPhoneNumberAndNameL( aPhoneNumber, *(result.iSelectedContactItem) ); - } - return displayName; - } + HBufC* displayName = NULL; + + if ( result.iExitReason == + CPbkxRemoteContactLookupServiceUiContext::TResult::EExitContactSelected ) + { + displayName = GetPhoneNumberAndNameL( aPhoneNumber, *(result.iSelectedContactItem) ); + } + return displayName; + } void CFSEmailUiContactHandler::LaunchRemoteLookupWithQueryL( CFSMailBox& aMailBox, const TDesC& aQuery ) - { + { FUNC_LOG; - CPbkxRemoteContactLookupServiceUiContext::TResult result; - DoRemoteLookupL( aMailBox, aQuery , result, - CPbkxRemoteContactLookupServiceUiContext::EModeExistingCriteria ); + CPbkxRemoteContactLookupServiceUiContext::TResult result; + DoRemoteLookupL( aMailBox, aQuery , result, + CPbkxRemoteContactLookupServiceUiContext::EModeExistingCriteria ); - } + } HBufC* CFSEmailUiContactHandler::GetLastSearchNameL( const TDesC& aEmailAddress ) - { + { FUNC_LOG; - HBufC* name(NULL); - if ( iSearchMatch ) - { - if ( !iSearchMatch->EmailAddress().CompareF( aEmailAddress ) ) - { - if ( iSearchMatch->DisplayName() != KNullDesC ) - { - name = iSearchMatch->DisplayName().AllocL(); - } - } - } - return name; - } + HBufC* name(NULL); + if ( iSearchMatch ) + { + if ( !iSearchMatch->EmailAddress().CompareF( aEmailAddress ) ) + { + if ( iSearchMatch->DisplayName() != KNullDesC ) + { + name = iSearchMatch->DisplayName().AllocL(); + } + } + } + return name; + } void CFSEmailUiContactHandler::Reset() - { + { FUNC_LOG; - iContactObjects.ResetAndDestroy(); - iState = EContactHandlerIdle; - delete iLinksSet; - iLinksSet = NULL; - delete iLinkOperation; - iLinkOperation = NULL; - delete iLinkOperationFetch; - iLinkOperationFetch = NULL; - iHandlerObserver = NULL; - } + iContactObjects.ResetAndDestroy(); + iState = EContactHandlerIdle; + delete iLinksSet; + iLinksSet = NULL; + delete iLinkOperation; + iLinkOperation = NULL; + delete iLinkOperationFetch; + iLinkOperationFetch = NULL; + iHandlerObserver = NULL; + } // --------------------------------------------------------------------------- @@ -1553,131 +1571,131 @@ // void CFSEmailUiContactHandler::GetNameAndEmail( TDes& aName, TDes& aEmail, CContactItem& aItem ) const - { + { FUNC_LOG; - CContactItemFieldSet& fieldSet = aItem.CardFields(); - aName.Zero(); + CContactItemFieldSet& fieldSet = aItem.CardFields(); + aName.Zero(); - RBuf familyName; - RBuf givenName; - TInt pos; + RBuf familyName; + RBuf givenName; + TInt pos; - pos = fieldSet.Find(KUidContactFieldFamilyName); - if (pos >= 0) - { - CContactItemField& itemField=fieldSet[pos]; - if (!(itemField.IsHidden()) && !(itemField.IsDisabled())) - { - CContactTextField* textField = itemField.TextStorage(); - familyName.Create( textField->Text() ); - } - } - pos = fieldSet.Find(KUidContactFieldGivenName); - if (pos >= 0) - { - CContactItemField& itemField=fieldSet[pos]; - if (!(itemField.IsHidden()) && !(itemField.IsDisabled())) - { - CContactTextField* textField = itemField.TextStorage(); - givenName.Create( textField->Text() ); - } - } - RBuf email; - pos = fieldSet.Find(KUidContactFieldEMail); - if (pos >= 0) - { - CContactItemField& itemField=fieldSet[pos]; - if (!(itemField.IsHidden()) && !(itemField.IsDisabled())) - { - CContactTextField* textField = itemField.TextStorage(); - email.Create( textField->Text() ); - aEmail.Copy( email ); - } - } - email.Close(); + pos = fieldSet.Find(KUidContactFieldFamilyName); + if (pos >= 0) + { + CContactItemField& itemField=fieldSet[pos]; + if (!(itemField.IsHidden()) && !(itemField.IsDisabled())) + { + CContactTextField* textField = itemField.TextStorage(); + familyName.Create( textField->Text() ); + } + } + pos = fieldSet.Find(KUidContactFieldGivenName); + if (pos >= 0) + { + CContactItemField& itemField=fieldSet[pos]; + if (!(itemField.IsHidden()) && !(itemField.IsDisabled())) + { + CContactTextField* textField = itemField.TextStorage(); + givenName.Create( textField->Text() ); + } + } + RBuf email; + pos = fieldSet.Find(KUidContactFieldEMail); + if (pos >= 0) + { + CContactItemField& itemField=fieldSet[pos]; + if (!(itemField.IsHidden()) && !(itemField.IsDisabled())) + { + CContactTextField* textField = itemField.TextStorage(); + email.Create( textField->Text() ); + aEmail.Copy( email ); + } + } + email.Close(); - if ( familyName.Length() ) - { - aName.Append(givenName); - aName.Trim(); - } + if ( familyName.Length() ) + { + aName.Append(givenName); + aName.Trim(); + } - if ( givenName.Length() ) - { - aName.Append(' '); - aName.Append(familyName); - aName.Trim(); - } + if ( givenName.Length() ) + { + aName.Append(' '); + aName.Append(familyName); + aName.Trim(); + } - givenName.Close(); - familyName.Close(); - } + givenName.Close(); + familyName.Close(); + } // --------------------------------------------------------------------------- // Gets the phone number from given contact item // --------------------------------------------------------------------------- // HBufC* CFSEmailUiContactHandler::GetPhoneNumberAndNameL( RBuf& aPhoneNumber, CContactItem& aItem ) const - { + { FUNC_LOG; - TInt pos; - CContactItemFieldSet& fieldSet = aItem.CardFields(); + TInt pos; + CContactItemFieldSet& fieldSet = aItem.CardFields(); - pos = fieldSet.Find(KUidContactFieldPhoneNumber); - if (pos >= 0) - { - CContactItemField& itemField=fieldSet[pos]; - if (!(itemField.IsHidden()) && !(itemField.IsDisabled())) - { - CContactTextField* textField = itemField.TextStorage(); - //aPhoneNumber.Create( textField->Text()->Length() ); - //aPhoneNumber.Copy( textField->Text() ); - aPhoneNumber.Create( textField->Text() ); - } - } - - HBufC* firstname = NULL; - - pos = fieldSet.Find( KUidContactFieldGivenName ); - if ( pos >= 0 ) - { - CContactItemField& itemField=fieldSet[pos]; - if ( !itemField.IsHidden() && !itemField.IsDisabled() ) - { - CContactTextField* textField = itemField.TextStorage(); - firstname = textField->Text().AllocLC(); - } - } - if ( !firstname ) - { - firstname = KNullDesC().AllocLC(); - } + pos = fieldSet.Find(KUidContactFieldPhoneNumber); + if (pos >= 0) + { + CContactItemField& itemField=fieldSet[pos]; + if (!(itemField.IsHidden()) && !(itemField.IsDisabled())) + { + CContactTextField* textField = itemField.TextStorage(); + //aPhoneNumber.Create( textField->Text()->Length() ); + //aPhoneNumber.Copy( textField->Text() ); + aPhoneNumber.Create( textField->Text() ); + } + } + + HBufC* firstname = NULL; + + pos = fieldSet.Find( KUidContactFieldGivenName ); + if ( pos >= 0 ) + { + CContactItemField& itemField=fieldSet[pos]; + if ( !itemField.IsHidden() && !itemField.IsDisabled() ) + { + CContactTextField* textField = itemField.TextStorage(); + firstname = textField->Text().AllocLC(); + } + } + if ( !firstname ) + { + firstname = KNullDesC().AllocLC(); + } - HBufC* lastname = NULL; - - pos = fieldSet.Find( KUidContactFieldFamilyName ); - if ( pos >= 0 ) - { - CContactItemField& itemField=fieldSet[pos]; - if ( !itemField.IsHidden() && !itemField.IsDisabled() ) - { - CContactTextField* textField = itemField.TextStorage(); - lastname = textField->Text().AllocLC(); - } - } - if ( !lastname ) - { - lastname = KNullDesC().AllocLC(); - } - - HBufC* name = TFsEmailUiUtility::CreateDisplayNameLC( *firstname, *lastname, KNullDesC ); - CleanupStack::Pop( name ); - CleanupStack::PopAndDestroy( lastname ); - CleanupStack::PopAndDestroy( firstname ); - - return name; - } + HBufC* lastname = NULL; + + pos = fieldSet.Find( KUidContactFieldFamilyName ); + if ( pos >= 0 ) + { + CContactItemField& itemField=fieldSet[pos]; + if ( !itemField.IsHidden() && !itemField.IsDisabled() ) + { + CContactTextField* textField = itemField.TextStorage(); + lastname = textField->Text().AllocLC(); + } + } + if ( !lastname ) + { + lastname = KNullDesC().AllocLC(); + } + + HBufC* name = TFsEmailUiUtility::CreateDisplayNameLC( *firstname, *lastname, KNullDesC ); + CleanupStack::Pop( name ); + CleanupStack::PopAndDestroy( lastname ); + CleanupStack::PopAndDestroy( firstname ); + + return name; + } // --------------------------------------------------------------------------- // CFSEmailUiContactHandler::DoRemoteLookupL @@ -1685,36 +1703,36 @@ // void CFSEmailUiContactHandler::DoRemoteLookupL( CFSMailBox& aMailBox, const TDesC& aQueryString, - CPbkxRemoteContactLookupServiceUiContext::TResult& aResult, - CPbkxRemoteContactLookupServiceUiContext::TMode aContext ) - { + CPbkxRemoteContactLookupServiceUiContext::TResult& aResult, + CPbkxRemoteContactLookupServiceUiContext::TMode aContext ) + { FUNC_LOG; - TUid protocolUid = TUid::Null(); - TUint accountId = 0; - aMailBox.GetRCLInfo( protocolUid, accountId ); - const TPbkxRemoteContactLookupProtocolAccountId KAccountId( - protocolUid, accountId ); - + TUid protocolUid = TUid::Null(); + TUint accountId = 0; + aMailBox.GetRCLInfo( protocolUid, accountId ); + const TPbkxRemoteContactLookupProtocolAccountId KAccountId( + protocolUid, accountId ); + - CPbkxRemoteContactLookupEnv* env = CPbkxRemoteContactLookupEnv::NewL(); - CleanupStack::PushL( env ); + CPbkxRemoteContactLookupEnv* env = CPbkxRemoteContactLookupEnv::NewL(); + CleanupStack::PushL( env ); - MPbkxRemoteContactLookupServiceUi* serviceUi = env->ServiceUiL(); + MPbkxRemoteContactLookupServiceUi* serviceUi = env->ServiceUiL(); - // If you want test with RCL dummyContactDatabase, KAccountId = serviceUi->DefaultAccountIdL(); - MPbkxRemoteContactLookupServiceUi::TContextParams params = { KAccountId, aContext }; + // If you want test with RCL dummyContactDatabase, KAccountId = serviceUi->DefaultAccountIdL(); + MPbkxRemoteContactLookupServiceUi::TContextParams params = { KAccountId, aContext }; - CPbkxRemoteContactLookupServiceUiContext* ctx( NULL ); - ctx = serviceUi->NewContextL( params ); + CPbkxRemoteContactLookupServiceUiContext* ctx( NULL ); + ctx = serviceUi->NewContextL( params ); - CleanupStack::PushL( ctx ); + CleanupStack::PushL( ctx ); - ctx->ExecuteL( aQueryString, aResult ); + ctx->ExecuteL( aQueryString, aResult ); - CleanupStack::PopAndDestroy( ctx ); - CleanupStack::PopAndDestroy( env ); + CleanupStack::PopAndDestroy( ctx ); + CleanupStack::PopAndDestroy( env ); - } + } // --------------------------------------------------------------------------- @@ -1723,43 +1741,43 @@ // TBool CFSEmailUiContactHandler::CallQueryL( const TDesC& aDisplayName ) - { + { FUNC_LOG; - TInt answer = 0; - - if ( aDisplayName.Length() ) - { - if ( iUseSenderText ) - { - answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_CALL_SENDER_QUERY, - aDisplayName ); - } - else - { - answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, - aDisplayName ); - } - } - else // Show basic note if display name is not available. - { - _LIT(KEmpty, ""); - // Create dialog - CFSEmailUiCallDialog* queryNote = new ( ELeave ) CFSEmailUiCallDialog(); - CleanupStack::PushL( queryNote ); + TInt answer = 0; + + if ( aDisplayName.Length() ) + { + if ( iUseSenderText ) + { + answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_CALL_SENDER_QUERY, + aDisplayName ); + } + else + { + answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, + aDisplayName ); + } + } + else // Show basic note if display name is not available. + { + _LIT(KEmpty, ""); + // Create dialog + CFSEmailUiCallDialog* queryNote = new ( ELeave ) CFSEmailUiCallDialog(); + CleanupStack::PushL( queryNote ); // Createa and set text - HBufC* querytext = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, KEmpty ); - TPtr pointer = querytext->Des(); - _LIT(KLineBreak, "\n"); + HBufC* querytext = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, KEmpty ); + TPtr pointer = querytext->Des(); + _LIT(KLineBreak, "\n"); AknTextUtils::StripCharacters( pointer, KLineBreak ); - queryNote->SetPromptL( *querytext ); - CleanupStack::PopAndDestroy( querytext ); + queryNote->SetPromptL( *querytext ); + CleanupStack::PopAndDestroy( querytext ); CleanupStack::Pop( queryNote ); // Show note. answer = queryNote->ExecuteLD( R_FSEMAIL_QUERY_DIALOG ); - } - - return answer; - } + } + + return answer; + } @@ -1793,42 +1811,42 @@ } void CFSEmailUiContactHandler::RemoteContactQueryL() - { - FUNC_LOG; - TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_FETCH_FROM_REMOTE_QUERY ); - if ( answer ) - { - LaunchRemoteLookupWithQueryL( *iMailBox, *iPreviousEmailAddress ); - } + { + FUNC_LOG; + TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_FETCH_FROM_REMOTE_QUERY ); + if ( answer ) + { + LaunchRemoteLookupWithQueryL( *iMailBox, *iPreviousEmailAddress ); + } else // user cancelled operation inform client to enable its actions (i.e. return search priority) { ObserverOperationErrorL( CurrentCommand(), KErrCancel ); } - } + } TContactHandlerCmd CFSEmailUiContactHandler::CurrentCommand() - { + { FUNC_LOG; - switch (iState) - { - case EContactHandlerAddToContacts: - return EAddToContactL; - case EContactHandlerSearchMatches: - return ESearchContacts; - case EContactHandlerShowContactDetails: - return EShowContactDetailsL; - case EContactHandlerGetAddressesFromPhonebook: - return EGetAddressesFromPhonebook; - case EContactHandlerCallToContactByEmail: - return ECallToContact; - case EContactHandlerCreateMessage: - return ECreateMessage; - default: - break; - } - return EIdle; - } + switch (iState) + { + case EContactHandlerAddToContacts: + return EAddToContactL; + case EContactHandlerSearchMatches: + return ESearchContacts; + case EContactHandlerShowContactDetails: + return EShowContactDetailsL; + case EContactHandlerGetAddressesFromPhonebook: + return EGetAddressesFromPhonebook; + case EContactHandlerCallToContactByEmail: + return ECallToContact; + case EContactHandlerCreateMessage: + return ECreateMessage; + default: + break; + } + return EIdle; + } void CFSEmailUiContactHandler::ClearObservers() { @@ -1845,3 +1863,16 @@ } } +void CFSEmailUiContactHandler::CCASimpleNotifyL( TNotifyType aType, TInt /*aReason*/ ) + { + if ( MCCAObserver::EExitEvent == aType ) + { + // Calling Close() for iConnection will close the running + // CCApplication, so be careful when using it + if ( iConnection ) + { + iConnection->Close(); + iConnection = NULL; + } + } + } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiDownloadManagerVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiDownloadManagerVisualiser.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiDownloadManagerVisualiser.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,8 +19,8 @@ // SYSTEM INCLUDES #include "emailtrace.h" -#include -#include +#include +#include #include #include #include @@ -37,9 +37,9 @@ #include "fstreeplaintwolineitemdata.h" #include "fstreeplaintwolineitemvisualizer.h" // -#include -#include -#include +#include +#include +#include #include #include // SF @@ -50,7 +50,7 @@ #include "mfsmailbrandmanager.h" #include "cfsmailclient.h" // -#include +#include // // INTERNAL INCLUDES @@ -89,32 +89,32 @@ CleanupStack::PushL( self ); self->ConstructL(); return self; - } + } void CFSEmailUiDownloadManagerVisualiser::ConstructL() - { + { FUNC_LOG; - BaseConstructL( R_FSEMAILUI_DOWNLOADMANAGER_VIEW ); + BaseConstructL( R_FSEMAILUI_DOWNLOADMANAGER_VIEW ); - // Create list screen (list) control - iScreenControl = CFreestyleEmailUiDownloadManagerControl::NewL( iEnv, this ); - - // Create attachments list layout and set it to fill the main pane - TRect screenRect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); + // Create list screen (list) control + iScreenControl = CFreestyleEmailUiDownloadManagerControl::NewL( iEnv, this ); + + // Create attachments list layout and set it to fill the main pane + TRect screenRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); iListLayout = CAlfDeckLayout::AddNewL( *iScreenControl ); screenRect.Move(0,0); iListLayout->SetRect( screenRect ); - // Create attachments list tree list component + // Create attachments list tree list component iDownloadManagerTreeListVisualizer = CFsTreeVisualizerBase::NewL(iScreenControl, *iListLayout); - iDownloadManagerTreeListVisualizer->SetItemExpansionDelay( iAppUi.LayoutHandler()->ListItemExpansionDelay() ); - + iDownloadManagerTreeListVisualizer->SetItemExpansionDelay( iAppUi.LayoutHandler()->ListItemExpansionDelay() ); + iDownloadManagerList = CFsTreeList::NewL(*iDownloadManagerTreeListVisualizer, iEnv); iDownloadManagerList->SetScrollbarVisibilityL( EFsScrollbarAuto ); - iDownloadManagerList->SetMarkTypeL( CFsTreeList::EFsTreeListMultiMarkable ); - iDownloadManagerList->SetIndentationL( 0 ); + iDownloadManagerList->SetMarkTypeL( CFsTreeList::EFsTreeListMultiMarkable ); + iDownloadManagerList->SetIndentationL( 0 ); // Compared to S60 3.2.3 in S60 5.0 Alf offers the key events in // opposite order. @@ -125,7 +125,7 @@ iModel = CFSEmailUiDownloadManagerModel::NewL( iAppUi, *this ); // S60 skin support //iDownloadManagerTreeListVisualizer->SetBackgroundTextureL( iAppUi.FsTextureManager()->TextureByIndex( EBackgroundTextureMailList ) ); - // + // iDownloadManagerTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) ); iDownloadManagerTreeListVisualizer->SetItemsAlwaysExtendedL( ETrue ); iDownloadManagerList->AddObserverL( *this ); @@ -136,42 +136,42 @@ iDownloadManagerTreeListVisualizer->AddCustomPageUpKey( EStdKeyPageUp ); iDownloadManagerTreeListVisualizer->AddCustomPageDownKey( EStdKeyPageDown ); - CAlfBrush* selectorBrush = iAppUi.FsTextureManager()->ListSelectorBrushL(); - iDownloadManagerTreeListVisualizer->SetSelectorPropertiesL( selectorBrush, 1.0, CFsTreeVisualizerBase::EFsSelectorMoveSmoothly ); + CAlfBrush* selectorBrush = iAppUi.FsTextureManager()->ListSelectorBrushL(); + iDownloadManagerTreeListVisualizer->SetSelectorPropertiesL( selectorBrush, 1.0, CFsTreeVisualizerBase::EFsSelectorMoveSmoothly ); - } + } CFSEmailUiDownloadManagerVisualiser::CFSEmailUiDownloadManagerVisualiser( CAlfEnv& aEnv, CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aControlGroup ) : CFsEmailUiViewBase( aControlGroup, *aAppUi ), iEnv( aEnv ) - { + { FUNC_LOG; - } + } CFSEmailUiDownloadManagerVisualiser::~CFSEmailUiDownloadManagerVisualiser() - { + { FUNC_LOG; - delete iModel; - if ( iDownloadManagerList ) - { - iDownloadManagerList->RemoveObserver( *this ); - } - delete iDownloadManagerList; - } + delete iModel; + if ( iDownloadManagerList ) + { + iDownloadManagerList->RemoveObserver( *this ); + } + delete iDownloadManagerList; + } TInt CFSEmailUiDownloadManagerVisualiser::HighlightedIndex() - { + { FUNC_LOG; - return 0; - } + return 0; + } TUid CFSEmailUiDownloadManagerVisualiser::Id() const - { + { FUNC_LOG; - return DownloadManagerViewId; - } + return DownloadManagerViewId; + } // --------------------------------------------------------------------------- // CFSEmailUiDownloadManagerVisualiser::ChildDoActivateL @@ -187,38 +187,38 @@ TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/ ) // Toolbar - { + { FUNC_LOG; - RefreshL(); - iDownloadManagerList->ShowListL(); - - SetMailboxNameToStatusPaneL(); - } + RefreshL(); + iDownloadManagerList->ShowListL(); + + SetMailboxNameToStatusPaneL(); + } void CFSEmailUiDownloadManagerVisualiser::SetMailboxNameToStatusPaneL() - { + { FUNC_LOG; - iAppUi.SetActiveMailboxNameToStatusPaneL(); - } + iAppUi.SetActiveMailboxNameToStatusPaneL(); + } // --------------------------------------------------------------------------- // CFSEmailUiDownloadManagerVisualiser::ChildDoDeactivate // --------------------------------------------------------------------------- // void CFSEmailUiDownloadManagerVisualiser::ChildDoDeactivate() - { + { FUNC_LOG; if ( !iAppUi.AppUiExitOngoing() ) { iDownloadManagerTreeListVisualizer->NotifyControlVisibilityChange( EFalse ); } - } - + } + CFSEmailUiDownloadManagerModel* CFSEmailUiDownloadManagerVisualiser::Model() - { + { FUNC_LOG; - return iModel; - } + return iModel; + } void CFSEmailUiDownloadManagerVisualiser::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) { @@ -257,10 +257,10 @@ else if ( aResourceId == R_FSEMAILUI_DOWNLOADMANAGER_MENUPANE ) { if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) - { - // remove help support in pf5250 - aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); - } + { + // remove help support in pf5250 + aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); + } aMenuPane->SetItemDimmed( EFsEmailUiCmdMailActions, !IsCommandAvailableOnItem(EFsEmailUiCmdMailActions, selectedItem) ); @@ -278,10 +278,10 @@ // Add shortcut hints iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, - CFSEmailUiShortcutBinding::EContextDownloadManager ); + CFSEmailUiShortcutBinding::EContextDownloadManager ); } - - + + // --------------------------------------------------------------------------- // HandleMailBoxEventL // Mailbox event handler, responds to events sent by the plugin. @@ -291,10 +291,10 @@ TFSMailMsgId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ ) { FUNC_LOG; - // Safety, refresh only if this view is active, has model and mail deleted event has been received. + // Safety, refresh only if this view is active, has model and mail deleted event has been received. if ( aEvent == TFSEventMailDeleted && iModel ) { - // Remove deleted items from list. Refresh list if this view is active + // Remove deleted items from list. Refresh list if this view is active // and some item was removed. if ( iModel->ClearInvalidItemsL() && iAppUi.CurrentActiveView() == this ) @@ -303,122 +303,122 @@ SetMskL(); } } - } - - + } + + void CFSEmailUiDownloadManagerVisualiser::RefreshL() - { + { FUNC_LOG; - TRect screenRect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); - iListLayout->SetRect( screenRect ); + TRect screenRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); + iListLayout->SetRect( screenRect ); - iDownloadManagerList->RemoveAllL(); - - CFsTreePlainTwoLineItemData* twoLineItemData = CFsTreePlainTwoLineItemData::NewL(); - CleanupStack::PushL( twoLineItemData ); + iDownloadManagerList->RemoveAllL(); + + CFsTreePlainTwoLineItemData* twoLineItemData = CFsTreePlainTwoLineItemData::NewL(); + CleanupStack::PushL( twoLineItemData ); CFsTreePlainTwoLineItemVisualizer* twoLineItemVisualizer = CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl() ); CleanupStack::PushL( twoLineItemVisualizer ); - // Set font height - twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() ); - // Set font bolding - twoLineItemVisualizer->SetTextBold( ETrue ); + // Set font height + twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() ); + // Set font bolding + twoLineItemVisualizer->SetTextBold( ETrue ); // Set manual layout and make item non-focusable - twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() & ~KFsTreeListItemFocusable ); + twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() & ~KFsTreeListItemFocusable ); - // Set correct skin text colors for the list items - TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor(); - TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); - TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor(); + // Set correct skin text colors for the list items + TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor(); + TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); + TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor(); TRgb headerBgColor = iAppUi.LayoutHandler()->ListHeaderBackgroundColor(); - twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor ); - twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor ); - twoLineItemVisualizer->SetBackgroundColor( headerBgColor ); - - const RArray& modelData = iModel->GetModel(); - HBufC* resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_DOWNLOAD_MANAGER ); - twoLineItemData->SetDataL( *resourceString ); - CleanupStack::PopAndDestroy( resourceString ); + twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor ); + twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor ); + twoLineItemVisualizer->SetBackgroundColor( headerBgColor ); + + const RArray& modelData = iModel->GetModel(); + HBufC* resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_DOWNLOAD_MANAGER ); + twoLineItemData->SetDataL( *resourceString ); + CleanupStack::PopAndDestroy( resourceString ); - resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_TOTAL, iModel->AttachmentCount() ); - twoLineItemData->SetSecondaryDataL( *resourceString ); - CleanupStack::PopAndDestroy( resourceString ); - twoLineItemData->SetIcon ( iAppUi.FsTextureManager()->TextureByIndex( EAttachmentIcon ) ); - CleanupStack::Pop( twoLineItemVisualizer ); - CleanupStack::Pop( twoLineItemData ); + resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_TOTAL, iModel->AttachmentCount() ); + twoLineItemData->SetSecondaryDataL( *resourceString ); + CleanupStack::PopAndDestroy( resourceString ); + twoLineItemData->SetIcon ( iAppUi.FsTextureManager()->TextureByIndex( EAttachmentIcon ) ); + CleanupStack::Pop( twoLineItemVisualizer ); + CleanupStack::Pop( twoLineItemData ); iHeaderItemId = iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, KFsTreeRootID ); - TFsTreeItemId parentNode; - for ( TInt i=0 ; iTreeControl() ); - CleanupStack::PushL( separatorVisualiser ); - separatorData->SetDataL( *modelData[i].mailSubject ); - // Set font height - separatorVisualiser->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() ); - // Set font bolding - separatorVisualiser->SetTextBold( ETrue ); - // Set correct skin text colors for the list items - separatorVisualiser->SetFocusedStateTextColor( focusedColor ); - separatorVisualiser->SetNormalStateTextColor( normalNodeColor ); - separatorVisualiser->SetBackgroundColor( iAppUi.LayoutHandler()->ListNodeBackgroundColor() ); - - separatorVisualiser->SetExtendable( EFalse ); - separatorData->SetIconExpanded( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeExpanded ) ); - separatorData->SetIconCollapsed( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeCollapsed ) ); - CleanupStack::Pop( separatorVisualiser ); - CleanupStack::Pop( separatorData ); - parentNode = iDownloadManagerList->InsertNodeL(*separatorData, *separatorVisualiser, KFsTreeRootID); - iModel->SetNodeIdL( i, parentNode ); - for (TInt j=0; jSetDataL( modelData[i].mailAttachments[j].fileName ); - + CleanupStack::PushL( separatorVisualiser ); + separatorData->SetDataL( *modelData[i].mailSubject ); + // Set font height + separatorVisualiser->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() ); + // Set font bolding + separatorVisualiser->SetTextBold( ETrue ); + // Set correct skin text colors for the list items + separatorVisualiser->SetFocusedStateTextColor( focusedColor ); + separatorVisualiser->SetNormalStateTextColor( normalNodeColor ); + separatorVisualiser->SetBackgroundColor( iAppUi.LayoutHandler()->ListNodeBackgroundColor() ); + + separatorVisualiser->SetExtendable( EFalse ); + separatorData->SetIconExpanded( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeExpanded ) ); + separatorData->SetIconCollapsed( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeCollapsed ) ); + CleanupStack::Pop( separatorVisualiser ); + CleanupStack::Pop( separatorData ); + parentNode = iDownloadManagerList->InsertNodeL(*separatorData, *separatorVisualiser, KFsTreeRootID); + iModel->SetNodeIdL( i, parentNode ); + for (TInt j=0; jSetDataL( modelData[i].mailAttachments[j].fileName ); + HBufC* secondLine = CreateSecondLineTextLC( modelData[i].mailAttachments[j] ); - twoLineItemData->SetSecondaryDataL( *secondLine ); - CleanupStack::PopAndDestroy( secondLine ); - - CAlfTexture& itemTexture = TFsEmailUiUtility::GetAttachmentIcon( modelData[i].mailAttachments[j].fileType, - *iAppUi.FsTextureManager() ); - twoLineItemData->SetIcon( itemTexture ); + twoLineItemData->SetSecondaryDataL( *secondLine ); + CleanupStack::PopAndDestroy( secondLine ); + + CAlfTexture& itemTexture = TFsEmailUiUtility::GetAttachmentIcon( modelData[i].mailAttachments[j].fileType, + *iAppUi.FsTextureManager() ); + twoLineItemData->SetIcon( itemTexture ); - twoLineItemVisualizer = CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl()); - CleanupStack::PushL( twoLineItemVisualizer ); - twoLineItemVisualizer->SetExtendable(ETrue); - twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu ); - - CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall ); - twoLineItemVisualizer->SetTextStyleId( textStyle->Id() ); + twoLineItemVisualizer = CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl()); + CleanupStack::PushL( twoLineItemVisualizer ); + twoLineItemVisualizer->SetExtendable(ETrue); + twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu ); + + CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall ); + twoLineItemVisualizer->SetTextStyleId( textStyle->Id() ); - // Set font height - twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() ); - // Set font bolding - twoLineItemVisualizer->SetTextBold( EFalse ); - // Set correct skin text colors for the list items - twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor ); - twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor ); + // Set font height + twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() ); + // Set font bolding + twoLineItemVisualizer->SetTextBold( EFalse ); + // Set correct skin text colors for the list items + twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor ); + twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor ); - - TFsTreeItemId treeItemId = iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, parentNode); - CleanupStack::Pop( twoLineItemVisualizer ); - CleanupStack::Pop( twoLineItemData ); - - iModel->SetItemIdL( i, j, treeItemId ); - } - } - } - - + + TFsTreeItemId treeItemId = iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, parentNode); + CleanupStack::Pop( twoLineItemVisualizer ); + CleanupStack::Pop( twoLineItemData ); + + iModel->SetItemIdL( i, j, treeItemId ); + } + } + } + + void CFSEmailUiDownloadManagerVisualiser::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ) - { + { FUNC_LOG; iDownloadManagerList->HideListL(); if ( aType == CFsEmailUiViewBase::ESkinChanged ) @@ -426,12 +426,12 @@ ResetColorsL(); iDownloadManagerList->ShowListL(); } - else if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged ) - { - ReScaleUiL(); - iDownloadManagerList->ShowListL(); - } - } + else if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged ) + { + ReScaleUiL(); + iDownloadManagerList->ShowListL(); + } + } void CFSEmailUiDownloadManagerVisualiser::HandleDynamicVariantSwitchOnBackgroundL( CFsEmailUiViewBase::TDynamicSwitchType aType ) { @@ -453,67 +453,67 @@ TFsTreeItemId focusedId = iDownloadManagerList->FocusedItem(); switch(aCommand) - { - case EFsEmailUiCmdEmpty: // used when focused item is being downloaded + { + case EFsEmailUiCmdEmpty: // used when focused item is being downloaded case EAknSoftkeyOpen: - case EFsEmailUiCmdOpen: - { - TryToOpenItemL( focusedId ); - } - break; - case EFsEmailUiCmdDownload: - { - iModel->StartDownloadL(focusedId); - } - break; - case EFsEmailUiCmdDownloadAll: - { - iModel->DownloadAllAttachmentsL(); - } - break; - case EFsEmailUiCmdCancelDownload: - { - TInt reallyCancel = - TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOAD_QUERY ); - if ( reallyCancel ) - { - iModel->CancelDownloadL( focusedId ); - } - } - break; - case EFsEmailUiCmdCancelAllDownloads: - { - TInt reallyCancel = - TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOADS_QUERY ); - if ( reallyCancel ) - { - iModel->CancelAllDownloadsL(); - } - } - break; - case EFsEmailUiCmdSave: - { - TFileName fileName; - TInt savedCount( 0 ); - if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) ) - { - iModel->SaveAttachmentL( focusedId, fileName, savedCount ); - } - if ( savedCount ) - { - TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( savedCount ); - } - } - break; - case EFsEmailUiCmdSaveAll: - { - TFileName fileName; - if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) ) - { - iModel->SaveAllAttachmentsL( fileName ); - } - } - break; + case EFsEmailUiCmdOpen: + { + TryToOpenItemL( focusedId ); + } + break; + case EFsEmailUiCmdDownload: + { + iModel->StartDownloadL(focusedId); + } + break; + case EFsEmailUiCmdDownloadAll: + { + iModel->DownloadAllAttachmentsL(); + } + break; + case EFsEmailUiCmdCancelDownload: + { + TInt reallyCancel = + TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOAD_QUERY ); + if ( reallyCancel ) + { + iModel->CancelDownloadL( focusedId ); + } + } + break; + case EFsEmailUiCmdCancelAllDownloads: + { + TInt reallyCancel = + TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOADS_QUERY ); + if ( reallyCancel ) + { + iModel->CancelAllDownloadsL(); + } + } + break; + case EFsEmailUiCmdSave: + { + TFileName fileName; + TInt savedCount( 0 ); + if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) ) + { + iModel->SaveAttachmentL( focusedId, fileName, savedCount ); + } + if ( savedCount ) + { + TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( savedCount ); + } + } + break; + case EFsEmailUiCmdSaveAll: + { + TFileName fileName; + if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) ) + { + iModel->SaveAllAttachmentsL( fileName ); + } + } + break; case EFsEmailUiCmdClearFetchedAttachment: case EFsEmailUiCmdRemoveAttachment: case EFsEmailUiCmdActionsDelete: // from shortcut key @@ -521,7 +521,7 @@ RemoveAttachmentL( focusedId ); } break; - case EFsEmailUiCmdMsgDetails: + case EFsEmailUiCmdMsgDetails: { TPartData messageData = iModel->GetMessageL( focusedId ); @@ -530,11 +530,11 @@ msgDetailsData.iFolderId = messageData.iFolderId; msgDetailsData.iMessageId = messageData.iMessageId; - const TPckgBuf pkgOut( msgDetailsData ); + const TPckgBuf pkgOut( msgDetailsData ); iAppUi.EnterFsEmailViewL( MsgDetailsViewId, KStartMsgDetailsToBeginning, pkgOut ); } break; - case EFSEmailUICmdViewMessage: + case EFSEmailUICmdViewMessage: { TPartData messageData = iModel->GetMessageL( focusedId ); @@ -543,7 +543,7 @@ msgViewerData.iFolderId = messageData.iFolderId; msgViewerData.iMessageId = messageData.iMessageId; msgViewerData.iDetails = EFSMsgDataStructure; - const TPckgBuf pkgOut( msgViewerData ); + const TPckgBuf pkgOut( msgViewerData ); iAppUi.EnterFsEmailViewL( MailViewerId, KStartViewerWithMsgId, pkgOut ); } break; @@ -553,14 +553,14 @@ } break; case EAknSoftkeyBack: - { - if ( !iAppUi.ViewSwitchingOngoing() ) - { - iAppUi.ReturnToPreviousViewL(); - } - } - break; - + { + if ( !iAppUi.ViewSwitchingOngoing() ) + { + iAppUi.ReturnToPreviousViewL(); + } + } + break; + case EFsEmailUiCmdCollapse: { iDownloadManagerList->CollapseNodeL( focusedId ); @@ -601,13 +601,13 @@ iCoeEnv->SimulateKeyEventL( simEvent, EEventKey ); } break; - case EFsEmailUiCmdHelp: - { - TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID ); - } - break; + case EFsEmailUiCmdHelp: + { + TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID ); + } + break; default: - break; + break; } } @@ -615,41 +615,41 @@ { FUNC_LOG; TFsTreeItemId curId = iDownloadManagerList->FocusedItem(); - if ( curId ) - { - if( iDownloadManagerList->IsNode( curId ) ) - { - if (iDownloadManagerList->IsExpanded( curId ) ) - { - ChangeMskCommandL( R_FSE_QTN_MSK_COLLAPSE ); - } - else - { - ChangeMskCommandL( R_FSE_QTN_MSK_EXPAND ); - } - } - else // non-node item - { - TAttachmentData* selectedItem = iModel->GetItem( iDownloadManagerList->FocusedItem()); - if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdDownload, selectedItem ) ) - { - ChangeMskCommandL( R_FSE_QTN_MSK_DOWNLOAD ); - } - else if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdOpen, selectedItem ) ) - { - ChangeMskCommandL( R_FSE_QTN_MSK_OPEN ); - } - else - { - ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); - } - } - } - else - { - ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); - } - } + if ( curId ) + { + if( iDownloadManagerList->IsNode( curId ) ) + { + if (iDownloadManagerList->IsExpanded( curId ) ) + { + ChangeMskCommandL( R_FSE_QTN_MSK_COLLAPSE ); + } + else + { + ChangeMskCommandL( R_FSE_QTN_MSK_EXPAND ); + } + } + else // non-node item + { + TAttachmentData* selectedItem = iModel->GetItem( iDownloadManagerList->FocusedItem()); + if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdDownload, selectedItem ) ) + { + ChangeMskCommandL( R_FSE_QTN_MSK_DOWNLOAD ); + } + else if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdOpen, selectedItem ) ) + { + ChangeMskCommandL( R_FSE_QTN_MSK_OPEN ); + } + else + { + ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); + } + } + } + else + { + ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); + } + } TBool CFSEmailUiDownloadManagerVisualiser::OfferEventL(const TAlfEvent& aEvent) { @@ -658,19 +658,19 @@ SetMskL(); if ( aEvent.IsKeyEvent() && aEvent.Code() == EEventKey ) { - TInt scanCode = aEvent.KeyEvent().iScanCode; - // Swap right and left controls in mirrored layout - if ( AknLayoutUtils::LayoutMirrored() ) - { - if (scanCode == EStdKeyRightArrow) scanCode = EStdKeyLeftArrow; - else if (scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow; - } - - if ( scanCode == EStdKeyRightArrow ) - { - LaunchActionMenuL(); - result = ETrue; - } + TInt scanCode = aEvent.KeyEvent().iScanCode; + // Swap right and left controls in mirrored layout + if ( AknLayoutUtils::LayoutMirrored() ) + { + if (scanCode == EStdKeyRightArrow) scanCode = EStdKeyLeftArrow; + else if (scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow; + } + + if ( scanCode == EStdKeyRightArrow ) + { + LaunchActionMenuL(); + result = ETrue; + } else { // Check keyboard shortcuts. @@ -685,17 +685,17 @@ } } - /* + /* if (!result) { result = iDownloadManagerList->TreeControl()->OfferEventL(aEvent); } - */ + */ return result; } void CFSEmailUiDownloadManagerVisualiser::ReScaleUiL() - { + { FUNC_LOG; TInt fontHeight = iAppUi.LayoutHandler()->ListItemFontHeightInTwips(); @@ -720,52 +720,52 @@ MFsTreeItemVisualizer& attachmentVis = iDownloadManagerList->ItemVisualizer( attachment.treeId ); attachmentVis.SetFontHeight( fontHeight ); } - } + } } void CFSEmailUiDownloadManagerVisualiser::ResetColorsL() { FUNC_LOG; - TRgb normalTextColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); - TRgb focusedTextColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor(); - TRgb nodeTextColor = iAppUi.LayoutHandler()->ListNodeTextColor(); - TRgb nodeBgColor = iAppUi.LayoutHandler()->ListNodeBackgroundColor(); + TRgb normalTextColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); + TRgb focusedTextColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor(); + TRgb nodeTextColor = iAppUi.LayoutHandler()->ListNodeTextColor(); + TRgb nodeBgColor = iAppUi.LayoutHandler()->ListNodeBackgroundColor(); TRgb headerBgColor = iAppUi.LayoutHandler()->ListHeaderBackgroundColor(); - - // Header item - TFsTreeItemId headerId = iDownloadManagerList->Child( KFsTreeRootID, 0 ); - MFsTreeItemVisualizer& headerVis = iDownloadManagerList->ItemVisualizer( headerId ); - headerVis.SetNormalStateTextColor( normalTextColor ); - headerVis.SetFocusedStateTextColor( focusedTextColor ); - headerVis.SetBackgroundColor( headerBgColor ); + + // Header item + TFsTreeItemId headerId = iDownloadManagerList->Child( KFsTreeRootID, 0 ); + MFsTreeItemVisualizer& headerVis = iDownloadManagerList->ItemVisualizer( headerId ); + headerVis.SetNormalStateTextColor( normalTextColor ); + headerVis.SetFocusedStateTextColor( focusedTextColor ); + headerVis.SetBackgroundColor( headerBgColor ); - // Mail nodes and attachment items - const RArray& modelData = iModel->GetModel(); + // Mail nodes and attachment items + const RArray& modelData = iModel->GetModel(); for ( TInt i=0 ; iItemVisualizer( message.treeId ); - messageVis.SetNormalStateTextColor( nodeTextColor ); - messageVis.SetFocusedStateTextColor( focusedTextColor ); - messageVis.SetBackgroundColor( nodeBgColor ); - - for ( TInt j=0 ; jItemVisualizer( attachment.treeId ); - attachmentVis.SetNormalStateTextColor( normalTextColor ); - attachmentVis.SetFocusedStateTextColor( focusedTextColor ); - } + const TMessageData& message = modelData[ i ]; + + MFsTreeItemVisualizer& messageVis = iDownloadManagerList->ItemVisualizer( message.treeId ); + messageVis.SetNormalStateTextColor( nodeTextColor ); + messageVis.SetFocusedStateTextColor( focusedTextColor ); + messageVis.SetBackgroundColor( nodeBgColor ); + + for ( TInt j=0 ; jItemVisualizer( attachment.treeId ); + attachmentVis.SetNormalStateTextColor( normalTextColor ); + attachmentVis.SetFocusedStateTextColor( focusedTextColor ); + } } } CAlfControl* CFSEmailUiDownloadManagerVisualiser::ViewerControl() - { + { FUNC_LOG; - return iScreenControl; - } + return iScreenControl; + } TBool CFSEmailUiDownloadManagerVisualiser::IsCommandAvailableOnItem( TInt aCommandId, const TAttachmentData* aFocusedItem ) const @@ -784,10 +784,10 @@ //case FsEActionAttachmentClearFetchedContent: // { - if ( aFocusedItem && aFocusedItem->downloadProgress == KComplete ) - { - available = ETrue; - } + if ( aFocusedItem && aFocusedItem->downloadProgress == KComplete ) + { + available = ETrue; + } } break; @@ -803,33 +803,33 @@ case EFsEmailUiCmdRemoveAttachment: case FsEActionAttachmentRemoveUnfetchedAttachment: { - if ( iAppUi.DownloadInfoMediator() && aFocusedItem && aFocusedItem->downloadProgress == KNone && - !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) ) - { - available = ETrue; - } + if ( iAppUi.DownloadInfoMediator() && aFocusedItem && aFocusedItem->downloadProgress == KNone && + !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) ) + { + available = ETrue; + } } break; case EFsEmailUiCmdCancelDownload: case FsEActionAttachmentCancelDownload: { - if ( iAppUi.DownloadInfoMediator() && aFocusedItem && - iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) ) - { - available = ETrue; - } + if ( iAppUi.DownloadInfoMediator() && aFocusedItem && + iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) ) + { + available = ETrue; + } } break; case EFsEmailUiCmdSave: case FsEActionAttachmentSave: { - if ( iAppUi.DownloadInfoMediator() && aFocusedItem && - !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) ) - { - available = ETrue; - } + if ( iAppUi.DownloadInfoMediator() && aFocusedItem && + !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) ) + { + available = ETrue; + } } break; @@ -841,19 +841,19 @@ if ( iModel->AttachmentCount() > 1 ) { available = ETrue; - for ( TInt i=0; i& attachments = model[i].mailAttachments; - for ( TInt j=0 ; jIsDownloading( attachments[j].partData.iMessagePartId ) ) - { - available = EFalse; - break; - } - } - } + for ( TInt i=0; i& attachments = model[i].mailAttachments; + for ( TInt j=0 ; jIsDownloading( attachments[j].partData.iMessagePartId ) ) + { + available = EFalse; + break; + } + } + } } } break; @@ -863,22 +863,22 @@ { // Cancel all is available if there is more than one ongoing download TInt downloads = 0; - for ( TInt i=0; i& attachments = model[i].mailAttachments; - for ( TInt j=0 ; jIsDownloading( attachments[j].partData.iMessagePartId ) ) - { - downloads++; - } - } - } - if ( downloads > 1 ) - { - available = ETrue; - } + for ( TInt i=0; i& attachments = model[i].mailAttachments; + for ( TInt j=0 ; jIsDownloading( attachments[j].partData.iMessagePartId ) ) + { + downloads++; + } + } + } + if ( downloads > 1 ) + { + available = ETrue; + } } break; @@ -888,21 +888,21 @@ // Download all is available there is more than one attachments for which // "Download" command is available. TInt downloadableFiles = 0; - for ( TInt i=0; i& attachments = model[i].mailAttachments; - for ( TInt j=0 ; j& attachments = model[i].mailAttachments; + for ( TInt j=0 ; j 1 ) - { - available = ETrue; - } + } + } + } + if ( downloadableFiles > 1 ) + { + available = ETrue; + } } break; @@ -934,30 +934,30 @@ { FUNC_LOG; // File extension - TPtrC extString = TParsePtrC( aAttachment.fileName ).Ext(); - // It seems to vary if preceeding dot is included in the file extension. Remove it if present. - if ( extString.Length() && extString[0] == '.' ) - { - extString.Set( extString.Mid(1) ); - } + TPtrC extString = TParsePtrC( aAttachment.fileName ).Ext(); + // It seems to vary if preceeding dot is included in the file extension. Remove it if present. + if ( extString.Length() && extString[0] == '.' ) + { + extString.Set( extString.Mid(1) ); + } - // File size - HBufC* sizeString = iModel->CreateSizeDescLC( aAttachment.fileSize ); + // File size + HBufC* sizeString = iModel->CreateSizeDescLC( aAttachment.fileSize ); // Download progress HBufC* progressString = NULL; - if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloading( aAttachment.partData.iMessagePartId ) ) - { - progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING, aAttachment.downloadProgress ); - } - else if ( aAttachment.downloadProgress == KComplete ) - { - progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADED_100 ); - } - else - { - progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING_CANCELLED ); - } + if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloading( aAttachment.partData.iMessagePartId ) ) + { + progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING, aAttachment.downloadProgress ); + } + else if ( aAttachment.downloadProgress == KComplete ) + { + progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADED_100 ); + } + else + { + progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING_CANCELLED ); + } // Combine the accumulated data to one buffer HBufC* result = HBufC::NewL( extString.Length() + @@ -971,12 +971,12 @@ resultPtr.Append( *sizeString ); resultPtr.Append( KSpace ); resultPtr.Append( *progressString ); - - CleanupStack::PopAndDestroy( progressString ); - CleanupStack::PopAndDestroy( sizeString ); - - CleanupStack::PushL( result ); - return result; + + CleanupStack::PopAndDestroy( progressString ); + CleanupStack::PopAndDestroy( sizeString ); + + CleanupStack::PushL( result ); + return result; } // --------------------------------------------------------------------------- @@ -992,28 +992,28 @@ TRAPD( err, attachment = &iModel->GetItemL( aId ) ); if( !err ) - { - if ( attachment ) - { - if ( iModel->IsDownloading( *attachment ) ) - { - TFsEmailUiUtility::ShowInfoNoteL( R_FSE_VIEWER_NOTE_ATTACHMENT_DOWNLOADING_PROGRESS ); - } - else if ( attachment->downloadProgress != KComplete ) - { - TInt restartDownload = - TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_NOTE_ATTACHMENT_RESTART_DOWNLOADING ); - if ( restartDownload ) - { - HandleCommandL( EFsEmailUiCmdDownload ); - } - } - else - { - TFsEmailUiUtility::OpenAttachmentL( attachment->partData ); - } - } - } + { + if ( attachment ) + { + if ( iModel->IsDownloading( *attachment ) ) + { + TFsEmailUiUtility::ShowInfoNoteL( R_FSE_VIEWER_NOTE_ATTACHMENT_DOWNLOADING_PROGRESS ); + } + else if ( attachment->downloadProgress != KComplete ) + { + TInt restartDownload = + TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_NOTE_ATTACHMENT_RESTART_DOWNLOADING ); + if ( restartDownload ) + { + HandleCommandL( EFsEmailUiCmdDownload ); + } + } + else + { + TFsEmailUiUtility::OpenAttachmentL( attachment->partData ); + } + } + } } // --------------------------------------------------------------------------- @@ -1071,22 +1071,22 @@ } void CFSEmailUiDownloadManagerVisualiser::DownloadStatusChangedL( TInt aIndex ) - { + { FUNC_LOG; - if ( iAppUi.CurrentActiveView() == this && - aIndex < iModel->GetModel().Count() && - !iAppUi.AppUiExitOngoing() ) - { - TRect screenRect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); + if ( iAppUi.CurrentActiveView() == this && + aIndex < iModel->GetModel().Count() && + !iAppUi.AppUiExitOngoing() ) + { + TRect screenRect; + AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect ); - TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor(); - TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); - TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor(); + TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor(); + TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor(); + TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor(); - const RArray& modelData = iModel->GetModel(); - const TMessageData& message = modelData[ aIndex ]; - + const RArray& modelData = iModel->GetModel(); + const TMessageData& message = modelData[ aIndex ]; + // Insert the message node if it's not yet present if ( message.treeId == KFsTreeNoneID ) { @@ -1114,33 +1114,33 @@ // Insert or update the attachment items for ( TInt j = 0 ; j < message.mailAttachments.Count() ; j++ ) - { + { HBufC* secondLine = CreateSecondLineTextLC( message.mailAttachments[j] ); - //is the item already drawn - TFsTreeItemId itemId = message.mailAttachments[j].treeId; - if ( itemId != KFsTreeNoneID ) - { - // Item is already present. Update the existing item but only if the second line data - // is actually changed. - CFsTreePlainTwoLineItemData& itemData = - static_cast( iDownloadManagerList->ItemData( itemId ) ); + //is the item already drawn + TFsTreeItemId itemId = message.mailAttachments[j].treeId; + if ( itemId != KFsTreeNoneID ) + { + // Item is already present. Update the existing item but only if the second line data + // is actually changed. + CFsTreePlainTwoLineItemData& itemData = + static_cast( iDownloadManagerList->ItemData( itemId ) ); - if ( itemData.SecondaryData() != *secondLine ) - { - itemData.SetSecondaryDataL( *secondLine ); - iDownloadManagerTreeListVisualizer->UpdateItemL( itemId ); - - // Update the MSK label if the updated item happens to be the focused item - if ( itemId == iDownloadManagerList->FocusedItem() ) - { + if ( itemData.SecondaryData() != *secondLine ) + { + itemData.SetSecondaryDataL( *secondLine ); + iDownloadManagerTreeListVisualizer->UpdateItemL( itemId ); + + // Update the MSK label if the updated item happens to be the focused item + if ( itemId == iDownloadManagerList->FocusedItem() ) + { SetMskL(); - } - } - } - else - { - //create and draw new item + } + } + } + else + { + //create and draw new item CFsTreePlainTwoLineItemData* twoLineItemData = CFsTreePlainTwoLineItemData::NewL(); CleanupStack::PushL( twoLineItemData ); @@ -1151,94 +1151,94 @@ *iAppUi.FsTextureManager() ); twoLineItemData->SetIcon( itemTexture ); - CFsTreePlainTwoLineItemVisualizer* twoLineItemVisualizer = - CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl() ); - CleanupStack::PushL( twoLineItemVisualizer ); - twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu ); - twoLineItemVisualizer->SetExtendable( ETrue ); - CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall ); - twoLineItemVisualizer->SetTextStyleId( textStyle->Id() ); - // Set font height - twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() ); - // Set font bolding - twoLineItemVisualizer->SetTextBold( EFalse ); - // Set correct skin text colors for the list items - twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor ); - twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor ); - TFsTreeItemId treeItemId = - iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, message.treeId, j ); - CleanupStack::Pop( twoLineItemVisualizer ); // ownership transferred to TreeList - CleanupStack::Pop( twoLineItemData ); // ownership transferred to TreeList - iModel->SetItemIdL( aIndex, j, treeItemId ); - } + CFsTreePlainTwoLineItemVisualizer* twoLineItemVisualizer = + CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl() ); + CleanupStack::PushL( twoLineItemVisualizer ); + twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu ); + twoLineItemVisualizer->SetExtendable( ETrue ); + CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall ); + twoLineItemVisualizer->SetTextStyleId( textStyle->Id() ); + // Set font height + twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() ); + // Set font bolding + twoLineItemVisualizer->SetTextBold( EFalse ); + // Set correct skin text colors for the list items + twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor ); + twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor ); + TFsTreeItemId treeItemId = + iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, message.treeId, j ); + CleanupStack::Pop( twoLineItemVisualizer ); // ownership transferred to TreeList + CleanupStack::Pop( twoLineItemData ); // ownership transferred to TreeList + iModel->SetItemIdL( aIndex, j, treeItemId ); + } - CleanupStack::PopAndDestroy( secondLine ); - } - } - } + CleanupStack::PopAndDestroy( secondLine ); + } + } + } // Touch void CFSEmailUiDownloadManagerVisualiser::TreeListEventL( - const TFsTreeListEvent aEvent, const TFsTreeItemId aId ) + const TFsTreeListEvent aEvent, const TFsTreeItemId aId ) // - { + { FUNC_LOG; - if ( aEvent == EFsTreeItemSelected ) - { - TRAPD( err, TryToOpenItemL( aId ) ); - if ( err != KErrNone ) - { - } - } - } + if ( aEvent == EFsTreeItemSelected ) + { + TRAPD( err, TryToOpenItemL( aId ) ); + if ( err != KErrNone ) + { + } + } + } void CFSEmailUiDownloadManagerVisualiser::LaunchActionMenuL() - { + { FUNC_LOG; - - TAttachmentData* selectedItem = NULL; - - TRAPD( err, selectedItem = &iModel->GetItemL( iDownloadManagerList->FocusedItem() ) ); - - if ( !err ) - { - // Remove old items from action menu - CFSEmailUiActionMenu::RemoveAllL(); - - // Construct item list - RFsEActionMenuIdList itemList; + + TAttachmentData* selectedItem = NULL; + + TRAPD( err, selectedItem = &iModel->GetItemL( iDownloadManagerList->FocusedItem() ) ); + + if ( !err ) + { + // Remove old items from action menu + CFSEmailUiActionMenu::RemoveAllL(); + + // Construct item list + RFsEActionMenuIdList itemList; CleanupClosePushL( itemList ); - if ( IsCommandAvailableOnItem( FsEActionAttachmentOpen, selectedItem ) ) - { - itemList.AppendL( FsEActionAttachmentOpen ); - } + if ( IsCommandAvailableOnItem( FsEActionAttachmentOpen, selectedItem ) ) + { + itemList.AppendL( FsEActionAttachmentOpen ); + } - if ( IsCommandAvailableOnItem( FsEActionAttachmentDownload, selectedItem ) ) - { - itemList.AppendL( FsEActionAttachmentDownload ); - } + if ( IsCommandAvailableOnItem( FsEActionAttachmentDownload, selectedItem ) ) + { + itemList.AppendL( FsEActionAttachmentDownload ); + } if ( IsCommandAvailableOnItem( FsEActionAttachmentDownloadAll, selectedItem ) ) { itemList.AppendL( FsEActionAttachmentDownloadAll ); } - if ( IsCommandAvailableOnItem( FsEActionAttachmentCancelDownload, selectedItem ) ) - { - itemList.AppendL( FsEActionAttachmentCancelDownload ); - } + if ( IsCommandAvailableOnItem( FsEActionAttachmentCancelDownload, selectedItem ) ) + { + itemList.AppendL( FsEActionAttachmentCancelDownload ); + } if ( IsCommandAvailableOnItem( FsEActionAttachmentCancelAllDownloads, selectedItem ) ) { itemList.AppendL( FsEActionAttachmentCancelAllDownloads ); } - if ( IsCommandAvailableOnItem( FsEActionAttachmentSave, selectedItem ) ) - { - itemList.AppendL( FsEActionAttachmentSave ); - } - + if ( IsCommandAvailableOnItem( FsEActionAttachmentSave, selectedItem ) ) + { + itemList.AppendL( FsEActionAttachmentSave ); + } + if ( IsCommandAvailableOnItem( FsEActionAttachmentSaveAll, selectedItem ) ) { itemList.AppendL( FsEActionAttachmentSaveAll ); @@ -1254,25 +1254,25 @@ itemList.AppendL( FsEActionAttachmentRemoveUnfetchedAttachment ); } - // Execute action list and handle the menu command - TActionMenuCustomItemId itemId = CFSEmailUiActionMenu::ExecuteL( itemList ); - - CleanupStack::PopAndDestroy( &itemList ); - - switch( itemId ) - { - case FsEActionAttachmentOpen: - HandleCommandL( EFsEmailUiCmdOpen ); - break; - case FsEActionAttachmentDownload: - HandleCommandL( EFsEmailUiCmdDownload ); - break; - case FsEActionAttachmentCancelDownload: + // Execute action list and handle the menu command + TActionMenuCustomItemId itemId = CFSEmailUiActionMenu::ExecuteL( itemList ); + + CleanupStack::PopAndDestroy( &itemList ); + + switch( itemId ) + { + case FsEActionAttachmentOpen: + HandleCommandL( EFsEmailUiCmdOpen ); + break; + case FsEActionAttachmentDownload: + HandleCommandL( EFsEmailUiCmdDownload ); + break; + case FsEActionAttachmentCancelDownload: HandleCommandL( EFsEmailUiCmdCancelDownload ); - break; - case FsEActionAttachmentSave: - HandleCommandL( EFsEmailUiCmdSave ); - break; + break; + case FsEActionAttachmentSave: + HandleCommandL( EFsEmailUiCmdSave ); + break; case FsEActionAttachmentDownloadAll: HandleCommandL( EFsEmailUiCmdDownloadAll ); break; @@ -1288,11 +1288,11 @@ case FsEActionAttachmentRemoveUnfetchedAttachment: HandleCommandL( EFsEmailUiCmdRemoveAttachment ); break; - default: - break; - } - } - } + default: + break; + } + } + } // --------------------------------------------------------------------------- // If there is one or more expanded nodes, collapses all nodes. @@ -1312,7 +1312,7 @@ { collapseAllNodes = ETrue; break; - } + } } if ( collapseAllNodes ) @@ -1321,9 +1321,9 @@ } else { - TFsTreeItemId prevId = iDownloadManagerList->FocusedItem(); // the focus may fall out of the screen unless manually reset + TFsTreeItemId prevId = iDownloadManagerList->FocusedItem(); // the focus may fall out of the screen unless manually reset iDownloadManagerTreeListVisualizer->ExpandAllL(); - iDownloadManagerTreeListVisualizer->SetFocusedItemL( prevId ); + iDownloadManagerTreeListVisualizer->SetFocusedItemL( prevId ); } } @@ -1367,4 +1367,4 @@ } } - + diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiFolderListModel.cpp --- a/emailuis/emailui/src/FreestyleEmailUiFolderListModel.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiFolderListModel.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,8 +19,8 @@ // SYSTEM INCLUDES // #include "emailtrace.h" -#include "CFSMailBox.h" -#include "CFSMailFolder.h" +#include "cfsmailbox.h" +#include "cfsmailfolder.h" // // INTERNAL INCLUDES diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -50,10 +50,10 @@ #include "fsseparatorvisualizer.h" // FREESTYLE EMAIL FRAMEWORK INCLUDES -#include "CFSMailCommon.h" -#include "CFSMailClient.h" -#include "CFSMailBox.h" -#include "CFSMailFolder.h" +#include "cfsmailcommon.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" +#include "cfsmailfolder.h" #include #include @@ -72,7 +72,7 @@ #include "FreestyleEmailUiUtilities.h" #include "FreestyleEmailUiLayoutData.h" #include "FreestyleEmailUiShortcutBinding.h" -#include "ESMailSettingsPlugin.h" +#include "esmailsettingsplugin.h" #include "FreestyleEmailUiStatusIndicator.h" #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiGlobalSettingsList.cpp --- a/emailuis/emailui/src/FreestyleEmailUiGlobalSettingsList.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiGlobalSettingsList.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -97,7 +97,7 @@ aId, iSettings.TitleDividers() ); return item; - } + }/* case EGlobalSettingsDownloadNotifications: { CAknBinaryPopupSettingItem* item = new ( ELeave ) @@ -105,7 +105,7 @@ aId, iSettings.DownloadNotifications() ); return item; - } + }*/ case EGlobalSettingsWarnBeforeDelete: { CAknBinaryPopupSettingItem* item = new ( ELeave ) @@ -204,7 +204,7 @@ iSettings.SetBodyPreview( crHandler->BodyPreview() ); iSettings.SetTitleDividers( crHandler->TitleDividers() ); - iSettings.SetDownloadNotifications( crHandler->DownloadNotifications() ); + //iSettings.SetDownloadNotifications( crHandler->DownloadNotifications() ); iSettings.SetActiveIdle( crHandler->ActiveIdle() ); iSettings.SetWarnBeforeDelete( crHandler->WarnBeforeDelete() ); //iSettings.SetDownloadHTMLImages( crHandler->DownloadHTMLImages() ); @@ -227,7 +227,7 @@ crHandler->SetBodyPreview( iSettings.BodyPreview() ); crHandler->SetTitleDividers( iSettings.TitleDividers() ); - crHandler->SetDownloadNotifications( iSettings.DownloadNotifications() ); + //crHandler->SetDownloadNotifications( iSettings.DownloadNotifications() ); crHandler->SetActiveIdle( iSettings.ActiveIdle() ); crHandler->SetWarnBeforeDelete( iSettings.WarnBeforeDelete() ); //crHandler->SetDownloadHTMLImages( iSettings.DownloadHTMLImages() ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp --- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -22,16 +22,17 @@ #include #include #include -#include +#include #include #include +#include // -#include "CFSMailMessage.h" +#include "cfsmailmessage.h" // #include #include -#include +#include #include @@ -354,6 +355,14 @@ { iScrollPosition = 0; } + if ( AknLayoutUtils::LayoutMirrored() ) + { + direction = TBidiText::ERightToLeft; + } + else + { + direction = TBidiText::ELeftToRight; + } CFreestyleMessageHeaderHTML::ExportL( *iMessage, iFs, headerHtmlFile, iAppUi.ClientRect().Width(), iScrollPosition, direction); @@ -361,57 +370,16 @@ // Remove all previously created files from temporary HTML folder EmptyTempHtmlFolderL(); - CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL(); - - if ( htmlBodyPart ) - { - CleanupStack::PushL( htmlBodyPart ); - - RFile htmlFile = htmlBodyPart->GetContentFileL(); - CleanupClosePushL( htmlFile ); - - // Copy html body part to email html file - CopyFileToHtmlFileL( htmlFile, KBodyHtmlFile, *htmlBodyPart ); - - CleanupStack::PopAndDestroy( &htmlFile ); - CleanupStack::PopAndDestroy( htmlBodyPart ); - } - else + TRAPD( error, PrepareBodyHtmlL( KBodyHtmlFile ) ); + if ( error != KErrNone ) { - CFSMailMessagePart* textBodyPart = iMessage->PlainTextBodyPartL(); - - if ( textBodyPart ) - { - CleanupStack::PushL( textBodyPart ); - //For now do not do any conversion just add start and end..Let browser display plain text as is - //Later need to refine this and add conversions - //htmlFile = textBodyPart->GetContentFileL(); - //Need to get buffer in this case, file does not work - //HBufC* contentBuffer=HBufC::NewLC(textBodyPart->ContentSize()); - - HBufC* contentBuffer=HBufC::NewLC(textBodyPart->FetchedContentSize()); - TPtr bufPtr(contentBuffer->Des()); - - textBodyPart->GetContentToBufferL(bufPtr,0); - HBufC8* contentBuffer8=HBufC8::NewLC(contentBuffer->Length()); - - contentBuffer8->Des().Copy(*contentBuffer); - CopyFileToHtmlFileL( *contentBuffer8, KBodyHtmlFile, *textBodyPart ); - - CleanupStack::PopAndDestroy( contentBuffer8 ); - CleanupStack::PopAndDestroy( contentBuffer ); - CleanupStack::PopAndDestroy( textBodyPart ); - } - else - { - WriteEmptyBodyHtmlL( KBodyHtmlFile ); - } + WriteEmptyBodyHtmlL( KBodyHtmlFile ); } // pass the emailHtmlFile to the browser for it to load TPath emailHtmlFile; emailHtmlFile.Copy( iHtmlFolderPath ); - if ( direction == TBidiText::ELeftToRight ) + if ( !AknLayoutUtils::LayoutMirrored() ) { emailHtmlFile.Append( KMessageHtmlFile ); } @@ -456,10 +424,20 @@ return iBrCtlInterface; } case 1: + { + return iOverlayControlNext; + } + case 2: + { + return iOverlayControlPrev; + } + case 3: + { if ( iStatusIndicator ) return iStatusIndicator; else return NULL; + } default: { return NULL; @@ -476,11 +454,11 @@ FUNC_LOG; if ( iStatusIndicator ) { - return 2; + return 4; } else { - return 1; + return 3; } } @@ -515,22 +493,39 @@ { iBrCtlInterface->SetRect( rect ); } - - if ( iMessage ) + + if ( iMessage ) + { + // update the width in header part and reload + TPath headerHtmlFile; + headerHtmlFile.Copy( iHtmlFolderPath ); + headerHtmlFile.Append( KHeaderHtmlFile ); + + TLanguage language = User::Language(); + TBidiText::TDirectionality direction = TBidiText::ScriptDirectionality( language ); + + if ( AknLayoutUtils::LayoutMirrored() ) + { + direction = TBidiText::ERightToLeft; + } + else { - // update the width in header part and reload - TPath headerHtmlFile; - headerHtmlFile.Copy( iHtmlFolderPath ); - headerHtmlFile.Append( KHeaderHtmlFile ); - - TRAP_IGNORE( CFreestyleMessageHeaderHTML::ExportL( *iMessage, iFs, headerHtmlFile, - rect.Width(), iScrollPosition ) ) - - TPath emailHtmlFile; - emailHtmlFile.Copy( iHtmlFolderPath ); + direction = TBidiText::ELeftToRight; + } + TRAP_IGNORE( CFreestyleMessageHeaderHTML::ExportL( *iMessage, iFs, headerHtmlFile, + rect.Width(), iScrollPosition, direction ) ) + + TPath emailHtmlFile; + emailHtmlFile.Copy( iHtmlFolderPath ); + if ( AknLayoutUtils::LayoutMirrored() ) + { + emailHtmlFile.Append( KMessageHtmlRTLFile ); + } + else + { emailHtmlFile.Append( KMessageHtmlFile ); - TRAP_IGNORE( LoadContentFromFileL( emailHtmlFile ) ) } + } UpdateOverlayButtons( IsVisible() ); @@ -567,7 +562,7 @@ } } - if ( iBrCtlInterface && retVal == EKeyWasNotConsumed ) + else if ( iBrCtlInterface && retVal == EKeyWasNotConsumed ) { retVal = iBrCtlInterface->OfferKeyEventL( aKeyEvent, aType ); } @@ -833,21 +828,24 @@ // --------------------------------------------------------------------------- // // -void CFsEmailUiHtmlViewerContainer::CopyFileToHtmlFileL( RFile& aFile, - const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart ) +void CFsEmailUiHtmlViewerContainer::CopyToHtmlFileL( CFSMailMessagePart& aHtmlBodyPart, const TDesC& aFileName ) { FUNC_LOG; TFileName targetFileName; targetFileName.Copy( iTempHtmlFolderPath ); targetFileName.Append( aFileName ); + RFile htmlFile = aHtmlBodyPart.GetContentFileL(); + CleanupClosePushL( htmlFile ); + // Read content from given source file - HBufC8* content = ReadContentFromFileLC( aFile ); + HBufC8* content = ReadContentFromFileLC( htmlFile ); // Write content to target file WriteContentToFileL( *content, targetFileName, aHtmlBodyPart ); CleanupStack::PopAndDestroy( content ); + CleanupStack::PopAndDestroy( &htmlFile ); } // @@ -856,16 +854,27 @@ // --------------------------------------------------------------------------- // // -void CFsEmailUiHtmlViewerContainer::CopyFileToHtmlFileL( const TDesC8& aBuffer, - const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart ) +void CFsEmailUiHtmlViewerContainer::ConvertToHtmlFileL( CFSMailMessagePart& aTextBodyPart, const TDesC& aHtmlFileName ) { FUNC_LOG; TFileName targetFileName; targetFileName.Copy( iTempHtmlFolderPath ); - targetFileName.Append( aFileName ); + targetFileName.Append( aHtmlFileName ); + + HBufC* content = HBufC::NewLC( aTextBodyPart.FetchedContentSize() ); + TPtr contentPtr( content->Des() ); + + aTextBodyPart.GetContentToBufferL( contentPtr, 0 ); - // Write content to target file - ConvertToHTML( aBuffer, targetFileName, aHtmlBodyPart ); + HBufC8* content8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *content ); + + CleanupStack::PopAndDestroy( content ); + CleanupStack::PushL( content8 ); + + ConvertToHTML( *content8, targetFileName, aTextBodyPart ); + + CleanupStack::PopAndDestroy( content8 ); + } // --------------------------------------------------------------------------- @@ -1287,25 +1296,23 @@ CleanupClosePushL( targetFile ); User::LeaveIfError( targetFile.Replace( iFs, aFileName, EFileWrite ) ); - HBufC8* charSet = GetCharacterSetL( aTextBodyPart ); - CleanupStack::PushL( charSet ); - RBuf8 messageHeader; - TInt bufSize = KHtmlHeader1().Length() + charSet->Length() + KHtmlHeader2().Length(); + _LIT8( KCharsetUtf8, "UTF-8" ); + TInt bufSize = KHtmlHeader1().Length() + KCharsetUtf8().Length() + KHtmlHeader2().Length(); messageHeader.CreateL( bufSize ); messageHeader.CleanupClosePushL(); messageHeader.Append( KHtmlHeader1 ); - messageHeader.Append( *charSet ); + messageHeader.Append( KCharsetUtf8 ); messageHeader.Append( KHtmlHeader2 ); - + RFileWriteStream fileStream( targetFile ); fileStream.PushL(); fileStream.WriteL( messageHeader.Ptr(), messageHeader.Length() ); - + TInt bufPos( 0 ); TInt bufTotalSize = bodyBuf->Size(); - + while ( bufPos < bufTotalSize ) { TInt segmentLength = bodyBuf->Ptr( bufPos ).Length(); @@ -1314,10 +1321,9 @@ } fileStream.CommitL(); - + CleanupStack::PopAndDestroy( &fileStream ); CleanupStack::PopAndDestroy( &messageHeader ); - CleanupStack::PopAndDestroy( charSet ); CleanupStack::PopAndDestroy( &targetFile ); CleanupStack::PopAndDestroy( bodyBuf ); @@ -1645,31 +1651,27 @@ } void CFsEmailUiHtmlViewerContainer::HandleResourceChange( TInt aType ) - { - CCoeControl::HandleResourceChange( aType ); - - if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged ) - { - // only update header if we get a layout change from email ui - RefreshCurrentMailHeader(); - } - } + { + CCoeControl::HandleResourceChange( aType ); + } void CFsEmailUiHtmlViewerContainer::RefreshCurrentMailHeader() - { - if ( iMessage ) - { - // Update the width in header part and reload - TPath headerHtmlFile; - headerHtmlFile.Copy( iHtmlFolderPath ); - headerHtmlFile.Append( KHeaderHtmlFile ); - - TLanguage language = User::Language(); - TBidiText::TDirectionality direction = TBidiText::ScriptDirectionality( language ); - TRAP_IGNORE( CFreestyleMessageHeaderHTML::ExportL( *iMessage, iFs, headerHtmlFile, iAppUi.ClientRect().Width(), direction ) ) - + { + if ( iMessage ) + { + // Update the width in header part and reload + TPath headerHtmlFile; + headerHtmlFile.Copy( iHtmlFolderPath ); + headerHtmlFile.Append( KHeaderHtmlFile ); + + TLanguage language = User::Language(); + TBidiText::TDirectionality direction = TBidiText::ScriptDirectionality( language ); + TRAP_IGNORE( CFreestyleMessageHeaderHTML::ExportL( *iMessage, iFs, headerHtmlFile, iAppUi.ClientRect().Width(), direction ) ) + TPath emailHtmlFile; emailHtmlFile.Copy( iHtmlFolderPath ); + emailHtmlFile.Append( KMessageHtmlFile ); + if ( direction == TBidiText::ELeftToRight ) { emailHtmlFile.Append( KMessageHtmlFile ); @@ -1678,7 +1680,7 @@ { emailHtmlFile.Append( KMessageHtmlRTLFile ); } - + //Load page synchronously if menu invisible if(!iEventHandler->IsMenuVisible()) { @@ -1689,9 +1691,9 @@ else { iEventHandler->DismissMenuAndReload(); - } - } - } + } + } + } void CFsEmailUiHtmlViewerContainer::ReloadPageL() { @@ -1699,8 +1701,8 @@ TBidiText::TDirectionality direction = TBidiText::ScriptDirectionality( language ); TPath emailHtmlFile; emailHtmlFile.Copy( iHtmlFolderPath ); - if ( direction == TBidiText::ELeftToRight ) - { + if( !AknLayoutUtils::LayoutMirrored() ) + { emailHtmlFile.Append( KMessageHtmlFile ); } else @@ -1973,6 +1975,35 @@ CleanupStack::PopAndDestroy( handler ); } +void CFsEmailUiHtmlViewerContainer::PrepareBodyHtmlL( const TDesC& aFileName ) + { + CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL(); + + if ( htmlBodyPart ) + { + CleanupStack::PushL( htmlBodyPart ); + // Copy html body part to email html file + CopyToHtmlFileL( *htmlBodyPart, aFileName ); + CleanupStack::PopAndDestroy( htmlBodyPart ); + } + else + { + CFSMailMessagePart* textBodyPart = iMessage->PlainTextBodyPartL(); + + if ( textBodyPart ) + { + CleanupStack::PushL( textBodyPart ); + // Copy html body part to email html file + ConvertToHtmlFileL( *textBodyPart, aFileName ); + CleanupStack::PopAndDestroy( textBodyPart ); + } + else + { + User::Leave( KErrNotFound ); + } + } + } + void CFsEmailUiHtmlViewerContainer::WriteEmptyBodyHtmlL( const TDesC& aFileName ) { FUNC_LOG; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp --- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -26,15 +26,15 @@ #include #include #include -#include -#include -#include +#include +#include +#include // #include -#include "CFSMailMessage.h" -#include "CFSMailClient.h" +#include "cfsmailmessage.h" +#include "cfsmailclient.h" #include -#include // CSchemeHandler +#include // CSchemeHandler #include #include #include // for clipboard copy @@ -53,11 +53,11 @@ #include "FreestyleEmailUiHtmlViewerContainer.h" #include "FreestyleEmailUiUtilities.h" #include "FreestyleEmailUiShortcutBinding.h" -#include "FreestyleEmailCenRepHandler.h" +#include "freestyleemailcenrephandler.h" #include "FreestyleEmailUiAttachmentsListModel.h" #include "FreestyleEmailUiConstants.h" #include "FSEmail.pan" -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "FreestyleEmailUiMailViewerConstants.h" #include "FSDelayedLoader.h" @@ -209,23 +209,23 @@ case TBrCtlDefs::EElementAnchor: { // OPEN url in standalone browser UI - /* HBufC* url = iContainer->BrowserControlIf()->PageInfoLC(TBrCtlDefs::EPageInfoFocusedNodeUrl); - // Use scheme handler to launch the browser as a stand alone application - TInt urlPos = url->Find( KUrlPrefixIdentifier ); - if( urlPos == KErrNotFound ) - { - HBufC* newBuf = url->ReAllocL( url->Length() + KHttpUrlPrefix().Length() ); - CleanupStack::Pop( url ); - url = newBuf; - CleanupStack::PushL( url ); - TPtr urlPtr = url->Des(); - urlPtr.Insert( 0, KHttpUrlPrefix ); - } - CSchemeHandler* handler = CSchemeHandler::NewL( *url ); - CleanupStack::PushL( handler ); - handler->HandleUrlStandaloneL(); - CleanupStack::PopAndDestroy( handler ); - CleanupStack::PopAndDestroy( url ); */ + HBufC* url = iContainer->BrowserControlIf()->PageInfoLC(TBrCtlDefs::EPageInfoFocusedNodeUrl); + // Use scheme handler to launch the browser as a stand alone application + TInt urlPos = url->Find( KUrlPrefixIdentifier ); + if( urlPos == KErrNotFound ) + { + HBufC* newBuf = url->ReAllocL( url->Length() + KHttpUrlPrefix().Length() ); + CleanupStack::Pop( url ); + url = newBuf; + CleanupStack::PushL( url ); + TPtr urlPtr = url->Des(); + urlPtr.Insert( 0, KHttpUrlPrefix ); + } + CSchemeHandler* handler = CSchemeHandler::NewL( *url ); + CleanupStack::PushL( handler ); + handler->HandleUrlStandaloneL(); + CleanupStack::PopAndDestroy( handler ); + CleanupStack::PopAndDestroy( url ); } break; case TBrCtlDefs::EElementNone: @@ -243,6 +243,7 @@ case EFsEmailUiCmdActionsOpen: case EFsEmailUiCmdActionsReply: { + TIMESTAMP( "Reply selected from html viewer" ); if ( iMessage && !iActivationData.iEmbeddedMessageMode ) { TEditorLaunchParams params; @@ -263,6 +264,7 @@ break; case EFsEmailUiCmdActionsReplyAll: { + TIMESTAMP( "Reply to all selected from html viewer" ); if ( iMessage && !iActivationData.iEmbeddedMessageMode ) { TEditorLaunchParams params; @@ -282,6 +284,7 @@ break; case EFsEmailUiCmdActionsForward: { + TIMESTAMP( "Forward selected from html viewer" ); if ( iMessage && !iActivationData.iEmbeddedMessageMode ) { TEditorLaunchParams params; @@ -301,6 +304,7 @@ break; case EFsEmailUiCmdActionsDelete: { + TIMESTAMP( "Delete selected from html viewer" ); DeleteMailL(); } break; @@ -323,6 +327,7 @@ break; case EFsEmailUiCmdExit: { + TIMESTAMP( "Exit selected from html viewer" ); // iContainer->PrepareForExit(); // @@ -406,6 +411,7 @@ break; } } + TIMESTAMP( "Html viewer selected operation done" ); } // --------------------------------------------------------------------------- @@ -477,6 +483,9 @@ TUid aCustomMessageId, const TDesC8& aCustomMessage ) { FUNC_LOG; + + TBool msgBodyStructurePresent ( EFalse ); + TBool msgBodyContentPresent ( EFalse ); if ( iMrObserverToInform && aCustomMessageId == KStartViewerReturnToPreviousMsg ) @@ -588,13 +597,14 @@ iAppUi.MrViewerInstanceL()->ExecuteViewL( *iMessage, *this ); } else - { - iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this ); - TPartData msgPartData( iActivationData.iMailBoxId, iActivationData.iFolderId, iActivationData.iMessageId); - iAttachmentsListModel->UpdateListL( msgPartData ); + { + iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this ); + TPartData msgPartData( iActivationData.iMailBoxId, iActivationData.iFolderId, iActivationData.iMessageId); + iAttachmentsListModel->UpdateListL( msgPartData ); - LoadContentFromMailMessageL( iMessage, ETrue ); - } + CheckMessageBodyL( *iMessage, msgBodyStructurePresent, msgBodyContentPresent ); + LoadContentFromMailMessageL( iMessage, ETrue ); + } } else @@ -640,7 +650,7 @@ iAttachmentsListModel->UpdateListL( iOpenMessages->Head() ); } - + CheckMessageBodyL( *iOpenMessages->Head(), msgBodyStructurePresent, msgBodyContentPresent ); LoadContentFromMailMessageL( iOpenMessages->Head(), ETrue ); // update tool bar as some action menu boton should not appear in embbeded messages. @@ -711,21 +721,7 @@ } else { - TBool bodypartNotFound ( EFalse ); - if ( type == EMessagePlainTextBodyPart ) - { - CFSMailMessagePart* textBodyPart = iMessage->PlainTextBodyPartL(); - if ( textBodyPart ) - { - delete textBodyPart; - } - else - { - bodypartNotFound = ETrue; - } - } - - if ( bodypartNotFound ) + if ( msgBodyStructurePresent && !msgBodyContentPresent ) { iAsyncProcessComplete = EFalse; iFetchingAlready = EFalse; @@ -745,7 +741,7 @@ iContainer->SetRect( ContainerRect() ); } - + TIMESTAMP( "Html viewer opened" ); } // ----------------------------------------------------------------------------- @@ -923,7 +919,7 @@ // --------------------------------------------------------------------------- // void CFsEmailUiHtmlViewerView::SetStatusBarLayout() - { + { TInt res = R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT; if( Layout_Meta_Data::IsLandscapeOrientation() ) { @@ -936,7 +932,7 @@ TRAP_IGNORE( StatusPane()->SwitchLayoutL( res )); } - } + } void CFsEmailUiHtmlViewerView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) { @@ -1253,14 +1249,14 @@ TFSMailMsgId mailBox = iMessage->GetMailBoxId(); TFSMailMsgId folderId = iMessage->GetFolderId(); - //Get the id and check if there is a previous message available - TFSMailMsgId prevMsgId; - TFSMailMsgId prevMsgFolderId; - - //Get the previous message if it exists - TBool available = iAppUi.IsPreviousMsgAvailable( currentMsgId, - prevMsgId, - prevMsgFolderId ); + //Get the id and check if there is a previous message available + TFSMailMsgId prevMsgId; + TFSMailMsgId prevMsgFolderId; + + //Get the previous message if it exists + TBool available = iAppUi.IsPreviousMsgAvailable( currentMsgId, + prevMsgId, + prevMsgFolderId ); //Delete the message iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, folderId, msgIds ); @@ -1270,20 +1266,20 @@ SendEventToAppUiL( TFSEventMailDeleted ); if ( iAppUi.CurrentActiveView()->Id() == HtmlViewerId ) - { - //Open the previous message or navigate back to list viewer - if ( available ) - { - iAppUi.MoveToPreviousMsgAfterDeleteL( prevMsgId ); - } - else - { - ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); - NavigateBackL(); - } - //inform user that mail is deleted - TFsEmailUiUtility::ShowGlobalInfoNoteL( R_FREESTYLE_EMAIL_MAIL_DELETED ); - } + { + //Open the previous message or navigate back to list viewer + if ( available ) + { + iAppUi.MoveToPreviousMsgAfterDeleteL( prevMsgId ); + } + else + { + ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); + NavigateBackL(); + } + //inform user that mail is deleted + TFsEmailUiUtility::ShowGlobalInfoNoteL( R_FREESTYLE_EMAIL_MAIL_DELETED ); + } } } @@ -1306,9 +1302,12 @@ for ( TInt i = 0 ; i < removedEntries->Count() && cont; i++ ) { - if ( curMsgId == ( *removedEntries )[i] ) + if ( ( curMsgId == ( *removedEntries )[i] ) && + (iDeletedMessageFromMrui != curMsgId) ) { cont = EFalse; + ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); + HandleCommandL( EAknSoftkeyBack ); } } } @@ -1430,10 +1429,10 @@ } break; case EFsEmailUiCmdActionsAddContact: - { - SaveEmailAsContactL( aEmailAddress ); - } - break; + { + SaveEmailAsContactL( aEmailAddress ); + } + break; case EFsEmailUiCmdActionsCall: { CallAdressL( aEmailAddress, EFalse ); @@ -1455,9 +1454,9 @@ } break; case EFsEmailUiCmdActionsCopyToClipboard: - { - CopyCurrentToClipBoardL( aEmailAddress ); - } + { + CopyCurrentToClipBoardL( aEmailAddress ); + } break; default: //nothing right now? @@ -1474,23 +1473,23 @@ { FUNC_LOG; switch ( aCommand ) - { - case EFsEmailUiCmdActionsOpenWeb: - { - OpenLinkInBrowserL( aUrl ); - break; - } - case EFsEmailUiCmdActionsAddBookmark: - { - SaveWebAddressToFavouritesL( aUrl ); - break; - } - case EFsEmailUiCmdActionsCopyWWWAddressToClipboard: - { - CopyCurrentToClipBoardL( aUrl ); - break; - } - } + { + case EFsEmailUiCmdActionsOpenWeb: + { + OpenLinkInBrowserL( aUrl ); + break; + } + case EFsEmailUiCmdActionsAddBookmark: + { + SaveWebAddressToFavouritesL( aUrl ); + break; + } + case EFsEmailUiCmdActionsCopyWWWAddressToClipboard: + { + CopyCurrentToClipBoardL( aUrl ); + break; + } + } } void CFsEmailUiHtmlViewerView::SaveEmailAsContactL( @@ -1732,7 +1731,7 @@ TBool CFsEmailUiHtmlViewerView::IsEmbeddedMsgSavingAllowed() { return iMailBox->HasCapability( - EFSMboxCapaSupportsSavingOfEmbeddedMessages ); + EFSMboxCapaSupportsSavingOfEmbeddedMessages ); } void CFsEmailUiHtmlViewerView::UpdateDownloadIndicatorL( @@ -1884,16 +1883,16 @@ void CFsEmailUiHtmlViewerView::SendEventToAppUiL( TFSMailEvent aEventType ) { if ( iMessage ) - { - RArray msgIdArray; - CleanupClosePushL( msgIdArray ); - msgIdArray.AppendL( iMessage->GetMessageId() ); - TFSMailMsgId folderId = iMessage->GetFolderId(); - iAppUi.EventL( aEventType, - iAppUi.GetActiveMailboxId(), - &msgIdArray, &folderId, NULL ); - CleanupStack::PopAndDestroy( &msgIdArray ); - } + { + RArray msgIdArray; + CleanupClosePushL( msgIdArray ); + msgIdArray.AppendL( iMessage->GetMessageId() ); + TFSMailMsgId folderId = iMessage->GetFolderId(); + iAppUi.EventL( aEventType, + iAppUi.GetActiveMailboxId(), + &msgIdArray, &folderId, NULL ); + CleanupStack::PopAndDestroy( &msgIdArray ); + } } // ----------------------------------------------------------------------------- // CFsEmailUiHtmlViewerView::ChangeMsgReadStatusL @@ -2313,11 +2312,11 @@ if ( iContainer ) { iContainer->ResetContent(); - if( iMessage ) - { - LoadContentFromMailMessageL( iMessage , EFalse); - SetMskL(); - } + if( iMessage ) + { + LoadContentFromMailMessageL( iMessage , EFalse); + SetMskL(); + } } } @@ -3010,9 +3009,9 @@ FUNC_LOG; // Reload mail header. if ( iContainer ) - { - iContainer->RefreshCurrentMailHeader(); - } + { + iContainer->RefreshCurrentMailHeader(); + } } // ----------------------------------------------------------------------------- @@ -3050,7 +3049,7 @@ // CFsEmailUiHtmlViewerView::CopyToClipBoardL // ----------------------------------------------------------------------------- void CFsEmailUiHtmlViewerView::CopyCurrentToClipBoardL( const TDesC& aArgument ) const - { + { FUNC_LOG; // Making sure that we are copying something to the clipboard @@ -3058,92 +3057,92 @@ { HBufC* clipBoardText = aArgument.AllocLC(); CClipboard* cb = CClipboard::NewForWritingLC( CCoeEnv::Static()->FsSession() ); - cb->StreamDictionary().At( KClipboardUidTypePlainText ); - CPlainText* plainText = CPlainText::NewL(); - CleanupStack::PushL( plainText ); - plainText->InsertL( 0 , *clipBoardText ); - plainText->CopyToStoreL( cb->Store(), cb->StreamDictionary(), 0, plainText->DocumentLength() ); - CleanupStack::PopAndDestroy( plainText ); - cb->CommitL(); - CleanupStack::PopAndDestroy( cb ); - CleanupStack::PopAndDestroy( clipBoardText ); + cb->StreamDictionary().At( KClipboardUidTypePlainText ); + CPlainText* plainText = CPlainText::NewL(); + CleanupStack::PushL( plainText ); + plainText->InsertL( 0 , *clipBoardText ); + plainText->CopyToStoreL( cb->Store(), cb->StreamDictionary(), 0, plainText->DocumentLength() ); + CleanupStack::PopAndDestroy( plainText ); + cb->CommitL(); + CleanupStack::PopAndDestroy( cb ); + CleanupStack::PopAndDestroy( clipBoardText ); } - } + } // -------------------------------------------------------------------------------- // CFsEmailUiHtmlViewerView::OpenLinkInBrowserL // -------------------------------------------------------------------------------- void CFsEmailUiHtmlViewerView::OpenLinkInBrowserL( const TDesC& aUrl ) const - { - FUNC_LOG; - - // Create session - RApaLsSession session; - User::LeaveIfError( session.Connect() ); - CleanupClosePushL( session ); - - // Gets the default application UID for for the given MIME type - TUid uid; - TDataType dataType( _L8( "text/html" ) ); - session.AppForDataType( dataType, uid ); - - // Runs the default application using the dataType - TThreadId threadId; - User::LeaveIfError( session.StartDocument( aUrl , dataType, threadId ) ); - - CleanupStack::PopAndDestroy(); // session + { + FUNC_LOG; + + // Create session + RApaLsSession session; + User::LeaveIfError( session.Connect() ); + CleanupClosePushL( session ); + + // Gets the default application UID for for the given MIME type + TUid uid; + TDataType dataType( _L8( "text/html" ) ); + session.AppForDataType( dataType, uid ); + + // Runs the default application using the dataType + TThreadId threadId; + User::LeaveIfError( session.StartDocument( aUrl , dataType, threadId ) ); + + CleanupStack::PopAndDestroy(); // session } // -------------------------------------------------------------------------------- // CFsEmailUiHtmlViewerView::SaveWebAddressToFavouritesL // -------------------------------------------------------------------------------- void CFsEmailUiHtmlViewerView::SaveWebAddressToFavouritesL( const TDesC& aUrl ) const - { - FUNC_LOG; - HBufC* url = aUrl.AllocLC(); - - RFavouritesSession fSession; - User::LeaveIfError( fSession.Connect() ); - CleanupClosePushL( fSession ); + { + FUNC_LOG; + HBufC* url = aUrl.AllocLC(); + + RFavouritesSession fSession; + User::LeaveIfError( fSession.Connect() ); + CleanupClosePushL( fSession ); - RFavouritesDb favourites; - User::LeaveIfError( favourites.Open( fSession, KBrowserBookmarks ) ); - CleanupClosePushL( favourites ); + RFavouritesDb favourites; + User::LeaveIfError( favourites.Open( fSession, KBrowserBookmarks ) ); + CleanupClosePushL( favourites ); - CFavouritesItem *favouritesItem = CFavouritesItem::NewLC(); - favouritesItem->SetType( CFavouritesItem::EItem ); - favouritesItem->SetUrlL( aUrl ); - // Should be less than KFavouritesMaxName ( 50 ) - if ( url->Length() > KFavouritesMaxName ) - { - favouritesItem->SetNameL( url->Left( KFavouritesMaxName ) ); - } - else - { - favouritesItem->SetNameL( *url ); - } + CFavouritesItem *favouritesItem = CFavouritesItem::NewLC(); + favouritesItem->SetType( CFavouritesItem::EItem ); + favouritesItem->SetUrlL( aUrl ); + // Should be less than KFavouritesMaxName ( 50 ) + if ( url->Length() > KFavouritesMaxName ) + { + favouritesItem->SetNameL( url->Left( KFavouritesMaxName ) ); + } + else + { + favouritesItem->SetNameL( *url ); + } - favouritesItem->SetParentFolder( KFavouritesRootUid ); + favouritesItem->SetParentFolder( KFavouritesRootUid ); - TInt error = favourites.Add( *favouritesItem, ETrue ); + TInt error = favourites.Add( *favouritesItem, ETrue ); - CleanupStack::PopAndDestroy( favouritesItem ); - CleanupStack::PopAndDestroy( &favourites ); - CleanupStack::PopAndDestroy( &fSession ); + CleanupStack::PopAndDestroy( favouritesItem ); + CleanupStack::PopAndDestroy( &favourites ); + CleanupStack::PopAndDestroy( &fSession ); - CleanupStack::PopAndDestroy( url ); - - if ( error == KErrNone ) - { - TFsEmailUiUtility::ShowInfoNoteL( - R_FREESTYLE_EMAIL_UI_VIEWER_BOOKMARK_ADDED, ETrue ); - } - else // Error in bookmark creation, show could not complete message - { - TFsEmailUiUtility::ShowErrorNoteL( - R_FREESTYLE_EMAIL_ERROR_GENERAL_UNABLE_TO_COMPLETE, ETrue ); - } - } + CleanupStack::PopAndDestroy( url ); + + if ( error == KErrNone ) + { + TFsEmailUiUtility::ShowInfoNoteL( + R_FREESTYLE_EMAIL_UI_VIEWER_BOOKMARK_ADDED, ETrue ); + } + else // Error in bookmark creation, show could not complete message + { + TFsEmailUiUtility::ShowErrorNoteL( + R_FREESTYLE_EMAIL_ERROR_GENERAL_UNABLE_TO_COMPLETE, ETrue ); + } + } /* * Delaying the fetch for MfE till the user scrolls to the bottom of @@ -3174,6 +3173,38 @@ } } } + +void CFsEmailUiHtmlViewerView::CheckMessageBodyL( CFSMailMessage& aMessage, TBool& aMessageBodyStructurePresent, TBool& aMessageBodyContentPresent) + { + CFSMailMessagePart* bodyPart = iMessage->HtmlBodyPartL(); + if ( !bodyPart ) + { + bodyPart = iMessage->PlainTextBodyPartL(); + } + + if ( bodyPart ) + { + aMessageBodyStructurePresent = ETrue; + CleanupStack::PushL( bodyPart ); + + if ( bodyPart->FetchedContentSize() == 0 && bodyPart->ContentSize() != 0 ) + { + aMessageBodyContentPresent = EFalse; + } + else + { + aMessageBodyContentPresent = ETrue; + } + + CleanupStack::PopAndDestroy( bodyPart ); + } + else + { + aMessageBodyStructurePresent = EFalse; + aMessageBodyContentPresent = EFalse; + } + } + ////////////////////////////////////////////////////////////////////////////////////// // CLASS IMPLEMENTATION CHANGE TO FLAG DIALOG GLOBAL NOTE /////////////////////////////////////////////////////////////////////////////////// diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -35,10 +35,10 @@ #include #include #include -#include "CFSMailMessage.h" +#include "cfsmailmessage.h" #include -#include "CFSMailBox.h" -#include "CFSMailClient.h" +#include "cfsmailbox.h" +#include "cfsmailclient.h" #include #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiMailListModel.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailListModel.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiMailListModel.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ // SYSTEM INCLUDES // #include "emailtrace.h" -#include "CFSMailMessage.h" +#include "cfsmailmessage.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -24,9 +24,9 @@ #include #include #include -#include "CFSMailClient.h" -#include "CFSMailBox.h" -#include "CFSMailFolder.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" +#include "cfsmailfolder.h" #include "fscontrolbar.h" #include "fscontrolbuttoninterface.h" #include "fstreelist.h" @@ -35,7 +35,7 @@ #include "fstreeplainonelinenodevisualizer.h" #include "fstreeplaintwolineitemdata.h" #include "fstreeplaintwolineitemvisualizer.h" -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "ceuiemaillisttouchmanager.h" #include "FSEmailBuildFlags.h" #include "cfsccontactactionmenu.h" @@ -52,9 +52,9 @@ #include #include #include -#include "ESMailSettingsPluginUids.hrh" -#include "ESMailSettingsPlugin.h" -#include "MFSMailBrandManager.h" +#include "esmailsettingspluginuids.hrh" +#include "esmailsettingsplugin.h" +#include "mfsmailbrandmanager.h" #include #include #include @@ -78,7 +78,7 @@ #include "FreestyleEmailUiMailListControl.h" #include "FreestyleEmailUiMailViewerVisualiser.h" #include "FreestyleEmailUiStatusIndicator.h" -#include "FreestyleEmailCenRepHandler.h" +#include "freestyleemailcenrephandler.h" #include "FreestyleEmailUiFolderListVisualiser.h" #include "FreestyleEmailUiShortcutBinding.h" #include "FreestyleEmailUiMsgDetailsVisualiser.h" @@ -470,7 +470,8 @@ iEnv( aEnv ), iListMarkItemsState( ETrue ), //Initlly list has no markings iMoveToFolderOngoing( EFalse ), - iConsumeStdKeyYes_KeyUp( EFalse ) // use to prevent Call application execution if call for contact processed + iConsumeStdKeyYes_KeyUp( EFalse ), // use to prevent Call application execution if call for contact processed + iMailOpened(EFalse) { FUNC_LOG; } @@ -601,6 +602,7 @@ } SetListAndCtrlBarFocusL(); iAppUi.StartMonitoringL(); + TIMESTAMP( "Locally stored messages fetched for message list" ); } // --------------------------------------------------------------------------- @@ -1041,6 +1043,7 @@ TInt idx = KErrNotFound; TFsTreeItemId parentId = KFsTreeRootID; TInt childIdx = KErrNotFound; + TInt moveViewPortPosition = 0; if ( !iNodesInUse ) { @@ -1079,6 +1082,7 @@ TInt nodeIdxUnderRoot = iMailList->ChildIndex( KFsTreeRootID, nextNodeId ); InsertNodeItemL( idx-1, nodeIdxUnderRoot, aAllowRefresh ); } + moveViewPortPosition += iAppUi.LayoutHandler()->OneLineListItemHeight(); } else { @@ -1093,7 +1097,23 @@ CleanupStack::Pop( newItem ); // Insert the tree list item - InsertListItemL( idx, parentId, childIdx, aAllowRefresh ); + TPoint viewPortCenterPos = iMailTreeListVisualizer->ViewPosition(); + TPoint viewPortTopPos = iMailTreeListVisualizer->ViewPortTopPosition(); + TInt itemPos = iMailTreeListVisualizer->GetItemWorldPosition( idx ); + TBool refresh = viewPortTopPos.iY != 0 && itemPos < viewPortCenterPos.iY; + + if( refresh ) + { + InsertListItemL( idx, parentId, childIdx, EFalse ); + // viewPort update needed + moveViewPortPosition += iAppUi.LayoutHandler()->TwoLineListItemHeight(); // add mail item height + viewPortCenterPos.iY += moveViewPortPosition; + iMailTreeListVisualizer->ViewPositionChanged( viewPortCenterPos, EFalse, 1 ); + } + else + { + InsertListItemL( idx, parentId, childIdx, aAllowRefresh ); + } // Move focus after insertion if necessary if ( firstItemWasFocused ) @@ -1224,6 +1244,7 @@ const TDesC8& aCustomMessage) { FUNC_LOG; + TIMESTAMP( "Opening message list view" ); iShowReplyAll = EFalse; if ( !iFirstStartCompleted ) @@ -1491,7 +1512,7 @@ iThisViewActive = ETrue; // Set email indicator off.. user has checked the new emails - TFsEmailUiUtility::ToggleEmailIconL(EFalse); + TFsEmailUiUtility::ToggleEmailIconL(EFalse, activationData.iMailBoxId ); iShiftDepressed = EFalse; // clear state just in case @@ -1511,6 +1532,7 @@ UpdateButtonTextsL(); FocusVisibilityChange( iAppUi.IsFocusShown() ); iAppUi.ShowTitlePaneConnectionStatus(); + TIMESTAMP( "Message list view opened" ); } // --------------------------------------------------------------------------- @@ -1610,7 +1632,30 @@ // MAIN MENU *************************************************************************** if ( aResourceId == R_FSEMAILUI_MAILLIST_MENUPANE ) - { + { + // Sync/cancel sync + CFSMailBox* activeMailbox = iAppUi.GetActiveMailbox(); + TBool supportsSync = activeMailbox->HasCapability( EFSMBoxCapaSupportsSync ); + + // flag to hide or show SyncButton + TBool hideSync = GetLatestSyncState(); + if(activeMailbox->CurrentSyncState()==StartingSync) hideSync=EFalse; + + // hide or show options: Sync/cancel sync + if ( !supportsSync ) + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue ); + aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); + } + else if ( hideSync || iMailListModelUpdater->IsUpdating() ) + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue ); + } + else + { + aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue ); + } + // Saves a focus visibility. iLastFocus = EFalse; if( iFocusedControl == EMailListComponent && IsFocusShown() ) @@ -1902,6 +1947,9 @@ iMailList->RemoveAllL(); iTreeItemArray.Reset(); + // when we get refresh mail list updates should be fully enabled + iMailOpened = EFalse; + RefreshListItemsL(); if ( !iModel->Count() ) @@ -2998,10 +3046,14 @@ // If there is a need to refresh the list. // --------------------------------------------------------------------------- // -void CFSEmailUiMailListVisualiser::HandleForegroundEventL() +void CFSEmailUiMailListVisualiser::HandleForegroundEventL( TBool aForeground ) { FUNC_LOG; - if ( iFirstStartCompleted ) // Safety + if( iMailFolder ) + { + TFsEmailUiUtility::ToggleEmailIconL(EFalse, iMailFolder->GetMailBoxId() ); + } + if ( aForeground && iFirstStartCompleted ) // Safety { // Update mail list settings and date formats, is done every time // the user might have changed these in settings, so the list needs to refresh @@ -3075,6 +3127,7 @@ void CFSEmailUiMailListVisualiser::HandleCommandL( TInt aCommand ) { FUNC_LOG; + TIMESTAMP( "Message list command for handling" ); CompletePendingRefresh(); // custom command handling for launching plugin settings @@ -3133,6 +3186,7 @@ { case EAknSoftkeyOpen: { + TIMESTAMP( "Open email selected from message list" ); if( !iAppUi.IsFocusShown() ) { iAppUi.SetFocusVisibility( ETrue ); @@ -3141,6 +3195,7 @@ } case EAknSoftkeySelect: { + TIMESTAMP( "Open email selected from message list" ); if ( iFocusedControl == EMailListComponent ) { CFSEmailUiMailListModelItem* item = dynamic_cast(iModel->Item(HighlightedIndex())); @@ -3211,22 +3266,26 @@ case EEikCmdExit: case EAknSoftkeyExit: case EFsEmailUiCmdExit: + TIMESTAMP( "Exit selected from message list" ); iAppUi.Exit(); break; case EFsEmailUiCmdCalActionsReplyAsMail: case EFsEmailUiCmdActionsReply: { + TIMESTAMP( "Reply to selected from message list" ); ReplyL( NULL ); // Function will check marked/highlighted msg } break; case EFsEmailUiCmdActionsReplyAll: { + TIMESTAMP( "Reply to all selected from message list" ); ReplyAllL( NULL ); // Function will check marked/highlighted msg } break; case EFsEmailUiCmdCalActionsForwardAsMail: case EFsEmailUiCmdActionsForward: { + TIMESTAMP( "Forward selected from message list" ); ForwardL( NULL ); // Function will check marked/highlighted msg } break; @@ -3346,6 +3405,7 @@ case EFsEmailUiCmdActionsDeleteCalEvent: case EFsEmailUiCmdActionsDelete: { + TIMESTAMP( "Delete to selected from message list" ); TInt index = HighlightedIndex(); CFSEmailUiMailListModelItem* item = dynamic_cast( @@ -3370,6 +3430,7 @@ break; case EFsEmailUiCmdCompose: { + TIMESTAMP( "Create new message selected from message list" ); CreateNewMsgL(); } break; @@ -3421,6 +3482,7 @@ case EFsEmailUiCmdOpen: case EFsEmailUiCmdActionsOpen: { + TIMESTAMP( "Open email selected from message list" ); if ( iFocusedControl == EMailListComponent ) { // Opening can happen only when there's exactly one message marked or in focus @@ -3536,18 +3598,21 @@ iAppUi.SyncActiveMailBoxL(); // Sync was started by the user ManualMailBoxSync(ETrue); - iAppUi.ManualMailBoxSync( ETrue ); + iAppUi.ManualMailBoxSync( ETrue ); } } } break; case EFsEmailUiCmdCancelSync: { - TBool supportsSync = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaSupportsSync ); - if ( supportsSync ) - { - iAppUi.StopActiveMailBoxSyncL(); - } + TBool supportsSync = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaSupportsSync ); + if ( supportsSync ) + { + iAppUi.StopActiveMailBoxSyncL(); + // Sync was started by the user + ManualMailBoxSync(ETrue); + iAppUi.ManualMailBoxSync( ETrue ); + } } break; case EFsEmailUiCmdGoOffline: @@ -3781,6 +3846,7 @@ break; } // switch ( aCommand ) CleanupStack::PopAndDestroy( &actionTargetItems ); + TIMESTAMP( "Message list selected operation done" ); } // --------------------------------------------------------------------------- @@ -4339,6 +4405,7 @@ CFSMailMessage* messagePtr = &item->MessagePtr(); if ( messagePtr ) { + TIMESTAMP( "Open email selected from message list" ); OpenHighlightedMailL(); return EKeyWasConsumed; } @@ -4551,6 +4618,7 @@ CFSMailMessage* messagePtr = &item->MessagePtr(); if ( messagePtr ) { + TIMESTAMP( "Open email selected from message list" ); OpenHighlightedMailL(); } } @@ -5330,8 +5398,11 @@ } msgPtr.SaveMessageL(); // Save flag - // Switch icon to correct one - UpdateMsgIconAndBoldingL( aIndex ); + if ( !iMailOpened ) + { + // Switch icon to correct one if mail list is visible + UpdateMsgIconAndBoldingL( aIndex ); + } if ( iCurrentSortCriteria.iField == EFSMailSortByUnread ) { @@ -5616,6 +5687,17 @@ } } } + if ( aEntryIds.Count() > 0 ) + { + if ( iMailListUpdater ) + { + if ( iMailListUpdater->IsActive() ) + { + iMailListUpdater->Stop(); + } + iMailListUpdater->StartL(); + } + } if ( iNodesInUse ) { RemoveUnnecessaryNodesL(); @@ -6400,6 +6482,8 @@ iMailFolder->GetFolderId(), item->MessagePtr().GetMessageId(), EFSMsgDataEnvelope ); if ( confirmedMsgPtr ) { + iMailOpened = ETrue; + ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); // Pointer confirmed, store Id and delete not needed anymore TFSMailMsgId confirmedId = confirmedMsgPtr->GetMessageId(); @@ -6489,7 +6573,7 @@ iDateChanged = ETrue; if ( iAppUi.IsForeground() ) { - HandleForegroundEventL(); + HandleForegroundEventL(ETrue); } } @@ -6566,50 +6650,53 @@ // Check mail list item's type CFSEmailUiMailListModelItem* item = static_cast( iModel->Item( HighlightedIndex() ) ); - if ( item && item->ModelItemType() == ETypeMailItem ) + if ( item ) { - // Add mark as read / unread options - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !IsMarkAsUnreadAvailableL() ); - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, !IsMarkAsReadAvailableL() ); - - // Check support for object mail iten moving - TBool supportsMoving = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ); - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, !supportsMoving ); - - // Hide / show follow up - TBool supportsFlag = TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() ); - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, !supportsFlag ); - - // Hide mark if applicable - if ( iMailList->IsMarked( iMailList->FocusedItem() ) ) + if ( item->ModelItemType() == ETypeMailItem ) { - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMark, ETrue ); - } - - // Hide collapse / expand all - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue ); - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue ); - } - else if ( item->ModelItemType() == ETypeSeparator ) - { - // Hide mark as read / unread options - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); - - // Hide move & follow up - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); - - // Hide collapse / expand all when applicable - if ( iNodesInUse == EListControlSeparatorDisabled || !iModel->Count() ) - { + // Add mark as read / unread options + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !IsMarkAsUnreadAvailableL() ); + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, !IsMarkAsReadAvailableL() ); + + // Check support for object mail iten moving + TBool supportsMoving = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ); + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, !supportsMoving ); + + // Hide / show follow up + TBool supportsFlag = TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() ); + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, !supportsFlag ); + + // Hide mark if applicable + if ( iMailList->IsMarked( iMailList->FocusedItem() ) ) + { + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMark, ETrue ); + } + + // Hide collapse / expand all iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue ); iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue ); } - else + else if ( item->ModelItemType() == ETypeSeparator ) { - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, AllNodesCollapsed() ); - iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, AllNodesExpanded() ); + // Hide mark as read / unread options + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); + + // Hide move & follow up + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); + + // Hide collapse / expand all when applicable + if ( iNodesInUse == EListControlSeparatorDisabled || !iModel->Count() ) + { + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue ); + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue ); + } + else + { + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, AllNodesCollapsed() ); + iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, AllNodesExpanded() ); + } } } @@ -6851,28 +6938,31 @@ } else if ( aEvent == TFSEventMailChanged && iMailFolder ) // Added iMailFolder null safety check { - // Change mail item icon or read status - RArray* entries = static_cast*>( aParam1 ); - TFSMailMsgId* parentFolderId = static_cast( aParam2 ); - TFSMailMsgId currentFolderId = iMailFolder->GetFolderId(); - if ( *parentFolderId == currentFolderId ) - { - // Refresh mailfolder to get correct actual data - /* - iMailListModelUpdater->Cancel(); - SafeDelete(iMailFolder); - iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( aMailboxId, currentFolderId ); - */ - for ( TInt i=0 ; iCount() ; i++ ) - { - TFSMailMsgId msgId = (*entries)[i]; - TInt idx = ItemIndexFromMessageId( msgId ); - if ( idx != KErrNotFound ) - { - UpdateItemAtIndexL( idx ); - } - } - } + if ( !iMailOpened ) // do not handle mail changed while viewer/editor is open. This may cause flickering + { + // Change mail item icon or read status + RArray* entries = static_cast*>( aParam1 ); + TFSMailMsgId* parentFolderId = static_cast( aParam2 ); + TFSMailMsgId currentFolderId = iMailFolder->GetFolderId(); + if ( *parentFolderId == currentFolderId ) + { + // Refresh mailfolder to get correct actual data + /* + iMailListModelUpdater->Cancel(); + SafeDelete(iMailFolder); + iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( aMailboxId, currentFolderId ); + */ + for ( TInt i=0 ; iCount() ; i++ ) + { + TFSMailMsgId msgId = (*entries)[i]; + TInt idx = ItemIndexFromMessageId( msgId ); + if ( idx != KErrNotFound ) + { + UpdateItemAtIndexL( idx ); + } + } + } + } } else if ( aEvent == TFSEventMailboxSyncStateChanged ) { @@ -6882,14 +6972,25 @@ switch ( *newSyncState ) { case StartingSync: - { - //If sync was started by user, show the synchronisation indicator - if ( iManualMailBoxSync ) - { - ManualMailBoxSync(EFalse); - } - } - break; + { + //If sync was started by user, show the synchronisation indicator + if ( iManualMailBoxSync ) + { + ManualMailBoxSync(EFalse); + } + } + break; + + case SyncCancelled: + { + //If sync was started by user, show the synchronisation indicator + if ( iManualMailBoxSync ) + { + ManualMailBoxSync(EFalse); + } + } + break; + } } } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiMailViewerRichText.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailViewerRichText.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiMailViewerRichText.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description: FreestyleEmailUi mail viewer rich text implementation -* Version : %version: 48 % +* Version : %version: e003sa37#49 % * */ @@ -27,9 +27,9 @@ // #include "fstextviewer.h" #include "fsrichtext.h" -#include "CFSMailMessagePart.h" -#include "CFSMailClient.h" -#include "CFSMailCommon.h" +#include "cfsmailmessagepart.h" +#include "cfsmailclient.h" +#include "cfsmailcommon.h" // #include // SF diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiMailViewerVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMailViewerVisualiser.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiMailViewerVisualiser.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -40,12 +40,12 @@ #include #include // -#include "CFSMailMessagePart.h" -#include "CFSMailClient.h" +#include "cfsmailmessagepart.h" +#include "cfsmailclient.h" // #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // #include // @@ -79,12 +79,12 @@ #include // for opening normal browser -#include -#include +#include +#include // for bookmarks -#include // KBrowserBookmarks -#include +#include // KBrowserBookmarks +#include // for fonts #include @@ -114,7 +114,7 @@ // #include -#include // CSchemeHandler +#include // CSchemeHandler // #include "FreestyleEmailUiConstants.h" @@ -125,7 +125,7 @@ #include "FreestyleEmailUiMailListVisualiser.h" #include "FreestyleEmailUiFileSystemInfo.h" #include "FreestyleEmailUi.hrh" -#include "FreestyleEmailCenRepHandler.h" +#include "freestyleemailcenrephandler.h" #include "FreestyleEmailUiLayoutHandler.h" #include "FreestyleEmailUiTextureManager.h" #include "FreestyleEmailUiMsgDetailsVisualiser.h" @@ -788,7 +788,7 @@ } // Set email indicator off.. user has checked the new emails - TFsEmailUiUtility::ToggleEmailIconL( EFalse ); + TFsEmailUiUtility::ToggleEmailIconL( EFalse, activationData.iMailBoxId ); } iNextOrPevMessageSelected = EFalse; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiMsgDetailsModel.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMsgDetailsModel.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiMsgDetailsModel.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ // SYSTEM INCLUDES // #include "emailtrace.h" -#include "CFSMailAddress.h" +#include "cfsmailaddress.h" // // INTERNAL INCLUDES @@ -29,18 +29,18 @@ // Folder list item constructor. // --------------------------------------------------------------------------- CFSEmailUiMsgDetailsItem::CFSEmailUiMsgDetailsItem( TFsTreeItemId aListId ) - : iListId( aListId ), iMailAddress( NULL ), iText( NULL ) - { + : iListId( aListId ), iMailAddress( NULL ), iText( NULL ) + { FUNC_LOG; - } + } // --------------------------------------------------------------------------- // Folder list item destructor. // --------------------------------------------------------------------------- CFSEmailUiMsgDetailsItem::~CFSEmailUiMsgDetailsItem() - { + { FUNC_LOG; - } + } // --------------------------------------------------------------------------- // NewLC @@ -59,66 +59,66 @@ // Constructor // --------------------------------------------------------------------------- CFSEmailUiMsgDetailsModel::CFSEmailUiMsgDetailsModel() - { + { FUNC_LOG; - } + } // --------------------------------------------------------------------------- // Destructor. // --------------------------------------------------------------------------- CFSEmailUiMsgDetailsModel::~CFSEmailUiMsgDetailsModel() - { + { FUNC_LOG; - RemoveAll(); - iItemArray.Close(); - } + RemoveAll(); + iItemArray.Close(); + } // --------------------------------------------------------------------------- // Add an item to the end of the list. // --------------------------------------------------------------------------- void CFSEmailUiMsgDetailsModel::AppendL( TFsTreeItemId aListId, CFSMailAddress* aMailAddress ) - { + { FUNC_LOG; - CFSEmailUiMsgDetailsItem* item = CFSEmailUiMsgDetailsItem::NewLC( aListId ); - item->iMailAddress = aMailAddress; - iItemArray.AppendL( item ); + CFSEmailUiMsgDetailsItem* item = CFSEmailUiMsgDetailsItem::NewLC( aListId ); + item->iMailAddress = aMailAddress; + iItemArray.AppendL( item ); CleanupStack::Pop( item ); - } + } // --------------------------------------------------------------------------- // Add an item to the end of the list. // --------------------------------------------------------------------------- void CFSEmailUiMsgDetailsModel::AppendL( TFsTreeItemId aListId, TDesC* aText ) - { + { FUNC_LOG; - CFSEmailUiMsgDetailsItem* item = CFSEmailUiMsgDetailsItem::NewLC( aListId ); - item->iText = aText; - iItemArray.AppendL( item ); + CFSEmailUiMsgDetailsItem* item = CFSEmailUiMsgDetailsItem::NewLC( aListId ); + item->iText = aText; + iItemArray.AppendL( item ); CleanupStack::Pop( item ); - } + } // --------------------------------------------------------------------------- // Remove item by list item id. // --------------------------------------------------------------------------- void CFSEmailUiMsgDetailsModel::Remove( TFsTreeItemId aListId ) - { + { FUNC_LOG; - TInt index = Index( aListId ); - if( index != KErrNotFound ) - { - delete iItemArray[index]; - iItemArray.Remove( index ); - } - } + TInt index = Index( aListId ); + if( index != KErrNotFound ) + { + delete iItemArray[index]; + iItemArray.Remove( index ); + } + } // --------------------------------------------------------------------------- // Remove all items. -// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- void CFSEmailUiMsgDetailsModel::RemoveAll() - { + { FUNC_LOG; - iItemArray.ResetAndDestroy(); - } + iItemArray.ResetAndDestroy(); + } // --------------------------------------------------------------------------- // Get an item by list item id. @@ -126,56 +126,56 @@ // @return NULL if not found. // --------------------------------------------------------------------------- CFSEmailUiMsgDetailsItem* CFSEmailUiMsgDetailsModel::ItemByListId( TFsTreeItemId aListId ) const - { + { FUNC_LOG; - TInt index = Index( aListId ); - if( index != KErrNotFound ) - { - return iItemArray[ index ]; - } - else - { - return NULL; - } - } - + TInt index = Index( aListId ); + if( index != KErrNotFound ) + { + return iItemArray[ index ]; + } + else + { + return NULL; + } + } + // --------------------------------------------------------------------------- // Get an item by list index. // // @return NULL if not found. // --------------------------------------------------------------------------- CFSEmailUiMsgDetailsItem* CFSEmailUiMsgDetailsModel::ItemByIndex( TInt aModelIndex ) const - { + { FUNC_LOG; - return iItemArray[ aModelIndex ]; - } + return iItemArray[ aModelIndex ]; + } // --------------------------------------------------------------------------- // Get number of items in list. // // @return Number of items. -// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- TInt CFSEmailUiMsgDetailsModel::Count() const - { + { FUNC_LOG; - return iItemArray.Count(); - } - + return iItemArray.Count(); + } + // --------------------------------------------------------------------------- // Get the array index of the spcified item. // // @return Array index of the item. -// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- TInt CFSEmailUiMsgDetailsModel::Index( TFsTreeItemId aListId ) const - { + { FUNC_LOG; - for( TInt i = 0; i < Count(); i++ ) - { - if( iItemArray[i]->iListId == aListId ) - { - return i; - } - } - return KErrNotFound; - } + for( TInt i = 0; i < Count(); i++ ) + { + if( iItemArray[i]->iListId == aListId ) + { + return i; + } + } + return KErrNotFound; + } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiMsgDetailsVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiMsgDetailsVisualiser.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiMsgDetailsVisualiser.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -12,7 +12,7 @@ * Contributors: * * Description : FreestyleEmailUi message details view implementation -* Version : %version: e002sa38#46 % +* Version : %version: e003sa37#48 % * */ @@ -37,8 +37,8 @@ // // -#include "CFSMailMessage.h" -#include "CFSMailClient.h" +#include "cfsmailmessage.h" +#include "cfsmailclient.h" // #include "FSEmailBuildFlags.h" @@ -57,6 +57,7 @@ #include "fstreeplaintwolineitemdata.h" #include "fstreeplaintwolineitemvisualizer.h" #include +#include "AknWaitDialog.h" // // INTERNAL INCLUDES @@ -101,7 +102,9 @@ BaseConstructL( R_FSEMAILUI_MAIL_DETAILS_VIEW ); iFirstStartCompleted = EFalse; - + iFetchingMessageStructure = EFalse; + iAsyncProcessComplete = ETrue; + iWaitDialog = NULL; } // CFSEmailUiMsgDetailsVisualiser::DoFirstStartL() @@ -271,6 +274,24 @@ if ( iViewedMsg ) // Safety check { + // + // The code below fetches the mail structure in order to have access to all detail needed. + // IMAP - hasStructure should be always True + // POP - it is False if the message has not been read yet so the code below + // should fetch the message structure + iAsyncProcessComplete = ETrue; + TBool hasStructure = TFsEmailUiUtility::IsMessageStructureKnown( *iViewedMsg ); + if (!hasStructure) + { + iWaitDialog = new (ELeave) CAknWaitDialog((REINTERPRET_CAST(CEikDialog**,&iWaitDialog)), EFalse); + iWaitDialog->SetCallback(this); + iWaitDialog->ExecuteLD(R_FSE_FETCHING_WAIT_DIALOG); + + iDialogNotDismissed = ETrue; + iAsyncProcessComplete = EFalse; + StartFetchingMessageStructureL(iViewedMsg); + } + // // Set title bar text to "Message/Meeting details" ChangeTitleBarTextL( ETrue ); @@ -295,9 +316,17 @@ iParentLayout->SetRect( iScreenRect ); ClearMsgDetailsModelL(); + // + // IMAP - hasStructure is True so the view can be updated. + // POP - if hasStructure is False then the message strucure is being fetched. Wait for responce that will be received in + // observer method RequestResponseL( ... ) + if ( hasStructure ) + { UpdateMsgDetailsModelL(); iTreeList->ShowListL(); } + // + } } // Touch iTreeList->SetFocusedL(ETrue); @@ -307,6 +336,9 @@ void CFSEmailUiMsgDetailsVisualiser::ChildDoDeactivate() { FUNC_LOG; + // + CancelFetching(); + // if ( !iAppUi.AppUiExitOngoing() ) { if ( iTreeList->IsFocused() ) @@ -1810,3 +1842,145 @@ aLayoutArray.AppendL( iParentLayout ); } +// +// --------------------------------------------------------------------------- +// Fetching the Message Structure. It is necessary for POP protocol in order to read recipients +// --------------------------------------------------------------------------- +// +void CFSEmailUiMsgDetailsVisualiser::StartFetchingMessageStructureL( + CFSMailMessage* aMsg) + { + FUNC_LOG; + TFSMailMsgId currentMailboxId = aMsg->GetMailBoxId(); + TFSMailMsgId currentMessageFolderId = aMsg->GetFolderId(); + CFSMailFolder* currentFolder = iAppUi.GetMailClient()->GetFolderByUidL( + currentMailboxId, currentMessageFolderId); + CleanupStack::PushL(currentFolder); + RArray messageIds; + CleanupClosePushL(messageIds); + messageIds.Append(aMsg->GetMessageId()); + // Fetch the message structure + iCurrentStructureFetchRequestId = currentFolder->FetchMessagesL(messageIds, + EFSMsgDataStructure, *this); + iFetchingMessageStructure = ETrue; + CleanupStack::PopAndDestroy(&messageIds); + CleanupStack::PopAndDestroy(currentFolder); + } +// + +// +// --------------------------------------------------------------------------- +// MFSMailRequestObserver interface implementation +// --------------------------------------------------------------------------- +// +void CFSEmailUiMsgDetailsVisualiser::RequestResponseL(TFSProgress aEvent, + TInt aRequestId) + { + FUNC_LOG; + if (aRequestId == iCurrentStructureFetchRequestId && iFetchingMessageStructure) + { + if (aEvent.iError != KErrNone || aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled) + { + iAsyncProcessComplete = ETrue; + iFetchingMessageStructure = EFalse; + } + else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete) + { + iAsyncProcessComplete = ETrue; + iFetchingMessageStructure = EFalse; + + // get message again, there might be new information + if (iViewedMsg) + { + TFSMailMsgId mailboxId = iViewedMsg->GetMailBoxId(); + TFSMailMsgId folderId = iViewedMsg->GetFolderId(); + TFSMailMsgId messageId = iViewedMsg->GetMessageId(); + UpdateMessagePtrL(mailboxId, folderId, messageId); + } + } + } + // + if (iAsyncProcessComplete && iWaitDialog && iDialogNotDismissed) + { + iWaitDialog->ProcessFinishedL(); // deletes the dialog + } + // + + if (iViewedMsg) //safety check + { + UpdateMsgDetailsModelL(); + iTreeList->ShowListL(); + iTreeList->SetFocusedL(ETrue); + } + } +// + +// +// --------------------------------------------------------------------------- +// Update our message pointer and saves its status +// --------------------------------------------------------------------------- +// +void CFSEmailUiMsgDetailsVisualiser::UpdateMessagePtrL( + TFSMailMsgId aNewMailboxId, TFSMailMsgId aNewFolderId, + TFSMailMsgId aNewMessageId) + { + FUNC_LOG; + if (iViewedMsg) + { + + delete iViewedMsg; + iViewedMsg = NULL; + } + + // it should contain all data now (including recipients) + iViewedMsg = iAppUi.GetMailClient()->GetMessageByUidL(aNewMailboxId, + aNewFolderId, aNewMessageId, EFSMsgDataEnvelope); + + if (iViewedMsg) + { + // Save read status + iViewedMsg->SaveMessageL(); + } + } +// + +// +// --------------------------------------------------------------------------- +// Cancel fetching of the message structure +// --------------------------------------------------------------------------- +// +void CFSEmailUiMsgDetailsVisualiser::CancelFetching() + { + FUNC_LOG; + + if (iFetchingMessageStructure) + { + TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentStructureFetchRequestId ) ); + iFetchingMessageStructure = EFalse; + } + iAsyncProcessComplete = ETrue; + if (iWaitDialog && iDialogNotDismissed) + { + TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); // deletes the dialog + iWaitDialog = NULL; + } + // + } +// + +// +// --------------------------------------------------------------------------- +// MProgressDialogCallback interface implementation +// --------------------------------------------------------------------------- +// +void CFSEmailUiMsgDetailsVisualiser::DialogDismissedL( TInt aButtonId) + { + FUNC_LOG; + iDialogNotDismissed = EFalse; + if( aButtonId == EAknSoftkeyCancel ) + { + CancelFetching(); + } + + } +// diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -26,10 +26,10 @@ #include // -#include "CFSMailMessage.h" -#include "CFSMailClient.h" -#include "CFSMailFolder.h" -#include "CFSMailBox.h" +#include "cfsmailmessage.h" +#include "cfsmailclient.h" +#include "cfsmailfolder.h" +#include "cfsmailbox.h" #include #include #include "fstreelist.h" @@ -42,7 +42,7 @@ // #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include #include #include @@ -89,7 +89,7 @@ #include "FreestyleEmailUiLiterals.h" #include "FreestyleEmailUiShortcutBinding.h" #include "FreestyleEmailUiMsgDetailsVisualiser.h" -#include "FreestyleEmailCenRepHandler.h" +#include "freestyleemailcenrephandler.h" #include "FreestyleEmailUiHtmlViewerView.h" #include "FSEmail.pan" diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListControl.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListControl.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListControl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -31,7 +31,7 @@ #include #include #include -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include // Virtual phonebook contact manager // SF #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListModel.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListModel.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListModel.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,7 @@ #include #include #include -#include "CFSMailClient.h" +#include "cfsmailclient.h" // SF #include // diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -30,12 +30,12 @@ #include #include -#include "CFSMailClient.h" -#include "CFSMailBox.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" #include // confirmation #include // icons -#include "ESMailSettingsPluginUids.hrh" -#include "ESMailSettingsPlugin.h" +#include "esmailsettingspluginuids.hrh" +#include "esmailsettingsplugin.h" #include // for note #include // for settings dialog diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiSettingsListView.cpp --- a/emailuis/emailui/src/FreestyleEmailUiSettingsListView.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiSettingsListView.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -32,10 +32,10 @@ #include #include -#include "CFSMailCommon.h" -#include "CFSMailBox.h" -#include "ESMailSettingsPlugin.h" -#include "ESMailSettingsPluginUids.hrh" +#include "cfsmailcommon.h" +#include "cfsmailbox.h" +#include "esmailsettingsplugin.h" +#include "esmailsettingspluginuids.hrh" #include // Uids for general settings activation #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiShortcutBinding.cpp --- a/emailuis/emailui/src/FreestyleEmailUiShortcutBinding.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiShortcutBinding.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -114,7 +114,11 @@ { 0, EStdKeyBackspace, 0, EFsEmailUiCmdActionsDelete }, { 0, 'H', 0, EFsEmailUiCmdHelp }, { 0, '+', 0, EFsEmailUiCmdZoomIn }, - { 0, '-', 0, EFsEmailUiCmdZoomOut } + { 0, '-', 0, EFsEmailUiCmdZoomOut }, + { 0, 'N', 0, EFsEmailUiCmdNextMessage }, + { 0, 'P', 0, EFsEmailUiCmdPreviousMessage }, + { 0, EStdKeyLeftArrow, EModifierShift, EFsEmailUiCmdPreviousMessage }, + { 0, EStdKeyRightArrow, EModifierShift, EFsEmailUiCmdNextMessage } }; // Shortcuts for the search results view diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiUtilities.cpp --- a/emailuis/emailui/src/FreestyleEmailUiUtilities.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiUtilities.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -70,7 +70,7 @@ #include #include // offline mode keys #include - +#include // Removed DISABLE_DEFAULT_EMAIL //#ifndef DISABLE_DEFAULT_EMAIL @@ -90,10 +90,10 @@ #include // -#include "CFSMailCommon.h" -#include "CFSMailClient.h" -#include "CFSMailBox.h" -#include "CFSMailMessage.h" +#include "cfsmailcommon.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" +#include "cfsmailmessage.h" #include "cesmricalviewer.h" // @@ -2689,6 +2689,7 @@ void TFsEmailUiUtility::ToggleEmailIconL(TBool aIconOn ) { FUNC_LOG; + //Toggle email status indicator if(aIconOn) { RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus, ECoreAppUIsNewEmail ); @@ -2700,6 +2701,64 @@ } // ----------------------------------------------------------------------------- +// TFsEmailUiUtility::ToggleEmailIconL +// ----------------------------------------------------------------------------- +void TFsEmailUiUtility::ToggleEmailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox ) + { + FUNC_LOG; + //Toggle email status indicator + if(aIconOn) + { + RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus, ECoreAppUIsNewEmail ); + } + else + { + RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus, ECoreAppUIsNoNewEmail ); + } + + //Toggle new mail icon in widget + if (aMailBox.Id()) + { + CRepository* repository(NULL); + TRAPD( err, repository = CRepository::NewL( KCRUidCmailWidget ) ); + if ( err == KErrNone ) + { + TBuf<256> mailbox; + mailbox.Num(aMailBox.Id()); + + TBuf<256> str; + str.Copy(_L("<")); + str.Append(mailbox); + str.Append(_L(">")); + + TBuf<256> stored; + TUint32 key(KCMailMailboxesWithNewMail); + repository->Get( key, stored ); + + TInt result = stored.Find(str); + + if (aIconOn) + { + if (result < 0) // Not found + { + stored.Append(str); + repository->Set( key, stored ); + } + } + else + { + if (result >= 0) + { + stored.Delete(result, str.Length()); + repository->Set( key, stored ); + } + } + } + delete repository; + } + } + +// ----------------------------------------------------------------------------- // TFsEmailUiUtility::DisplayMsgsMovedNoteL // ----------------------------------------------------------------------------- void TFsEmailUiUtility::DisplayMsgsMovedNoteL( TInt aMsgCount, const TFSMailMsgId aDestinationFolderId, diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiViewBase.cpp --- a/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -110,6 +110,12 @@ TRAPD( error, ChildDoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage) ); if ( !error ) { + //view history have to be updated once again when email is sent to background when in plugin settings and composer is activated externaly + //when composer view will be deactivated it wiil call NavigateBack; + if (pluginSettingsActive && iAppUi.CurrentActiveView()->Id() == MailEditorId) + { + iAppUi.ReturnFromPluginSettingsView(); + } // View activated succesfully. Change visible control group, but not // when application is being sent to background. if ( !iAppUi.SwitchingToBackground() ) @@ -437,10 +443,9 @@ void CFsEmailUiViewBase::HandleAppForegroundEventL( TBool aForeground ) { FUNC_LOG; + HandleForegroundEventL(aForeground); if ( aForeground ) { - HandleForegroundEventL(); - // Activate control group in case the view was activated when // application was being sent to background, and the control group // was left inactive. @@ -556,7 +561,7 @@ // --------------------------------------------------------------------------- // -void CFsEmailUiViewBase::HandleForegroundEventL() +void CFsEmailUiViewBase::HandleForegroundEventL( TBool /*aForeground*/ ) { FUNC_LOG; } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleEmailUiWizardObserver.cpp --- a/emailuis/emailui/src/FreestyleEmailUiWizardObserver.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiWizardObserver.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -23,13 +23,13 @@ #include #include // -#include "CFSMailClient.h" +#include "cfsmailclient.h" // // INTERNAL INCLUDE FILES #include "FreestyleEmailUiWizardObserver.h" #include "FreestyleEmailUiLauncherGridVisualiser.h" -#include "FreestyleEmailCenRepHandler.h" +#include "freestyleemailcenrephandler.h" #include "FreestyleEmailUiUtilities.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp --- a/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include #include - +#include #include "FreestyleMessageHeaderHTML.h" #include "FreestyleEmailUiUtilities.h" #include "ncsconstants.h" @@ -156,22 +156,31 @@ iWriteStream( aWriteStream ), iVisibleWidth( aVisibleWidth - KFreestyleMessageHeaderHTMLRightMarginInPx ), iScrollPosition(aScrollPosition), - iDirectionality( aDirectionality ) + iDirectionality( aDirectionality ), + iMirrorLayout( EFalse ) { } void CFreestyleMessageHeaderHTML::ConstructL() { iMailMessage.AttachmentListL( iAttachments ); + if ( AknLayoutUtils::LayoutMirrored() ) + { + iMirrorLayout = ETrue; + } } void CFreestyleMessageHeaderHTML::HTMLStartL() const { iWriteStream.WriteL(_L8("\n")); iWriteStream.CommitL(); } @@ -258,7 +267,8 @@ // add Sent time and date iWriteStream.WriteL(_L8("\n")); iWriteStream.WriteL(_L8("")); - HBufC8* subject8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( iMailMessage.GetSubject() ); - CleanupStack::PushL( subject8 ); - iWriteStream.WriteL( *subject8 ); - CleanupStack::PopAndDestroy( subject8 ); + HBufC* subject = iMailMessage.GetSubject().Alloc(); + /* + * Writes the subject to iWriteStream and also + * takes care of the urls and marks them as hotspots + */ + WriteSubjectL(*subject); + iWriteStream.WriteL(_L8("")); // Write icons (if necessary). @@ -347,6 +360,90 @@ iWriteStream.CommitL(); } +// ----------------------------------------------------------------------------- +// CFreestyleMessageHeaderHTML::WriteSubjectL +// Writes the subject to iWriteStream and also +// takes care of the urls and marks them as hotspots +// ----------------------------------------------------------------------------- +// +void CFreestyleMessageHeaderHTML::WriteSubjectL(TDesC& aText ) const + { + /* + * Add these to searchcases to make it also search + * for emailaddress and phonenumber : + * CFindItemEngine::EFindItemSearchMailAddressBin | + * CFindItemEngine::EFindItemSearchPhoneNumberBin | + */ + // Search for urls + TInt searchCases = CFindItemEngine::EFindItemSearchURLBin; + + CFindItemEngine* itemEngine = + CFindItemEngine::NewL ( aText, + ( CFindItemEngine::TFindItemSearchCase ) searchCases ); + CleanupStack::PushL (itemEngine ); + + const CArrayFixFlat + * foundItems = itemEngine->ItemArray ( ); + + TInt index = 0; + // For each found item + for (TInt i=0; iCount ( ); ++i ) + { + // iItemType, iStartPos, iLength + const CFindItemEngine::SFoundItem& item = foundItems->At (i ); + HBufC* valueBuf = aText.Mid (item.iStartPos, item.iLength ).AllocL ( ); + CleanupStack::PushL (valueBuf ); + // We write the normal text to iWriteStream before and between the links in the header subject field + if(item.iStartPos > 0) + { + TInt itemstart = item.iStartPos; + HBufC* normalText = aText.Mid(index, itemstart-index).Alloc(); + CleanupStack::PushL( normalText ); + HBufC8* normalText8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *normalText ); + CleanupStack::PushL( normalText8 ); + iWriteStream.WriteL( *normalText8 ); + CleanupStack::PopAndDestroy( 2 ); //normalText8m, normalText + } + switch (item.iItemType ) + { + /* To make header subjectfield to recognise also phonenumber and emailadress just + * add CFindItemEngine::EFindItemSearchMailAddressBin & + * CFindItemEngine::EFindItemSearchPhoneNumberBin cases here. + */ + case CFindItemEngine::EFindItemSearchURLBin: + { + HBufC8* url8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *valueBuf ); + FreestyleMessageHeaderURLFactory::CreateEmailSubjectUrlL(*valueBuf); + CleanupStack::PushL( url8 ); + StartHyperlinkL(*url8); + iWriteStream.WriteL(*url8); + EndHyperlinkL(); + CleanupStack::PopAndDestroy( url8 ); + + break; + } + default: + { + break; + } + } + index = item.iStartPos+item.iLength; + CleanupStack::PopAndDestroy (valueBuf ); + } + //Write the rest of the subject to subject field if we are not + //at the end of the subject already, or if there wasn't any + //url items write the whole subject field here + if(index < aText.Length() ) + { + HBufC* normalText = aText.Mid(index, aText.Length()-index).Alloc(); + CleanupStack::PushL( normalText ); + HBufC8* normalText8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *normalText ); + CleanupStack::PushL( normalText8 ); + iWriteStream.WriteL( *normalText8 ); + CleanupStack::PopAndDestroy( 2 ); //normalText8m, normalText + } + CleanupStack::PopAndDestroy (itemEngine ); + } HBufC8* CFreestyleMessageHeaderHTML::HTMLHeaderFollowUpIconLC( TBool aShowText ) const { @@ -567,11 +664,12 @@ // subject text iWriteStream.WriteL( _L8("") ); iWriteStream.WriteL( _L8("") ); - - HBufC8* subject8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( iMailMessage.GetSubject() ); - CleanupStack::PushL( subject8 ); - iWriteStream.WriteL( *subject8 ); - CleanupStack::PopAndDestroy( subject8 ); + HBufC* subject = iMailMessage.GetSubject().Alloc(); + /* + * Writes the subject to iWriteStream and also + * takes care of the urls and marks them as hotspots + */ + WriteSubjectL(*subject); iWriteStream.WriteL( _L8("") ); iWriteStream.WriteL( _L8("\n") ); @@ -696,13 +794,13 @@ // add attachment icon iWriteStream.WriteL( _L8(" 0 ) + // ENLN-7ZVBES + // Display name not shown in From:, instead, email address is shown + if ( (aEmailAddress.GetDisplayName().Length() > 0) && aEmailAddressType != FreestyleMessageHeaderURLFactory::EEmailAddressTypeFrom ) { displayName8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aEmailAddress.GetDisplayName() ); } @@ -904,7 +1004,7 @@ iWriteStream.WriteL( _L8("\n")); iWriteStream.WriteL( _L8(" #include -#include +#include #include -#include +#include #include +#include EXPORT_C CFreestyleMessageHeaderURLEventHandler* CFreestyleMessageHeaderURLEventHandler::NewL( CFreestyleEmailUiAppUi& aAppUi, @@ -66,19 +67,19 @@ delete iMessageHeaderURL; delete iHTMLReloadAO; if( iEmailAddressStylusPopup ) - { - delete iEmailAddressStylusPopup; - } + { + delete iEmailAddressStylusPopup; + } if( iAttachmentStylusPopup ) - { - delete iAttachmentStylusPopup; - } + { + delete iAttachmentStylusPopup; + } if( iWebAddressStylusPopup ) - { - delete iWebAddressStylusPopup; - } + { + delete iWebAddressStylusPopup; + } delete iUrl; } @@ -92,17 +93,17 @@ { //Handle http and https links if( ( aUri.FindF( KURLHttpPrefix ) ) == 0 - ||( aUri.FindF( KURLHttpsPrefix ) ) == 0 ) - { - if ( iUrl ) - { - delete iUrl; - iUrl = NULL; - } - iUrl = aUri.AllocL(); - LaunchWebAddressMenuL( ); - return ETrue; - } + ||( aUri.FindF( KURLHttpsPrefix ) ) == 0 ) + { + if ( iUrl ) + { + delete iUrl; + iUrl = NULL; + } + iUrl = aUri.AllocL(); + LaunchWebAddressMenuL( ); + return ETrue; + } //Link wasn't handled return EFalse; } @@ -122,6 +123,13 @@ { LaunchAttachmentMenuL( FindAttachmentL( *iMessageHeaderURL ) ); } + else if ( iMessageHeaderURL->Type()->CompareF( KURLTypeSubject ) ) + { + CSchemeHandler* handler = CSchemeHandler::NewL( aUri ); + CleanupStack::PushL( handler ); + handler->HandleUrlStandaloneL(); + CleanupStack::PopAndDestroy( handler ); + } iMenuVisible=EFalse; if( iPendingReload ) { @@ -158,61 +166,62 @@ CleanupStack::PopAndDestroy(); //resource reader iEmailAddressStylusPopup->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, - !iView.IsRemoteLookupSupportedL() ); + !iView.IsRemoteLookupSupportedL() ); iEmailAddressStylusPopup->SetPosition( iAppUi.ClientRect().Center(), - CAknStylusPopUpMenu::EPositionTypeRightBottom ); + CAknStylusPopUpMenu::EPositionTypeRightBottom ); iEmailAddressStylusPopup->ShowMenu(); } //From MEikMenuObserver void CFreestyleMessageHeaderURLEventHandler::ProcessCommandL( TInt aCommand ) - { - - switch ( aCommand ) - { - case EFsEmailUiCmdActionsReply: - case EFsEmailUiCmdActionsAddContact: - case EFsEmailUiCmdActionsRemoteLookup: - case EFsEmailUiCmdActionsCopyToClipboard: - { - iView.HandleEmailAddressCommandL( aCommand, *iMessageHeaderURL->ItemId() ); - break; - } - - case EFsEmailUiCmdCancelDownload: - { - iView.CancelAttachmentL( FindAttachmentL( *iMessageHeaderURL ) ); - break; - } - - case EFsEmailUiCmdOpenAttachment: - { - iView.OpenAttachmentL( FindAttachmentL( *iMessageHeaderURL ) ); - break; - } - - case EFsEmailUiCmdSave: - { - iView.SaveAttachmentL( FindAttachmentL( *iMessageHeaderURL ) ); - break; - } - - case EFsEmailUiCmdSaveAll: - { - iView.SaveAllAttachmentsL( ); - break; - } - - case EFsEmailUiCmdActionsOpenWeb: - case EFsEmailUiCmdActionsAddBookmark: - case EFsEmailUiCmdActionsCopyWWWAddressToClipboard: - { - iView.HandleWebAddressCommandL( aCommand, *iUrl ); - break; - } - - } - } + { + + switch ( aCommand ) + { + case EFsEmailUiCmdActionsReply: + case EFsEmailUiCmdActionsAddContact: + case EFsEmailUiCmdActionsRemoteLookup: + case EFsEmailUiCmdActionsCopyToClipboard: + case EFsEmailUiCmdActionsContactDetails: + { + iView.HandleEmailAddressCommandL( aCommand, *iMessageHeaderURL->ItemId() ); + break; + } + + case EFsEmailUiCmdCancelDownload: + { + iView.CancelAttachmentL( FindAttachmentL( *iMessageHeaderURL ) ); + break; + } + + case EFsEmailUiCmdOpenAttachment: + { + iView.OpenAttachmentL( FindAttachmentL( *iMessageHeaderURL ) ); + break; + } + + case EFsEmailUiCmdSave: + { + iView.SaveAttachmentL( FindAttachmentL( *iMessageHeaderURL ) ); + break; + } + + case EFsEmailUiCmdSaveAll: + { + iView.SaveAllAttachmentsL( ); + break; + } + + case EFsEmailUiCmdActionsOpenWeb: + case EFsEmailUiCmdActionsAddBookmark: + case EFsEmailUiCmdActionsCopyWWWAddressToClipboard: + { + iView.HandleWebAddressCommandL( aCommand, *iUrl ); + break; + } + + } + } const TAttachmentData& CFreestyleMessageHeaderURLEventHandler::FindAttachmentL( const CFreestyleMessageHeaderURL& aAttachmentUrl ) @@ -323,7 +332,7 @@ } } iAttachmentStylusPopup->SetPosition( iAppUi.ClientRect().Center(), - CAknStylusPopUpMenu::EPositionTypeRightBottom ); + CAknStylusPopUpMenu::EPositionTypeRightBottom ); iAttachmentStylusPopup->ShowMenu(); } @@ -348,14 +357,14 @@ CleanupStack::PopAndDestroy(); //resource reader iWebAddressStylusPopup->SetPosition( iAppUi.ClientRect().Center(), - CAknStylusPopUpMenu::EPositionTypeRightBottom ); + CAknStylusPopUpMenu::EPositionTypeRightBottom ); iWebAddressStylusPopup->ShowMenu(); } //From MEikMenuObserver void CFreestyleMessageHeaderURLEventHandler::SetEmphasis(CCoeControl* /*aMenuControl*/,TBool /*aEmphasis*/) - { - } + { + } void CFreestyleMessageHeaderURLEventHandler::DismissMenuAndReload() { diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/FreestyleMessageHeaderURLFactory.cpp --- a/emailuis/emailui/src/FreestyleMessageHeaderURLFactory.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/FreestyleMessageHeaderURLFactory.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,7 +16,7 @@ */ #include "FreestyleMessageHeaderURLFactory.h" -#include "CFSMailAddress.h" +#include "cfsmailaddress.h" EXPORT_C CFreestyleMessageHeaderURL* FreestyleMessageHeaderURLFactory::CreateEmailAddressUrlL( TEmailAddressType aEmailType, const CFSMailAddress& aEmailAddress ) @@ -67,4 +67,16 @@ return url; } +EXPORT_C CFreestyleMessageHeaderURL* FreestyleMessageHeaderURLFactory::CreateEmailSubjectUrlL( const TDesC& aSubject ) + { + HBufC* scheme = KURLSchemeCmail().AllocLC(); + HBufC* type = KURLTypeSubject().AllocLC(); + HBufC* subject = aSubject.AllocLC(); + CFreestyleMessageHeaderURL *url = CFreestyleMessageHeaderURL::NewL( scheme, type, subject ); + CleanupStack::Pop( subject ); + CleanupStack::Pop( type ); + CleanupStack::Pop( scheme ); + + return url; + } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/OverlayControl.cpp --- a/emailuis/emailui/src/OverlayControl.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/OverlayControl.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -30,7 +30,6 @@ { delete iBitmap; delete iMask; - delete iSolidMask; } COverlayControl* COverlayControl::NewL( CCoeControl* aParent, MOverlayControlObserver* aObserver, @@ -45,9 +44,8 @@ void COverlayControl::ConstructL( CCoeControl* aParent, const TRect& aRect, TInt aBitmapId, TInt aMaskId ) { - iSolidMask = new(ELeave) CFbsBitmap(); - CreateWindowL( aParent ); + SetContainerWindowL( *aParent ); TFileName iconFileName; TFsEmailUiUtility::GetFullIconFileNameL( iconFileName ); @@ -72,137 +70,41 @@ if( iMask ) { AknIconUtils::SetSize( iMask, aRect.Size() ); - - // Create a solid version of the mask, too - TRAP_IGNORE( - CopyBitmapL( *iMask, *iSolidMask ); - AdjustAlpha( *iSolidMask, KSolidTransparencyFactor ); - ); - - UpdateMask(); } CCoeControl::SetRect( aRect ); } -void COverlayControl::CopyBitmapL( const CFbsBitmap& aSource, CFbsBitmap& aDest ) - { - TSize size = aSource.SizeInPixels(); - TInt dataSize = aSource.DataStride() * size.iHeight; - User::LeaveIfError( aDest.Create( size, aSource.DisplayMode() ) ); - - CFbsBitGc* bitCtx; - CFbsBitmapDevice* bitDev = CFbsBitmapDevice::NewL( &aDest ); - CleanupStack::PushL( bitDev ); - User::LeaveIfError( bitDev->CreateContext( bitCtx ) ); - CleanupStack::PushL( bitCtx ); - bitCtx->BitBlt( TRect( size ).iTl, &aSource ); - CleanupStack::PopAndDestroy( 2 ); // bitCtx, bitDev - } - -void COverlayControl::AdjustAlpha( CFbsBitmap& aBitmap, TReal aFactor ) - { - aBitmap.LockHeap(); - TUint8* data = (TUint8*)aBitmap.DataAddress(); - TSize size = aBitmap.SizeInPixels(); - TInt dataSize = aBitmap.DataStride() * size.iHeight; - for( TInt i = 0; i KMaxTUint8 ) - { - value = KMaxTUint8; - } - data[ i ] = value; - } - } - aBitmap.UnlockHeap(); - } - void COverlayControl::HandlePointerEventL( const TPointerEvent& aPointerEvent ) { CCoeControl::HandlePointerEventL( aPointerEvent ); - - // Do hit test for the pointer event - TBool hit = EFalse; - TSize size = Size(); - if( aPointerEvent.iPosition.iX >= 0 && - aPointerEvent.iPosition.iY >= 0 && - aPointerEvent.iPosition.iX < size.iWidth && - aPointerEvent.iPosition.iY < size.iHeight ) - { - hit = ETrue; - } - - if( aPointerEvent.iType == TPointerEvent::EButton1Up ) + if( iObserver ) { - SetPointerCapture( EFalse ); - UpdateButtonState( EFalse ); - - // Notify the events only if released on top of the control - if( iObserver && hit ) - { - // Do not let leaves disturb the system - TRAP_IGNORE( - iObserver->HandleOverlayPointerEventL( this, aPointerEvent ); - ); - } + // Do not let leaves disturb the system + TRAP_IGNORE( + iObserver->HandleOverlayPointerEventL( this, aPointerEvent )); } - else if( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - UpdateButtonState( ETrue ); - SetGloballyCapturing( ETrue ); - SetPointerCapture( ETrue ); - } - else if( aPointerEvent.iType == TPointerEvent::EDrag ) - { - // Update the button UI according to hit result - UpdateButtonState( hit ); - } - } - -void COverlayControl::UpdateButtonState( TBool aButtonDown ) - { - if( iDownState != aButtonDown ) - { - iDownState = aButtonDown; - UpdateMask(); - } - } + } void COverlayControl::MakeVisible( TBool aVisible ) { if( !aVisible ) { - UpdateButtonState( EFalse ); SetPointerCapture( EFalse ); } + else + { + DrawDeferred(); + } CCoeControl::MakeVisible( aVisible ); } -void COverlayControl::UpdateMask() - { - CFbsBitmap* mask = iMask; - if( iDownState ) - { - mask = iSolidMask; - } - if( mask ) - { - Window().SetTransparencyBitmap( *mask ); - } - } - void COverlayControl::Draw( const TRect& ) const { CWindowGc& gc = SystemGc(); - if( iBitmap ) { TSize size = iBitmap->SizeInPixels(); - gc.BitBlt( TPoint( 0, 0 ), iBitmap ); - } + gc.BitBltMasked(Position(),iBitmap,TRect( TPoint(0,0), size),iMask, ETrue); + } } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/freestyleemailuimailboxdeleter.cpp --- a/emailuis/emailui/src/freestyleemailuimailboxdeleter.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/freestyleemailuimailboxdeleter.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -30,9 +30,9 @@ #include "emailtrace.h" #include "freestyleemailuimailboxdeleter.h" #include "FreestyleEmailUiUtilities.h" -#include "CFSMailBox.h" +#include "cfsmailbox.h" #include "FreestyleEmailUiAppui.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" // CONSTANT VALUES _LIT( KTabCharacter, "\t" ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/ncsaddressinputfield.cpp --- a/emailuis/emailui/src/ncsaddressinputfield.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/ncsaddressinputfield.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -352,6 +352,7 @@ { iButton->HandlePointerEventL( aPointerEvent ); } + iTextEditor->HandleTextChangedL(); } // ----------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/ncsaifeditor.cpp --- a/emailuis/emailui/src/ncsaifeditor.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/ncsaifeditor.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -1087,7 +1087,6 @@ CleanupStack::PushL( text ); TPtr ptr( text->Des() ); - ptr = ptr.LeftTPtr( CursorPos() ); TInt location = ptr.LocateReverse( KCharAddressDelimeterSemiColon ); if( location != KErrNotFound ) { diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/ncscomposeview.cpp --- a/emailuis/emailui/src/ncscomposeview.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/ncscomposeview.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -24,11 +24,11 @@ #include #include #include -#include "CFSMailBox.h" -#include "CFSMailMessage.h" -#include "CFSMailAddress.h" -#include "CFSMailClient.h" -#include "CFSMailCommon.h" +#include "cfsmailbox.h" +#include "cfsmailmessage.h" +#include "cfsmailaddress.h" +#include "cfsmailclient.h" +#include "cfsmailcommon.h" #include #include #include @@ -42,7 +42,7 @@ #include "ncsconstants.h" #include "ncsutility.h" #include "ncsemailaddressobject.h" -#include "FreestyleEmailCenRepHandler.h" +#include "freestyleemailcenrephandler.h" #include "FreestyleEmailUi.hrh" #include "FreestyleEmailUiConstants.h" #include "FreestyleEmailUiSendAttachmentsListControl.h" @@ -408,6 +408,7 @@ Toolbar()->SetDimmed( EFalse ); RefreshToolbar(); } + TIMESTAMP( "Editor launched" ); } @@ -908,6 +909,7 @@ break; case ENcsCmdExit: { + TIMESTAMP( "Exit selected from editor" ); iAppUi.Exit(); } break; @@ -1041,6 +1043,7 @@ break; case 1: { + TIMESTAMP( "Delete draft message selected in editor" ); TRAPD( error, SaveToDraftsL( ETrue ) ); if ( KErrNone != error ) { @@ -2029,6 +2032,7 @@ attachmentControl->Model()->Clear(); } ExitComposer(); + TIMESTAMP( "Editor exited" ); } // ----------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/ncscomposeviewcontainer.cpp --- a/emailuis/emailui/src/ncscomposeviewcontainer.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/ncscomposeviewcontainer.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -287,6 +287,7 @@ { iFocused = iHeader; iHeader->SetFocus( ETrue,EDrawNow ); + iMessageField->ClearSelectionL(); iMessageField->SetFocus( EFalse, EDrawNow ); iHeader->MakeVisible( ETrue ); CommitL( EBodyField ); @@ -425,6 +426,11 @@ break; } } + + if( iFocused == iMessageField ) + { + iMessageField->HandleTextChangedL(); + } if ( aPointerEvent.iType == TPointerEvent::EButton1Down && iHeader->NeedsLongTapL( aPointerEvent.iPosition ) ) @@ -505,7 +511,9 @@ if ( ret == EKeyWasNotConsumed ) { ret = iFocused->OfferKeyEventL( aKeyEvent, aType ); - + if( aType == EEventKeyUp ) + iView.HandleContainerChangeRequiringToolbarRefresh(); + // Report user activity to auto saver if editor field handled the // event. In case of message field (body text), EKeyWasConsumed // condition does not come true because AknFep consumes EKeyEvent @@ -514,7 +522,6 @@ // autosaver is notified in HandleEdwinEventL() if ( ( ret == EKeyWasConsumed ) && ( iFocused != iMessageField ) ) { - iView.HandleContainerChangeRequiringToolbarRefresh(); iAutoSaver.ReportActivity(); } } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/ncsheadercontainer.cpp --- a/emailuis/emailui/src/ncsheadercontainer.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/ncsheadercontainer.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include //CAknInformationNote #include -#include "CFSMailBox.h" +#include "cfsmailbox.h" #include #include "cpbkxremotecontactlookupserviceuicontext.h" @@ -536,7 +536,14 @@ { ret = focused->OfferKeyEventL( aKeyEvent, aType ); - doScroll = ( ret == EKeyWasConsumed ); + if(aType==EEventKeyDown) + { + doScroll = ETrue; + } + else + { + doScroll = (ret == EKeyWasConsumed); + } } } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/ncspopuplistbox.cpp --- a/emailuis/emailui/src/ncspopuplistbox.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/ncspopuplistbox.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -291,32 +291,34 @@ // ----------------------------------------------------------------------------- // CNcsEmailAddressObject* CNcsPopupListBox::ReturnCurrentEmailAddressLC() - { + { FUNC_LOG; - CNcsEmailAddressObject* addressObject = NULL; + CNcsEmailAddressObject* addressObject = NULL; if ( iMatchingItems.Count() ) - { - CFSEmailUiClsItem* clsItem = NULL; - if ( iRemoteLookupSupported ) - { - clsItem = iMatchingItems[CurrentItemIndex()-1]; // -1 because of iRemoteLookupItemPos - } - else - { - clsItem = iMatchingItems[CurrentItemIndex()]; // no iRemoteLookupItemPos - } - addressObject= CNcsEmailAddressObject::NewL( clsItem->DisplayName(), clsItem->EmailAddress() ); - CleanupStack::PushL( addressObject ); + { + CFSEmailUiClsItem* clsItem = NULL; + if ( iRemoteLookupSupported ) + { + // calculate index of item + TInt index = (CurrentItemIndex() > iRemoteLookupItemPos ? CurrentItemIndex() - 1 : CurrentItemIndex()); + clsItem = iMatchingItems[index]; + } + else + { + clsItem = iMatchingItems[CurrentItemIndex()]; // no iRemoteLookupItemPos + } + + addressObject= CNcsEmailAddressObject::NewL( clsItem->DisplayName(), clsItem->EmailAddress() ); + CleanupStack::PushL( addressObject ); if ( clsItem->MultipleEmails() ) - { + { + addressObject->SetDisplayFull( ETrue ); + } + } - addressObject->SetDisplayFull( ETrue ); - } - - } - return addressObject; - } + return addressObject; + } // ----------------------------------------------------------------------------- // CNcsPopupListBox::SetPopupMaxRect @@ -503,7 +505,7 @@ } - if( ItemExists ( newCurrentItem ) ) + if( ItemExists ( newCurrentItem ) && newRMLUItemIndex != -1 ) { iItemTextsArray->Delete( iRemoteLookupItemPos ); @@ -580,6 +582,29 @@ iGc->SetBrushColor(iBackColor); iGc->SetBrushStyle(CGraphicsContext::ESolidBrush); + // draw the background + TRect backgroundRect( aActualItemRect ); + + if ( !aItemIndex ) + { + backgroundRect.iTl.iY = 0; + } + else if ( aItemIndex == iListBox.Model()->NumberOfItems() - 1 ) + { + backgroundRect.iBr.iY = iListBox.Size().iHeight; + } + + iGc->DrawRect( backgroundRect ); + + + TRect textRect( aActualItemRect ); + { + // temporary const_cast to get scroll width + CNcsPopupListBox& tmpListBox = const_cast(iListBox); + textRect.Resize( -tmpListBox.ScrollBarFrame()->ScrollBarBreadth(CEikScrollBar::EVertical), 0 ); + } + + // Now draw the highlight if( aItemIsCurrent ) { @@ -588,14 +613,13 @@ // AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), *iGc, // aActualItemRect, aActualItemRect, // KNcsIIDHighlightBackground, KNcsIIDHighlightBackground ); + iGc->DrawRect(textRect); } - iGc->DrawRect(aActualItemRect); - iGc->SetPenColor(iTextColor); iGc->SetPenStyle(CGraphicsContext::ESolidPen); iGc->SetBrushStyle(CGraphicsContext::ENullBrush); - TInt topToBaseline = ( aActualItemRect.Height() - font->HeightInPixels() ) / 2 + TInt topToBaseline = ( textRect.Height() - font->HeightInPixels() ) / 2 + font->AscentInPixels(); TPtrC itemText = iListBox.Model()->ItemText( aItemIndex ); @@ -606,10 +630,10 @@ TRAPD( err, bidiText = TBidiText::NewL( itemText, 1 ) ); if ( err == KErrNone ) { - bidiText->WrapText( aActualItemRect.Width(), *font, NULL ); + bidiText->WrapText( textRect.Width(), *font, NULL ); } - TPoint leftBase = aActualItemRect.iTl + TPoint( 0, topToBaseline ); + TPoint leftBase = textRect.iTl + TPoint( 0, topToBaseline ); if ( err != KErrNone ) { @@ -625,7 +649,7 @@ else { // if list has rmlu item change item index right - if ( rmluPosition >= 0 ) + if ( rmluPosition >= 0 && aItemIndex > rmluPosition ) { aItemIndex--; } @@ -662,7 +686,7 @@ { // draw letters to the start of the underlined part currentTextLength = underlines[i].index - currentTextStart; - DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, + DrawPartOfItem( textRect, *font, currentTextStart, currentTextLength, itemText, EFalse, topToBaseline ); } else if ( currentTextStart == underlines[i].index ) @@ -670,7 +694,7 @@ // draw underlined letters currentTextLength = underlines[i].length; - DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, + DrawPartOfItem( textRect, *font, currentTextStart, currentTextLength, itemText, ETrue, topToBaseline ); i++; } @@ -691,7 +715,7 @@ if ( currentTextStart < itemText.Length() ) { currentTextLength = itemText.Length() - currentTextStart; - DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText, + DrawPartOfItem( textRect, *font, currentTextStart, currentTextLength, itemText, EFalse, topToBaseline ); } } @@ -746,6 +770,7 @@ else { MakeVisible( ETrue ); + UpdateScrollBarsL(); iHeaderContainer.ShowPopupMenuBarL( ETrue ); } } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/ncssubjectfield.cpp --- a/emailuis/emailui/src/ncssubjectfield.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/ncssubjectfield.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -89,9 +89,6 @@ iTextEditor = new ( ELeave ) CNcsEditor( iSizeObserver, ETrue, ENcsEditorSubject, captionText ); CleanupStack::PopAndDestroy( aTextBuf ); - - // iTextEditor is not completely constructed until in SetContainerWindowL() - iFocusChangeHandler = new (ELeave) CAsyncCallBack( CActive::EPriorityStandard ); } // --------------------------------------------------------------------------- @@ -109,8 +106,6 @@ ControlEnv()->ScreenDevice()->ReleaseFont( iFont ); iFont = NULL; }*/ - - delete iFocusChangeHandler; } // ----------------------------------------------------------------------------- @@ -245,6 +240,7 @@ { FUNC_LOG; iTextEditor->HandlePointerEventL( aPointerEvent ); + iTextEditor->HandleTextChangedL(); } // ----------------------------------------------------------------------------- @@ -254,21 +250,8 @@ void CNcsSubjectField::FocusChanged( TDrawNow aDrawNow ) { FUNC_LOG; - // The focus change gaining handling needs to be deferred until AknFep is fully - // initialised. Otherwise there will be problems when moving focus from - // body to subject. Focus losing can be handled immediately iDrawAfterFocusChange = aDrawNow; - if ( IsFocused() ) - { - TCallBack callback( DoHandleFocusChanged, this ); - iFocusChangeHandler->Cancel(); - iFocusChangeHandler->Set( callback ); - iFocusChangeHandler->CallBack(); - } - else - { - DoHandleFocusChanged( this ); - } + DoHandleFocusChanged( this ); } // ----------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/emailui/src/ncsutility.cpp --- a/emailuis/emailui/src/ncsutility.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/emailui/src/ncsutility.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -36,9 +36,9 @@ #include #include // CAknEnv -#include "CFSMailBox.h" -#include "CFSMailClient.h" -#include "CFSMailAddress.h" +#include "cfsmailbox.h" +#include "cfsmailclient.h" +#include "cfsmailaddress.h" #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/gsemailsettings/src/GSEmailSettingsView.cpp --- a/emailuis/gsemailsettings/src/GSEmailSettingsView.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/gsemailsettings/src/GSEmailSettingsView.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -25,7 +25,7 @@ #include #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "FreestyleEmailUiConstants.h" // email enumerations // #include // icons diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/uicomponents/inc/fstreevisualizerbase.h --- a/emailuis/uicomponents/inc/fstreevisualizerbase.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/uicomponents/inc/fstreevisualizerbase.h Fri Feb 19 22:37:30 2010 +0200 @@ -1009,6 +1009,13 @@ virtual void SetFocusedItemL( const TFsTreeItemId aItem, TBool aCheckFocus = ETrue ); // + /** + * Gets item vertical position in the list + * + * @param aIdx indicates item index + */ + virtual TInt GetItemWorldPosition( const TInt aIdx ); + /** * Returns item id of the currently focused item. * @@ -1646,6 +1653,28 @@ * @return ETrue if kinetic scrolling is disabled. */ TBool IsKineticScrollingDisabled() const; + + /** + * Returns viewPort top-left position + */ + virtual TPoint ViewPortTopPosition() const; + +public: // from MAknPhysicsObserver + + /** + * @see MAknPhysicsObserver::ViewPositionChanged + */ + virtual void ViewPositionChanged( const TPoint& aNewPosition, TBool aDrawNow = ETrue, TUint aFlags = 0 ); + + /** + * @see MAknPhysicsObserver::PhysicEmulationEnded + */ + virtual void PhysicEmulationEnded(); + + /** + * @see MAknPhysicsObserver::ViewPosition + */ + virtual TPoint ViewPosition() const; private: @@ -1953,23 +1982,6 @@ private: // from MAknPhysicsObserver - /** - * @see MAknPhysicsObserver::ViewPositionChanged - */ - virtual void ViewPositionChanged( const TPoint& aNewPosition, TBool aDrawNow = ETrue, TUint aFlags = 0 ); - - /** - * @see MAknPhysicsObserver::PhysicEmulationEnded - */ - virtual void PhysicEmulationEnded(); - - /** - * @see MAknPhysicsObserver::ViewPosition - */ - virtual TPoint ViewPosition() const; - -private: // Single click changes - virtual TBool IsFocusShown(); private: //Data members diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp --- a/emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -1243,9 +1243,9 @@ { TSize oldIconSize = iconA.Size(); iconA.SetRect( TPoint( - iconA.iTl .iX + ( buttonSize.iWidth - oldIconSize.iWidth ) / 2, - iconA.iTl .iY + ( buttonSize.iHeight - oldIconSize.iHeight ) / 2 ), - oldIconSize ); + ( buttonSize.iWidth - oldIconSize.iWidth ) / 2, + ( buttonSize.iHeight - oldIconSize.iHeight ) / 2 ), + oldIconSize ); } iconA.SetHeight( buttonSize.iHeight ); text1.SetHeight( buttonSize.iHeight ); diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/uicomponents/src/fsfastaddressingvisualizer.cpp --- a/emailuis/uicomponents/src/fsfastaddressingvisualizer.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/uicomponents/src/fsfastaddressingvisualizer.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -16,16 +16,11 @@ */ -// removed __FS_ALFRED_SUPPORT flag -//#include -// removed __FS_ALFRED_SUPPORT flag -// SF #include "emailtrace.h" #include #include #include -// -#include +#include #include "fsfastaddressingvisualizer.h" #include "fstextinputvisual.h" diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/uicomponents/src/fstreevisualizerbase.cpp --- a/emailuis/uicomponents/src/fstreevisualizerbase.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/uicomponents/src/fstreevisualizerbase.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -1703,6 +1703,17 @@ } // --------------------------------------------------------------------------- +// Gets item vertical position in the list +// --------------------------------------------------------------------------- +// +TInt CFsTreeVisualizerBase::GetItemWorldPosition( const TInt aIdx ) + { + TRect rect; + iWorld.GetItemRectByIndex( aIdx, rect); + return rect.iTl.iY; + } + +// --------------------------------------------------------------------------- // Checks if the specified item is focused. // --------------------------------------------------------------------------- // @@ -2524,7 +2535,8 @@ iWorld.AppendL(itemId, itemviz->Size()); } } - iViewPort.SetPositionL(TPoint(), EFalse); + // Below line commetned out. ViewPort is now not moved to the top of mail list + //iViewPort.SetPositionL(TPoint(), EFalse); iViewPort.ClearCache(); if (!isUpdating) { @@ -5020,15 +5032,26 @@ } // --------------------------------------------------------------------------- +// Returns viewPort top-left position +// --------------------------------------------------------------------------- +// +TPoint CFsTreeVisualizerBase::ViewPortTopPosition() const +{ + FUNC_LOG; + return iViewPort.Position(); +} + +// --------------------------------------------------------------------------- // Physic updated view position // --------------------------------------------------------------------------- // void CFsTreeVisualizerBase::ViewPositionChanged(const TPoint& aNewPosition, - TBool /*aDrawNow*/, TUint /*aFlags*/) + TBool /*aDrawNow*/, TUint aFlags ) { FUNC_LOG; TInt error(KErrNone); - TRAP( error, iViewPort.SetCenterPositionL(aNewPosition, ETrue, EUpdatedByPhisic) ); + TRAP( error, iViewPort.SetCenterPositionL(aNewPosition, ETrue, + aFlags == 0 ? EUpdatedByPhisic : ENotUpdatedByPhisic ) ); ERROR_1( error, "iViewPort.SetCenterPositionL failed with error: %d", error ); } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/widget/emailwidgetsettings/conf/cmailwidget.confml Binary file emailuis/widget/emailwidgetsettings/conf/cmailwidget.confml has changed diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/widget/emailwidgetsettings/conf/cmailwidget_2001E272.crml Binary file emailuis/widget/emailwidgetsettings/conf/cmailwidget_2001E272.crml has changed diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/widget/emailwidgetsettings/group/emailwidgetsettings.mmp --- a/emailuis/widget/emailwidgetsettings/group/emailwidgetsettings.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/widget/emailwidgetsettings/group/emailwidgetsettings.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -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" @@ -20,6 +20,7 @@ #include #include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber +#include "../../../../inc/emailtraceconfig.hrh" TARGET emailwidgetsettings.exe TARGETTYPE exe @@ -28,6 +29,7 @@ VENDORID VID_DEFAULT CAPABILITY CAP_APPLICATION +EPOCSTACKSIZE 0x5000 VERSION KEmailBinaryVersionNumber KEmailBinaryDemandPaging @@ -77,5 +79,10 @@ LIBRARY commonengine.lib LIBRARY cmaillogger.lib LIBRARY egul.lib +LIBRARY ecom.lib + +#ifdef TRACE_INTO_FILE +LIBRARY flogger.lib +#endif // TRACE_INTO_FILE // End of file diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingslistview.h --- a/emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingslistview.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingslistview.h Fri Feb 19 22:37:30 2010 +0200 @@ -23,6 +23,9 @@ #include #include #include +#include +#include +#include #include "emailwidgetsettingsappui.h" #include "emailwidgetsettingsmailboxes.h" @@ -30,7 +33,9 @@ extern const TUid KEmailWidgetSettingsListViewId; class CEmailWidgetSettingsListView; -class CEmailWidgetSettingsListViewContainer : public CCoeControl +class CEmailWidgetSettingsListViewContainer : + public CCoeControl, + public EmailInterface::MEmailObserverListener { public: CEmailWidgetSettingsListViewContainer(); @@ -46,6 +51,9 @@ TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); TSize MinimumSize(); void SaveSelectedL(); + + // From MEmailObserverListener + virtual void EmailObserverEvent( EmailInterface::MEmailData& aEmailData ); private: void CreateCbaL(MEikCommandObserver* aObserver); @@ -55,20 +63,31 @@ CArrayPtr* aIcons, const TInt aFileBitmapId, const TInt aFileMaskId); - TInt GetSettingToAssociateL(const TDesC& aCid); + TInt AppendExternalIconL( + CArrayPtr* aIcons, + const TDesC& aMifPath, + const TInt aFileBitmapId, + const TInt aFileMaskId); + + TInt GetSettingToAssociateL(const TDesC& aCid, const TBool aNativeBox, CRepository* aCenRep); void LaunchEmailWizardL(); + void ResetExtAccountWithSameId( const TDesC& aContentId, CRepository* aCenRep ); + void ResetNatAccountWithSameId( const TDesC& aContentId, CRepository* aCenRep ); + private: // from MObjectProvider TTypeUid::Ptr MopSupplyObject(TTypeUid aId); public: - CEikButtonGroupContainer* iPopoutCba; - CEikColumnListBox* iListBox; - CDesCArrayFlat* iAccountNames; - CDesCArrayFlat* iDomains; - CArrayFixFlat* iAccountIds; - CEmailWidgetSettingsMailboxes* iMailboxes; - CEikonEnv* iEnv; + CEikColumnListBox* iListBox; + +private: + CEikButtonGroupContainer* iPopoutCba; + CDesCArrayFlat* iAccountNames; + CDesCArrayFlat* iDomains; + CArrayFixFlat* iAccountIds; + CEmailWidgetSettingsMailboxes* iMailboxes; + CEikonEnv* iEnv; }; class CEmailWidgetSettingsListView : public CAknView, public MEikListBoxObserver diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingsmailboxes.h --- a/emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingsmailboxes.h Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingsmailboxes.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #ifndef EMAILWIDGETSETTINGSMAILBOXES_H_ #define EMAILWIDGETSETTINGSMAILBOXES_H_ -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" class CFSMailClient; diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsappui.cpp --- a/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsappui.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsappui.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -47,7 +47,7 @@ void CEmailWidgetSettingsAppUi::ConstructL() { FUNC_LOG; - BaseConstructL(EAknEnableSkin); + BaseConstructL( EAknEnableSkin /*| EAknEnableMSK | EAknSingleClickCompatible*/ ); CreateListViewL(); } diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistview.cpp --- a/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistview.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistview.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -88,7 +88,7 @@ // void CEmailWidgetSettingsListView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType) { - if (aEventType == EEventEnterKeyPressed || aEventType == EEventItemDoubleClicked) + if (aEventType == EEventEnterKeyPressed || aEventType == EEventItemDoubleClicked /*EEventItemSingleClicked*/ ) { iView->SaveSelectedL(); AppUi()->HandleCommandL(EAknSoftkeyCancel); // Exit app diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistviewcontainer.cpp --- a/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistviewcontainer.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistviewcontainer.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -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" @@ -20,28 +20,33 @@ #include #include #include -#include +#include #include #include +#include +#include #include "emailtrace.h" #include "emailwidgetsettingslistview.h" #include "cmailwidgetcenrepkeys.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" using namespace AknLayout; +using namespace EmailInterface; const TInt KMaxMailboxCount = 18; +const TInt KMaxExternalBoxCount = 10; _LIT( KDissociated,"0"); const TInt KMaxDescLen = 256; const TUid KUidWizardApp = { 0x10281c96 }; const TUid KUidEmailWizardView = { 0x10281C9A }; _LIT( KMifPath, "z:\\resource\\apps\\emailwidgetsettings.mif"); +_LIT( KMifPrefix, "mif(" ); // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- -// +// CEmailWidgetSettingsListViewContainer::CEmailWidgetSettingsListViewContainer // --------------------------------------------------------------------------- // CEmailWidgetSettingsListViewContainer::CEmailWidgetSettingsListViewContainer() @@ -50,7 +55,7 @@ } // --------------------------------------------------------------------------- -// +// CEmailWidgetSettingsListViewContainer::ConstructL // --------------------------------------------------------------------------- // void CEmailWidgetSettingsListViewContainer::ConstructL(CEmailWidgetSettingsListView* aView, @@ -69,24 +74,27 @@ } // --------------------------------------------------------------------------- -// +// CEmailWidgetSettingsListViewContainer::CreateListBoxL // --------------------------------------------------------------------------- // void CEmailWidgetSettingsListViewContainer::CreateListBoxL(MEikListBoxObserver* aObserver) { - FUNC_LOG; - TInt count = iMailboxes->MailboxCount(); + FUNC_LOG; + + + TInt nativeMailboxCount = iMailboxes->MailboxCount(); iListBox = new(ELeave) CAknSingleGraphicStyleListBox; iListBox->SetContainerWindowL( *this); iListBox->ConstructL( this, EAknListBoxSelectionList ); - iAccountNames = new (ELeave) CDesCArrayFlat(count + 1); - iDomains = new (ELeave) CDesCArrayFlat(count); - if (count) - { - iAccountIds = new ( ELeave ) CArrayFixFlat(count); - } - for (TInt i = 0; i < count; i++) + + iAccountNames = new (ELeave) CDesCArrayFlat(nativeMailboxCount + 1); // +1 for creating new mailbox + iDomains = new (ELeave) CDesCArrayFlat(1); + iAccountIds = new ( ELeave ) CArrayFixFlat(1); + + // First items on the selection list are native mailboxes. + // Append name, domain and id information to the arrays. + for (TInt i = 0; i < nativeMailboxCount; i++) { TBuf name; TBuf domain; @@ -98,6 +106,56 @@ iDomains->AppendL(domain); iAccountIds->AppendL(id); } + + // Continue with external mailboxes. + // List plugins implementing the interface. + TUid interfaceUid = TUid::Uid( KEmailObserverInterfaceUid ); + RImplInfoPtrArray pluginArray; + REComSession::ListImplementationsL( interfaceUid, pluginArray); + + const TInt pluginCount = pluginArray.Count(); + INFO_1("***** NUMBER OF plugins == %d", pluginCount); + for ( TInt ii = 0; ii < pluginCount; ii++ ) + { + TUid implUid = pluginArray[ii]->ImplementationUid(); + + // load external email client plugin + INFO_1("***** BEFORE instantiating plugin %d", implUid.iUid); + EmailInterface::CEmailObserverPlugin* plugin = EmailInterface::CEmailObserverPlugin::NewL( implUid, this ); + CleanupStack::PushL( plugin ); + INFO("***** AFTER instantiating plugin "); + + // list mailboxes of the plugin + MEmailData& data( plugin->EmailDataL() ); + RPointerArray extMailboxes = data.MailboxesL(); + + const TInt extMailboxCount = extMailboxes.Count(); + + for ( TInt jj = 0; jj < extMailboxCount; jj++ ) + { + // Append mailbox name using indexed format ( e.g. "1\tMailboxName\t\t" ) + TBuf name; + name.AppendNum(nativeMailboxCount + 1 + jj); + name.Append(_L("\t")); + name.Append(extMailboxes[jj]->Name()); + name.Append(_L("\t\t")); + iAccountNames->AppendL(name); + + // Instead of domain information, external mail clients are requested + // to provide a string containing a mif file path and icon/mask numbers. + // The provided string is stored to domain list. + iDomains->AppendL( extMailboxes[jj]->BrandingIcon()); + + + // Combine plugin uid and mailbox id and add to the list. + TFSMailMsgId uid( implUid, extMailboxes[jj]->MailboxId() ); + iAccountIds->AppendL( uid ); + } + CleanupStack::PopAndDestroy(plugin); + plugin = NULL; + } + pluginArray.ResetAndDestroy(); + HBufC* createNewMailbox = StringLoader::LoadLC(R_EMAILWIDGETSETTINGS_CREATE_NEW_MAILBOX); iAccountNames->AppendL(createNewMailbox->Des()); CleanupStack::PopAndDestroy(createNewMailbox); @@ -110,11 +168,13 @@ iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); iListBox->SetListBoxObserver(aObserver); + SetupListIconsL(); + } // --------------------------------------------------------------------------- -// +// CEmailWidgetSettingsListViewContainer::SetupListIconsL // --------------------------------------------------------------------------- // void CEmailWidgetSettingsListViewContainer::SetupListIconsL() @@ -124,10 +184,12 @@ CleanupClosePushL(*mailClient); MFSMailBrandManager& brandManager = mailClient->GetBrandManagerL(); - TInt count = iMailboxes->MailboxCount(); + TInt count = iAccountIds->Count(); + CArrayPtr* icons = new(ELeave) CArrayPtrFlat( count + 1 ); CleanupStack::PushL( icons ); - + + // Add "new mailbox" icon to the list AppendIconL(icons, EMbmEmailwidgetsettingsQgn_prop_cmail_new_mailbox, EMbmEmailwidgetsettingsQgn_prop_cmail_new_mailbox_mask); @@ -138,15 +200,54 @@ if (brandIcon) { + // Add branded mailbox icon to the list icons->AppendL(brandIcon); } else { - AppendIconL(icons, EMbmEmailwidgetsettingsQgn_indi_cmail_drop_email_account, - EMbmEmailwidgetsettingsQgn_indi_cmail_drop_email_account_mask); + TInt err(KErrNotFound); + + // Check if domain list item contains mif file path (instead of domain) + // Path follows the format: "mif(z:\\resource\\apps\\myemailplugin.mif N1 N2)" + + TBufC temp( iDomains->MdcaPoint(i) ); + if( temp.Find(KMifPrefix) == 0 ) + { + TInt p1 = KMifPrefix().Length(); + TInt p2 = temp.Locate(' ') + 1; + TInt p3 = temp.LocateReverse(' ') + 1; + TInt end = temp.Length() - 1; + + TInt p1Len = p2-p1-1; + TInt p2Len = p3-p2-1; + TInt p3Len = end-p3; + + // negative lengths not allowed + if ( p1Len > 0 && p2Len > 0 && p3Len > 0 ) + { + TBufC mifPath(temp.Mid( p1, p1Len )); + TBufC<16> iconString(temp.Mid( p2, p2Len )); + TBufC<16> maskString(temp.Mid( p3, p3Len )); + + TLex lexIcon(iconString); + TLex lexMask(maskString); + TInt icon(0), mask(0); + lexIcon.Val(icon); + lexMask.Val(mask); + + // Add 3rd party mailbox icon to the list + err = AppendExternalIconL( icons, mifPath, icon, mask ); + } + } + if ( err ) + { + // Add default mailbox icon to the list + AppendIconL(icons, EMbmEmailwidgetsettingsQgn_indi_cmail_drop_email_account, + EMbmEmailwidgetsettingsQgn_indi_cmail_drop_email_account_mask); + } } } - + // clear any previous icon array CAknIconArray* oldIconArray = static_cast(iListBox->ItemDrawer()->ColumnData()->IconArray()); if (oldIconArray) @@ -158,7 +259,7 @@ } // ----------------------------------------------------------------------------- -// CFeedsTopicContainer::AppendIconL +// CEmailWidgetSettingsListViewContainer::AppendIconL // // Loads and appends an icon to the icon array. // ----------------------------------------------------------------------------- @@ -184,6 +285,40 @@ CleanupStack::Pop(newIcon); } +// ----------------------------------------------------------------------------- +// CEmailWidgetSettingsListViewContainer::AppendExternalIconL +// +// Loads and appends an 3rd party icon to the icon array. +// ----------------------------------------------------------------------------- +// +TInt CEmailWidgetSettingsListViewContainer::AppendExternalIconL( + CArrayPtr* aIcons, + const TDesC& aMifPath, + const TInt aFileBitmapId, + const TInt aFileMaskId) + { + FUNC_LOG; + CGulIcon* newIcon; + CFbsBitmap* newIconBmp; + CFbsBitmap* newIconMaskBmp; + // Trap when faulty mif path, missing graphic file, etc. + TRAPD( err, AknIconUtils::CreateIconL( newIconBmp, newIconMaskBmp, aMifPath, + aFileBitmapId, + aFileMaskId ) ); + if (!err) + { + CleanupStack::PushL(newIconBmp); + CleanupStack::PushL(newIconMaskBmp); + newIcon = CGulIcon::NewL(newIconBmp, newIconMaskBmp); + CleanupStack::Pop(newIconMaskBmp); + CleanupStack::Pop(newIconBmp); + CleanupStack::PushL(newIcon); + aIcons->AppendL(newIcon); + CleanupStack::Pop(newIcon); + } + return err; + } + // --------------------------------------------------------------------------- // CEmailWidgetSettingsListViewContainer::CreateCbaL // --------------------------------------------------------------------------- @@ -210,6 +345,7 @@ delete iAccountNames; delete iDomains; delete iAccountIds; + REComSession::FinalClose(); } // --------------------------------------------------------------------------- @@ -220,9 +356,9 @@ { FUNC_LOG; TRect mainPaneRect; - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); - TRect listBoxRect(mainPaneRect.Size()); - iListBox->SetRect(listBoxRect); + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect); + TRect listBoxRect(mainPaneRect.Size()); + iListBox->SetRect(listBoxRect); } // --------------------------------------------------------------------------- @@ -291,7 +427,8 @@ // void CEmailWidgetSettingsListViewContainer::SaveSelectedL() { - FUNC_LOG; + FUNC_LOG; + if (CurrentIndex() == iAccountNames->Count() - 1) { LaunchEmailWizardL(); @@ -306,21 +443,47 @@ } CRepository* cenRep = CRepository::NewL( KCRUidCmailWidget ); + // Check whether selected box is native or external mailbox + TInt index = CurrentIndex(); + TInt nativeBoxCount = iMailboxes->MailboxCount(); + + TBool nativeBox(ETrue); + if ( index >= nativeBoxCount ) + { + nativeBox = EFalse; + } + if ( cenRep ) { - TInt setId (GetSettingToAssociateL(args->Arg(1))); + TInt setId ( GetSettingToAssociateL(args->Arg(1), nativeBox, cenRep) ); if (setId >= 0) { - TUint32 errorKey; TFSMailMsgId msgId = (*iAccountIds)[CurrentIndex()]; TInt id = msgId.Id(); TUid pluginId = msgId.PluginId(); TInt pId(pluginId.iUid); - cenRep->StartTransaction(CRepository::EConcurrentReadWriteTransaction); - cenRep->Set( KCMailMailboxIdBase+setId, id ); - cenRep->Set( KCMailPluginIdBase+setId, pId ); - cenRep->Set( KCMailWidgetContentIdBase+setId, args->Arg(1) ); + TInt ret = cenRep->StartTransaction(CRepository::EConcurrentReadWriteTransaction); + + if ( nativeBox ) + { + ResetExtAccountWithSameId( args->Arg(1), cenRep ); + + ret = cenRep->Set( KCMailMailboxIdBase+setId, id ); + ret = cenRep->Set( KCMailPluginIdBase+setId, pId ); + ret = cenRep->Set( KCMailWidgetContentIdBase+setId, args->Arg(1) ); + } + else // external mailbox + { + ResetNatAccountWithSameId( args->Arg(1), cenRep ); + + ret = cenRep->Set( KCMailExtMailboxBase+setId, id ); + ret = cenRep->Set( KCMailExtMailboxBase+KCMailExtPluginIdOffset+setId, pId ); + ret = cenRep->Set( KCMailExtMailboxBase+KCMailExtWidgetCidOffset+setId, args->Arg(1) ); + } + + TUint32 errorKey( 0 ); cenRep->CommitTransaction(errorKey); + INFO_1("Errorkey == %d", errorKey); } } delete cenRep; @@ -328,42 +491,99 @@ } // --------------------------------------------------------------------------- +// CEmailWidgetSettingsListViewContainer::ResetExtAccountWithSameId +// --------------------------------------------------------------------------- +// +void CEmailWidgetSettingsListViewContainer::ResetExtAccountWithSameId( const TDesC& aContentId, CRepository* aCenRep ) + { + FUNC_LOG; + for ( TInt i = 0; i < KMaxExternalBoxCount; i++ ) + { + TBuf<10> value; + TInt ret = aCenRep->Get( KCMailExtMailboxBase+KCMailExtWidgetCidOffset+i, value ); + if ( !value.Compare( aContentId ) ) + { + // found + ret = aCenRep->Set(KCMailExtMailboxBase+i, 0); + ret = aCenRep->Set(KCMailExtMailboxBase+KCMailExtPluginIdOffset+i, 0); + ret = aCenRep->Set(KCMailExtMailboxBase+KCMailExtWidgetCidOffset+i, KDissociated); + } + } + } + +// --------------------------------------------------------------------------- +// CEmailWidgetSettingsListViewContainer::ResetNatAccountWithSameId +// --------------------------------------------------------------------------- +void CEmailWidgetSettingsListViewContainer::ResetNatAccountWithSameId( const TDesC& aContentId, CRepository* aCenRep ) + { + FUNC_LOG; + for ( TInt i = 0; i < KMaxMailboxCount; i++ ) + { + TBuf<10> value; + TInt ret = aCenRep->Get( KCMailWidgetContentIdBase+i, value ); + if ( !value.Compare( aContentId ) ) + { + // found + ret = aCenRep->Set(KCMailMailboxIdBase+i, 0); + ret = aCenRep->Set(KCMailPluginIdBase+i, 0); + ret = aCenRep->Set(KCMailWidgetContentIdBase+i, KDissociated); + } + } + } + +// --------------------------------------------------------------------------- // CEmailWidgetSettingsListViewContainer::GetSettingToAssociateL // --------------------------------------------------------------------------- // -TInt CEmailWidgetSettingsListViewContainer::GetSettingToAssociateL(const TDesC& aCid) +TInt CEmailWidgetSettingsListViewContainer::GetSettingToAssociateL(const TDesC& aCid, + const TBool aNativeBox, + CRepository* aCenRep) { FUNC_LOG; + TUint32 keyBase; + TInt mailboxCount; + if (aNativeBox) + { + keyBase = KCMailWidgetContentIdBase; + mailboxCount = KMaxMailboxCount; + } + else // external mailbox + { + keyBase = KCMailExtMailboxBase + KCMailExtWidgetCidOffset; + mailboxCount = KMaxExternalBoxCount; + } + TInt ret(KErrNotFound); - CRepository* cenRep = CRepository::NewL( KCRUidCmailWidget ); - for (TInt i = 0; i < KMaxMailboxCount; i++) + + // Search selected widget content id from cenrep settings + for (TInt i = 0; i < mailboxCount; i++) { TBuf value; - TUint32 key(KCMailWidgetContentIdBase+i); - cenRep->Get( key, value ); + aCenRep->Get( keyBase+i, value ); TInt result = value.Compare(aCid); if (!result) { + // Content id found ret = i; break; } } if (ret < 0 ) { - for (TInt i = 0; i < KMaxMailboxCount; i++) + // Content id not found. Search first free space. + for (TInt i = 0; i < mailboxCount; i++) { TBuf value; - TUint32 key(KCMailWidgetContentIdBase+i); - cenRep->Get( key, value ); + aCenRep->Get( keyBase+i, value ); TInt result = value.Compare(KDissociated); if (!result) { + // Free space found ret = i; break; } } } - delete cenRep; return ret; } @@ -385,4 +605,10 @@ } } +void CEmailWidgetSettingsListViewContainer::EmailObserverEvent( + EmailInterface::MEmailData& /*aEmailData*/ ) + { + FUNC_LOG; + } + // End of File diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsmailboxes.cpp --- a/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsmailboxes.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsmailboxes.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -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" @@ -73,7 +73,7 @@ } // --------------------------------------------------------------------------- -// CEmailWidgetSettingsMailboxes::AppendMailboxItemsL +// CEmailWidgetSettingsMailboxes::GetMailboxIdL // --------------------------------------------------------------------------- // void CEmailWidgetSettingsMailboxes::GetMailboxIdL(TInt aNum, diff -r e7aa27f58ae1 -r e1b6206813b4 emailuis/widget/xuikon/00/emailwidget.css --- a/emailuis/widget/xuikon/00/emailwidget.css Tue Feb 02 00:02:40 2010 +0200 +++ b/emailuis/widget/xuikon/00/emailwidget.css Fri Feb 19 22:37:30 2010 +0200 @@ -107,3 +107,7 @@ text-align: right; } +image +{ + _s60-aspect-ratio:preserve; +} diff -r e7aa27f58ae1 -r e1b6206813b4 group/bld.inf --- a/group/bld.inf Tue Feb 02 00:02:40 2010 +0200 +++ b/group/bld.inf Fri Feb 19 22:37:30 2010 +0200 @@ -23,3 +23,4 @@ #include "../meetingrequest/group/bld.inf" #include "../emailuis/group/bld.inf" #include "../email_plat/group/bld.inf" +#include "../email_pub/group/bld.inf" \ No newline at end of file diff -r e7aa27f58ae1 -r e1b6206813b4 help/data/xhtml.zip Binary file help/data/xhtml.zip has changed diff -r e7aa27f58ae1 -r e1b6206813b4 help/inc/cmail.hlp.hrh --- a/help/inc/cmail.hlp.hrh Tue Feb 02 00:02:40 2010 +0200 +++ b/help/inc/cmail.hlp.hrh Fri Feb 19 22:37:30 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosaoplugin/group/IPSSosAOPlugin.mmp --- a/ipsservices/ipssosaoplugin/group/IPSSosAOPlugin.mmp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosaoplugin/group/IPSSosAOPlugin.mmp Fri Feb 19 22:37:30 2010 +0200 @@ -70,8 +70,7 @@ LIBRARY ipssosplugin.lib LIBRARY IpsSosSettings.lib LIBRARY cmaillogger.lib -LIBRARY cmmanager.lib -DEBUGLIBRARY flogger.lib +LIBRARY cmmanager.lib #ifdef TRACE_INTO_FILE LIBRARY flogger.lib diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosaoplugin/inc/IpsSosAOImapAgent.h --- a/ipsservices/ipssosaoplugin/inc/IpsSosAOImapAgent.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOImapAgent.h Fri Feb 19 22:37:30 2010 +0200 @@ -24,7 +24,7 @@ #include #include // -#include "MFSMailRequestObserver.h" +#include "mfsmailrequestobserver.h" // #include "IpsSosAOBaseAgent.h" diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp --- a/ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -25,7 +25,7 @@ #include #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/data/2000E53D.rss --- a/ipsservices/ipssosplugin/data/2000E53D.rss Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/data/2000E53D.rss Fri Feb 19 22:37:30 2010 +0200 @@ -17,7 +17,7 @@ #include -#include "CFSMailPlugin.hrh" // fsmailplugininterface +#include "cfsmailplugin.hrh" // fsmailplugininterface #include "ipsplgsosbaseplugin.hrh" #include "../../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgbaseoperation.h --- a/ipsservices/ipssosplugin/inc/ipsplgbaseoperation.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgbaseoperation.h Fri Feb 19 22:37:30 2010 +0200 @@ -18,8 +18,10 @@ #ifndef IPSPLGBASEOPERATION_H #define IPSPLGBASEOPERATION_H +#include "cfsmailcommon.h" // for TFSMailMsgId, TFSProgress class CMsvOperation; + /** * class CIpsPlgBaseOperation * diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgeventhandler.h --- a/ipsservices/ipssosplugin/inc/ipsplgeventhandler.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgeventhandler.h Fri Feb 19 22:37:30 2010 +0200 @@ -205,11 +205,27 @@ void SignalMailboxOfflineStateL( const TFSMailMsgId& aAccount ); /** - * Send user password query request to fs email ui + * Send user password query request to fs email ui. + * Request is handled by emailserver. + * Only one query at a time is allowed - restriction of CFSMailMessageQueryHandler + * Operation callback is registered in handler and will receive notification + * on query password finished. + * * @param aMbox entry id of mailbox service * @param aCallback callback interface to connection operation, defaut NULL + * @param aIncoming incoming or outgoing password query + * @return ETrue query invoked, wait for notification + * EFalse another query is in progress */ - void QueryUsrPassL( TMsvId aMbox, MIpsPlgConnectOpCallback* aCallback=NULL ); + TBool QueryUsrPassL( + TMsvId aMbox, + MIpsPlgConnectOpCallback* aCallback=NULL, + TBool aIncoming=ETrue ); + + /** + * Query in progress is for incoming or outgoing mail. + */ + TBool IncomingPass() const; /** * Send user password (=credentials) set signal to all plugin @@ -221,6 +237,16 @@ private: + /** States of Query user password operation */ + enum TQueryUsrPassState + { + EReady, // ready for action + EBusy, // request in progress (invoker eventhandler`s state) + ENotificationRequest, // user notification request (emailserver eventhandler`s state) + EPasswordRequest, // password request (emailserver eventhandler`s state) + ERequestResponding // response for request received, handling in progress (invoker eventhandler`s state) + }; + /** * Checks the source type of event and also * checks is the event from IPS type ( imap/pop ) entry @@ -443,11 +469,16 @@ // base plugin id TUint iPluginId; - //not owned - MIpsPlgConnectOpCallback* iConnOpCallback; - RArray iImapFolderIds; + // state of the query user password operation + // diffrent states are for query invoker and query handler (emailserver) + TQueryUsrPassState iQueryPassState; + // array of operations which wait for query response + // or possibilty to perform a query + RPointerArray iConnOpCallbacks; + // query user password for incoming or outgoing + TBool iIncomingPass; }; diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgheaders.h --- a/ipsservices/ipssosplugin/inc/ipsplgheaders.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgheaders.h Fri Feb 19 22:37:30 2010 +0200 @@ -71,16 +71,16 @@ #include // MMsvAttachmentManager // cfsmail // -#include "CFSMailCommon.h" -#include "CFSMailMessage.h" +#include "cfsmailcommon.h" +#include "cfsmailmessage.h" // sendui #include #include #include "fsmailserverconst.h" // mfsmail -#include "MFSMailBoxSearchObserver.h" -#include "MFSMailEventObserver.h" +#include "mfsmailboxsearchobserver.h" +#include "mfsmaileventobserver.h" // // alwaysonline #include @@ -160,7 +160,7 @@ #include "ipsplgsyncstatehandler.h" // observers -#include "MFSMailRequestObserver.h" +#include "mfsmailrequestobserver.h" #include "ipsplgsettingsobserver.h" #include "ipsplgpropertywatcher.h" diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h --- a/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h Fri Feb 19 22:37:30 2010 +0200 @@ -139,7 +139,8 @@ enum TImapConnectionState { EStateStartConnect, - EStateQueryingDetails, + EStateQueryingDetails, + EStateQueryingDetailsBusy, EStateConnectAndSync, EStatePopulateAllCompleted, EStateCompleted, @@ -186,13 +187,14 @@ * */ void DoPopulateAllL(); - + /** - * - */ - void QueryUserPwdL(); - - + * Send user password query request to CIpsPlgEventHandler + * @return ETrue - if query send + */ + TBool QueryUserPassL(); + + /** * */ diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h --- a/ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h Fri Feb 19 22:37:30 2010 +0200 @@ -232,6 +232,7 @@ TMsvId iService; TBool iPopulated; CIpsFetchProgReport* iProgReport; + TInt iRetryCount; }; #endif //__IPSPLGIMAP4FETCHATTACHMENTOP_H__ diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgimap4moveremoteop.h --- a/ipsservices/ipssosplugin/inc/ipsplgimap4moveremoteop.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgimap4moveremoteop.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include "ipsplgonlineoperation.h" -#include "MFSMailRequestObserver.h" +#include "mfsmailrequestobserver.h" /** * Move a selection of messages that may or may not be complete. diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgmsgiterator.h --- a/ipsservices/ipssosplugin/inc/ipsplgmsgiterator.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgmsgiterator.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,7 @@ #include // NONSHARABLE_CLASS // -#include "MFSMailIterator.h" // mfsmailiterator +#include "mfsmailiterator.h" // mfsmailiterator // class TIpsPlgMsgKey; diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgmsgkey.h --- a/ipsservices/ipssosplugin/inc/ipsplgmsgkey.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgmsgkey.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #include // TKey // -#include "CFSMailCommon.h" // tfsmailsortcriteria +#include "cfsmailcommon.h" // tfsmailsortcriteria // class CMsvEntry; diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h --- a/ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h Fri Feb 19 22:37:30 2010 +0200 @@ -135,9 +135,10 @@ TBool ValidateL(); /** - * - */ - void QueryUsrPassL(); + * Send user password query request to CIpsPlgEventHandler + * @return ETrue - if query send + */ + TBool QueryUserPassL(); /** @@ -163,7 +164,7 @@ EConnected, EPopulate, EQueryingDetails, - EErrInvalidDetails, + EQueryingDetailsBusy, EIdle }; diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h --- a/ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,18 +21,33 @@ #include #include "ipsplgcommon.h" +#include "ipsplgonlineoperation.h" // for MIpsPlgConnectOpCallback class CClientMtmRegistry; /** * Class for smtp related operations * + * This class encapsulates SMTP send new message and send pending messages + * operations. + * + * This class requires CIpsPlgEventHandler for QueryUsrPassL method + * for handling login problems. Because this class is exported and + * CIpsPlgEventHandler isn`t, to avoid problems, iEventHandler is passed + * as TAny* and can be set only from ipssosplugin. + * * @lib ipssosplugin.lib * @since FS 1.0 */ //should this class inherited from online operation -NONSHARABLE_CLASS( CIpsPlgSmtpOperation ) : public CMsvOperation +NONSHARABLE_CLASS( CIpsPlgSmtpOperation ) : + public CMsvOperation, + public MIpsPlgConnectOpCallback { +public: //from MIpsPlgConnectOpCallback + + void CredientialsSetL( TInt aEvent ); + public: /** @@ -84,6 +99,11 @@ IMPORT_C TInt EmptyOutboxFromPendingMessagesL( TMsvId aMailboxId ); IMPORT_C CMsvEntrySelection* GetOutboxChildrensL( ); + + /** + * Sets CIpsPlgEventHandler + */ + void SetEventHandler( TAny* aEventHandler ); protected: @@ -121,8 +141,11 @@ enum TIpsSendState { - EMovingOutbox, - ESending + EIdle, + EMovingOutbox, // moving mail to OutBox folder + ESending, // sending mail + EQueryingDetails, // querying for password + EQueryingDetailsBusy, // another operation is querying for details }; /** @@ -158,7 +181,13 @@ * @param aRecipients array of addresses */ void ValidateAddressArrayL( const CDesCArray& aRecipients ); - + + /** + * Send user password query request to CIpsPlgEventHandler + * @return ETrue - if query send + */ + TBool QueryUserPassL(); + private: CSmtpClientMtm* iSmtpMtm; @@ -167,6 +196,8 @@ CClientMtmRegistry* iMtmRegistry; TInt iState; TMsvId iSmtpService; + // not owned + TAny* iEventHandler; // pointer to CIpsPlgEventHandler }; #endif /* IPSPLGSENDOPERATION_H */ diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h --- a/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,8 +20,8 @@ #define IPSPLGSOSBASEPLUGIN_H // -#include "CFSMailPlugin.h" -#include "MFSMailRequestObserver.h" +#include "cfsmailplugin.h" +#include "mfsmailrequestobserver.h" // #include @@ -586,6 +586,17 @@ void DeleteAndRemoveOperation( const TInt aOpArrayIndex, TInt aCompleteCode ); + /** + * Fixes the forward (or reply) message header parts (that are copied + * to msg content) in case that caller has provided an own header + * descriptor for these parts. + */ + void FixReplyForwardHeaderL( + CFSMailMessage* aMessage, + const TFSMailMsgId& aMailBoxId, + const TFSMailMsgId& aOriginalMessageId, + const TDesC& aHeaderDescriptor ); + private: /** diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.hrh --- a/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.hrh Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.hrh Fri Feb 19 22:37:30 2010 +0200 @@ -55,7 +55,8 @@ EIPSSosSettingsChanged, KIPSSosSmtpSendStartedSignal, KIPSSosSmtpSendEndedSignal, - KIPSSosSmtpEmptyOutboxNow + KIPSSosSmtpEmptyOutboxNow, + EIPSSosSmtpPswErr }; enum TIpsOpType diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp --- a/ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -17,7 +17,7 @@ */ -#include +#include #include "emailtrace.h" #include "ipsplgheaders.h" @@ -64,18 +64,18 @@ TFSMailMsgId& aMailboxId, MFSMailRequestObserver& aFSObserver, CIpsPlgTimerOperation& aTimer ) - : - CIpsPlgOnlineOperation( - aSession, - aPriority, - aObserverRequestStatus, - aTimer, - aMailboxId, - aFSObserver, - 0, // FSRequestId - EFalse), // SignallingAllowed - iState( EIdle ), - iMailboxId( aMailboxId ), + : + CIpsPlgOnlineOperation( + aSession, + aPriority, + aObserverRequestStatus, + aTimer, + aMailboxId, + aFSObserver, + 0, // FSRequestId + EFalse), // SignallingAllowed + iState( EIdle ), + iMailboxId( aMailboxId ), iSession( aSession ), iService( aService ), iOperation( NULL ), @@ -197,50 +197,50 @@ delete iOperation; iOperation = NULL; InvokeClientMtmAsyncFunctionL( - KIMAP4MTMConnect, - *iMsvEntry, - iService, - dummyParam ); + KIMAP4MTMConnect, + *iMsvEntry, + iService, + dummyParam ); iState = EConnecting; SetActive(); break; - case EConnecting: - { - // We have successfully completed connecting - - delete iOperation; - iOperation = NULL; - InvokeClientMtmAsyncFunctionL( - KIMAP4MTMSyncTree, - *iMsvEntry, - iService, - dummyParam ); - iState = ERefreshing; - SetActive(); - } - break; - case ERefreshing: - // We have successfully completed refreshing the folder list - delete iOperation; - iOperation = NULL; - iOperation = CIpsPlgDisconnectOp::NewL( - iSession, - iStatus, - iService, - *iTimer, - iMailboxId, - *observer, - NULL ); - iState = EDisconnecting; - SetActive(); - break; - case EDisconnecting: - iState = ECompleted; - CompleteObserver(); - break; - default: - User::Panic( KIpsPlgPanicCategory, EIpsPlgNoParameters ); - break; + case EConnecting: + { + // We have successfully completed connecting + + delete iOperation; + iOperation = NULL; + InvokeClientMtmAsyncFunctionL( + KIMAP4MTMSyncTree, + *iMsvEntry, + iService, + dummyParam ); + iState = ERefreshing; + SetActive(); + } + break; + case ERefreshing: + // We have successfully completed refreshing the folder list + delete iOperation; + iOperation = NULL; + iOperation = CIpsPlgDisconnectOp::NewL( + iSession, + iStatus, + iService, + *iTimer, + iMailboxId, + *observer, + NULL ); + iState = EDisconnecting; + SetActive(); + break; + case EDisconnecting: + iState = ECompleted; + CompleteObserver(); + break; + default: + User::Panic( KIpsPlgPanicCategory, EIpsPlgNoParameters ); + break; } } diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/src/ipsplgeventhandler.cpp --- a/ipsservices/ipssosplugin/src/ipsplgeventhandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgeventhandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -105,6 +105,7 @@ iIPSSettingsObservers.ResetAndDestroy(); iIPSSettingsObservers.Close(); iPropertyObservers.Close(); + iConnOpCallbacks.Close(); delete iSettingsApi; iImapFolderIds.Close(); } @@ -118,7 +119,8 @@ iIPSAccounts( KEventGranularity ), iIPSSettingsObservers( KEventGranularity ), iIsConnected( EFalse ), - iPropertyObservers( KEventGranularity ) + iPropertyObservers( KEventGranularity ), + iConnOpCallbacks( KEventGranularity ) { FUNC_LOG; } @@ -1578,29 +1580,43 @@ void CIpsPlgEventHandler::HandlePropertyEventL( TInt aEvent, TInt aMailbox, - TInt /*aPluginId*/, - TInt aError ) + TInt aPluginId, + TInt /*aError*/ ) { FUNC_LOG; RProcess process; - if ( aEvent == EIPSSosPswErr && process.SecureId() == FREESTYLE_FSSERVER_SID ) + + // only email server should handle login notifications + if (( aEvent == EIPSSosPswErr || aEvent == EIPSSosSmtpPswErr ) && + process.SecureId() == FREESTYLE_FSSERVER_SID && + iQueryPassState == EReady && + iBasePlugin.PluginId() == aPluginId ) { - TFSMailMsgId mbox = SymId2FsId( aMailbox, - iBasePlugin.MtmId().iUid ); + TFSMailMsgId mbox = SymId2FsId( aMailbox, iBasePlugin.MtmId().iUid ); + + // keep information about type of mail we`re setting the password + iIncomingPass = ( aEvent == EIPSSosPswErr ? ETrue : EFalse ); + iQueryPassState = ENotificationRequest; + TFSMailEvent event = TFSEventException; TFsEmailNotifierSystemMessageType msg = EFsEmailNotifErrLoginUnsuccesfull; - SendDelayedEventL( event, mbox, &msg, NULL , (MFSMailExceptionEventCallback*)this ); + SendDelayedEventL( event, mbox, &msg, NULL, (MFSMailExceptionEventCallback*)this ); } else if ( aEvent == EIPSSosCredientialsSet || aEvent == EIPSSosCredientialsCancelled ) { - if ( iConnOpCallback ) + // if this handler invoked query user pass + if ( iQueryPassState == EBusy ) { - iConnOpCallback->CredientialsSetL( aEvent ); + iQueryPassState = ERequestResponding; + // run callbacks + for ( TInt i = 0; i < iConnOpCallbacks.Count(); i++ ) + iConnOpCallbacks[i]->CredientialsSetL( aEvent ); - //Set to null after we have used this. - //don't delete, we don't own this. - iConnOpCallback=NULL; + iConnOpCallbacks.Reset(); + // now handler is ready for another query user pass + iQueryPassState = EReady; } + //if password was changed, we need to send settings changed event also. if( aEvent == EIPSSosCredientialsSet ) { @@ -1617,24 +1633,41 @@ TFSMailEvent event = TFSEventMailboxSettingsChanged; SendDelayedEventL( event, mbox, NULL, NULL , NULL ); } - else if ( aEvent == KIpsSosEmailSyncCompleted && - aError == KErrImapBadLogon ) - { - TFSMailMsgId mbox = SymId2FsId( aMailbox, - iBasePlugin.MtmId().iUid ); - TFSMailEvent event = TFSEventException; - TFsEmailNotifierSystemMessageType msg = EFsEmailNotifErrLoginUnsuccesfull; - SendDelayedEventL( event, mbox, &msg, NULL , this ); - } } // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- -void CIpsPlgEventHandler::QueryUsrPassL( TMsvId aMbox, MIpsPlgConnectOpCallback* aCallback ) +TBool CIpsPlgEventHandler::QueryUsrPassL( + TMsvId aMbox, + MIpsPlgConnectOpCallback* aCallback/*=NULL*/, + TBool aIncoming/*=ETrue*/ ) { FUNC_LOG; - iConnOpCallback = aCallback;//can be null, doesn't matter. - SetNewPropertyEvent( aMbox, EIPSSosPswErr, 0 ); + + ASSERT( iConnOpCallbacks.Find( aCallback ) == KErrNotFound ); + if ( aCallback ) + iConnOpCallbacks.Append( aCallback ); + + // set or re-set property event + SetNewPropertyEvent( aMbox, (aIncoming ? EIPSSosPswErr : EIPSSosSmtpPswErr), 0 ); + + // only one query at a time allowed + if ( iQueryPassState != EReady ) + { + return EFalse; + } + + // update state + iQueryPassState = EBusy; + + return ETrue; + } + +// ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +TBool CIpsPlgEventHandler::IncomingPass() const + { + return iIncomingPass; } // ---------------------------------------------------------------------------- @@ -1642,6 +1675,12 @@ void CIpsPlgEventHandler::SignalCredientialsSetL( TInt aMailboxId, TBool aCancelled ) { FUNC_LOG; + if ( iQueryPassState == EPasswordRequest ) + { + iQueryPassState = EReady; + iIncomingPass = ETrue; + } + TInt event = EIPSSosCredientialsSet; if ( aCancelled ) { @@ -1703,14 +1742,20 @@ // ---------------------------------------------------------------------------- void CIpsPlgEventHandler::ExceptionEventCallbackL( TFSMailMsgId aMailboxId, - TInt /*aEventType*/, + TInt aEventType, TBool /*aResponse*/ ) { FUNC_LOG; - TFSMailEvent event = TFSEventMailboxSyncStateChanged; - TSSMailSyncState state = PasswordNotVerified; - SendDelayedEventL( event, aMailboxId, &state, NULL , NULL ); + if ( aEventType == EFsEmailNotifErrLoginUnsuccesfull && + iQueryPassState == ENotificationRequest ) + { + iQueryPassState = EPasswordRequest; + TFSMailEvent event = TFSEventMailboxSyncStateChanged; + TSSMailSyncState state = PasswordNotVerified; + + SendDelayedEventL( event, aMailboxId, &state, NULL, NULL ); + } } // End of File diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp --- a/ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -188,6 +188,7 @@ switch( iState ) { case EStateQueryingDetails: + case EStateQueryingDetailsBusy: result.iProgressStatus = TFSProgress::EFSStatus_Authenticating; break; case EStateStartConnect: @@ -268,33 +269,22 @@ switch( iState ) { case EStateQueryingDetails: - - if ( KErrNone != err ) - { - // user might be cancelled query - // or it IS EMPTY - iError = err; - iState = EStateIdle; - } - else - { - // Retry connect. - DoConnectOpL(); - } + // querying pass finished - try to reconnect + DoConnectOpL(); break; case EStateStartConnect: StartL(); break; case EStateConnectAndSync: // Connection completed - - if( err == KErrImapBadLogon ) + + if ( err == KErrImapBadLogon ) { - // Login details are wrong. - QueryUserPwdL(); - iState = EStateQueryingDetails; - - err = KErrNone; + // Login details are wrong. Trying to ask for password + if ( QueryUserPassL() ) + { + err = KErrNone; + } } else if ( err == KErrNone ) { @@ -520,12 +510,25 @@ // CIpsPlgImap4ConnectOp::QueryUserPwdL() // ---------------------------------------------------------------------------- // -void CIpsPlgImap4ConnectOp::QueryUserPwdL() +TBool CIpsPlgImap4ConnectOp::QueryUserPassL() { if ( iEventHandler ) { - iEventHandler->QueryUsrPassL( iService, this ); + // ask for credentials for imap account and wait for callback + if ( iEventHandler->QueryUsrPassL( iService, this ) ) + { + iState = EStateQueryingDetails; + } + else + { + // another operation is waiting for password + iState = EStateQueryingDetailsBusy; + } + + return ETrue; } + + return EFalse; } @@ -580,8 +583,10 @@ FUNC_LOG; if ( iEventHandler && aError == KErrImapBadLogon ) { + /* iEventHandler->SetNewPropertyEvent( iService, KIpsSosEmailSyncCompleted, aError ); + */ iIsSyncStartedSignaled = EFalse; } } @@ -592,14 +597,29 @@ void CIpsPlgImap4ConnectOp::CredientialsSetL( TInt aEvent ) { FUNC_LOG; - if ( aEvent == EIPSSosCredientialsCancelled ) + + if ( iState == EStateQueryingDetails ) { - CompleteObserver( KErrCancel ); + // response for our operation`s query + if ( aEvent == EIPSSosCredientialsCancelled ) + { + // user canceled operation + CompleteObserver( KErrCancel ); + } + + // password has been set, continue with operation + SetActive(); + CompleteThis(); } - //password has been set, continue with operation - - SetActive(); - CompleteThis(); + else if ( iState == EStateQueryingDetailsBusy ) + { + // response for other operation`s query + // we could try to ask for password now, + // but decision was made to cancel operation + CompleteObserver( KErrCancel ); + SetActive(); + CompleteThis(); + } } // End of File diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp --- a/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -152,7 +152,8 @@ aFSRequestId), iSelection( NULL ), iGetMailInfo(aGetMailInfo), - iFunctionId(aFunctionId) + iFunctionId(aFunctionId), + iRetryCount( 0 ) { FUNC_LOG; iService = aService; @@ -233,6 +234,7 @@ CompleteObserver( KErrCouldNotConnect ); return; } + iRetryCount = 0; DoFetchAttachmentL(); break; } @@ -243,13 +245,22 @@ TInt err = iStatus.Int(); - if( err != KErrNone && iOperation ) + // If the server was busy, try again a few times. + if ( err == KErrServerBusy && iRetryCount < 3 ) { - iFetchErrorProgress = iOperation->ProgressL().AllocL(); + iRetryCount++; + DoFetchAttachmentL(); } - - iState = EStateIdle; - CompleteObserver( err ); + else + { + if( err != KErrNone && iOperation ) + { + iFetchErrorProgress = iOperation->ProgressL().AllocL(); + } + + iState = EStateIdle; + CompleteObserver( err ); + } break; } default: diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp --- a/ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -230,29 +230,34 @@ void CIpsPlgOnlineOperation::SignalFSObserver( TInt aStatus ) { FUNC_LOG; - if( iSignallingAllowed ) - { + if ( iSignallingAllowed ) + { TFSProgress prog; - prog.iError = aStatus; // Initialize the progress data // it would be better to get fs progress from inherited class // by calling FSProgressL method?? - if ( prog.iError == KErrCancel || prog.iError == KErrImapBadLogon ) + if ( aStatus == KErrCancel ) { + prog.iError = KErrNone; + prog.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled; + } + else if ( aStatus == KErrImapBadLogon ) + { + prog.iError = aStatus; prog.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled; } else { + prog.iError = aStatus; prog.iProgressStatus = TFSProgress::EFSStatus_RequestComplete; } // At least in the attachment download, FS UI assumes that // the counter fields are greater than 0 prog.iMaxCount = 1; prog.iCounter = 1; - - + //in case of autoconnect, we don't have valid observer - if( &iFSOperationObserver ) + if ( &iFSOperationObserver ) { TRAP_IGNORE( iFSOperationObserver.RequestResponseL( prog, iFSRequestId ) ); } diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp --- a/ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -149,11 +149,11 @@ ( err == KPop3InvalidLogin ) || ( err == KPop3InvalidApopLogin ) ) { - // Login details are wrong. - - iState = EQueryingDetails; - - QueryUsrPassL(); + // Login details are wrong. Trying to ask for password + if ( !QueryUserPassL() ) + { + CompleteObserver( err ); + } } else if ( err == KErrNone ) { @@ -167,7 +167,6 @@ iState = EIdle; CompleteObserver( KErrNone ); } - } else { @@ -189,11 +188,6 @@ iMsvSession, iService ); CompleteObserver( err ); } - else if ( iState == EErrInvalidDetails ) - { - // proper error code; - CompleteObserver( KErrGeneral ); - } else { User::Panic( KIpsPlgPopConnectPanic ,KErrNotFound); @@ -238,6 +232,7 @@ switch( iState ) { case EQueryingDetails: + case EQueryingDetailsBusy: result.iProgressStatus = TFSProgress::EFSStatus_Authenticating; break; case EStartConnect: @@ -427,21 +422,33 @@ } // ---------------------------------------------------------------------------- -// CIpsPlgPop3ConnectOp::QueryUsrPassL() +// CIpsPlgPop3ConnectOp::QueryUserPassL() // ---------------------------------------------------------------------------- // -void CIpsPlgPop3ConnectOp::QueryUsrPassL() +TBool CIpsPlgPop3ConnectOp::QueryUserPassL() { FUNC_LOG; if ( iEventHandler ) { - iEventHandler->QueryUsrPassL( iEntry->EntryId(), this ); + // ask for credentials for pop3 account and wait for callback + if ( iEventHandler->QueryUsrPassL( iEntry->EntryId(), this ) ) + { + iState = EQueryingDetails; + } + else + { + // another operation is waiting for password + iState = EQueryingDetailsBusy; + } + + return ETrue; } + + return EFalse; } - // ---------------------------------------------------------------------------- // CIpsPlgPop3ConnectOp::GetOperationErrorCodeL() // ---------------------------------------------------------------------------- @@ -476,16 +483,31 @@ // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- void CIpsPlgPop3ConnectOp::CredientialsSetL( TInt aEvent ) - { + { FUNC_LOG; - if ( aEvent == EIPSSosCredientialsCancelled ) + + if ( iState == EQueryingDetails ) { + // response for our operation`s query + if ( aEvent == EIPSSosCredientialsCancelled ) + { + // user canceled operation + CompleteObserver( KErrCancel ); + } + + // password has been set, continue with operation + SetActive(); + CompleteThis(); + } + else if ( iState == EQueryingDetailsBusy ) + { + // response for other operation`s query + // we could try to ask for password now, + // but decision was made to cancel operation CompleteObserver( KErrCancel ); + SetActive(); + CompleteThis(); } - //password has been set, continue with operation - - SetActive(); - CompleteThis(); } //EOF diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp --- a/ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -18,6 +18,7 @@ #include "emailtrace.h" #include "ipsplgheaders.h" +#include "miut_err.h" // SMTP error codes const TInt KIpsSmtpOperationCharLessThan = '<'; @@ -67,7 +68,9 @@ iSmtpMtm( NULL ), iOperation( NULL ), iSelection( NULL ), - iMtmRegistry( NULL ) + iMtmRegistry( NULL ), + iState( EIdle ), + iEventHandler( NULL ) { FUNC_LOG; } @@ -83,6 +86,9 @@ delete iMtmRegistry; delete iSelection; delete iOperation; + iOperation = NULL; + iEventHandler = NULL; + iState = EIdle; } // --------------------------------------------------------------------------- @@ -126,25 +132,67 @@ void CIpsPlgSmtpOperation::RunL() { FUNC_LOG; - - - if ( iState == EMovingOutbox ) + + switch ( iState ) { - delete iOperation; - iOperation = NULL; - iSelection->InsertL(0, iSmtpService ); - CallSendL( ); - } - else if ( iState == ESending ) - { - TImSmtpProgress prog; - TPckg param(prog); - param.Copy( iOperation->FinalProgress() ); + case EMovingOutbox: + { + delete iOperation; + iOperation = NULL; + iSelection->InsertL( 0, iSmtpService ); + CallSendL(); + break; + } + case ESending: + { + TImSmtpProgress prog; + TPckg param(prog); + param.Copy( iOperation->FinalProgress() ); - CompleteObserver( prog.Error() ); + if ( prog.Error() == KSmtpLoginRefused ) + { + // Login details are wrong. Trying to ask for password + if ( !QueryUserPassL() ) + { + CompleteObserver( prog.Error() ); + } + } + else if ( prog.Error() == KSmtpUnknownErr ) + { + // try to handle empty password problem + CEmailAccounts* accounts = CEmailAccounts::NewLC(); + CImSmtpSettings* smtpSettings = new(ELeave) CImSmtpSettings(); + CleanupStack::PushL( smtpSettings ); + TSmtpAccount smtpAccount; + accounts->GetSmtpAccountL( iSmtpService, smtpAccount ); + accounts->LoadSmtpSettingsL( smtpAccount, *smtpSettings ); + + if ( smtpSettings->Password().Length() == 0 ) + { + if ( !QueryUserPassL() ) + { + CompleteObserver( prog.Error() ); + } + } + CleanupStack::PopAndDestroy( 2, accounts ); + } + else + { + CompleteObserver( prog.Error() ); + } + break; + } + case EQueryingDetails: + { + delete iOperation; + iOperation = NULL; + // querying pass finished - try to resend mail + CallSendL(); + break; + } } } - + // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // @@ -400,5 +448,73 @@ } } +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CIpsPlgSmtpOperation::SetEventHandler( TAny* aEventHandler ) + { + iEventHandler = aEventHandler; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +TBool CIpsPlgSmtpOperation::QueryUserPassL() + { + if ( iEventHandler ) + { + CIpsPlgEventHandler* eventHandler = static_cast(iEventHandler); + TMsvEntry entry; + TMsvId service; + User::LeaveIfError( iMsvSession.GetEntry( iSmtpService, service, entry ) ); + + // ask for credentials for smtp account and wait for callback + if ( eventHandler->QueryUsrPassL( entry.iRelatedId, this, EFalse ) ) + { + iState = EQueryingDetails; + } + else + { + // another operation is waiting for password + iState = EQueryingDetailsBusy; + } + + return ETrue; + } + + return EFalse; + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CIpsPlgSmtpOperation::CredientialsSetL( TInt aEvent ) + { + FUNC_LOG; + + if ( iState == EQueryingDetails ) + { + // response for our operation`s query + if ( aEvent == EIPSSosCredientialsCancelled ) + { + // user canceled operation + CompleteObserver( KErrCancel ); + } + + // password has been set, continue with operation + SetActive(); + CompleteThis(); + } + else if ( iState == EQueryingDetailsBusy ) + { + // response for other operation`s query + // we could try to ask for password now, + // but decision was made to cancel operation + CompleteObserver( KErrCancel ); + SetActive(); + CompleteThis(); + } + } + // End of File diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp --- a/ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -196,7 +196,11 @@ header->CcRecipients().Reset(); for( TInt i = 0; i < ccArray.Count(); i++ ) { - header->CcRecipients().AppendL( ccArray[i]->GetEmailAddress() ); // copy created + TPtrC displayName = ccArray[i]->GetDisplayName(); + TPtrC emailName = ccArray[i]->GetEmailAddress(); + HBufC* fullName = CreateDisplayStringLC( displayName, emailName ); // << fullName + header->CcRecipients().AppendL( *fullName ); + CleanupStack::PopAndDestroy( fullName ); // >>> fullName } // BCC field @@ -205,7 +209,11 @@ header->BccRecipients().Reset(); for( TInt i = 0; i < bccArray.Count(); i++ ) { - header->BccRecipients().AppendL( bccArray[i]->GetEmailAddress() ); // copy created + TPtrC displayName = bccArray[i]->GetDisplayName(); + TPtrC emailName = bccArray[i]->GetEmailAddress(); + HBufC* fullName = CreateDisplayStringLC( displayName, emailName ); // << fullName + header->BccRecipients().AppendL( *fullName ); // copy created + CleanupStack::PopAndDestroy( fullName ); // >>> fullName } // Subject, check null pointer diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp --- a/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -15,10 +15,9 @@ * */ - - #include "emailtrace.h" #include "ipsplgheaders.h" +#include "FreestyleEmailUiConstants.h" #define FREESTYLE_EMAIL_UI_SID 0x2001E277 @@ -820,11 +819,23 @@ CFSMailMessage* CIpsPlgSosBasePlugin::CreateForwardMessageL( const TFSMailMsgId& aMailBoxId, const TFSMailMsgId& aOriginalMessageId, - const TDesC& /* aHeaderDescriptor */) + const TDesC& aHeaderDescriptor ) { FUNC_LOG; CFSMailMessage* msg = iSmtpService->CreateForwardSmtpMessageL( aMailBoxId, aOriginalMessageId ); + + if ( aHeaderDescriptor != KNullDesC ) + { + // Ignoring trap as it is better to provide something in case of the + // below fix method fails than nothing. + TRAP_IGNORE( FixReplyForwardHeaderL( + msg, + aMailBoxId, + aOriginalMessageId, + aHeaderDescriptor ) ); + } + return msg; } @@ -834,11 +845,23 @@ const TFSMailMsgId& aMailBoxId, const TFSMailMsgId& aOriginalMessageId, const TBool aReplyToAll, - const TDesC& /* aHeaderDescriptor */ ) + const TDesC& aHeaderDescriptor ) { FUNC_LOG; CFSMailMessage* msg = iSmtpService->CreateReplySmtpMessageL( aMailBoxId, aOriginalMessageId, aReplyToAll ); + + if ( aHeaderDescriptor != KNullDesC ) + { + // Ignoring trap as it is better to provide something in case of the + // below fix method fails than nothing. + TRAP_IGNORE( FixReplyForwardHeaderL( + msg, + aMailBoxId, + aOriginalMessageId, + aHeaderDescriptor ) ); + } + return msg; } @@ -1561,6 +1584,7 @@ CleanupStack::PushL(watcher); CIpsPlgSmtpOperation* op = CIpsPlgSmtpOperation::NewLC( *iSession, CActive::EPriorityStandard, watcher->iStatus, ETrue ); + op->SetEventHandler(iEventHandler); watcher->SetOperation(op); CleanupStack::Pop( op ); // op added as member of watcher op->StartSendL( aMessageId.Id() ); @@ -1831,7 +1855,20 @@ CMsvEntry* cEntry = iSession->GetEntryL( aMailBoxId.Id() ); CleanupStack::PushL( cEntry ); - api->SetNewPasswordL( *cEntry, aPassword ); + RProcess process; + // only email server can set outgoing password + if ( process.SecureId() == FREESTYLE_FSSERVER_SID ) + { + if ( !iEventHandler->IncomingPass() ) + { + CMsvEntry* cTmp = iSession->GetEntryL( cEntry->Entry().iRelatedId ); + CleanupStack::PopAndDestroy( 1, cEntry ); + CleanupStack::PushL( cTmp ); + cEntry = cTmp; + } + } + + api->SetNewPasswordL( *cEntry, aPassword ); CleanupStack::PopAndDestroy( 2, api );//cEntry, api @@ -2012,6 +2049,59 @@ // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- +void CIpsPlgSosBasePlugin::FixReplyForwardHeaderL( + CFSMailMessage* aMessage, + const TFSMailMsgId& aMailBoxId, + const TFSMailMsgId& aOriginalMessageId, + const TDesC& aHeaderDescriptor ) + { + FUNC_LOG; + CFSMailMessagePart* textBodyPart = aMessage->PlainTextBodyPartL(); + if ( textBodyPart ) + { + CleanupStack::PushL( textBodyPart ); + CFSMailMessage* origMsg = GetMessageByUidL( + aMailBoxId, + TFSMailMsgId(), + aOriginalMessageId, + EFSMsgDataStructure ); + if ( origMsg ) + { + CleanupStack::PushL( origMsg ); + CFSMailMessagePart* origMsgTextBodyPart = + origMsg->PlainTextBodyPartL(); + if ( origMsgTextBodyPart ) + { + CleanupStack::PushL( origMsgTextBodyPart ); + // Use the content provided in aHeaderDescriptor + // instead of what is provided by + // CreateForwardSmtpMessage.. + TPckgBuf pckg; + pckg.Copy( aHeaderDescriptor ); + TPtr hPtr( pckg().iHeader->Des() ); + HBufC* body = HBufC::NewLC( + textBodyPart->FetchedContentSize() ); + TPtr bPtr( body->Des() ); + origMsgTextBodyPart->GetContentToBufferL( bPtr, 0 ); + HBufC* content = HBufC::NewLC( + hPtr.Length() + bPtr.Length() ); + TPtr cPtr( content->Des() ); + cPtr.Append( hPtr ); + cPtr.Append( bPtr ); + textBodyPart->SetContent( cPtr ); + textBodyPart->SaveL(); + CleanupStack::PopAndDestroy( content ); + CleanupStack::PopAndDestroy( body ); + CleanupStack::PopAndDestroy( origMsgTextBodyPart ); + } + CleanupStack::PopAndDestroy( origMsg ); + } + CleanupStack::PopAndDestroy( textBodyPart ); + } + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- void CIpsPlgSosBasePlugin::DisconnectL( const TFSMailMsgId& aMailBoxId, MFSMailRequestObserver& aObserver, @@ -2082,6 +2172,7 @@ CleanupStack::PushL(watcher); CIpsPlgSmtpOperation* op = CIpsPlgSmtpOperation::NewLC( *iSession, CActive::EPriorityStandard, watcher->iStatus, ETrue ); + op->SetEventHandler(iEventHandler); watcher->SetOperation(op); op->EmptyOutboxFromPendingMessagesL( aMailBoxId.Id() ); iOperations.AppendL(watcher); diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/data/ipssetuistrings.ra --- a/ipsservices/ipssossettings/data/ipssetuistrings.ra Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/data/ipssetuistrings.ra Fri Feb 19 22:37:30 2010 +0200 @@ -337,7 +337,7 @@ RESOURCE DIALOG r_ips_setui_wait_disconnecting_dialog { flags = EAknWaitNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; + buttons = R_AVKON_SOFTKEYS_EMPTY; items = { DLG_LINE diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/inc/ipssetview.h --- a/ipsservices/ipssossettings/inc/ipssetview.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/inc/ipssetview.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,8 +20,8 @@ // SYSTEM INCLUDES // -#include "CFSMailCommon.h" -#include "ESMailSettingsPlugin.h" +#include "cfsmailcommon.h" +#include "esmailsettingsplugin.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/src/ipssetdata.cpp --- a/ipsservices/ipssossettings/src/ipssetdata.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/src/ipssetdata.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -1116,7 +1116,7 @@ // void CIpsSetData::SetSchedule( const TInt aSchedule, - const TBool aRoaming ) + const TBool /*aRoaming*/ ) { FUNC_LOG; TInt time = 0; diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/src/ipssetdataapi.cpp --- a/ipsservices/ipssossettings/src/ipssetdataapi.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/src/ipssetdataapi.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -162,6 +162,16 @@ { SetNewImap4PasswordL( aService, aPassword ); } + else if ( aService.Entry().iMtm.iUid == KSenduiMtmSmtpUidValue ) + { + CEmailAccounts* accounts = CEmailAccounts::NewLC(); + + TBuf8 temp; + temp.Copy( aPassword ); + + SetNewSmtpPasswordL( aService.EntryId(), temp, *accounts ); + CleanupStack::PopAndDestroy( 1, accounts ); + } } // ---------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/src/ipssetdatamanager.cpp --- a/ipsservices/ipssossettings/src/ipssetdatamanager.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/src/ipssetdatamanager.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -13,7 +13,7 @@ * * Description: * Encapsulates saving and removing email accounts -* Version : %version: 12.1.2 % +* Version : %version: e003sa37#12.1.3 % * */ @@ -34,7 +34,7 @@ #include "ipssetdataapi.h" #include "ipsplgpropertywatcher.h" #include "ipsplgcommon.h" -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" const TInt KIpsSetManagerMaxCreTry = 10; diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/src/ipssetuidialog.cpp --- a/ipsservices/ipssossettings/src/ipssetuidialog.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/src/ipssetuidialog.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -35,7 +35,7 @@ // // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // #include "ipssetui.h" diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/src/ipssetuifoldersubscription.cpp --- a/ipsservices/ipssossettings/src/ipssetuifoldersubscription.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/src/ipssetuifoldersubscription.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -39,7 +39,7 @@ // #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/src/ipssetview.cpp --- a/ipsservices/ipssossettings/src/ipssetview.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/src/ipssetview.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -183,10 +183,20 @@ } else { - // go back to previous view - self->AppUi()->ActivateViewL( self->iPrevViewId, - TUid::Uid(KMailSettingsReturnFromPluginSettings), - *self->iCustomMessage ); + //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); + if (aViewId.iViewUid == MailEditorId ) + { + //just skip + } + else + { + // go back to previous view + self->AppUi()->ActivateViewL( self->iPrevViewId, + TUid::Uid(KMailSettingsReturnFromPluginSettings), + *self->iCustomMessage ); + } } return KErrNone; } diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPDocument.h --- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPDocument.h Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPDocument.h Fri Feb 19 22:37:30 2010 +0200 @@ -25,7 +25,7 @@ #define TestAppDOCUMENT_H // INCLUDES -#include +#include // CONSTANTS diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPAppUi.cpp --- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPAppUi.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPAppUi.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPContainer.cpp --- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPContainer.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPContainer.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include "TestAppContainer.h" #include #include -#include +#include #include #include #include @@ -38,11 +38,11 @@ CreateWindowL(); // Get the skin instance - iSkinInstance = AknsUtils::SkinInstance(); + iSkinInstance = AknsUtils::SkinInstance(); - // Create background control context for skinning the background - iBackgroundSkinContext = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDSkinBmpMainPaneUsual, aRect, ETrue ); + // Create background control context for skinning the background + iBackgroundSkinContext = CAknsBasicBackgroundControlContext::NewL( + KAknsIIDSkinBmpMainPaneUsual, aRect, ETrue ); iListBox = new (ELeave) CEikTextListBox; iListBox->SetContainerWindowL( *this ); @@ -119,7 +119,7 @@ void CTestAppContainer::Draw(const TRect& /*aRect*/) const { CWindowGc& gc = SystemGc(); - + AknsDrawUtils::Background( iSkinInstance, iBackgroundSkinContext, this, gc, Rect() ); } diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrentry/inc/cesmrfsmailboxutils.h --- a/meetingrequest/mrentry/inc/cesmrfsmailboxutils.h Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrentry/inc/cesmrfsmailboxutils.h Fri Feb 19 22:37:30 2010 +0200 @@ -20,7 +20,7 @@ #include #include -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "esmrdef.h" class CFSMailClient; diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrentry/inc/mesmrmeetingrequestentry.h --- a/meetingrequest/mrentry/inc/mesmrmeetingrequestentry.h Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrentry/inc/mesmrmeetingrequestentry.h Fri Feb 19 22:37:30 2010 +0200 @@ -19,7 +19,7 @@ #ifndef MESMRMEETINGREQUESTENTRY_H #define MESMRMEETINGREQUESTENTRY_H -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "mesmrcalentry.h" #include "esmrdef.h" diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrentry/src/cesmrfsmailboxutils.cpp --- a/meetingrequest/mrentry/src/cesmrfsmailboxutils.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrentry/src/cesmrfsmailboxutils.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -22,8 +22,8 @@ #include "esmrinternaluid.h" #include -#include "CFSMailClient.h" -#include "CFSMailBox.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" #include // Unnamed namespace for local definitions diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/inc/cesmruibase.h --- a/meetingrequest/mrgui/inc/cesmruibase.h Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/inc/cesmruibase.h Fri Feb 19 22:37:30 2010 +0200 @@ -18,7 +18,7 @@ #ifndef CESMRUIBASE_H #define CESMRUIBASE_H -#include +#include #include "mesmruibase.h" /** diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/resmrpluginextensionstatic.h --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/resmrpluginextensionstatic.h Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/resmrpluginextensionstatic.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #include // -#include "CFSMailClient.h" +#include "cfsmailclient.h" // class TESMRPluginExtensionData; diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -27,7 +27,7 @@ #include // #include "esmrcommands.h" -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include "cesmrncspopuplistbox.h" #include "cesmrncsemailaddressobject.h" diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclslistshandler.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclslistshandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclslistshandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -25,7 +25,7 @@ #include // CPbkContactItem, TPbkContactItemField #include // CAknErrorNote // -#include "CFSMailBox.h" // cfsmailbox +#include "cfsmailbox.h" // cfsmailbox // #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrcontacthandler.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrcontacthandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrcontacthandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -46,7 +46,7 @@ #include //FS Email framework -#include "CFSMailBox.h" +#include "cfsmailbox.h" // //MRUI diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ #include "cesmrlayoutmgr.h" #include "nmrlayoutmanager.h" #include "esmrhelper.h" -#include "CFSMailBox.h" +#include "cfsmailbox.h" #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattachmentsfield.cpp --- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattachmentsfield.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattachmentsfield.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -25,7 +25,7 @@ #include // #include "esmricalvieweropcodes.hrh" -#include "CFSMailMessage.h" +#include "cfsmailmessage.h" // #include "cesmrrichtextviewer.h" diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/src/cesmraddressselectionquery.cpp --- a/meetingrequest/mrgui/src/cesmraddressselectionquery.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmraddressselectionquery.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #include "cesmraddressselectionquery.h" #include -#include +#include #include #include #include @@ -115,7 +115,7 @@ // ----------------------------------------------------------------------------- // TInt CESMRAddressSelectionQuery::ExecuteAddressSelectionListL( - const RPointerArray& aAddressArray ) + const RPointerArray& aAddressArray ) { FUNC_LOG; TInt ret = ExecuteL( aAddressArray ); @@ -127,13 +127,13 @@ // ----------------------------------------------------------------------------- // TInt CESMRAddressSelectionQuery::ExecuteL( - const RPointerArray& aAddressArray ) + const RPointerArray& aAddressArray ) { FUNC_LOG; TInt response( KErrCancel ); CAknDoublePopupMenuStyleListBox* list = - new( ELeave )CAknDoublePopupMenuStyleListBox; + new( ELeave )CAknDoublePopupMenuStyleListBox; CleanupStack::PushL( list ); CAknPopupList* popupList = CAknPopupList::NewL( list, @@ -175,14 +175,14 @@ // void CESMRAddressSelectionQuery::SetListQueryTextsL( - CDesCArrayFlat* aItemArray, - CAknPopupList* aPopupList, - const RPointerArray& aAddressArray ) + CDesCArrayFlat* aItemArray, + CAknPopupList* aPopupList, + const RPointerArray& aAddressArray ) { FUNC_LOG; // Set title for popup aPopupList->SetTitleL( *iEnv->AllocReadResourceAsDes16LC( - R_QTN_MEET_REQ_LOC_ADDRESS_SELECTION_TITLE ) ); + R_QTN_MEET_REQ_LOC_ADDRESS_SELECTION_TITLE ) ); CleanupStack::PopAndDestroy(); // Resource string // Amount of addresses the contact has @@ -193,7 +193,7 @@ item.CleanupClosePushL(); for ( TInt i(0); i < itemCount; ++i ) - { + { // Descriptor has separator between label and the actual address TPtr16 temp = aAddressArray[i]->Des(); @@ -203,25 +203,25 @@ temp.SetLength( KMaxLength ); } - // Finding the first instance of a separator - TInt offset = temp.Find( KSeparator ); - - if( 0 <= offset && offset < KMaxLength ) - { - // Forming label from the beginning to the first separator - TPtrC16 tempLabel = temp.Mid( 0, offset ); - - // Forming address from the first separator to the end - TPtrC16 tempAddress = temp.Mid( - offset + KSeparatorLength, - temp.Length() - offset - KSeparatorLength ); - - // appending address item to array - item.Format( KListItemFormat, &tempLabel, &tempAddress ); - aItemArray->AppendL( item ); - } - - } + // Finding the first instance of a separator + TInt offset = temp.Find( KSeparator ); + + if( 0 <= offset && offset < KMaxLength ) + { + // Forming label from the beginning to the first separator + TPtrC16 tempLabel = temp.Mid( 0, offset ); + + // Forming address from the first separator to the end + TPtrC16 tempAddress = temp.Mid( + offset + KSeparatorLength, + temp.Length() - offset - KSeparatorLength ); + + // appending address item to array + item.Format( KListItemFormat, &tempLabel, &tempAddress ); + aItemArray->AppendL( item ); + } + + } CleanupStack::PopAndDestroy( &item ); } diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/src/cesmrcontactmenuurlhandler.cpp --- a/meetingrequest/mrgui/src/cesmrcontactmenuurlhandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrcontactmenuurlhandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -32,12 +32,12 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include // for intranet application opening #include #include @@ -49,7 +49,7 @@ /// Unnamed namespace for local definitions namespace // codescanner::namespace - { + { // URL actionmenu uids const TUid KUidOpenInBrowser = { @@ -87,7 +87,7 @@ // --------------------------------------------------------------------------- // CESMRContactMenuUrlHandler::CESMRContactMenuUrlHandler( - CFscContactActionMenu& aContactActionMenu ) : + CFscContactActionMenu& aContactActionMenu ) : iContactActionMenu( aContactActionMenu ) { FUNC_LOG; @@ -103,7 +103,7 @@ { FUNC_LOG; CESMRContactMenuUrlHandler* self = - new (ELeave) CESMRContactMenuUrlHandler( aContactActionMenu ); + new (ELeave) CESMRContactMenuUrlHandler( aContactActionMenu ); return self; } @@ -147,8 +147,8 @@ // --------------------------------------------------------------------------- // void CESMRContactMenuUrlHandler::CreateMenuItemL( - TInt aResourceId, - TUid aCommandUid ) + TInt aResourceId, + TUid aCommandUid ) { FUNC_LOG; CGulIcon* itemIcon = CreateIconL(aCommandUid); @@ -159,8 +159,8 @@ HBufC* text = CCoeEnv::Static()->AllocReadResourceLC( aResourceId ); CFscContactActionMenuItem* newItem = - iContactActionMenu.Model().NewMenuItemL( *text, - itemIcon, + iContactActionMenu.Model().NewMenuItemL( *text, + itemIcon, 1, EFalse, aCommandUid ); @@ -226,7 +226,7 @@ // --------------------------------------------------------------------------- // void CESMRContactMenuUrlHandler::InitOptionsMenuL( - CEikMenuPane* aActionMenuPane ) + CEikMenuPane* aActionMenuPane ) { FUNC_LOG; CEikMenuPaneItem::SData data; @@ -239,7 +239,7 @@ data.iCommandId = command; command++;//dynamic command ids CCoeEnv::Static()->ReadResourceL( - data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_OPEN_IN_WEB ); + data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_OPEN_IN_WEB ); aActionMenuPane->AddMenuItemL( data ); if(IsServiceAvailableL(R_INTRANET_AIW_INTEREST) && @@ -248,13 +248,13 @@ data.iCommandId = command; command++;//dynamic command ids CCoeEnv::Static()->ReadResourceL( - data.iText, R_QTN_MEET_REQ_FSOPTIONS_OPEN_IN_INTRA ); + data.iText, R_QTN_MEET_REQ_FSOPTIONS_OPEN_IN_INTRA ); aActionMenuPane->AddMenuItemL( data ); } data.iCommandId = command; CCoeEnv::Static()->ReadResourceL( - data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_BOOKMARK ); + data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_BOOKMARK ); aActionMenuPane->AddMenuItemL( data ); } @@ -326,13 +326,13 @@ //fill list CreateMenuItemL( R_QTN_MEET_REQ_VIEWER_OPTIONS_OPEN_IN_WEB, - KUidOpenInBrowser); + KUidOpenInBrowser); if(IsServiceAvailableL(R_INTRANET_AIW_INTEREST) && FeatureManager::FeatureSupported( KFeatureIdFfIntranetBrowsing ) ) { CreateMenuItemL( R_QTN_MEET_REQ_FSOPTIONS_OPEN_IN_INTRA, - KUidOpenInIntranet); + KUidOpenInIntranet); } CreateMenuItemL(R_QTN_MEET_REQ_VIEWER_OPTIONS_BOOKMARK, KUidBookmark); @@ -375,7 +375,7 @@ User::LeaveIfError( appArcSession.Connect() ); TThreadId id; User::LeaveIfError( appArcSession.StartDocument ( - *param, KUidBrowser, id ) ); + *param, KUidBrowser, id ) ); CleanupStack::PopAndDestroy( &appArcSession ); } CleanupStack::PopAndDestroy( param ); @@ -396,9 +396,9 @@ inParamList.AppendL( inParam ); ServiceHandlerL().ExecuteServiceCmdL( - KAiwCmdView, - inParamList, - ServiceHandlerL().OutParamListL() ); + KAiwCmdView, + inParamList, + ServiceHandlerL().OutParamListL() ); CleanupStack::PopAndDestroy( eightBitUrl ); } @@ -416,7 +416,7 @@ // Read default name from resources HBufC* defaultName =CCoeEnv::Static()->AllocReadResourceLC ( - R_QTN_CALENDAR_DEFAULT_BOOKMARK ); + R_QTN_CALENDAR_DEFAULT_BOOKMARK ); TBuf retName; retName.Copy( defaultName->Des() ); @@ -430,31 +430,31 @@ CleanupStack::PopAndDestroy ( 2, item ); // item, defaultName } else - { - item->SetNameL( retName ); - item->SetUrlL( *iUrl ); + { + item->SetNameL( retName ); + item->SetUrlL( *iUrl ); - RFavouritesSession sess; // codescanner::resourcenotoncleanupstack - RFavouritesDb db; // codescanner::resourcenotoncleanupstack + RFavouritesSession sess; // codescanner::resourcenotoncleanupstack + RFavouritesDb db; // codescanner::resourcenotoncleanupstack - User::LeaveIfError( sess.Connect() ); - CleanupClosePushL ( sess ); - User::LeaveIfError( db.Open( sess, KBrowserBookmarks ) ); - CleanupClosePushL ( db ); + User::LeaveIfError( sess.Connect() ); + CleanupClosePushL ( sess ); + User::LeaveIfError( db.Open( sess, KBrowserBookmarks ) ); + CleanupClosePushL ( db ); - // add item - db.Add( *item, ETrue ); - // Close the database. - db.Close(); + // add item + db.Add( *item, ETrue ); + // Close the database. + db.Close(); - HBufC * msgBuffer = CCoeEnv::Static()->AllocReadResourceLC( - R_QTN_CALENDAR_BOOKMARK_SAVED ); - CAknConfirmationNote* note = new(ELeave)CAknConfirmationNote( ETrue ); - note->ExecuteLD ( *msgBuffer ); + HBufC * msgBuffer = CCoeEnv::Static()->AllocReadResourceLC( + R_QTN_CALENDAR_BOOKMARK_SAVED ); + CAknConfirmationNote* note = new(ELeave)CAknConfirmationNote( ETrue ); + note->ExecuteLD ( *msgBuffer ); - // item, db, sess, defaultName, msgBuffer - CleanupStack::PopAndDestroy ( 5, item ); // codescanner::magicnumbers - } + // item, db, sess, defaultName, msgBuffer + CleanupStack::PopAndDestroy ( 5, item ); // codescanner::magicnumbers + } } // --------------------------------------------------------------------------- diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/src/cesmrviewerdialog.cpp --- a/meetingrequest/mrgui/src/cesmrviewerdialog.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/src/cesmrviewerdialog.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -79,7 +79,7 @@ #include "esmrconfig.hrh" #include "mesmrfieldevent.h" -#include "CFSMailBox.h" +#include "cfsmailbox.h" /// Unnamed namespace for local definitions namespace { // codescanner::namespace diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/src/cmrresponsedialogview.cpp --- a/meetingrequest/mrgui/src/cmrresponsedialogview.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/src/cmrresponsedialogview.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -177,10 +177,10 @@ CCoeControl::SetContainerWindowL( aContainer ); iEditor = new (ELeave )CEikRichTextEditor(); iEditor->ConstructL( this, 0, 0, CEikEdwin::ENoAutoSelection, 0, 0 ); + iEditor->SetContainerWindowL(*this); + iEditor->SetSize(Rect().Size()); + iEditor->SetSkinBackgroundControlContextL( iBgContext ); iEditor->SetFocus( ETrue ); - iEditor->SetContainerWindowL( *this ); - iEditor->SetSize( Rect().Size() ); - iEditor->SetSkinBackgroundControlContextL( iBgContext ); // Create vertical scrollbar for editor iScrollBarFrame = iEditor->CreateScrollBarFrameL(); diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrgui/src/resmrstatic.cpp --- a/meetingrequest/mrgui/src/resmrstatic.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrgui/src/resmrstatic.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -21,8 +21,8 @@ #include "cesmrcontactmenuhandler.h" #include "cesmrcontactmanagerhandler.h" -#include "CFSMailClient.h" -#include "CFSMailBox.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" // Removed profiling /** diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/inc/cesmrimapicalretriever.h --- a/meetingrequest/mricalviewer/inc/cesmrimapicalretriever.h Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/inc/cesmrimapicalretriever.h Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,7 @@ #include // #include "mesmragnimportobserver.h" -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" // #include "cesmricalviewerasynccommand.h" diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/inc/cesmrimapmailfetcher.h --- a/meetingrequest/mricalviewer/inc/cesmrimapmailfetcher.h Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/inc/cesmrimapmailfetcher.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #include // -#include "MFSMailRequestObserver.h" +#include "mfsmailrequestobserver.h" #include "mesmricalviewerobserver.h" // #include "cesmricalviewerasynccommand.h" diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmricalviewercanviewmr.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewercanviewmr.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewercanviewmr.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -21,8 +21,8 @@ #include "cesmricalviewercanviewmr.h" // #include "esmricalvieweropcodes.hrh" -#include "CFSMailCommon.h" -#include "CFSMailMessage.h" +#include "cfsmailcommon.h" +#include "cfsmailmessage.h" // // ======== MEMBER FUNCTIONS ======== diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmricalviewercmdhandler.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewercmdhandler.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewercmdhandler.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -29,7 +29,7 @@ #include // -#include "CFSMailClient.h" +#include "cfsmailclient.h" #include "esmricalvieweropcodes.hrh" #include "esmricalviewerdefs.hrh" // diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmricalvieweremailasynccmd.cpp --- a/meetingrequest/mricalviewer/src/cesmricalvieweremailasynccmd.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalvieweremailasynccmd.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ // #include "esmricalvieweropcodes.hrh" #include -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmricalviewerloadmrdatacmd.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewerloadmrdatacmd.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewerloadmrdatacmd.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -22,7 +22,7 @@ // #include "esmricalvieweropcodes.hrh" #include -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include "cesmrmrinfoicalretriever.h" diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmricalviewerremovemrfromcalcmd.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewerremovemrfromcalcmd.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewerremovemrfromcalcmd.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -24,7 +24,7 @@ // #include "esmricalvieweropcodes.hrh" #include -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmricalviewerresolvemrmethodasync.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewerresolvemrmethodasync.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewerresolvemrmethodasync.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -23,7 +23,7 @@ // #include "esmricalvieweropcodes.hrh" #include -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmricalviewerresponsetomrcmd.cpp --- a/meetingrequest/mricalviewer/src/cesmricalviewerresponsetomrcmd.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmricalviewerresponsetomrcmd.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -28,7 +28,7 @@ // #include "esmricalvieweropcodes.hrh" #include -#include "CFSMailClient.h" +#include "cfsmailclient.h" // #include diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmrimapicalretriever.cpp --- a/meetingrequest/mricalviewer/src/cesmrimapicalretriever.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmrimapicalretriever.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -25,11 +25,11 @@ #include "esmrconfig.hrh" // -#include "CFSMailClient.h" -#include "CFSMailBox.h" -#include "CFSMailMessage.h" -#include "CFSMailMessagePart.h" -#include "CFSMailCommon.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" +#include "cfsmailmessage.h" +#include "cfsmailmessagepart.h" +#include "cfsmailcommon.h" #include "cesmragnexternalinterface.h" #include "esmricalvieweropcodes.hrh" // diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmrimapmailfetcher.cpp --- a/meetingrequest/mricalviewer/src/cesmrimapmailfetcher.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmrimapmailfetcher.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -20,10 +20,10 @@ #include "cesmrimapmailfetcher.h" #include "esmricalviewerutils.h" // -#include "CFSMailClient.h" -#include "CFSMailFolder.h" -#include "CFSMailMessagePart.h" -#include "CFSMailCommon.h" +#include "cfsmailclient.h" +#include "cfsmailfolder.h" +#include "cfsmailmessagepart.h" +#include "cfsmailcommon.h" #include "esmricalvieweropcodes.hrh" // diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp --- a/meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -27,11 +27,11 @@ // #include "esmricalvieweropcodes.hrh" -#include "CFSMailClient.h" -#include "CFSMailBox.h" -#include "CFSMailMessage.h" -#include "CFSMailMessagePart.h" -#include "CFSMailCommon.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" +#include "cfsmailmessage.h" +#include "cfsmailmessagepart.h" +#include "cfsmailcommon.h" #include "mmrinfoprocessor.h" #include "mmrattendee.h" #include "mmrrecurrencerule.h" diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/cesmruilauncher.cpp --- a/meetingrequest/mricalviewer/src/cesmruilauncher.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/cesmruilauncher.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -27,7 +27,7 @@ #include // #include "FreestyleEmailUiConstants.h" -#include "CFSMailMessage.h" +#include "cfsmailmessage.h" #include "fsmtmsuids.h" #include #include diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mricalviewer/src/esmricalviewerutils.cpp --- a/meetingrequest/mricalviewer/src/esmricalviewerutils.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mricalviewer/src/esmricalviewerutils.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -20,10 +20,10 @@ #include "esmricalviewerutils.h" #include "cesmrattachmentinfo.h" // -#include "CFSMailMessagePart.h" -#include "CFSMailClient.h" -#include "CFSMailMessage.h" -#include "CFSMailBox.h" +#include "cfsmailmessagepart.h" +#include "cfsmailclient.h" +#include "cfsmailmessage.h" +#include "cfsmailbox.h" // #include diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrtasks/inc/cesmrfsemailmanager.h --- a/meetingrequest/mrtasks/inc/cesmrfsemailmanager.h Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrtasks/inc/cesmrfsemailmanager.h Fri Feb 19 22:37:30 2010 +0200 @@ -21,7 +21,7 @@ #include // -#include "CFSMailCommon.h" +#include "cfsmailcommon.h" #include "mmrinfoprocessor.h" #include "esmrdef.h" // diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrtasks/src/cesmrfsemailmanager.cpp --- a/meetingrequest/mrtasks/src/cesmrfsemailmanager.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrtasks/src/cesmrfsemailmanager.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -21,13 +21,13 @@ #include "emailtrace.h" #include "cesmrfsemailmanager.h" -#include "CFSMailClient.h" -#include "CFSMailBox.h" -#include "CFSMailMessage.h" -#include "CFSMailMessagePart.h" +#include "cfsmailclient.h" +#include "cfsmailbox.h" +#include "cfsmailmessage.h" +#include "cfsmailmessagepart.h" #include "mmrinfoprocessor.h" -#include "CFSMailCommon.h" -#include "CFSMailPlugin.h" +#include "cfsmailcommon.h" +#include "cfsmailplugin.h" #include "tesmrinputparams.h" #include "esmrconfig.hrh" diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrtasks/src/cesmrsendmrfsmailreplytask.cpp --- a/meetingrequest/mrtasks/src/cesmrsendmrfsmailreplytask.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrtasks/src/cesmrsendmrfsmailreplytask.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -24,7 +24,7 @@ #include #include // -#include "CFSMailMessage.h" +#include "cfsmailmessage.h" #include #include #include "FreestyleEmailUiConstants.h" diff -r e7aa27f58ae1 -r e1b6206813b4 meetingrequest/mrtasks/src/cesmrtaskfactory.cpp --- a/meetingrequest/mrtasks/src/cesmrtaskfactory.cpp Tue Feb 02 00:02:40 2010 +0200 +++ b/meetingrequest/mrtasks/src/cesmrtaskfactory.cpp Fri Feb 19 22:37:30 2010 +0200 @@ -35,10 +35,10 @@ #include "esmrconfig.hrh" // -#include "CFSMailCommon.h" -#include "CFSMailClient.h" -#include "CFSMailMessage.h" -#include "CFSMailBox.h" +#include "cfsmailcommon.h" +#include "cfsmailclient.h" +#include "cfsmailmessage.h" +#include "cfsmailbox.h" // namespace {