Revision: 201023 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 21 Jun 2010 15:57:43 +0300
branchRCL_3
changeset 38 c52421ed5f07
parent 29 a8834a2e9a96
child 42 6b0a8425dd42
child 50 a1caeb42b3a3
Revision: 201023 Kit: 2010125
classicui_plat/extended_sounds_api/group/bld.inf
classicui_plat/find_item_ui_api/tsrc/inc/testdomfinditem.h
classicui_plat/find_item_ui_api/tsrc/src/testdomfinditemblocks.cpp
classicui_plat/find_item_ui_api/tsrc/src/testdomfinditemblocksdialog.cpp
classicui_plat/signal_pane_api/inc/aknsignal.h
classicui_pub/buttons_api/inc/eikcba.h
classicui_pub/options_menu_api/inc/EIKMENUP.H
classicui_pub/ui_framework_definitions_api/inc/EIKON.HRH
commonuis/CommonDialogs/group/CommonDialogs.rss
commonuis/CommonDialogs/group/commondialogsdata.hrh
commonuis/CommonDialogs/group/commondialogsdata.rh
commonuis/CommonDialogs/src/CAknFileSelectionModel.cpp
commonuis/CommonDialogs/src/CAknFileSelectionModel.h
commonuis/CommonUi/src/FindItemDialog.cpp
psln/Src/PslnGeneralThemeView.cpp
psln/Src/PslnSoundActivator.cpp
psln/pslnengine/src/PslnSkinStore.cpp
uifw/AknGlobalUI/AknNfySrv/inc/AknNfySrv.h
uifw/AknGlobalUI/AknNfySrv/src/AknNfySrv.cpp
uifw/AknGlobalUI/OldStyleNotif/Src/AknNotifyPlugin.cpp
uifw/AknGlobalUI/OldStyleNotif/Src/aknkeylocknotifier.cpp
uifw/AknGlobalUI/OldStyleNotif/group/AknOldStyleNotif.mmp
uifw/AvKon/akncompamode/srv/src/akncompaserver.cpp
uifw/AvKon/aknhlist/src/akntreelistphysicshandler.cpp
uifw/AvKon/aknhlist/src/akntreelistview.cpp
uifw/AvKon/animdllsrc/AknKeyEventMap.cpp
uifw/AvKon/src/AknCharMap.cpp
uifw/AvKon/src/AknIndicatorContainer.cpp
uifw/AvKon/src/AknQueryControl.cpp
uifw/AvKon/src/AknRadioButtonSettingPage.cpp
uifw/AvKon/src/AknTextSettingPage.cpp
uifw/AvKon/src/AknViewAppUi.cpp
uifw/AvKon/src/aknchoicelist.cpp
uifw/AvKon/src/akncontext.cpp
uifw/AvKon/src/aknglobalpopupprioritycontroller.cpp
uifw/AvKon/src/aknindicator.cpp
uifw/AvKon/src/aknmessagequerydialog.cpp
uifw/AvKon/src/aknnavi.cpp
uifw/AvKon/src/aknsignal.cpp
uifw/AvKon/src/aknstatuspanedatapublisher.cpp
uifw/AvKon/src/aknutils.cpp
uifw/AvKon/src/aknview.cpp
uifw/AvKon/srcdata/smiley.rss
uifw/AvKon/tsrc/bc/S60_SDKMCL/bctestmixmcl/inc/bctestmixmclgeneralcase.h
uifw/AvKon/tsrc/bc/S60_SDKMCL/bctestmixmcl/src/bctestmixmclgeneralcase.cpp
uifw/AvKon/tsrc/bc/bctesttemplate/inc/bctesttemplatecontainer.h
uifw/AvKon/tsrc/bc/bctesttemplate/src/bctesttemplatecontainer.cpp
uifw/EikStd/coctlinc/smileyiconrecord.h
uifw/EikStd/coctlinc/smileymodel.h
uifw/EikStd/coctlsrc/AknButton.cpp
uifw/EikStd/coctlsrc/AknToolbar.cpp
uifw/EikStd/coctlsrc/EIKEDWIN.CPP
uifw/EikStd/coctlsrc/EIKLBX.CPP
uifw/EikStd/coctlsrc/EIKMENUB.CPP
uifw/EikStd/coctlsrc/EIKMENUP.CPP
uifw/EikStd/coctlsrc/EIKSCRLB.CPP
uifw/EikStd/coctlsrc/aknedwinphysicshandler.cpp
uifw/EikStd/coctlsrc/eikcba.cpp
uifw/EikStd/coctlsrc/eikspane.cpp
uifw/EikStd/coctlsrc/smileyiconrecord.cpp
uifw/EikStd/coctlsrc/smileymanager.cpp
uifw/EikStd/coctlsrc/smileymodel.cpp
uifw/EikStd/dlgsrc/EIKDIALG.CPP
uifw/EikStd/srvuisrc/eikkeysoundserver.cpp
uifw/eikctl/src/EIKMFNE.CPP
uifw/ganes/inc/HgVgMediaWallRenderer.h
uifw/ganes/src/HgItem.cpp
uifw/ganes/src/HgScroller.cpp
uifw/ganes/src/HgVgMediaWall.cpp
uifw/ganes/src/HgVgMediaWallRenderer.cpp
uiutils/Findutil/src/FindUtilChinese.cpp
--- a/classicui_plat/extended_sounds_api/group/bld.inf	Wed Jun 09 09:58:37 2010 +0300
+++ b/classicui_plat/extended_sounds_api/group/bld.inf	Mon Jun 21 15:57:43 2010 +0300
@@ -33,7 +33,7 @@
 // TEMP
 // Temp solution to remove original version exported from audiothemes
 // To be removed after one release cycle to platform
-../inc/ataudioeventapi.h                  MW_LAYER_PLATFORM_EXPORT_PATH(../../ataudioeventapi.h)
-../inc/mateventcompleteobserver.h  MW_LAYER_PLATFORM_EXPORT_PATH(../../mateventcompleteobserver.h)
+//../inc/ataudioeventapi.h                  MW_LAYER_PLATFORM_EXPORT_PATH(../../ataudioeventapi.h)
+//../inc/mateventcompleteobserver.h  MW_LAYER_PLATFORM_EXPORT_PATH(../../mateventcompleteobserver.h)
 // TEMP
 // TEMP
--- a/classicui_plat/find_item_ui_api/tsrc/inc/testdomfinditem.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/classicui_plat/find_item_ui_api/tsrc/inc/testdomfinditem.h	Mon Jun 21 15:57:43 2010 +0300
@@ -134,7 +134,7 @@
     * @param aItem never used.
     * @return Symbian OS error code.
     */
-    virtual TInt TestDialogEnableSingleClick( CStifItemParser& aItem );
+    virtual TInt TestDialogEnableSingleClickL( CStifItemParser& aItem );
 
 private: // test functions in finditemmenu.h
 
--- a/classicui_plat/find_item_ui_api/tsrc/src/testdomfinditemblocks.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/classicui_plat/find_item_ui_api/tsrc/src/testdomfinditemblocks.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -44,7 +44,7 @@
         ENTRY( "TestDialogExecuteLD", Ctestdomfinditem::TestDialogExecuteLDL ),
         ENTRY( "TestDialogProcessCommandL", Ctestdomfinditem::TestDialogProcessCommandL ),
         ENTRY( "TestDialogOfferKeyEventL", Ctestdomfinditem::TestDialogOfferKeyEventL ),
-        ENTRY( "TestDialogEnableSingleClick", Ctestdomfinditem::TestDialogEnableSingleClick ),
+        ENTRY( "TestDialogEnableSingleClickL", Ctestdomfinditem::TestDialogEnableSingleClickL ),
 
         // test functions in finditemmenu.h
         ENTRY( "TestMenuNewL", Ctestdomfinditem::TestMenuNewL ),
--- a/classicui_plat/find_item_ui_api/tsrc/src/testdomfinditemblocksdialog.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/classicui_plat/find_item_ui_api/tsrc/src/testdomfinditemblocksdialog.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -133,10 +133,10 @@
 
 
 // -----------------------------------------------------------------------------
-// Ctestdomfinditem::TestDialogEnableSingleClick
+// Ctestdomfinditem::TestDialogEnableSingleClickL
 // -----------------------------------------------------------------------------
 //
-TInt Ctestdomfinditem::TestDialogEnableSingleClick( CStifItemParser& /*aItem*/ )
+TInt Ctestdomfinditem::TestDialogEnableSingleClickL( CStifItemParser& /*aItem*/ )
     {
     // Print to UI
     _LIT( Ktestdomfinditem, "testdomfinditem" );
--- a/classicui_plat/signal_pane_api/inc/aknsignal.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/classicui_plat/signal_pane_api/inc/aknsignal.h	Mon Jun 21 15:57:43 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-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"
@@ -236,6 +236,9 @@
     CFbsBitmap* SignalIconBitmapMask() const;
     void SetContainerWindowNonFading(TBool aNonFading);    
 	void LoadSignalIconL(TInt aIconState, TInt aColorIndex);
+	void StartTickerL( TTimeIntervalMicroSeconds32 aDelay,
+	                   TTimeIntervalMicroSeconds32 aInterval );
+	void StopTicker();
 
 private:
     // Private flags for internal statemachines, iSpare taken into use
--- a/classicui_pub/buttons_api/inc/eikcba.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/classicui_pub/buttons_api/inc/eikcba.h	Mon Jun 21 15:57:43 2010 +0300
@@ -1084,6 +1084,12 @@
      */
     void UpdateItemSpecificSoftkey( CCoeControl& aControl, TBool aEnable );
 
+    /**
+     * Creates the skin background contexts used in StaCon layout if they
+     * don't already exist. 
+     */
+    void CheckAndCreateStaconContextsL();
+
 private: // from CCoeControl
     void SizeChanged();
 
--- a/classicui_pub/options_menu_api/inc/EIKMENUP.H	Wed Jun 09 09:58:37 2010 +0300
+++ b/classicui_pub/options_menu_api/inc/EIKMENUP.H	Mon Jun 21 15:57:43 2010 +0300
@@ -896,6 +896,15 @@
     void SetItemCommandsStateL( TBool aDimmed );
 
     /**
+     * Sets item action commands state.
+     * 
+     * @internal
+     * @since S60 v5.2
+     * @param aDimmed If ETrue, item action commands are dimmed.
+     */
+    void SetItemActionsStateL( TBool aDimmed );    
+
+    /**
      * Adds menu items to this menu and item action menu data. 
      * 
      * @internal
--- a/classicui_pub/ui_framework_definitions_api/inc/EIKON.HRH	Wed Jun 09 09:58:37 2010 +0300
+++ b/classicui_pub/ui_framework_definitions_api/inc/EIKON.HRH	Mon Jun 21 15:57:43 2010 +0300
@@ -219,6 +219,7 @@
 #define EAknEditorFlagSelectionVisible                0x100000
 #define EAknEditorFlagEnablePartialScreen             0x200000
 #define EAknEditorFlagLaunchPenInputAutomatic         0x400000
+#define EAknEditorFlagHideTextView                    0x800000
 // NOTICE! Flag value 0x80000000 is reserved for internal use by FEP.
 
 // EIKLABEL.HRH
--- a/commonuis/CommonDialogs/group/CommonDialogs.rss	Wed Jun 09 09:58:37 2010 +0300
+++ b/commonuis/CommonDialogs/group/CommonDialogs.rss	Mon Jun 21 15:57:43 2010 +0300
@@ -27,6 +27,8 @@
 #include <commondialogs.loc>
 #include <CommonDialogs.rh>
 
+#include "commondialogsdata.hrh"
+#include "commondialogsdata.rh"
 //  RESOURCE DEFINITIONS
 
 // ---------------------------------------------------------
@@ -514,4 +516,247 @@
     softkey_2 = text_softkey_cancel;
     }
 
+
+RESOURCE FILEXTNAMEANDICONINDEXLIST r_cdf_file_type_icon_set
+    {
+    fileextnameandiconindex = 
+            {
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".txt";
+                iconindex = ENoteFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".sdp";
+                iconindex = EVideoFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".3gp";
+                iconindex = EVideoFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".mpeg";
+                iconindex = EVideoFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".mpeg4";
+                iconindex = EVideoFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".mp4";
+                iconindex = EVideoFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".nim";
+                iconindex = EVideoFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".jpg";
+                iconindex = EImageFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".jpeg";
+                iconindex = EImageFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".gif";
+                iconindex = EImageFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".png";
+                iconindex = EImageFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".tif";
+                iconindex = EImageFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".mbm";
+                iconindex = EImageFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".wbmp";
+                iconindex = EImageFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".bmp";
+                iconindex = EImageFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".svg";
+                iconindex = EImageFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".wmf";
+                iconindex = EImageFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".awb";
+                iconindex = EVoiceRecFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".ota";
+                iconindex = EGmsFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".amr";
+                iconindex = EVoiceRecFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".rng";
+                iconindex = EVoiceRecFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".nrt";
+                iconindex = EVoiceRecFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".mid";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".rmf";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".aiff";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".aif";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".wav";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".mp3";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".m4a";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".aac";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".mxmf";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".wma";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".3g2";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".au";
+                iconindex = ESoundFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".sisx";
+                iconindex = EAppFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".sis";
+                iconindex = EAppFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".zip";
+                iconindex = EAppFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".rar";
+                iconindex = EAppFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".jad";
+                iconindex = EAppFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".jar";
+                iconindex = EAppFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".pdf";
+                iconindex = ENoteFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".pptx";
+                iconindex = ENoteFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".ppt";
+                iconindex = ENoteFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".xls";
+                iconindex = ENoteFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".xlsx";
+                iconindex = ENoteFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".docx";
+                iconindex = ENoteFileIcon;
+                },
+            FILEXTNAMEANDICONINDEX
+                {
+                fileextnamet = ".doc";
+                iconindex = ENoteFileIcon;
+                }
+            };
+    }
+
 // End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/commonuis/CommonDialogs/group/commondialogsdata.hrh	Mon Jun 21 15:57:43 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is file dialog data enum value file.
+*
+*/
+/**
+ * Enumerations for file dialog list item icon.
+ */
+enum TFileTypeIcon
+    {
+    EFolderIcon,
+    EFileIcon,
+    ESubFolderIcon,
+    EThisFolderIcon,
+    EImageFileIcon,
+    EGmsFileIcon,
+    ELinkFileIcon,
+    EVoiceRecFileIcon,
+    ESoundFileIcon,
+    EPlaylistFileIcon,
+    ECompoFileIcon,
+    ENoteFileIcon,
+    EAppFileIcon,
+    EVideoFileIcon,
+    EGameFileIcon,
+    EUnknowTypeIcon,
+    EFolderEmptyIcon,
+    EFlashFileIcon
+    };
+    
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/commonuis/CommonDialogs/group/commondialogsdata.rh	Mon Jun 21 15:57:43 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This is file dialog data struct file.
+*
+*/
+
+// ---------------------------------------------------------
+//    FILEXTNAMEANDICONINDEX
+//    A structure for saving file ext name and icon index for listbox
+// ---------------------------------------------------------
+//
+STRUCT FILEXTNAMEANDICONINDEX
+    {
+    LTEXT fileextnamet; // file ext name
+    LONG iconindex;     // icon index for listbox
+    }
+// ---------------------------------------------------------
+//    FILEXTNAMEANDICONINDEX
+//    A structure for list FILEXTNAMEANDICONINDEX
+// ---------------------------------------------------------
+//
+STRUCT FILEXTNAMEANDICONINDEXLIST
+    {
+    STRUCT fileextnameandiconindex[];
+    }
+// End of File
--- a/commonuis/CommonDialogs/src/CAknFileSelectionModel.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/commonuis/CommonDialogs/src/CAknFileSelectionModel.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -31,36 +31,21 @@
 #include "MAknFileFilter.h"
 #include "AknCFDUtility.h"
 #include "CAknDataCagingFilter.h"
-
+#include "commondialogsdata.hrh"
 // CONSTANTS
+_LIT( KImageHeader, "%d\t" );
+const TInt KFileExtNameSize = 10;
 const TInt KEntryArrayGranularity( 10 );
 const TInt KFilterArrayGranularity( 2 );
+const TInt KIndexDataLen = 6;
 
-_LIT( KCFDMimeTypeImage, "image/*" );
-_LIT( KCFDMimeTypeImageGms, "image/x-ota-bitmap" );
-_LIT( KCFDMimeTypeRam, "audio/x-pn-realaudio-plugin" ); // = link
-_LIT( KCFDMimeTypeAudioVoiceRec, "audio/amr*" );
-_LIT( KCFDMimeTypeAudioVoiceRec2, "application/vnd.nokia.ringing-tone" );
-_LIT( KCFDMimeTypeAudio, "audio/*" ); // = other sound files
-_LIT( KCFDMimeTypePlaylist, "audio/*mpegurl*" );
-_LIT( KCFDMimeTypeVideo, "video/*" );
-_LIT( KCFDMimeTypeVideoRealMedia, "application/*n-realmedia" );
-_LIT( KCFDMimeTypeVideoSdp, "application/sdp" );
-_LIT( KCFDMimeTypeGame, "application/*game*" );
-_LIT( KCFDMimeTypeNote, "text/*" );
-_LIT( KCFDMimeTypeJava, "application/java-archive" );
-_LIT( KCFDMimeTypeFlash, "application/x-shockwave-flash" );
-
-_LIT( KCFDMimeTypeJad, "text/vnd.sun.j2me.app-descriptor" );
-_LIT( KCFDMimeTypePdf, "application/pdf" );
-_LIT( KCFDMimeTypeZip, "application/*zip*");
-_LIT( KCFDMimeTypeDoc, "application/vnd.ms-word");
-_LIT( KCFDMimeTypePpt, "application/vnd.ms-powerpoint");
-_LIT( KCFDMimeTypeXls, "application/vnd.ms-excel");
-
-_LIT( KCFDFileExtSis, ".sis" );
-_LIT( KCFDFileExtSisx, ".sisx");
-_LIT( KCFDFileExtMid, ".mid" );
+// Store file ext name and right icon index
+class TCFDFileTypes
+    {
+public:
+    TBuf<KFileExtNameSize> iFileType;
+    TInt iIconIndex;
+    };
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -72,8 +57,7 @@
 //
 CAknFileSelectionModel::CAknFileSelectionModel(
     const TCommonDialogType& aDialogType, CCoeEnv& aCoeEnv )
-    :   iImageIndexArray( KEntryArrayGranularity ),
-        iDirectoryLevel( 0 ),
+      : iDirectoryLevel( 0 ),
         iDialogType( aDialogType ),
         iCoeEnv( aCoeEnv )
     {
@@ -86,19 +70,47 @@
 //
 void CAknFileSelectionModel::ConstructL()
     {
-    User::LeaveIfError( iApaSession.Connect() );
     iLocalizer = CDirectoryLocalizer::NewL();
     iEntryArray = new( ELeave ) CArrayPakFlat<TEntry>( KEntryArrayGranularity );
     iFilterArray = new( ELeave ) CArrayPtrSeg<MAknFileFilter>( KFilterArrayGranularity );
-    iItemWithImageIndex = HBufC::NewL(KMaxPath);
+    iFileTypeArray = new ( ELeave ) CArrayFixFlat<TCFDFileTypes>( KEntryArrayGranularity );
+    
+    // Directories should be shown in front of files in list, 
+    // create two arrays to save it respectively
+    iLocalFileNameArray = new ( ELeave ) CDesC16ArraySeg( KEntryArrayGranularity );
+    iLocalDirNameArray = new ( ELeave ) CDesC16ArraySeg( KEntryArrayGranularity );
+    
+    TResourceReader reader;
+    iCoeEnv.CreateResourceReaderLC( reader, R_CDF_FILE_TYPE_ICON_SET );
+    ReadFileExtNameAndIconIndexL( reader );
+    CleanupStack::PopAndDestroy();//reader
+    
+    iStringBuf = HBufC::NewL(KMaxPath);
+    
     User::LeaveIfError( iFs.Connect() );
     iRootFolderText = iCoeEnv.AllocReadResourceL( R_CFD_QTN_FLDR_ROOT_LEVEL );
-
     AddFilterL( CAknDataCagingFilter::NewLC() );
     CleanupStack::Pop();    //caging filter
     }
 
 // -----------------------------------------------------------------------------
+// CAknFileSelectionModel::ReadFileExtNameAndIconIndexL
+//
+// -----------------------------------------------------------------------------
+//
+void CAknFileSelectionModel::ReadFileExtNameAndIconIndexL( TResourceReader& aReader )
+    {
+    // File icon will be selected by file extname.
+    TInt count( aReader.ReadInt16() );
+    for ( TInt i = 0; i < count; i++ )
+        {
+        TCFDFileTypes type;
+        type.iFileType.Copy( aReader.ReadTPtrC() );
+        type.iIconIndex = aReader.ReadInt32();
+        iFileTypeArray->AppendL( type );
+        }
+    }
+// -----------------------------------------------------------------------------
 // CAknFileSelectionModel::NewL
 //
 // -----------------------------------------------------------------------------
@@ -118,10 +130,23 @@
 CAknFileSelectionModel::~CAknFileSelectionModel()
     {
     delete iRootFolderText;
-    iImageIndexArray.Close();
     iFs.Close();
-
-    delete iItemWithImageIndex;
+    if ( iFileTypeArray )
+        {
+        iFileTypeArray->Reset();
+        delete iFileTypeArray;
+        }
+    if ( iLocalFileNameArray )
+        {
+        iLocalFileNameArray->Reset();
+        delete iLocalFileNameArray;
+        }
+    if ( iLocalDirNameArray )
+        {
+        iLocalDirNameArray->Reset();
+        delete iLocalDirNameArray;
+        }
+    delete iStringBuf;
 
     if ( iFilterArray )
         {
@@ -135,8 +160,6 @@
         }
     delete iLocalizer;
 
-
-    iApaSession.Close();
     }
 
 
@@ -178,9 +201,6 @@
 
     // Set as current path
     iCurrentPath = iParse;
-    // Reset directory level
-    iDirectoryLevel = 0;
-
 
     errorCode = UpdateItemListL();
 
@@ -197,8 +217,8 @@
 //
 TInt CAknFileSelectionModel::AddFolderL( const TDesC& aFolder )
     {
-    // Cache the directory level because SetPath resets it
-    TInt level( iDirectoryLevel );
+    // Open new sub-folder, directory level is increased
+    iDirectoryLevel++;
 
     // The engine only supports adding one folder at a time
     if ( AknCFDUtility::DirectoryCount( aFolder ) !=  1 )
@@ -223,8 +243,6 @@
         return errorCode;
         }
 
-    iDirectoryLevel = ++level;
-
     return errorCode;
     }
 
@@ -277,9 +295,11 @@
 //
 TInt CAknFileSelectionModel::UpdateItemListL()
     {
+    // Clear array contents
     iEntryArray->Reset();
-    iImageIndexArray.Reset();
-
+    iLocalDirNameArray->Reset();
+    iLocalFileNameArray->Reset();
+    
     CDir* entryArray = ReadDirectory( iCurrentPath.DriveAndPath() );
     if ( !entryArray )
         {
@@ -288,157 +308,110 @@
     CleanupStack::PushL( entryArray );
 
     TInt itemCount( entryArray->Count() );
-    if ( itemCount > 0 )
+    // entry index in iEntryArray
+    TInt entryIndex = 0;
+    for ( TInt i( 0 ); i < itemCount; i++ ) // Add entry or not
         {
-        TInt filterCount( iFilterArray->Count() );
-        TInt filterIndex;
-        TBool accepted;
-        CDesC16Array* desC16FoldersArray = new ( ELeave )
-                           CDesC16ArrayFlat( KEntryArrayGranularity );
-        CleanupStack::PushL( desC16FoldersArray );
-        CDesC16Array* desC16FilesArray = new ( ELeave )
-                           CDesC16ArrayFlat( KEntryArrayGranularity );
-        CleanupStack::PushL( desC16FilesArray );
-        CArrayPakFlat<TEntry>* tmpFoldersArray = new( ELeave ) 
-            CArrayPakFlat<TEntry>( KEntryArrayGranularity );
-        CleanupStack::PushL( tmpFoldersArray );
-        CArrayPakFlat<TEntry>* tmpFilesArray = new( ELeave ) 
-            CArrayPakFlat<TEntry>( KEntryArrayGranularity );
-        CleanupStack::PushL( tmpFilesArray );
-            
-        tmpFoldersArray->Reset();
-        desC16FoldersArray->Reset();
-        tmpFilesArray->Reset();
-        desC16FilesArray->Reset();
-        
-        for ( TInt i( 0 ); i < itemCount; i++ ) // Generate filtered list
-            {
-            accepted = ETrue; // If there are no filters, accept the entry
-            TEntry entry = ( *entryArray )[i];
-            filterIndex = 0;
-            // Go thru the filters while the entry is accepted
-            while( ( filterIndex < filterCount ) && ( accepted ) )
-                {
-                accepted = iFilterArray->At( filterIndex )->Accept(
-                    iCurrentPath.DriveAndPath(), entry );
-                filterIndex++;
-                }
-            if ( accepted ) // Directory entry has passed all filters
-                {
-                 // Add filename to filtered list
-                if ( entry.IsDir() )
-                    {
-                    desC16FoldersArray->AppendL( GetLocalizedName( entry.iName ) );
-                    tmpFoldersArray->AppendL( entry, sizeof( TEntry ) );
-                    }
-                else
-                    {
-                    desC16FilesArray->AppendL( GetLocalizedName( entry.iName ) );
-                    tmpFilesArray->AppendL( entry, sizeof( TEntry ) );
-                    }
-                }
-            }
-        
-        TInt entryCount = 0;
-        TInt index;
-        TKeyArrayPak key( _FOFF( TEntry, iName ), ECmpCollated );
-        
-        // Add folder entries
-        desC16FoldersArray->Sort( ECmpCollated );
-        entryCount = desC16FoldersArray->MdcaCount();
-        for( TInt j( 0 ); j < entryCount; j++ )
+        const TEntry& entry = ( *entryArray )[i];
+        if ( EntryIsAccepted( entry ) )
             {
-            for( TInt k( 0 ); k < entryCount; k++ )
+             // Add entry
+            if ( entry.IsDir() )
                 {
-                if( ( *desC16FoldersArray )[j] == 
-                        GetLocalizedName( ( *tmpFoldersArray )[k].iName ) &&
-                    iEntryArray->Find( ( *tmpFoldersArray )[k], key, index ) != 0 )
+            // Entry is a directory
+                TFileTypeIcon folderIcon( EFolderIcon );
+                
+                if( !AknCFDUtility::IsRemoteDrive( iCurrentPath.Drive() ) )
                     {
-                    TEntry tmpEntry = ( *tmpFoldersArray )[k];
-                    
-                    iEntryArray->AppendL( tmpEntry, sizeof( TEntry ) );
-                    
-                    // Entry is a directory
-                    TFileTypeIcon folderIcon( EFolderIcon );
-                    
-                    if( !AknCFDUtility::IsRemoteDrive( iCurrentPath.Drive() ) )
+                    if ( ContainsSubfolders( entry.iName ) )
+                        {
+                        folderIcon = ESubFolderIcon;
+                        }
+                    else if ( !ContainsFiles( entry.iName ) )
                         {
-                        if ( ContainsSubfolders( tmpEntry.iName ) )
-                            {
-                            folderIcon = ESubFolderIcon;
-                            }
-                        else if ( !ContainsFiles( tmpEntry.iName ) )
-                            {
-                            folderIcon = EFolderEmptyIcon;
-                            }
+                        folderIcon = EFolderEmptyIcon;
                         }
-                    iImageIndexArray.Append( folderIcon );
-                    
-                    break;
                     }
+                // List item uses localized name and icon index to show itself,
+                // common dialogs need to give user the entry's iName, list item
+                // need to bind unique entry. For sorting list and binding entry,
+                // save icon index, localized name and right entry index of iEntryArray
+                // in the element of iLocalDirNameArray and iLocalFileNameArray
+                TFileName name( GetLocalizedName( entry.iName ) );
+                // Append icon index number at the end of entry's localized name
+                name.AppendNumFixedWidth( folderIcon, EDecimal, KIndexDataLen );
+                // Append entry index number of iEntryArray in the end
+                name.AppendNumFixedWidth( entryIndex, EDecimal, KIndexDataLen );
+                iLocalDirNameArray->AppendL( name );
                 }
+            else
+                {
+                TInt icon(EUnknowTypeIcon);
+                icon = GetIconForFileL( entry.iName );
+                TFileName name( GetLocalizedName( entry.iName ) );
+                name.AppendNumFixedWidth( icon, EDecimal, KIndexDataLen );
+                name.AppendNumFixedWidth( entryIndex, EDecimal, KIndexDataLen );
+                iLocalFileNameArray->AppendL( name );
+                }
+            entryIndex++;
+            iEntryArray->AppendL( entry, sizeof( TEntry ) );
             }
-        
-        // Add file entries
-        desC16FilesArray->Sort( ECmpCollated );
-        entryCount = desC16FilesArray->MdcaCount();
-        for( TInt j( 0 ); j < entryCount; j++ )
-            {
-            for( TInt k( 0 ); k < entryCount; k++ )
-                {
-                if( ( *desC16FilesArray )[j] == 
-                        GetLocalizedName( ( *tmpFilesArray )[k].iName ) &&
-                    iEntryArray->Find( ( *tmpFilesArray )[k], key, index ) != 0 )
-                    {
-                    TEntry tmpFile = ( *tmpFilesArray )[k];
-                    
-                    iEntryArray->AppendL( tmpFile, sizeof( TEntry ) );
-                    
-                    // Entry is a file
-                    AppendIconForFileL( tmpFile.iName );
-                    
-                    break;
-                    }
-                }
-            }
-        
-        CleanupStack::PopAndDestroy( tmpFilesArray );
-        CleanupStack::PopAndDestroy( tmpFoldersArray );
-        CleanupStack::Pop( desC16FilesArray );
-        desC16FilesArray->Reset();
-        delete desC16FilesArray;
-        CleanupStack::Pop( desC16FoldersArray );
-        desC16FoldersArray->Reset();
-        delete desC16FoldersArray;
         }
     
     CleanupStack::PopAndDestroy( entryArray );
-    
+    // Sort list item to show
+    iLocalDirNameArray->Sort( ECmpCollated );
+    iLocalFileNameArray->Sort( ECmpCollated );
     if ( AknCFDUtility::DirectoriesOnly( iDialogType ) )
         {
         // Set the current folder name as first item.
-        // Current folder is for example "E:\Images\Holiday\"
-        // Remove trailing backslash, we get "E:\Images\Holiday"
-        // Parse the path with TParse and ask for NameAndExt().
-        // TParse interpretes "Holiday" as file name and returns it.
-
-        HBufC * bufFolder = HBufC::NewLC(KMaxPath);
-        * bufFolder = iCurrentPath.DriveAndPath() ;
-        TPtr folder = bufFolder->Des();
-
+        TPtr folder = iStringBuf->Des();
+        folder = iCurrentPath.DriveAndPath();
         AknCFDUtility::RemoveTrailingBackslash( folder ); // ignore error
+        TParsePtr parsedFolder(folder);
+        folder = parsedFolder.NameAndExt();
+        TFileName name(folder);
+        TEntry folderEntry;
+        folderEntry.iName = name;
+        if ( iDirectoryLevel == 0 )
+            {
+            name = iRootFolderText->Des();
+            }
+        else
+            {
+            folder = iCurrentPath.DriveAndPath();
+            iLocalizer->SetFullPath( folder );
+            if( iLocalizer->IsLocalized() )
+                {
+                name = iLocalizer->LocalizedName();
+                }
+            }
+        name.AppendNumFixedWidth( EThisFolderIcon, EDecimal, KIndexDataLen );
+        name.AppendNumFixedWidth( entryIndex, EDecimal, KIndexDataLen );
+        iLocalDirNameArray->InsertL( 0, name );
+        iEntryArray->AppendL( folderEntry, sizeof(TEntry) );
+        }
+    return iEntryArray->Count();
+    }
 
-        TParsePtr parsedFolder(folder);
-
-        folder = parsedFolder.NameAndExt();
-        iFolderEntry.iName = folder;
-        iEntryArray->InsertL( 0, iFolderEntry, sizeof( TEntry ) );
-        iImageIndexArray.Insert( EThisFolderIcon, 0 );
-
-        CleanupStack::PopAndDestroy(); //bufFolder
+// -----------------------------------------------------------------------------
+// CAknFileSelectionModel::EntryIsAccepted
+// -----------------------------------------------------------------------------
+//
+TBool CAknFileSelectionModel::EntryIsAccepted( const TEntry& aEntry ) const
+    {
+    TInt filterCount( iFilterArray->Count() );
+    // Go through the filters while the entry is accepted
+    for ( TInt i = 0 ; i < filterCount ; ++i )
+        {
+        if ( !( iFilterArray->At( i )->Accept(
+                iCurrentPath.DriveAndPath(), aEntry ) ) )
+            {
+            // Some filter does not accept this entry
+            return EFalse;
+            }
         }
-    
-    return iEntryArray->Count();
+    return ETrue;
     }
 
 // -----------------------------------------------------------------------------
@@ -449,7 +422,20 @@
 //
 const TEntry& CAknFileSelectionModel::Entry( const TInt& aIndex ) const
     {
-    return iEntryArray->At( aIndex );
+    TInt index = aIndex;
+    // List item sequence is arranged in MdcaPoint()
+    if ( aIndex < iLocalDirNameArray->Count() )
+        {
+        // Get right entry index of iEntryArray
+        TLex lex((*iLocalDirNameArray)[aIndex].Right(KIndexDataLen));
+        lex.Val( index );
+        }
+    else
+        {
+        TLex lex((*iLocalFileNameArray)[aIndex - iLocalDirNameArray->Count()].Right(KIndexDataLen));
+        lex.Val( index );
+        }
+    return iEntryArray->At( index );
     }
 
 // -----------------------------------------------------------------------------
@@ -526,60 +512,33 @@
 //
 TPtrC CAknFileSelectionModel::MdcaPoint( TInt aIndex ) const
     {
-    TEntry entry = iEntryArray->At( aIndex ); // reference
-    TParsePtrC parsedEntry( entry.iName );
-    TPtrC fileName( parsedEntry.NameAndExt() );
-    TInt entryType( iImageIndexArray[ aIndex ] );
-
-    TPtr itemWithImageIndex = iItemWithImageIndex->Des();
-
-    switch( entryType )
+    // List items sequence follows the sequence of sorted array
+    TPtr listItem = iStringBuf->Des();
+    TInt icon(0);
+    if ( aIndex < iLocalDirNameArray->Count() )
         {
-        case EThisFolderIcon:
-            {
-            if ( iDirectoryLevel == 0 )
-                {
-                // Root folder
-                fileName.Set( iRootFolderText->Des() );
-                }
-            else
-                {
-                // Not the root folder
-                iLocalizer->SetFullPath( iCurrentPath.DriveAndPath() );
-                if ( iLocalizer->IsLocalized() ) // Localized?
-                    {
-                    // Folder name is localized
-                    fileName.Set( iLocalizer->LocalizedName() );
-                    }
-                }
-            break;
-            }
-        case EFolderIcon: // fall through
-        case ESubFolderIcon:
-        case EFolderEmptyIcon:
-            {
-            itemWithImageIndex = iCurrentPath.DriveAndPath();
-            itemWithImageIndex.Append( entry.iName );
-            // ignore error:
-            AknCFDUtility::AddTrailingBackslash( itemWithImageIndex );
-            iLocalizer->SetFullPath( itemWithImageIndex );
-            if( iLocalizer->IsLocalized() )
-                {
-                fileName.Set( iLocalizer->LocalizedName() );
-                }
-            break;
-            }
-        default: // EFileIcon
-            {
-            break;
-            }
+        // Directories need to arrange at ahead of files
+        TInt len = (*iLocalDirNameArray)[aIndex].Length();
+        TLex lex( (*iLocalDirNameArray)[aIndex].Mid( 
+            len - KIndexDataLen - KIndexDataLen, KIndexDataLen) );
+        // Get icon index for the item
+        lex.Val( icon );
+        listItem.Format( KImageHeader, icon );
+        // Append localized name as list item name
+        listItem.Append((*iLocalDirNameArray)[aIndex].Left(
+            len - KIndexDataLen - KIndexDataLen ) );
         }
-
-    _LIT( KImageHeader, "%d\t" );
-    itemWithImageIndex.Format( KImageHeader, entryType );
-    itemWithImageIndex.Append( fileName );
-
-    return itemWithImageIndex;
+    else
+        {
+        TInt len = (*iLocalFileNameArray)[aIndex - iLocalDirNameArray->Count()].Length();
+        TLex lex( (*iLocalFileNameArray)[aIndex - iLocalDirNameArray->Count()].Mid( 
+            len - KIndexDataLen - KIndexDataLen, KIndexDataLen) );
+        lex.Val( icon );
+        listItem.Format( KImageHeader, icon );
+        listItem.Append((*iLocalFileNameArray)[aIndex - iLocalDirNameArray->Count()].Left(
+            len - KIndexDataLen - KIndexDataLen ) );
+        }
+    return listItem;
     }
 
 // -----------------------------------------------------------------------------
@@ -629,26 +588,34 @@
 //
 TBool CAknFileSelectionModel::ContainsSubfolders( const TDesC& aFolder )
     {
+    return ContainsContents( aFolder, KEntryAttDir | KEntryAttMatchExclusive );
+    }
+
+// -----------------------------------------------------------------------------
+// CAknFileSelectionModel::ContainsFiles
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAknFileSelectionModel::ContainsFiles( const TDesC& aFolder )
+    {
+    return ContainsContents( aFolder, KEntryAttNormal );
+    }
+
+// -----------------------------------------------------------------------------
+// CAknFileSelectionModel::ContainsFiles
+//
+// -----------------------------------------------------------------------------
+//
+TBool CAknFileSelectionModel::ContainsContents(
+    const TDesC& aFolder, TUint aAttMask )
+    {
     TPath directory( iCurrentPath.DriveAndPath() );
     directory.Append( aFolder );
     AknCFDUtility::AddTrailingBackslash( directory ); // ignore error
     
-    // Keep old code for possible roll-back
-    /*
-    CDir* array = ReadDirectory( directory );
-    if( ( !array ) || ( array->Count() == 0 ) || ( !(* array)[ 0 ].IsDir() ) )
-        {
-        delete array;
-        return EFalse;
-        }
-    delete array;
-    return ETrue;
-    */
-    
     RDir dir;
     TBool ret( EFalse );
-    if ( dir.Open(
-        iFs, directory, KEntryAttDir | KEntryAttMatchExclusive ) != KErrNone )
+    if ( dir.Open( iFs, directory, aAttMask ) != KErrNone )
         {
         return EFalse;
         }
@@ -660,120 +627,23 @@
     dir.Close();
     return ret;
     }
-
-void CAknFileSelectionModel::AppendIconForFileL(const TDesC& aFileName)
+// -----------------------------------------------------------------------------
+// CAknFileSelectionModel::AppendIconForFileL
+//
+// -----------------------------------------------------------------------------
+//
+TInt CAknFileSelectionModel::GetIconForFileL(const TDesC& aFileName ) const
     {
-    //TFileName absFileName( iCurrentPath.DriveAndPath() );
-    HBufC *bufAbsFileName = HBufC::NewLC(KMaxPath);
-    *bufAbsFileName = iCurrentPath.DriveAndPath();
-    TPtr absFileName = bufAbsFileName->Des();
-
-    absFileName.Append( aFileName );
-    TUid uidIgnore;
-    TDataType dataType;
-    TInt err = iApaSession.AppForDocument( absFileName, uidIgnore, dataType );
-    TInt iconIndex = EUnknowTypeIcon;
-    CleanupStack::PopAndDestroy(); //bufAbsFileName
-
-    if( err != KErrNone )
-        {
-        // Couldn't find out the data type, use generic file icon:
-        iconIndex = EUnknowTypeIcon;
-        }
-    else
+    TParsePtrC ptr( aFileName );
+    TPtrC ptrc = ptr.Ext();
+    for ( TInt i = 0; i < iFileTypeArray->Count(); i++ )
         {
-        HBufC *bufDataTypeBuf = HBufC::NewLC(KMaxDataTypeLength);
-        *bufDataTypeBuf = dataType.Des();
-        TPtr dataTypeBuf = bufDataTypeBuf->Des();
-
-        if( dataTypeBuf.MatchF( KCFDMimeTypeAudioVoiceRec ) == 0 ||
-            dataTypeBuf.MatchF( KCFDMimeTypeAudioVoiceRec2 ) == 0 )
-            {
-            iconIndex = EVoiceRecFileIcon;
-            }
-        else if( dataTypeBuf.MatchF( KCFDMimeTypePlaylist ) == 0 )
-            {
-            iconIndex = EPlaylistFileIcon;
-            }
-        else if( dataTypeBuf.MatchF( KCFDMimeTypeRam ) == 0 )
+        if ( ptrc.MatchF( (*iFileTypeArray)[i].iFileType ) == 0 )
             {
-            iconIndex = ELinkFileIcon;
-            }
-        else if( dataTypeBuf.MatchF( KCFDMimeTypeAudio ) == 0 )
-            {
-            iconIndex = ESoundFileIcon;
-            }
-        else if( dataTypeBuf.MatchF( KCFDMimeTypeImageGms ) == 0 )
-            {
-            iconIndex = EGmsFileIcon;
-            }
-        else if( dataTypeBuf.MatchF( KCFDMimeTypeImage ) == 0 )
-            {
-            iconIndex = EImageFileIcon;
-            }
-        else if( dataTypeBuf.MatchF( KCFDMimeTypeVideo ) == 0 ||
-                 dataTypeBuf.MatchF( KCFDMimeTypeVideoRealMedia ) == 0 ||
-                 dataTypeBuf.MatchF( KCFDMimeTypeVideoSdp ) == 0 )
-            {
-            iconIndex = EVideoFileIcon;
+            return (*iFileTypeArray)[i].iIconIndex;
             }
-        else if( dataTypeBuf.MatchF( KCFDMimeTypeGame ) == 0 )
-            {
-            iconIndex = EGameFileIcon;
-            }
-        else if( dataTypeBuf.MatchF( KCFDMimeTypeJava ) == 0
-                || dataTypeBuf.MatchF( KCFDMimeTypeJad ) == 0 )
-            {
-            iconIndex = EAppFileIcon;
-            }
-        else if ( dataTypeBuf.MatchF( KCFDMimeTypeFlash ) == 0 )
-            {
-            iconIndex = EFlashFileIcon;
-            }
-        else if ( dataTypeBuf.MatchF( KCFDMimeTypeZip ) == 0 )
-            {
-            iconIndex = EAppFileIcon;
-            }
-        else if ( dataTypeBuf.MatchF( KCFDMimeTypePdf ) == 0
-                || dataTypeBuf.MatchF( KCFDMimeTypeDoc ) == 0
-                || dataTypeBuf.MatchF( KCFDMimeTypePpt ) == 0
-                || dataTypeBuf.MatchF( KCFDMimeTypeXls ) == 0
-                || dataTypeBuf.MatchF( KCFDMimeTypeNote ) == 0 )
-            {
-            iconIndex = ENoteFileIcon;
-            }
-        else
-            {
-            // Check from the file name extension, if it's a SIS file:
-            //TParse fileName;
-            //fileName.Set( aFileName, NULL, NULL );
-
-            HBufC * bufFileName = aFileName.AllocLC();
-            TPtr ptrFileName = bufFileName->Des();
-            TParsePtr fileName(ptrFileName);
-
-            TPtrC ext( fileName.Ext() );
-            if( ext.CompareF( KCFDFileExtSis ) == 0
-                || ext.CompareF( KCFDFileExtSisx ) == 0 )
-                {
-                iconIndex = EAppFileIcon;
-                }
-            // RApaLsSession does not recognize .mid's:
-            else if( ext.CompareF( KCFDFileExtMid ) == 0 )
-                {
-                iconIndex = ESoundFileIcon;
-                }
-            else
-                {
-                iconIndex = EUnknowTypeIcon;
-                }
-            CleanupStack::PopAndDestroy(); //bufFileName
-
-            }
-
-        CleanupStack::PopAndDestroy(); //bufDataTypeBuf
         }
-    iImageIndexArray.Append( iconIndex );
+    return EUnknowTypeIcon;
     }
 
 TPtrC CAknFileSelectionModel::GetLocalizedName(const TDesC& aFileName)
@@ -781,7 +651,7 @@
     TParsePtrC parsedEntry( aFileName );
     TPtrC fileName( parsedEntry.NameAndExt() );
 
-    TPtr itemWithImageIndex = iItemWithImageIndex->Des();
+    TPtr itemWithImageIndex = iStringBuf->Des();
     
     itemWithImageIndex = iCurrentPath.DriveAndPath();
     itemWithImageIndex.Append( aFileName);
@@ -795,30 +665,4 @@
     return fileName;
     }
 
-// -----------------------------------------------------------------------------
-// CAknFileSelectionModel::ContainsFiles
-//
-// -----------------------------------------------------------------------------
-//
-TBool CAknFileSelectionModel::ContainsFiles( const TDesC& aFolder )
-    {
-    TPath directory( iCurrentPath.DriveAndPath() );
-    directory.Append( aFolder );
-    AknCFDUtility::AddTrailingBackslash( directory ); // ignore error
-    
-    RDir dir;
-    TBool ret( EFalse );
-    if ( dir.Open(
-        iFs, directory, KEntryAttNormal ) != KErrNone )
-        {
-        return EFalse;
-        }
-    TEntry entry;
-    if ( dir.Read( entry ) == KErrNone )
-        {
-        ret = ETrue;
-        }
-    dir.Close();
-    return ret;
-    }
 //  End of File
--- a/commonuis/CommonDialogs/src/CAknFileSelectionModel.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/commonuis/CommonDialogs/src/CAknFileSelectionModel.h	Mon Jun 21 15:57:43 2010 +0300
@@ -29,7 +29,8 @@
 class MAknFileFilter;
 class MAknFileSelectionObserver;
 class CDirectoryLocalizer;
-
+class TResourceReader;
+class TCFDFileTypes;
 
 /**
  *  A model class for file selection dialog. It is derived from
@@ -43,34 +44,7 @@
     {
 
 public:
-
-// Enumerations
-
-    /**
-     * Enumerations for images.
-     */
-    enum TFileTypeIcon
-        {
-        EFolderIcon,
-        EFileIcon,
-        ESubFolderIcon,
-        EThisFolderIcon,
-        EImageFileIcon,
-        EGmsFileIcon,
-        ELinkFileIcon,
-        EVoiceRecFileIcon,
-        ESoundFileIcon,
-        EPlaylistFileIcon,
-        ECompoFileIcon,
-        ENoteFileIcon,
-        EAppFileIcon,
-        EVideoFileIcon,
-        EGameFileIcon,
-        EUnknowTypeIcon,
-        EFolderEmptyIcon,
-        EFlashFileIcon
-        };
-
+    
 // Constructors and destructor
 
     /**
@@ -185,23 +159,47 @@
     CDir* ReadDirectory( const TDesC& aDirectory );
 
     /**
-     * Returns ETrue if a folder contains subfolders.
+     * Test if a folder contains subfolders.
      * @param aFolder Relative folder to current path.
      * @return Returns ETrue if a folder contains subfolders.
      */
     TBool ContainsSubfolders( const TDesC& aFolder );
-
-    void AppendIconForFileL(const TDesC& aFileName);
-
-    TPtrC GetLocalizedName(const TDesC& aFileName);
     
     /**
-     * Returns ETrue if a folder contains files.
+     * Test if a folder contains files.
      * @param aFolder Relative folder to current path.
      * @return Returns ETrue if a folder contains files.
      */
     TBool ContainsFiles( const TDesC& aFolder );
-
+    /**
+     * Test if a folder contains contents.
+     * @param aFolder Relative folder to current path.
+     * @return Returns ETrue if a folder contains contents.
+     */
+    TBool ContainsContents( const TDesC& aFolder, TUint aAttMask );
+    /**
+     * Get the file type icon.
+     * @param aFileName File name to get right icon.
+     * return Return incon index base on the extname of file.
+     */
+    TInt GetIconForFileL( const TDesC& aFileName ) const;
+    /**
+     * Get the file local name.
+     * @param aFileName File name to get its locallize name.
+     * @return Returns file's local name.
+     */
+    TPtrC GetLocalizedName(const TDesC& aFileName);
+    /**
+     * Test if a entry can be added in listbox.
+     * @param aEntry The entry which be added or not.
+     * @return Returns ETrue if a entry can be added.
+     */
+    TBool EntryIsAccepted( const TEntry& aEntry ) const;
+    /**
+     * Read file type and icon index from reader
+     * @param aReader Reader object
+     */
+    void ReadFileExtNameAndIconIndexL( TResourceReader& aReader );
 // Constructors and destructor
 
     void ConstructL();
@@ -216,9 +214,21 @@
 
     // Own: An array of filtered directory entries.
     CArrayPakFlat<TEntry>* iEntryArray;
-
-    // Own: An array for image indices
-    RArray<TInt> iImageIndexArray;
+    
+    /* Own: An array which item has local name of file entry 
+     * with icon index and entry index in iEntryArray
+     * */
+    CDesC16ArraySeg * iLocalFileNameArray;
+    
+    /* Own: An array which item has local name of directory entry 
+     * with icon index and entry index in iEntryArray
+     * */
+    CDesC16ArraySeg * iLocalDirNameArray;
+    
+    /* Own: An array which item has extent name of file entry 
+     * with icon index for the file type
+     * */
+    CArrayFixFlat<TCFDFileTypes>* iFileTypeArray;
 
     // Own: // An array of filters.
     CArrayPtrSeg<MAknFileFilter>* iFilterArray;
@@ -241,14 +251,9 @@
     // Own: Root folder text
     HBufC* iRootFolderText;
 
-    // Own: RApaLsSession for getting mime-types for files:
-    RApaLsSession iApaSession;
-
-    TEntry iFolderEntry;
-
     TParse iParse;
-
-    HBufC * iItemWithImageIndex;
+    // Own: A buffer for using
+    HBufC * iStringBuf;
 
     };
 
--- a/commonuis/CommonUi/src/FindItemDialog.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/commonuis/CommonUi/src/FindItemDialog.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -2440,8 +2440,12 @@
 
     if ( found && iEdwin && iEdwin->TextView() )
         {
-        iEdwin->TextView()->SetSelectionVisibilityL( ETrue );
-        iEdwin->SetSelectionL( item.iStartPos, item.iStartPos + item.iLength );
+        TRAPD( err, iEdwin->TextView()->SetSelectionVisibilityL( ETrue ) );
+        if ( KErrNone == err )
+            {
+            //When set selection leaves, we can't highlight the item, so just ignore this leave.
+            TRAP_IGNORE( iEdwin->SetSelectionL( item.iStartPos, item.iStartPos + item.iLength ) );
+            }
         }
     }
 
--- a/psln/Src/PslnGeneralThemeView.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/psln/Src/PslnGeneralThemeView.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -597,8 +597,11 @@
 //
 void CPslnGeneralThemeView::HightlightDefaultSkin()
     {
-    CPslnGeneralThemeContainer* container = static_cast<CPslnGeneralThemeContainer*>(iContainer);
-    TInt modifier = container->IsEmbeddedLinkVisible( );
-    container->SetCurrentItemIndex( modifier );
+    if ( iContainer )
+        {
+        CPslnGeneralThemeContainer* container = static_cast<CPslnGeneralThemeContainer*>(iContainer);
+        TInt modifier = container->IsEmbeddedLinkVisible( );
+        container->SetCurrentItemIndex( modifier );
+        }
     }
 //  End of File
--- a/psln/Src/PslnSoundActivator.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/psln/Src/PslnSoundActivator.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -129,7 +129,7 @@
                 TPslnSoundActivatorEntry entry;
                 entry.iFullName = fullNamePtr;
                 entry.iID = KPslnSoundItems[i];
-                iSoundArray.Append( entry );
+                iSoundArray.AppendL( entry );
                 }
 
             CleanupStack::PopAndDestroy( 2, data ); // data, fullName
--- a/psln/pslnengine/src/PslnSkinStore.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/psln/pslnengine/src/PslnSkinStore.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -184,7 +184,7 @@
             {
             // Default skin found.
             iSkinArray.Remove( i );
-            iSkinArray.Insert( entry, 0 );
+            iSkinArray.InsertL( entry, 0 );
             entry = NULL; // this is not owned by us.
             break;
             }
--- a/uifw/AknGlobalUI/AknNfySrv/inc/AknNfySrv.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AknGlobalUI/AknNfySrv/inc/AknNfySrv.h	Mon Jun 21 15:57:43 2010 +0300
@@ -57,7 +57,7 @@
     
         RPointerArray<CAknNotifierEntry> iNotifierArray;
         RPointerArray<CAknNotifLibraryEntry> iLibraryArray;
-        CIdle* iLibraryRemover;
+        CPeriodic* iLibraryRemover;
     
     private: // from MNotifLibraryOwningServer
         void UnbalanceReferenceCount(TUid aUid, TBool aAddCount);
--- a/uifw/AknGlobalUI/AknNfySrv/src/AknNfySrv.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AknGlobalUI/AknNfySrv/src/AknNfySrv.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -20,7 +20,7 @@
 #include "AknNfySrv.h"
 
 const TUid KDllUid = {0x10000079};
-
+const TInt KCheckInterval = 1000000 / 64;
     
 class CAknNotifierEntry: public CBase
     {
@@ -65,6 +65,7 @@
             if (me->iLibraryArray[ii]->iNestingLevel >= CActiveScheduler::Current()->StackDepth())
                 {
                 me->DoUnload(me->iLibraryArray[ii]->iLibraryName->Des());
+                me->iLibraryRemover->Cancel();
                 }
             else
                 {
@@ -111,7 +112,7 @@
     {
     if (!iLibraryRemover)
         {
-        iLibraryRemover = CIdle::NewL(CActive::EPriorityIdle); // there is no hurry
+        iLibraryRemover = CPeriodic::NewL(CActive::EPriorityIdle); // there is no hurry
         }
     else if (iLibraryRemover->IsActive())
         {
@@ -291,7 +292,7 @@
                         {                            
                         if (!iLibraryRemover->IsActive())
                             {
-                            iLibraryRemover->Start(TCallBack(CheckUnusedLibraries, this));
+                            iLibraryRemover->Start(0, KCheckInterval, TCallBack(CheckUnusedLibraries, this));
                             }
                         }
                     }
--- a/uifw/AknGlobalUI/OldStyleNotif/Src/AknNotifyPlugin.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AknGlobalUI/OldStyleNotif/Src/AknNotifyPlugin.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -52,7 +52,7 @@
                 
             if (!err)                
                 {
-                iArray.Append(aId);
+                err = iArray.Append(aId);
                 }
             }
             
--- a/uifw/AknGlobalUI/OldStyleNotif/Src/aknkeylocknotifier.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AknGlobalUI/OldStyleNotif/Src/aknkeylocknotifier.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -50,7 +50,7 @@
 #include <ctsydomainpskeys.h>
 #include <bafindf.h>
 #include "AknNotifyPlugin.hrh"
-
+#include "akntrace.h"
 
 
 #ifdef _DEBUG
@@ -243,6 +243,8 @@
 //
 TInt CAknKeylockScreenSaverObserver::Start()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( IsActive() )
         {
         return KErrInUse;
@@ -250,7 +252,9 @@
     iStatus = KRequestPending;
     iScreenSaverActiveProperty.Subscribe( iStatus );
     SetActive();
-
+    
+    _AKNTRACE_FUNC_EXIT;
+    
     return KErrNone;
     }
 
@@ -261,12 +265,16 @@
 //
 void CAknKeylockScreenSaverObserver::Stop()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( !IsActive() )
         {
         return;
         }
     Cancel();
     iScreenSaverActiveProperty.Cancel();
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -293,6 +301,8 @@
 //
 void CAknKeylockScreenSaverObserver::ConstructL()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     // Add this active object to the scheduler.
     CActiveScheduler::Add( this );
     User::LeaveIfError( iScreenSaverActiveProperty.Attach( KPSUidScreenSaver,
@@ -313,6 +323,8 @@
         delete iDevicelockPolicyApi;
         iDevicelockPolicyApi = NULL;
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -323,6 +335,8 @@
 //
 void CAknKeylockScreenSaverObserver::RunL()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( iKeylockEnabled || iAutolockEnabled )
         {
         // Resubscribe before processing new value to prevent missing updates.
@@ -349,6 +363,8 @@
             }
         iScreenSaverActive = EFalse;
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -359,6 +375,8 @@
 void CAknKeylockScreenSaverObserver::SetLockStatus( TBool aKeylockEnabled,
                                                     TBool aAutolockEnabled )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     iKeylockEnabled  = aKeylockEnabled;
     iAutolockEnabled = aAutolockEnabled;
 
@@ -376,6 +394,8 @@
         // Screensaver is only observed when keylock is enabled.
         Stop();
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -385,6 +405,8 @@
 //
 void CAknKeylockScreenSaverObserver::CapturePrimaryKeys( TBool aCapture )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( aCapture )
         {
         if ( iScreenSaverActive && !iCaptured )
@@ -410,8 +432,10 @@
                                                                  primaryKey,
                                                                  secondaryKey ) == KErrNone )
                         {
-                        iPrimaryKeyCaptures.Append(
-                            iWindowGroup.CaptureKeyUpAndDowns( primaryKey, 0, 0 ) );
+                        if (KErrNone != iPrimaryKeyCaptures.Append(iWindowGroup.CaptureKeyUpAndDowns(primaryKey, 0, 0)))
+                            {
+                            return;
+                            }
                         index++;
                         }
                     }
@@ -437,8 +461,10 @@
                         TUint32 secondaryKey( 0 );
                         while ( iDevicelockPolicyApi->GetKeyCombination( index, primaryKey, secondaryKey ) == KErrNone )
                             {
-                            iPrimaryKeyCaptures.Append(
-                                iWindowGroup.CaptureKeyUpAndDowns( primaryKey, 0, 0 ) );
+                            if (KErrNone != iPrimaryKeyCaptures.Append(iWindowGroup.CaptureKeyUpAndDowns(primaryKey, 0, 0)))
+                                {
+                                return;
+                                }
                             index++;
                             }
                         }
@@ -468,6 +494,8 @@
             iCaptured = EFalse;
             }
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -478,7 +506,11 @@
 //
 void CAknKeylockScreenSaverObserver::DoCancel()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     iScreenSaverActiveProperty.Cancel();
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -506,11 +538,16 @@
 //
 TBool CAknLockedNote::OkToExitL( TInt aCommand )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     iLocked = EFalse;
     if ( iCommandObserver )
         {
         iCommandObserver->ProcessCommandL( aCommand );
         }
+    
+    _AKNTRACE_FUNC_EXIT;
+    
     return ETrue;
     }
 
@@ -532,12 +569,16 @@
 //
 void CAknLockedNote::CancelNote()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( iTimer )
         {
         iTimer->Cancel();
         }
     ExitSleepingDialog();
     iLocked = EFalse;
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -548,10 +589,14 @@
 //
 void CAknLockedNote::FocusChanged( TDrawNow /*aDrawNow*/ )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( !IsFocused() && iCommandObserver )
         {
         TRAP_IGNORE( iCommandObserver->ProcessCommandL( KNoteCmdFocusLost ) )
         }
+  
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -632,9 +677,14 @@
 //
 TInt CAknSleepingNote::ShowNote( const TInt aTimeout, const TTone aTone )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     TRAP_IGNORE(AknGlobalPopupPriorityController::SetPopupPriorityL( *this, KGlobalWindowPriority_KeyLock ));
     iTimeoutInMicroseconds = aTimeout;
     iTone = aTone;
+    
+    _AKNTRACE_FUNC_EXIT;
+    
     return RouseSleepingDialog();
     }
 
@@ -646,10 +696,15 @@
 //
 TBool CAknSleepingNote::OkToExitL( TInt aCommand )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( iCommandObserver )
         {
         iCommandObserver->ProcessCommandL( aCommand );
         }
+
+    _AKNTRACE_FUNC_EXIT;
+
     return ETrue;
     }
 
@@ -661,6 +716,8 @@
 //
 void CAknSleepingNote::HandleResourceChange( TInt aType )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( aType == KAknsMessageSkinChange )
         {
         TInt animationRes( 0 );
@@ -714,6 +771,8 @@
         }
 
     CAknNoteDialog::HandleResourceChange( aType );
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -806,6 +865,8 @@
 //
 void CAknEcsNote::SetEmergencyNumber( const TDesC& aMatchedNumber )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     TRect mainPane;
     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EPopupParent,
                                        mainPane );
@@ -869,6 +930,8 @@
 
     number.Append( aMatchedNumber );
     TRAP_IGNORE( SetTextL( number ) );
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -878,12 +941,16 @@
 //
 void CAknEcsNote::SleepNote()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( iNoteOnScreen )
         {
         // Causes flicker to other notes if called when note is not on screen.
         ExitSleepingDialog();
         }
     iNoteOnScreen = EFalse;
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -910,7 +977,11 @@
 CAknKeyLockControl::CAknKeyLockControl( CAknKeyLockNotifierSubject* aNotif ) :
     iNotif( aNotif )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     AKNTASHOOK_ADD( this, "CAknKeyLockControl" );
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -920,6 +991,8 @@
 //
 CAknKeyLockControl::~CAknKeyLockControl()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     AKNTASHOOK_REMOVE();
     // We implicitely trust that Eikon env exists
     // (though in practice it does not make the
@@ -945,6 +1018,8 @@
     delete iEcsNote; // Ecs change
     delete iKeylockApi;
     delete iKeylockScreenSaverObserver;
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -954,7 +1029,7 @@
 //
 void CAknKeyLockControl::ConstructL()
     {
-    TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::ConstructL ")); )
+    _AKNTRACE_FUNC_ENTER;
 
     FeatureManager::InitializeLibL();
     iFeatureKeypadNoSlider =
@@ -1120,6 +1195,8 @@
 
     iStatusProperty.Attach( KPSUidAvkonDomain, KAknKeyguardStatus );
     iStatusProperty.Set( EKeyguardNotActive );
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1129,8 +1206,10 @@
 //
 void CAknKeyLockControl::EnableKeylock( TBool aShowNote, TBool aNotifySysApp )
     {
-    TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::EnableKeylock %d"), aShowNote); )
-
+    _AKNTRACE_FUNC_ENTER;
+    _AKNTRACE("aShowNote:%d",aShowNote);
+    _AKNTRACE("aNotifySysApp:%d",aNotifySysApp);
+    
     // Policy can be used to disable support for keyguard.
     if ( !iAutolockEnabled && !CKeyLockPolicyApi::KeyguardAllowed() )
         {
@@ -1255,6 +1334,8 @@
     // leave, but we trap it in just in case.
     TRAP_IGNORE( static_cast<CAknCapAppServerAppUi*>( iEikonEnv->EikAppUi() )->HandleResourceChangeL(
             KAknInternalFSWClose ); );
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1264,7 +1345,8 @@
 //
 void CAknKeyLockControl::DisableKeylock(TBool aNotifySysApp)
     {
-    TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::DisableKeylock")); )
+    _AKNTRACE_FUNC_ENTER;
+    _AKNTRACE("aShowNote:%d",aNotifySysApp);
 
     // Keep locking status in sync.
     iKeylockScreenSaverObserver->SetLockStatus( EFalse, iAutolockEnabled );
@@ -1342,6 +1424,8 @@
         iEikonEnv->EikAppUi() )->SuppressAppSwitching( EFalse );
 
     iAutolockEnabled = EFalse;
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1351,6 +1435,8 @@
 //
 void CAknKeyLockControl::SendMessageToSysAp( TInt aMessage )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     RWsSession& ws = iEikonEnv->WsSession();
     TInt wgId = 0;
     CApaWindowGroupName::FindByAppUid( KSysApUid, ws, wgId );
@@ -1361,6 +1447,8 @@
         event.SetTimeNow();
         ws.SendEventToWindowGroup( wgId, event );
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1370,9 +1458,13 @@
 //
 void CAknKeyLockControl::OfferKeylock()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     iOfferLockNote->ShowNote( (CAknNoteDialog::TTimeout)KAknOfferKeyLockTimeout,
                               CAknNoteDialog::ENoTone );
     iOfferLockEnabled = ETrue;
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1406,8 +1498,12 @@
 //
 void CAknKeyLockControl::DoUnlock()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     DisableKeylock();
     DisplayKeyActiveNote();
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1418,6 +1514,9 @@
 //
 void CAknKeyLockControl::HandleResourceChange( TInt aType )
     {
+    _AKNTRACE_FUNC_ENTER;
+    _AKNTRACE("aType:%d",aType);
+
     if ( aType == KEikDynamicLayoutVariantSwitch )
         {
         TRect screenRect;
@@ -1440,6 +1539,8 @@
                 }
             }
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1450,7 +1551,8 @@
 //
 void CAknKeyLockControl::ProcessCommandL( TInt aCommandId )
     {
-    TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::ProcessCommandL %d"), aCommandId); )
+    _AKNTRACE_FUNC_ENTER;
+    _AKNTRACE("aCommandId:%d",aCommandId);
 
     switch ( aCommandId )
         {
@@ -1511,6 +1613,8 @@
             break;
             }
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1556,8 +1660,8 @@
 //
 void CAknKeyLockControl::LeftSoftKeyPressed()
     {
-    TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::LeftSoftKeyPressed")); )
-
+    _AKNTRACE_FUNC_ENTER; 
+    
     // Check that the confirmation note exists, as it's not created on
     // startup if touch layout is in use. In emulator this might cause
     // a problem, as layout can be changed to a non-touch one, and
@@ -1580,6 +1684,8 @@
         SendMessageToSysAp( EEikKeyLockLightsOnRequest );
         iUnlockConfirmation = ETrue;
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1591,15 +1697,17 @@
 TKeyResponse CAknKeyLockControl::OfferKeyEventL( const TKeyEvent& aKeyEvent,
                                                  TEventCode aType )
     {
+    _AKNTRACE_FUNC_ENTER; 
+    
     if ( AknLayoutUtils::PenEnabled() )
         {
-        TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::OfferKeyEventL: PenEnabled"));)
+        _AKNTRACE("(KeyGuard)CAknKeyLockControl::OfferKeyEventL: PenEnabled");
         if ( iAutolockEnabled )
             { // The case when touch device is locked and so must be unlocked by hold switch.
-            TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::OfferKeyEventL: Autolock Enabled"));)
+            _AKNTRACE("(KeyGuard)CAknKeyLockControl::OfferKeyEventL: Autolock Enabled");
             if ( aType == EEventKey && aKeyEvent.iCode == EKeyDeviceF )
                 {
-                TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::OfferKeyEventL: SysAp message"));)
+                _AKNTRACE("(KeyGuard)CAknKeyLockControl::OfferKeyEventL: SysAp message");
                 SendMessageToSysAp( EEikKeyLockLightsOnRequest );
                 if ( iAutolockEnabled && !iKeylockApi )
                     {
@@ -1615,7 +1723,7 @@
                         autolocktask.SendKey( keyEvent );
                         }
                     }
-                TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::OfferKeyEventL: return EKeyWasConsumed"));)
+                _AKNTRACE_FUNC_EXIT;
                 return EKeyWasConsumed;
                 }
             }
@@ -1820,7 +1928,7 @@
             ShowLockedNote();
             }
         }
-
+    _AKNTRACE_FUNC_EXIT;
     return EKeyWasConsumed;
     }
 
@@ -1831,10 +1939,14 @@
 //
 void CAknKeyLockControl::ShowLockedNote()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( !iLockedNoteDisplayed )
         {
         DoShowLockedNote();
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1856,11 +1968,15 @@
 //
 void CAknKeyLockControl::ShowKeylockCba()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     RDrawableWindow* cbaWindow =
         iKeyLockCba->ButtonGroup()->AsControl()->DrawableWindow();
     cbaWindow->SetFaded( EFalse, RWindowTreeNode::EFadeWindowOnly );
     cbaWindow->SetOrdinalPosition( 0, 1 );
     cbaWindow->SetNonFading( ETrue );
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1870,6 +1986,8 @@
 //
 void CAknKeyLockControl::CaptureSystemKeys()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( !iKeysCaptured )
         {
         RWindowGroup& groupWin = iCoeEnv->RootWin();
@@ -1897,15 +2015,17 @@
 
         if ( AknLayoutUtils::PenEnabled() )
             {
-            TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::CaptureSystemKeys PenEnabled"));)
+             _AKNTRACE("(KeyGuard)CAknKeyLockControl::CaptureSystemKeys PenEnabled");
             if ( iAutolockEnabled )
                 { //Capture Hold Switch
-                TRACES( RDebug::Print(_L("(KeyGuard)CAknKeyLockControl::CaptureSystemKeys iAutolockEnabled"));)
+             _AKNTRACE("(KeyGuard)CAknKeyLockControl::CaptureSystemKeys iAutolockEnabled");
                 iHoldSwitch = groupWin.CaptureKey( EKeyDeviceF, 0, 0 );
                 }
             }
         iKeysCaptured = ETrue;
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1915,6 +2035,8 @@
 //
 void CAknKeyLockControl::UnCaptureSystemKeys()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( iKeysCaptured )
         {
         RWindowGroup& groupWin = iCoeEnv->RootWin();
@@ -1935,6 +2057,8 @@
 
         iKeysCaptured = EFalse;
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1946,6 +2070,8 @@
 void CAknKeyLockControl::HandleEcsEvent( CAknEcsDetector* aEcsDetector,
                                          CAknEcsDetector::TState aState )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     switch ( aState )
         {
         case CAknEcsDetector::ECompleteMatchThenSendKey:
@@ -1990,6 +2116,8 @@
             break;
             }
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -1999,7 +2127,11 @@
 //
 void CAknKeyLockControl::DoExitOfferKeylock()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     iOfferLockNote->CancelNote();
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2009,7 +2141,11 @@
 //
 void CAknKeyLockControl::OfferTimerExpired()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     DoExitOfferKeylock();
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2019,7 +2155,11 @@
 //
 void CAknKeyLockControl::AutolockEnabled( TBool aAutoLockOn )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     iAutolockEnabled = aAutoLockOn;
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2047,11 +2187,15 @@
 //
 void CAknKeyLockControl::CapturePointerEvents()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( AknLayoutUtils::PenEnabled() )
         {
         Window().SetPointerCapture( RWindowBase::TCaptureDragDrop );
         Window().ClaimPointerGrab( ETrue );
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2061,20 +2205,30 @@
 //
 void CAknKeyLockControl::UnCapturePointerEvents()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( AknLayoutUtils::PenEnabled() )
         {
         Window().SetPointerCapture( RWindowBase::TCaptureDisabled );
         Window().ClaimPointerGrab( EFalse );
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 TBool CAknKeyLockControl::HasSliderKey()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     TBool hasSlider(iHardwareSupport != EKeyguardDefaultHardware);
     if( FeatureManager::FeatureSupported( KFeatureIdFfPowerKeyAsKeyguard ) )
         {
         hasSlider = ETrue;  // the only purpose is to display empty sotkeys
         }
+    
+    _AKNTRACE( "hasSlider:%d",hasSlider);
+    _AKNTRACE_FUNC_EXIT;
+    
     return hasSlider;
     }
 
@@ -2189,6 +2343,8 @@
 //
 TPtrC8 CAknKeyLockNotifierSubject::StartL( const TDesC8& aBuffer )
     {
+    _AKNTRACE_FUNC_ENTER; 
+    
     SAknNotifierPackage<SAknKeyLockNotifierParams>* params =
         ( SAknNotifierPackage<SAknKeyLockNotifierParams>*)aBuffer.Ptr();
 
@@ -2199,6 +2355,8 @@
         User::Leave( KErrArgument );
         }
 
+    _AKNTRACE( "params->iParamData.iReason:%d",params->iParamData.iReason);
+        
     switch ( params->iParamData.iReason )
         {
         case ELockEnabled:
@@ -2224,6 +2382,8 @@
             }
         }
 
+    _AKNTRACE_FUNC_EXIT;
+    
     return iRetPckg;
     }
 
@@ -2237,6 +2397,8 @@
                                          TInt /*aReplySlot*/,
                                          const RMessagePtr2& aMessage )
     {
+    _AKNTRACE_FUNC_ENTER; 
+    
     SAknNotifierPackage<SAknKeyLockNotifierParams>* params =
         ( SAknNotifierPackage<SAknKeyLockNotifierParams>*)aBuffer.Ptr();
 
@@ -2247,6 +2409,8 @@
         User::Leave( KErrArgument );
         }
 
+    _AKNTRACE( "params->iParamData.iReason:%d",params->iParamData.iReason);
+    
     switch ( params->iParamData.iReason )
         {
         case ELockEnabled:
@@ -2330,6 +2494,8 @@
             }
         };
 
+    _AKNTRACE_FUNC_EXIT;
+    
     aMessage.Complete( KErrNone );
     }
 
@@ -2384,10 +2550,14 @@
 //
 void CAknKeyLockNotifierSubject::UnlockKeys()
     {
+    _AKNTRACE_FUNC_ENTER; 
+    
     if ( IsKeyLockEnabled() )
         {
         iKeyLockControl->DisableKeylock();
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2398,6 +2568,9 @@
 //
 void CAknKeyLockNotifierSubject::LockKeys( TBool aAutoLockOn )
     {
+    _AKNTRACE_FUNC_ENTER; 
+    _AKNTRACE( "aAutoLockOn:%d",aAutoLockOn);
+    
     // We'll have to disable keylock if we are changing autolock status.
     if ( IsKeyLockEnabled() && aAutoLockOn != iKeyLockControl->iAutolockEnabled )
         {
@@ -2409,6 +2582,8 @@
         iKeyLockControl->AutolockEnabled( aAutoLockOn );
         iKeyLockControl->EnableKeylock(ETrue, EFalse);
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2419,6 +2594,8 @@
 //
 void CAknKeyLockNotifierSubject::AddObserverL( MAknKeyLockObserver* aObserver )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
 #if defined(_DEBUG)
     TInt count = iObserverList->Count();
     for ( TInt index = 0; index < count; index++ )
@@ -2433,6 +2610,8 @@
 
     // Make sure that the observer isn't obscuring the keylock CBA
     ShowKeylockCba();
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2443,6 +2622,8 @@
 //
 void CAknKeyLockNotifierSubject::RemoveObserver( MAknKeyLockObserver* aObserver )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     TInt count = iObserverList->Count();
     for ( TInt index = 0; index < count; index++ )
         {
@@ -2455,6 +2636,8 @@
 #if defined(_DEBUG)
     Panic( EAknPanicKeyLockObserverNotFound );
 #endif
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2464,11 +2647,16 @@
 //
 void CAknKeyLockNotifierSubject::NotifyStatusChange( TKeyLockStatus aStatus )
     {
+    _AKNTRACE_FUNC_ENTER;
+    _AKNTRACE( "aStatus:%d",aStatus);
+    
     TInt count = iObserverList->Count();
     for ( TInt index = count - 1; index >= 0; index-- )
         {
         ((*iObserverList)[index])->KeyLockStatusChange( aStatus );
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2478,10 +2666,14 @@
 //
 void CAknKeyLockNotifierSubject::ShowKeylockCba()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( IsKeyLockEnabled() )
         {
         iKeyLockControl->ShowKeylockCba();
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2491,10 +2683,14 @@
 //
 void CAknKeyLockNotifierSubject::DoEnableKeyLock()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( !IsKeyLockEnabled() )
         {
         iKeyLockControl->EnableKeylock();
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2504,6 +2700,8 @@
 //
 void CAknKeyLockNotifierSubject::DoDisableKeyLock()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( IsKeyLockEnabled() )
         {
         iKeyLockControl->DisableKeylock();
@@ -2515,6 +2713,8 @@
         // Remove the offer key lock CBA.
         iKeyLockControl->OfferTimerExpired();
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -2524,9 +2724,13 @@
 //
 void CAknKeyLockNotifierSubject::DoOfferKeyLock()
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     if ( !IsKeyLockEnabled() )
         {
         NotifyStatusChange( EKeyLockOffered );
         iKeyLockControl->OfferKeylock();
         }
+    
+    _AKNTRACE_FUNC_EXIT;
     }
--- a/uifw/AknGlobalUI/OldStyleNotif/group/AknOldStyleNotif.mmp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AknGlobalUI/OldStyleNotif/group/AknOldStyleNotif.mmp	Mon Jun 21 15:57:43 2010 +0300
@@ -36,6 +36,7 @@
 USERINCLUDE     ../../CommonInc 
 USERINCLUDE     ../../notpiinc
 USERINCLUDE         ../../../../inc
+USERINCLUDE     ../../../inc
 
 SOURCEPATH      ../Src
 
--- a/uifw/AvKon/akncompamode/srv/src/akncompaserver.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/akncompamode/srv/src/akncompaserver.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -304,7 +304,7 @@
     // This avoid possibility of memory allocation error when key is
     // added to key state array due to key press while application is
     // executing.
-    iKeyState.Reserve(EKeyStateGranularity);
+    iKeyState.ReserveL(EKeyStateGranularity);
     
     Server().AddSession();
     }
--- a/uifw/AvKon/aknhlist/src/akntreelistphysicshandler.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/aknhlist/src/akntreelistphysicshandler.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -446,7 +446,20 @@
                     // are not used in marking mode.
                     SetHighlight();   
                     }
-                }
+                }                      
+            else if ( aPointerEvent.iType == TPointerEvent::EDrag )
+                {
+                if ( iTreeListView->SingleClickEnabled() && !wasFlicking )
+                    {
+                    if ( ii != iTreeListView->FocusedItemIndex() )
+                        {
+                        iItemToBeSelected = NULL;
+                        iTreeListView->EnableHighlight( EFalse );
+                        iTreeListView->CancelLongTapDetectorL();
+                        iTreeListView->DrawNow();
+                        }
+                    }     
+                } 
             (*iItems)[ii].HandlePointerEventL( aPointerEvent, aViewLevel,
                 iTreeListView->Indention(), iTreeListView->IndentionWidth() );
             }
--- a/uifw/AvKon/aknhlist/src/akntreelistview.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/aknhlist/src/akntreelistview.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -876,6 +876,22 @@
                         {
                         SetFocusedItem( focusedItem, index, ETrue );
                         }
+                    else
+                        {
+                        // This block moves visible view after layout switch
+                        // if there are not enough items to fill whole screen
+                        TInt visibleItemIndex = iTree.VisibleItemIndex( focusedItem );
+                        if ( visibleItemIndex != KErrNotFound )
+                            {
+                            TInt visibleItemCount( iTree.VisibleItemCount() );
+                            TInt itemCountLimit = iItems.Count();
+                            if ( visibleItemCount <= itemCountLimit - KAdditionalItems )
+                                {
+                                UpdateVisibleItems( visibleItemIndex, focusedItem );
+                                }
+                            }
+                        }
+
                     }
                 else
                     {
@@ -899,9 +915,8 @@
                             if ( height < itemCountLimit &&
                                  height < visibleItemCount )
                                 {
-                                TInt move = itemCountLimit - height;                
-                                UpdateVisibleItems(
-                                    focusedItemIndex + move, focusedItem );
+                                TInt move = itemCountLimit - height;
+                                UpdateVisibleItems( focusedItemIndex + move, focusedItem );
                                 }
                             }
                         }
@@ -2036,7 +2051,10 @@
             // This should not fail, if enough space was reserved for the
             // array, and if it fails, it results only fewer items being
             // shown in the list.
-            iItems.Append( TAknTreeListViewItem() );
+			if ( KErrNone != iItems.Append( TAknTreeListViewItem() ) )
+				{
+				return;
+				}
             }
         }
 
@@ -2050,11 +2068,19 @@
         iterator.Previous();
         }
     if ( iFlags.IsSet( EFlagMarkingMode ) )    
-
         {
-        itemRect.iBr.iX -= 
-                AknLayoutScalable_Avkon::list_double_graphic_pane_t1( 
-                        0 ).LayoutLine().il;
+        if ( iFlags.IsSet( EFlagMirroredLayoutInUse ))
+            {
+            itemRect.iBr.iX -= 
+                    AknLayoutScalable_Avkon::list_double_graphic_pane_t1( 
+                            0 ).LayoutLine().ir;        
+            }
+        else
+            {
+            itemRect.iBr.iX -= 
+                    AknLayoutScalable_Avkon::list_double_graphic_pane_t1( 
+                            0 ).LayoutLine().il;
+            }
         }
 
     // Update items and their rectangles.
@@ -2844,9 +2870,22 @@
     CWindowGc& gc = SystemGc();
 #endif
 
-    TInt checkBoxOffset = 
-            AknLayoutScalable_Avkon::list_double_graphic_pane_t1( 
-                    0 ).LayoutLine().il;                                         
+    TInt checkBoxOffset ( 0 );
+    if ( iFlags.IsSet( EFlagMarkingMode ) )
+        {
+        if ( iFlags.IsSet( EFlagMirroredLayoutInUse ) )
+            {   
+            checkBoxOffset = 
+                    AknLayoutScalable_Avkon::list_double_graphic_pane_t1( 
+                            0 ).LayoutLine().ir;                                         
+            }
+        else
+            {
+            checkBoxOffset =           
+                    AknLayoutScalable_Avkon::list_double_graphic_pane_t1( 
+                            0 ).LayoutLine().il;                                         
+            }
+        }
 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
     MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal( &gc );
     if ( !empty && transApi )
@@ -2982,46 +3021,13 @@
                     }
 #endif
 
-                if ( iFlags.IsSet( EFlagMarkingMode ) && iMarkingIconArray 
-                        && iMarkingIconArray->Count() == 
-                                KMarkingModeIconArraySize )
-                    {
-                    // Rect for the marking icon
-                    TRect iconRect = RectFromLayout( drawRect,
-                        AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 ) );
-            
-                    iconRect.Move( 0, -offset );
-                    // unchecked icon
-                    CGulIcon* icon = ( *iMarkingIconArray )[1];                    
-
-                    TBool marked = ( iItems[ii].Item()->IsMarked() );
-                    if ( marked )
-                        {
-                        icon = (*iMarkingIconArray)[0];
-                        }
-
-                    CFbsBitmap* bitmap = icon->Bitmap();
-
-                    if ( bitmap )
-                        {
-                        gc.BitBltMasked( iconRect.iTl, bitmap, 
-                            iconRect.Size(), icon->Mask(), EFalse );
-                       }
-                    }
-
                 if ( iItems[ii].Item() != iBottomItem )
                     {
                     TRect offsetRect( drawRect );
                     offsetRect.Move( 0, -offset );
                     AknListUtils::DrawSeparator( gc, offsetRect, textColor, skin );
                     }
-
-                if ( iFlags.IsSet( EFlagMarkingMode ) )
-                    {
-                    gc.SetOrigin( TPoint( checkBoxOffset, 0 ) );
-                    drawRect.iBr.iX -= checkBoxOffset;                
-                    }
-
+                
                 TBool focused = ( FocusedItem() &&
                     iItems[ii].Item() == FocusedItem() );
 
@@ -3035,6 +3041,12 @@
                     // Draw highlight for focused item.
                     TRect highlightRect( iItems[ii].HighlightRect(
                         iViewLevel, Indention(), IndentionWidth() ) );
+                     
+                    if ( iFlags.IsSet( EFlagMarkingMode ) )
+                        {
+                        highlightRect.iBr.iX = drawRect.iBr.iX;
+                        highlightRect.iTl.iX = drawRect.iTl.iX;
+                        }
 
 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
                         TRect tfxHighlightRect( highlightRect );
@@ -3073,6 +3085,42 @@
 #endif //RD_UI_TRANSITION_EFFECTS_LIST
                     }
 
+                if ( iFlags.IsSet( EFlagMarkingMode ) && iMarkingIconArray
+                        && iMarkingIconArray->Count() == 
+                                KMarkingModeIconArraySize )
+                    {
+                    // Rect for the marking icon
+                    TRect iconRect = RectFromLayout( drawRect,
+                        AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 ) );
+            
+                    iconRect.Move( 0, -offset );
+                    // unchecked icon
+                    CGulIcon* icon = ( *iMarkingIconArray )[1];                    
+
+                    TBool marked = ( iItems[ii].Item()->IsMarked() );
+                    if ( marked )
+                        {
+                        icon = (*iMarkingIconArray)[0];
+                        }
+
+                    CFbsBitmap* bitmap = icon->Bitmap();
+
+                    if ( bitmap )
+                        {
+                        gc.BitBltMasked( iconRect.iTl, bitmap, 
+                            iconRect.Size(), icon->Mask(), EFalse );
+                       }
+                    }
+                
+                if ( iFlags.IsSet( EFlagMarkingMode ) )
+                    {
+                    drawRect.iBr.iX -= checkBoxOffset;
+                    if ( iFlags.IsClear( EFlagMirroredLayoutInUse ) )
+                        {
+                        gc.SetOrigin( TPoint( checkBoxOffset, 0 ) );
+                        }
+                    }
+
 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
                 if (iItems[ii].Item()) 
                 {
--- a/uifw/AvKon/animdllsrc/AknKeyEventMap.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/animdllsrc/AknKeyEventMap.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -859,7 +859,11 @@
         if ( (*(*iCombos)[i])[2] == aComboCandidate[0] && 
              ((*iCombos)[i])->Count()-2 == aComboCandidate.Count() ) 
             {
-            possibleMatch.Append(i);
+            if (KErrNone != possibleMatch.Append(i))
+                {
+                possibleMatch.Close();
+                return mapValue;
+                }
             __AKNANIMLOGSTRING1("CAknKeyEventMap::GetComboMapping ComboCandidate might hit iCombos[%d]",i);
             }                    
         }
--- a/uifw/AvKon/src/AknCharMap.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/AknCharMap.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -648,75 +648,75 @@
     }
 
 TBool CAknSctPageNavi::CalcNextStep( TUint aKey, TInt& aX, TInt& aY )
-	{
-	TBool landscape = Layout_Meta_Data::IsLandscapeOrientation();
-	TBool mirrored = AknLayoutUtils::LayoutMirrored();
-	TBool emotionEnabled = iExtension->IsEmotionEnabled();
-	TInt scPages = iCharMap->PageCount();
-	
-	aX = 0;
-	aY = 0;
-	TInt xOffset = 0;
-	TInt yOffset = 0;
-	
-	// Simplify key events to two variants
-	switch ( aKey )
-		{
+    {
+    TBool landscape = Layout_Meta_Data::IsLandscapeOrientation();
+    TBool mirrored = AknLayoutUtils::LayoutMirrored();
+    TBool emotionEnabled = iExtension->IsEmotionEnabled();
+    TInt scPages = iCharMap->PageCount();
+    
+    aX = 0;
+    aY = 0;
+    TInt xOffset = 0;
+    TInt yOffset = 0;
+    
+    // Simplify key events to two variants
+    switch ( aKey )
+        {
         case EKeyLeftArrow:
         case '4':
-        	{
-        	xOffset = -1;
-        	}
-        	break;
+            {
+            xOffset = -1;
+            }
+            break;
         case EKeyRightArrow:
         case '6':
-        	{
-        	xOffset = 1;
-        	}
-        	break;
+            {
+            xOffset = 1;
+            }
+            break;
         case EKeyDownArrow:
         case '8':
-        	{
-        	yOffset = 1;
-        	}
-        	break;
+            {
+            yOffset = 1;
+            }
+            break;
         case EKeyUpArrow:
         case '2':
-        	{
-        	yOffset = -1;
-        	}
-        	break;
+            {
+            yOffset = -1;
+            }
+            break;
         default:
-        	break;
-		}
-
-	TInt runtimeIndex = iButtonIndex;
-	if ( !emotionEnabled )
-        {
-	    // SC/Emotion unabled, button regrouped!
+            break;
+        }
+
+    TInt runtimeIndex = iButtonIndex;
+    if ( !emotionEnabled )
+        {
+        // SC/Emotion unabled, button regrouped!
         if ( ( mirrored && iButtonIndex == EAknSctPageNaviPrevPage && xOffset != 1 )
           || ( !mirrored && iButtonIndex == EAknSctPageNaviNextPage && xOffset != -1) )
-        	{
+            {
             runtimeIndex = iExtension->IsShowingEmotion()?EAknSctTableNaviSpecialChar:EAknSctTableNaviEmotion;
-        	}
+            }
         }
     // calculate when moving from PageNavi to grid, the column position
     switch ( runtimeIndex ) 
-    	{
-    	case EAknSctTableNaviExit:
-    		{
-    		aX = 0;
+        {
+        case EAknSctTableNaviExit:
+            {
+            aX = 0;
             if ( ( !mirrored && xOffset == -1 ) || ( mirrored && xOffset == 1 ) )
-            	{
+                {
                 // Grid end
                 aY = iCharMap->ColMax(0);
                 aX = iCharMap->RowMax( aY );
                 return ETrue;
-            	}
+                }
             else if ( mirrored && xOffset == -1 && scPages >= 2 )
-            	{
+                {
                 xOffset = EAknSctPageNaviNextPage;
-            	}
+                }
             else if ( scPages < 2 
                     && ( ( !mirrored && xOffset == 1 ) || ( mirrored && xOffset == -1 ) ) )
                 {
@@ -733,47 +733,47 @@
                     }
                 }
             else
-            	{
+                {
                 xOffset = EAknSctTableNaviExit + xOffset;
-            	}
-    		}
-    		break;
-    	case EAknSctPageNaviPrevPage:
-    		{
-    		aX = mirrored ? iCharMap->MaxCols()-2 : 1;
-    		if ( mirrored && xOffset == -1 )
-    			{
-    		    xOffset = LastButton();
-    			}
-    		else
-    			{
-    		    xOffset = xOffset + EAknSctPageNaviPrevPage;
-    			}
-    		}
-    		break;
-    	case EAknSctPageNaviNextPage:
-    		{
-    		aX = mirrored ? 1 : iCharMap->MaxCols()-2;
-    		if ( mirrored && xOffset == 1 )
-    			{
-    		    xOffset = 0;
-    			}
-    		else if ( !mirrored && xOffset == 1 )
-    			{
-    		    xOffset = LastButton();
-    			}
-    		else
-    			{
-    		    xOffset = EAknSctPageNaviNextPage + xOffset;
-    			}
-    		}
-    		break;
-    	case EAknSctTableNaviSpecialChar:
-    	case EAknSctTableNaviEmotion:
-    		{
-    		aX = iCharMap->MaxCols()-1;
+                }
+            }
+            break;
+        case EAknSctPageNaviPrevPage:
+            {
+            aX = mirrored ? iCharMap->MaxCols()-2 : 1;
+            if ( mirrored && xOffset == -1 )
+                {
+                xOffset = LastButton();
+                }
+            else
+                {
+                xOffset = xOffset + EAknSctPageNaviPrevPage;
+                }
+            }
+            break;
+        case EAknSctPageNaviNextPage:
+            {
+            aX = mirrored ? 1 : iCharMap->MaxCols()-2;
+            if ( mirrored && xOffset == 1 )
+                {
+                xOffset = 0;
+                }
+            else if ( !mirrored && xOffset == 1 )
+                {
+                xOffset = LastButton();
+                }
+            else
+                {
+                xOffset = EAknSctPageNaviNextPage + xOffset;
+                }
+            }
+            break;
+        case EAknSctTableNaviSpecialChar:
+        case EAknSctTableNaviEmotion:
+            {
+            aX = iCharMap->MaxCols()-1;
             if ( ( !mirrored && xOffset == 1 ) || ( mirrored && xOffset == -1 ) )
-            	{
+                {
                 // Grid start
                 aX = 0;
                 aY = iCharMap->ColMin( aX );
@@ -785,37 +785,37 @@
                 xOffset = EAknSctTableNaviExit;
                 }
             else if ( mirrored && xOffset == 1 )
-            	{
+                {
                 xOffset = EAknSctPageNaviPrevPage;
-            	}
+                }
             else
-            	{
+                {
                 xOffset = EAknSctPageNaviNextPage;
-            	}
-    		}
-    		break;
-    	default:
-    		break;
-    	}
+                }
+            }
+            break;
+        default:
+            break;
+        }
     
     if ( yOffset == 1 )
-    	{
+        {
         // DOWN
         aY = iCharMap->ColMin( aX );
         return ETrue;
-    	}
+        }
     else if ( yOffset == -1 )
-    	{
+        {
         // and UP
         aY = iCharMap->ColMax( aX );
         return ETrue;
-    	}
+        }
 
     // Return False means it's internal moving focus within Page Navi
     aX = xOffset;
     aY = 0;
     return EFalse;
-	}
+    }
 
 TBool CAknSctPageNavi::IsNextButton() const
     {
@@ -838,7 +838,9 @@
         CAknSctNaviButton* buttonObj =
             CAknSctNaviButton::NewL(*this, buttonId, oneButtonReader);
         buttonObj->iButtonControl->SetObserver(this); // for handling control events.
-        iButtonArray.Append(buttonObj);
+        CleanupStack::PushL( buttonObj );
+        iButtonArray.AppendL(buttonObj);
+        CleanupStack::Pop( buttonObj );
         CleanupStack::PopAndDestroy(); // oneButtonReader
         }
     iTitle = new (ELeave) CEikLabel;
@@ -982,22 +984,22 @@
     TRect rect;
 
     if ( iExtension )
-    	{
+        {
         emotionEnabled = iExtension->IsEmotionEnabled();
-    	}
+        }
     
     // Prev button
     buttonObj = iButtonArray[1];
     buttonObj->iButtonControl->SetButtonFlags(0);
     TInt col = 0;
     if ( !landScape )
-    	{
+        {
         col = mirrored ? ( !emotionEnabled?4:3 ) : 1;
-    	}
+        }
     else
-    	{
+        {
         col = mirrored ? ( !emotionEnabled?6:5 ) : 1;
-    	}
+        }
     pageButtonLayRect.LayoutRect( Rect(), AknLayoutScalable_Avkon::cell_graphic2_control_pane(cellVar,col) );
     buttonLayRect.LayoutRect( pageButtonLayRect.Rect(), AknLayoutScalable_Avkon::bg_button_pane_cp05(bgVar));
     rect = buttonLayRect.Rect();
@@ -1014,13 +1016,13 @@
     buttonObj = iButtonArray[2];
     buttonObj->iButtonControl->SetButtonFlags(0);
     if ( !landScape )
-    	{
+        {
         col = mirrored ? 1 : ( !emotionEnabled?4:3 );
-    	}
+        }
     else
-    	{
+        {
         col = mirrored ? 1 : ( !emotionEnabled?6:5 );
-    	}
+        }
     pageButtonLayRect.LayoutRect( Rect(), AknLayoutScalable_Avkon::cell_graphic2_control_pane(cellVar,col) );
     buttonLayRect.LayoutRect( pageButtonLayRect.Rect(), AknLayoutScalable_Avkon::bg_button_pane_cp05(bgVar));
     rect = buttonLayRect.Rect();
@@ -1120,7 +1122,7 @@
 
 TBool CAknSctPageNavi::EnterControl(TInt aX, TInt /*aY*/)
     {
-	// Note, the button index is fixed on spite of mirrored case
+    // Note, the button index is fixed on spite of mirrored case
     if (IsVisible())
         {
         if ((aX >= 0) && (aX < iButtonArray.Count()))
@@ -1151,16 +1153,16 @@
 void CAknSctPageNavi::MoveFocus(TBool aInternalMove, TInt aX, TInt aY )
     {
     if ( aInternalMove )
-    	{
+        {
         EnterControl( aX, 0 );
-    	}
+        }
     else
-    	{
+        {
         if (iExtension->EnterControl( aX, aY ) )
             {
             LeaveControl();
             }
-    	}
+        }
     }
 
 TBool CAknSctPageNavi::LeaveControl()
@@ -1174,7 +1176,14 @@
 
 TBool CAknSctPageNavi::ExitWithKey(TInt /*aKeycode*/)
     {
-    return EFalse;
+    if (iButtonArray[iButtonIndex]->iButtonId != EAknSctTableNaviExit)
+        {
+        return EFalse;
+        }
+    else
+        {
+        return ETrue;
+        }
     }
 
 
@@ -1243,14 +1252,14 @@
         CAknSctNaviButton* buttonObj = iButtonArray[index];
         if ( index == EAknSctPageNaviPrevPage 
                || index == EAknSctPageNaviNextPage )
-        	{
+            {
             // No need to display Prev/Next
             if ( iCharMap->PageCount() < 2 )
                 {
                 buttonObj->SetEnabled(EFalse);
                 }
             continue;
-        	}
+            }
         if (iCharMap->TableCount() > 1)
             {
             switch (iCharMap->NextTableCase())
@@ -1291,20 +1300,20 @@
     {
     TBool emotionEnable = iExtension->IsEmotionEnabled();
     if ( emotionEnable )
-    	{
+        {
         return iExtension->IsShowingEmotion()?EAknSctTableNaviSpecialChar:EAknSctTableNaviEmotion;
-    	}
+        }
     else if ( iCharMap->PageCount() < 2 && !emotionEnable )
         {
         // Only one page, must have no SC/Emotion also, left Exit only.
         return EAknSctTableNaviExit;
         }
     else
-    	{
+        {
         // emotion doesn't support, no SC/Emotion icon then
         TBool mirrored = AknLayoutUtils::LayoutMirrored();
         return mirrored ? EAknSctPageNaviPrevPage : EAknSctPageNaviNextPage;
-    	}
+        }
     }
 
 // ----------------------------------------------------------------------------
@@ -1489,7 +1498,9 @@
 
 void CAknCharMapExtension::LoadEmotionTumbnails(const TDesC& aChars)
     {
-    iSmileyModel->LoadStillImagesL(aChars);
+    //If emotion tumbbails can't be load, 
+    // no emotion tumbnail will be dispalyed.
+    TRAP_IGNORE( iSmileyModel->LoadStillImagesL(aChars) );
     }
 
 void CAknCharMapExtension::SetEmotionSize(const TSize& aSize)
@@ -1825,7 +1836,7 @@
     iExtension->iFlags = 0x00;
     iExtension->iFocusHandler = iExtension;
     iExtension->SetCharMapControl(this);
-	
+    
     if ( iExtension->iSingleClickEnabled )
         {
         iExtension->iHighlightVisible = EFalse;
@@ -2343,7 +2354,7 @@
         }
     
     TUint code=aKeyEvent.iCode;
-	
+    
     // First key event enables the highlight
     if ( iExtension->iSingleClickEnabled && !iExtension->iHighlightVisible )
         {
@@ -2375,10 +2386,10 @@
                             {
                             TInt maxButt = iExtension->iPageNavi->LastButton();
                             if ( iExtension->iPageNavi->EnterControl( maxButt,0 ) )
-                            	{
+                                {
                                 LeaveControl();
                                 break;
-                            	}
+                                }
                             }
                         }
                     }
@@ -2459,13 +2470,13 @@
                             {
                             // a bit complex as unable-emotion SCT has no SC/Emotion icon
                             if ( iExtension->IsEmotionEnabled() )
-                            	{
+                                {
                                 aX = iIsMirrored? 1 : 2;
-                            	}
+                                }
                             else
-                            	{
+                                {
                                 aX = -1;
-                            	}
+                                }
                             }
                         else if (iCursorPos.iX == 1 )  
                             {
@@ -2477,9 +2488,9 @@
                             aX = 0;
                             }
                         else
-                        	{
+                            {
                             aX = -1;
-                        	}
+                            }
                         if ( iExtension->iPageNavi->EnterControl( aX,0 ) )
                             {
                             LeaveControl();
@@ -2501,7 +2512,7 @@
                 if (iCursorPos.iY == ColMax(iCursorPos.iX))
                     {
                     if (  iExtension->iPageNavi )
-                    	{
+                        {
                         TInt aX = 0;
                     
                         if ( iCursorPos.iX == MaxCols() - 1 )
@@ -2530,15 +2541,15 @@
                             aX = 0;
                             }
                         else
-                        	{
+                            {
                             aX = -1;
-                        	}
+                            }
                         if ( iExtension->iPageNavi->EnterControl( aX,0 ) )
                             {
                             LeaveControl();
                             break;
                             }
-                    	}
+                        }
                     // cell is at bottom row
                     if (iCursorPos.iX > RowMax(ColMax(0)))
                         {
@@ -2752,9 +2763,9 @@
 
         // Sets the character case because the buffer content may have changed.
         SetCharacterCaseL(iSpecialCharCase);
-		
+        
         SetSmileyAnimationActivityInCurrentPageL(ETrue);
-		
+        
         TInt cursorIndexAfterSwitch;
         if ( !iExtension->iKeyBrdEvent )
             {
@@ -2858,13 +2869,13 @@
     else if(aType == KAknMessageFocusLost) // focus lost
         {
         SetSmileyAnimationActivityInCurrentPageL(EFalse);
-		
-    	if ( iExtension->iHighlightVisible )
-        	{
-        	iExtension->iHighlightVisible = EFalse;
-        	DrawCursor();
-        	}
-    	}
+        
+        if ( iExtension->iHighlightVisible )
+            {
+            iExtension->iHighlightVisible = EFalse;
+            DrawCursor();
+            }
+        }
     }
 
 void CAknCharMap::EnableNavigationButtonsL()
@@ -3050,45 +3061,45 @@
         // 1) Draw the background
         // Check if we got an offscreen bitmap allocated for skin background and
         // there is bitmap background in the current skin.
-		if( CAknEnv::Static()->TransparencyEnabled() )
-			{
-			TRegionFix<10> clipReg;
-			clipReg.AddRect(rect);
-
-			if ( iFirstVisibleRow == 0 && iSetRecentSct )
-				{
-				TPoint pos = iGridTopLeft;
-				TSize size(iGridItemWidth*iMaxColumns+1, iGridItemHeight);
-				if(iIsMirrored)
-				    {
+        if( CAknEnv::Static()->TransparencyEnabled() )
+            {
+            TRegionFix<10> clipReg;
+            clipReg.AddRect(rect);
+
+            if ( iFirstVisibleRow == 0 && iSetRecentSct )
+                {
+                TPoint pos = iGridTopLeft;
+                TSize size(iGridItemWidth*iMaxColumns+1, iGridItemHeight);
+                if(iIsMirrored)
+                    {
                     pos.iX += iGridItemWidth - size.iWidth;
-				    }
-				// eliminate the overlap area between menu sct and the first menu item.
-				if ( Extension()->iMenuSct )
-					{
+                    }
+                // eliminate the overlap area between menu sct and the first menu item.
+                if ( Extension()->iMenuSct )
+                    {
                     size.iHeight--;
-					}
-				clipReg.SubRect(TRect(pos,size));
-				}
-			
-			// Take scroll bar out of clip region
-			if (iSBFrame)
-				{
-				clipReg.SubRect(iSBFrame->GetScrollBarHandle(CEikScrollBar::EVertical)->Rect());
-				}
-
-			gc.SetClippingRegion(clipReg);
-			}
-		
-		AknsDrawUtils::Background( skin, cc, this, gc, rect,KAknsDrawParamNoClearUnderImage);
-		
-		if( CAknEnv::Static()->TransparencyEnabled() )
-			{
-			gc.CancelClippingRegion();
-			}
+                    }
+                clipReg.SubRect(TRect(pos,size));
+                }
+            
+            // Take scroll bar out of clip region
+            if (iSBFrame)
+                {
+                clipReg.SubRect(iSBFrame->GetScrollBarHandle(CEikScrollBar::EVertical)->Rect());
+                }
+
+            gc.SetClippingRegion(clipReg);
+            }
+        
+        AknsDrawUtils::Background( skin, cc, this, gc, rect,KAknsDrawParamNoClearUnderImage);
+        
+        if( CAknEnv::Static()->TransparencyEnabled() )
+            {
+            gc.CancelClippingRegion();
+            }
 
         // 2) Draw the grid
-		gc.SetPenStyle(CGraphicsContext::ESolidPen);
+        gc.SetPenStyle(CGraphicsContext::ESolidPen);
         gc.SetBrushStyle(CGraphicsContext::ENullBrush);
         gc.SetPenSize(TSize(1,1));
         DrawGrid(gc);
@@ -3116,15 +3127,15 @@
         
         // grid is focused and cursor pos is same with the current index.
         if ( iExtension->iMenuSct )
-        	{
+            {
             highlighted = iExtension->iMenuSctHighlighted && 
                           (iExtension->iFocusHandler->FocusedControl()==this) && 
                           (j==cursorPos);
-        	}
+            }
         else
-        	{
-        	highlighted = ((iExtension->iFocusHandler->FocusedControl()==this) && (j==cursorPos));
-        	}
+            {
+            highlighted = ((iExtension->iFocusHandler->FocusedControl()==this) && (j==cursorPos));
+            }
         DrawItem(gc, CursorRect(j, charIndex), charIndex, highlighted, EFalse);
         charIndex++;
         }
@@ -3235,7 +3246,7 @@
     if( aHighlighted )
         {
         TRgb color = AKN_LAF_COLOR(210);
-		
+        
         if( !( iExtension->iFlags & EAknCharMapPressedDown ) 
             || iExtension->iSingleClickEnabled )
             {
@@ -3244,7 +3255,7 @@
                     KAknsIIDQsnHighlightColors, 
                     EAknsCIQsnHighlightColorsCG1 );
             }
-			
+            
         else
             {
             AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnHighlightColors, EAknsCIQsnHighlightColorsCG2 );
@@ -4394,7 +4405,7 @@
 
 void CAknCharMap::CreateOffscreenBackgroundL()
     {
-	
+    
     }
 
 TInt CAknCharMap::NextPageL()
@@ -4542,15 +4553,15 @@
     // Draw the background of the item if requested
     else if ( aDrawBackground )
         {
-		aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
-		aGc.SetBrushColor(AKN_LAF_COLOR(0));
-
-		TRect innerRect = aSctPosition;
-		if (IsRecentChar(aCharIndex))
-			{
-			innerRect.Shrink(1,1);
-			}
-		aGc.Clear( innerRect );
+        aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+        aGc.SetBrushColor(AKN_LAF_COLOR(0));
+
+        TRect innerRect = aSctPosition;
+        if (IsRecentChar(aCharIndex))
+            {
+            innerRect.Shrink(1,1);
+            }
+        aGc.Clear( innerRect );
         }
     if (iPictoInterface->Interface()->IsPictograph((*iChars)[aCharIndex]))
         {
@@ -4570,7 +4581,7 @@
 
 void CAknCharMap::DrawOffscreenBackgroundIfRequired() const
     {
-	
+    
     }
 
 EXPORT_C CCoeControl* CAknCharMap::ComponentControl(TInt aIndex) const
@@ -5753,8 +5764,9 @@
         {
         return;
         }
-
-    SetSmileyAnimationActivityInCurrentPageL(aHighlight);
+    // The "PlayAnimationL" in "SetSmileyAnimationActivityInCurrentPageL"
+    // will leave. If we ignore it, just no animation is played.
+    TRAP_IGNORE( SetSmileyAnimationActivityInCurrentPageL(aHighlight) );
     
     CWindowGc& gc = SystemGc();
     if( !CAknEnv::Static()->TransparencyEnabled() )
@@ -5773,9 +5785,9 @@
         }
     // Menu SCT is being used.
     if ( Extension()->iMenuSct )
-    	{
-    	Extension()->iMenuSctHighlighted = aHighlight;
-    	}
+        {
+        Extension()->iMenuSctHighlighted = aHighlight;
+        }
     }
 // -----------------------------------------------------------------------------
 // CAknCharMap::SetMenuSctRect()
@@ -5947,7 +5959,9 @@
     
     iExtension->LoadEmotionTumbnails(*iChars);
 
-    SetSmileyAnimationActivityInCurrentPageL(ETrue);
+    // The "PlayAnimationL" in "SetSmileyAnimationActivityInCurrentPageL"
+    // will leave. If we ignore it, just no animation is played.
+    TRAP_IGNORE( SetSmileyAnimationActivityInCurrentPageL(ETrue) );
     }
 
 // -----------------------------------------------------------------------------
@@ -6701,19 +6715,25 @@
     {
     TInt begin = iFirstVisibleRow * iMaxColumns;
     TInt end = iExtension->iMaxVisibleRows * iMaxColumns + begin;
-    if(end > iChars->Length()) end = iChars->Length();
-
-    for(TInt i(begin); i<end; i++)
+    if( end > iChars->Length() ) 
+        {
+        end = iChars->Length();
+        }
+
+    for( TInt i(begin); i<end; i++ )
         {
         TChar code = (*iChars)[i];
         CAknSmileyIcon* icon = iExtension->EmotionIcon(code);
-        if(!icon) continue;
-
-        if((aIsActive) && 
-           (Extension()->IsShowingEmotion()||Extension()->iMenuSctHighlighted)
+        if( !icon ) 
+            {
+            continue;
+            }
+
+        if( ( aIsActive ) && 
+           ( Extension()->IsShowingEmotion() || Extension()->iMenuSctHighlighted) 
            )
             {
-            icon->PlayAnimationL(KAnimationRepeat, KAnimationDelay);
+            icon->PlayAnimationL( KAnimationRepeat, KAnimationDelay );
             }
         else
             {
--- a/uifw/AvKon/src/AknIndicatorContainer.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/AknIndicatorContainer.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -307,9 +307,6 @@
         iIndicators =
             new (ELeave) CAknIndicatorQueue( KAknIndicatorQueueGranularity );
         }
-
-
-    iTicker = CPeriodic::NewL( CActive::EPriorityLow );
     }
 
 
@@ -4288,24 +4285,37 @@
     if ( !iExtension->iIsForeground ||
             R_AVKON_STATUS_PANE_LAYOUT_EMPTY == curId )
         {
-        if ( iTicker->IsActive() )
+        if ( iTicker )
             {
             iTicker->Cancel();
+            delete iTicker;
+            iTicker = NULL;
             }
+
         return;
         }
 
-    if ( !iTicker->IsActive() && iAnimatedIndicatorsShown > 0 )
+    if ( iAnimatedIndicatorsShown > 0 )
         {
-        iTicker->Start( KAknIndicatorAnimationShortDelay,
-                        KAknIndicatorAnimationInterval,
-                        TCallBack( TickerCallback, this ) );
+        if ( !iTicker )
+            {
+            TRAP_IGNORE( iTicker = CPeriodic::NewL( CActive::EPriorityLow ) );
+            }
+
+        if ( iTicker && !iTicker->IsActive() )
+            {
+            iTicker->Start( KAknIndicatorAnimationShortDelay,
+                            KAknIndicatorAnimationInterval,
+                            TCallBack( TickerCallback, this ) );
+            }
         }
-    else if ( iTicker->IsActive() && iAnimatedIndicatorsShown == 0 )
+    else if ( iTicker && iAnimatedIndicatorsShown == 0 )
         {
         // Cancel animation timer if animated indicators
         // are not visible anymore.
         iTicker->Cancel();
+        delete iTicker;
+        iTicker = NULL;
         iSynchronizingValue = 0;
         }
     }
--- a/uifw/AvKon/src/AknQueryControl.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/AknQueryControl.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -3385,32 +3385,33 @@
 
 EXPORT_C void CAknQueryControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
     { 
-    CEikMfne* edwin = NULL;
-    if ( iTimeEdwin )
-        {
-        edwin = iTimeEdwin;
-        }        
-    else if ( iDateEdwin )
-        {
-        edwin = iDateEdwin;
-        }
-    else if ( LocationEd() )
-        {
-        edwin = LocationEd();
-        }
-    else if ( iDurationEdwin )
-        {
-        edwin = iDurationEdwin;
-        }
-        
-    if ( edwin && iEditorFrame.Rect().Contains(aPointerEvent.iPosition) )
-        {
-        edwin->HandlePointerEventL(aPointerEvent);
-        }
+    if ( iEditorFrame.Rect().Contains( aPointerEvent.iPosition ) )
+    	{
+		/*For the events happening inside editor frame's rect, query control will forward
+		the events to editors to handle.This is added to fix bug ESLM-85YFCH:Text editor is hard 
+		to open in input dialog (usability). The valid area is enlarged to editor frame rect,
+		instead of text's rect, because text rect is too small for user to tap*/
+		CCoeControl* ctrl = ControlByLayoutOrNull( iQueryType );
+		if( ctrl )
+			{
+			TPointerEvent pointerEvent( aPointerEvent );
+			if( !ctrl->Rect().Contains( aPointerEvent.iPosition ) && ( NbrOfEditorLines() == 1 ) )
+				{
+				// for the pointerevents happening in editor frame rect, 
+				// query control forward events to editors after justification
+				pointerEvent.iPosition.iY = ctrl->Rect().iTl.iY + ctrl->Rect().Height()/2;
+				}
+			ctrl->HandlePointerEventL( pointerEvent ); 
+			}
+		else
+			{
+			CAknControl::HandlePointerEventL( aPointerEvent ); 
+			}
+		}
     else
-        {
-        CAknControl::HandlePointerEventL(aPointerEvent); 
-        }
+    	{
+		CAknControl::HandlePointerEventL( aPointerEvent ); 
+		}
     }
 
 EXPORT_C void* CAknQueryControl::ExtensionInterface( TUid /*aInterface*/ ) 
@@ -3787,14 +3788,33 @@
 
 EXPORT_C void CAknExtQueryControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
     { 
-    if ( iIpEditor && iEditorFrame.Rect().Contains(aPointerEvent.iPosition) )
-        {
-        iIpEditor->HandlePointerEventL(aPointerEvent); 
-        }
-    else
-        {
-        CAknQueryControl::HandlePointerEventL(aPointerEvent);
-        }
+	if ( iEditorFrame.Rect().Contains( aPointerEvent.iPosition ) )
+		{
+		/*For the events happening inside editor frame's rect, query control will forward
+		the events to editors to handle.This is added to fix bug ESLM-85YFCH:Text editor is hard 
+		to open in input dialog (usability). The valid area is enlarged to editor frame rect,
+		instead of text's rect, because text rect is too small for user to tap*/
+		CCoeControl* ctrl = ControlByLayoutOrNull( iQueryType );
+		if( ctrl )
+			{
+			TPointerEvent pointerEvent( aPointerEvent );
+			if( !ctrl->Rect().Contains( aPointerEvent.iPosition ) && ( NbrOfEditorLines() == 1 ) )
+				{
+				// for the pointerevents happening in editor frame rect, 
+				// query control forward events to editors after justification
+				pointerEvent.iPosition.iY = ctrl->Rect().iTl.iY + ctrl->Rect().Height()/2;
+				}
+			ctrl->HandlePointerEventL( pointerEvent ); 
+			}
+		else
+			{
+			CAknControl::HandlePointerEventL( aPointerEvent ); 
+			}
+		}
+	else
+		{
+		CAknControl::HandlePointerEventL( aPointerEvent ); 
+		}
     }
 
 EXPORT_C void* CAknExtQueryControl::ExtensionInterface( TUid /*aInterface*/ ) 
--- a/uifw/AvKon/src/AknRadioButtonSettingPage.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/AknRadioButtonSettingPage.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -75,13 +75,26 @@
      * Extension flags.
      */
     TBitFlags iFlags;
+
+    /**
+     * Item that received pen down event
+     */
+    TInt iPenDownOnItem;
+    
+    /**
+     * Is selection valid
+     */
+    TBool iIsValidSelection;
+    
     };
 // end of CAknRadioButtonSettingPageExtension class definition
 
 
 CAknRadioButtonSettingPageExtension::CAknRadioButtonSettingPageExtension(
     CCoeControl& aOwner ) :
-    iOldFocusedItemIndex(-1), iIsDragged( EFalse )
+    iOldFocusedItemIndex(-1), iIsDragged( EFalse ), 
+    iIsValidSelection( ETrue ),
+    iPenDownOnItem ( KErrNotFound )
     {
     if ( static_cast<CAknAppUi*>(
             aOwner.ControlEnv()->AppUi() )->IsSingleClickCompatible() )
@@ -229,6 +242,14 @@
 		
     switch ( aEventType )
         {
+        case MEikListBoxObserver::EEventPenDownOnItem:
+            {
+            if ( iExtension )
+                {
+                iExtension->iPenDownOnItem = ListBoxControl()->CurrentItemIndex();
+                }
+            break;
+            }
         case MEikListBoxObserver::EEventItemSingleClicked:
         case MEikListBoxObserver::EEventItemDoubleClicked:
             {
@@ -287,8 +308,17 @@
 	} 
 
 EXPORT_C void CAknRadioButtonSettingPage::SelectCurrentItemL()
-	{
-    iCurrentSelectionIndex = ListBoxControl()->CurrentItemIndex();
+	{   
+    if ( ListBoxControl()->IsHighlightEnabled() || 
+            ( iExtension && iExtension->iIsValidSelection ) )
+        {
+        iCurrentSelectionIndex = ListBoxControl()->CurrentItemIndex();
+        }
+    else
+        {
+        ListBoxControl()->SetCurrentItemIndex ( iCurrentSelectionIndex );
+        }
+
     SetRadioButtonSelectionL( iCurrentSelectionIndex );
 	UpdateSettingL();
 	if( iSettingPageObserver )
@@ -456,7 +486,22 @@
     TPointerEvent& event = const_cast<TPointerEvent&>( aPointerEvent );
     event.iModifiers &= ~EModifierShift;
     event.iModifiers &= ~EModifierCtrl;
-
+    
+    if ( iExtension )
+        {
+        TInt index ( KErrNotFound );
+        ListBoxControl()->View()->XYPosToItemIndex( 
+            aPointerEvent.iPosition, index );
+        if ( index == iExtension->iPenDownOnItem 
+                && iExtension->iPenDownOnItem != KErrNotFound )
+            {
+            iExtension->iIsValidSelection = ETrue;
+            }
+        else
+            {
+            iExtension->iIsValidSelection = EFalse;
+            }
+        }
     CAknListBoxSettingPage::HandlePointerEventL( aPointerEvent );
     }
 
--- a/uifw/AvKon/src/AknTextSettingPage.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/AknTextSettingPage.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -38,17 +38,14 @@
 #include <e32property.h>
 #include <AknDef.h>
 
-static _LIT_SECURITY_POLICY_PASS( KAllowAllPolicy );
-static _LIT_SECURITY_POLICY_C1( KPowerMgmtPolicy, ECapabilityPowerMgmt );
 
 /*
  * this class is a fixing for bug ESLM-8395MP 
  * Settingpage will keep watch the RProperty(set by Fep) to hide it self 
  */
-class CAknFepSettingDialogStatusWatcher : public CActive
-	{
+NONSHARABLE_CLASS( CAknFepSettingDialogStatusWatcher ) : public CActive
+    {
 public:
-
     static CAknFepSettingDialogStatusWatcher* NewL( CAknTextSettingPage* aControl )
         {
         CAknFepSettingDialogStatusWatcher* watcher = new (ELeave) CAknFepSettingDialogStatusWatcher( aControl );
@@ -57,94 +54,80 @@
         CleanupStack::Pop(watcher);
         return watcher;
         }
-    
-	CAknFepSettingDialogStatusWatcher( CAknTextSettingPage* aControl )
-	    : CActive( EPriorityNormal )
-		, iControl( aControl ) 
-	    {
-	    CActiveScheduler::Add( this );
-	    }
-	
-	~CAknFepSettingDialogStatusWatcher()
+
+    CAknFepSettingDialogStatusWatcher( CAknTextSettingPage* aControl )
+        : CActive( EPriorityNormal )
+        , iControl( aControl ) 
+        , iAttachSucceed( EFalse )
+        {
+        CActiveScheduler::Add( this );
+        }
+
+    ~CAknFepSettingDialogStatusWatcher()
         {
         StopWatching();
         iFepSettingDialogStatusProperty.Close();
-	    }
-	
-	void StartWatchingL()
-	    {
-	    if ( !IsActive() )
+        }
+
+    void StartWatching()
+        {
+        if ( !IsActive() && iAttachSucceed )
             {
             iFepSettingDialogStatusProperty.Subscribe( iStatus );
             SetActive();
             }
-	    }
-		
+        }
+
     void StopWatching()
-	    {
-	    Cancel();
-	    }
-	
-private:    
-    
+        {
+        Cancel();
+        }
+
+private:
+
     void ConstructL()
         {
-        // Define PS Key
-        TInt err = RProperty::Define(
-            KPSUidAknFep, 
-            KAknFepSettingDialogState, 
-            RProperty::EInt, 
-            KAllowAllPolicy,  // None
-            KPowerMgmtPolicy ); 
-            
-        if (err != KErrAlreadyExists)
-            {
-            User::LeaveIfError( err );
-            }
-        User::LeaveIfError( iFepSettingDialogStatusProperty.Attach( KPSUidAknFep
-                                          , KAknFepSettingDialogState, EOwnerThread ) );
+        TInt ret = iFepSettingDialogStatusProperty.Attach( KPSUidAknFep
+                                                         , KAknFepSettingDialogState
+                                                         , EOwnerThread );
+        iAttachSucceed = ( ret == KErrNone );
         }
-	
-	void HandleAknFepSettingDialogStatusChangeNotificationL()
-	    {
-	    TInt isOpen = 0;
-	    TInt ret = iFepSettingDialogStatusProperty.Get( isOpen );
-        if ( ret!=KErrOverflow )
-            {
-            User::LeaveIfError( ret );
-            }
-	
+
+    void HandleAknFepSettingDialogStatusChangeNotification()
+        {
+        TInt isOpen = 0;
+        iFepSettingDialogStatusProperty.Get( isOpen );
         if ( !iControl )
             {
             return;
             }
 
-	    if ( isOpen )
-	        {
-	        iControl->MakeVisible( EFalse );
-	        }
-	    else
-	        {
-	        iControl->MakeVisible( ETrue );
-	        }
-	    }
-	
+        if ( isOpen )
+            {
+            iControl->MakeVisible( EFalse );
+            }
+        else
+            {
+            iControl->MakeVisible( ETrue );
+            }
+        }
+
 private: // from CActive
 
     void RunL()
-	    {
-	    if ( iStatus.Int() == KErrNone )
+        {
+        if ( iStatus.Int() == KErrNone )
             {
-            HandleAknFepSettingDialogStatusChangeNotificationL();
-            StartWatchingL();
+            HandleAknFepSettingDialogStatusChangeNotification();
+            StartWatching();
             }
-	    }
+        }
 
     void DoCancel()
-	    {
-	    iFepSettingDialogStatusProperty.Cancel();
-	    }
-	
+        {
+        iFepSettingDialogStatusProperty.Cancel();
+        }
+
 private:
     //
     // not owned
@@ -152,6 +135,11 @@
     CAknTextSettingPage* iControl;
 
     RProperty  iFepSettingDialogStatusProperty;
+
+    //
+    // If RProperty attach succeed 
+    //
+    TBool iAttachSucceed ;
     };
 
 
@@ -216,7 +204,7 @@
     void ConstructL()
         {
 		iAknFepSettingDialogStatusWatcher = CAknFepSettingDialogStatusWatcher::NewL( iExtensionOwner );
-		iAknFepSettingDialogStatusWatcher->StartWatchingL();
+		iAknFepSettingDialogStatusWatcher->StartWatching();
         }
         
     CAknTextSettingPageExtension(CAknTextSettingPage*  aExtensionOwner )
@@ -572,8 +560,12 @@
     
     for ( TInt i = textLimits.FirstRow(); i <= textLimits.LastRow(); ++i )
         {
-        array.Append(
-            AknLayoutScalable_Avkon::set_text_pane_t1_copy1( 0, 0, i ) );
+		TInt err = array.Append( AknLayoutScalable_Avkon::set_text_pane_t1_copy1( 0, 0, i ) );
+        if ( err != KErrNone)
+        	{
+			array.Close();
+			return;
+        	}
         }
     
     AknLayoutUtils::LayoutEdwin( TextControl(),
--- a/uifw/AvKon/src/AknViewAppUi.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/AknViewAppUi.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -319,15 +319,23 @@
 	
 	for ( TInt i = 0; i < count; ++i )
 		{
-		CAknView* view( iViews->At( i ) );
-		
-		if ( view->Id() == aViewId )
-			{
-			iViews->Delete( i );
-			CCoeAppUi::DeregisterView( *view );
-			delete view;
-			return;
-			}
+        CAknView* view( iViews->At( i ) );
+        if ( view->Id() == aViewId )
+            {
+            // remove the deleted view from iExtensione's list. Or the pointer 
+            // is invalid 
+            TInt index = iExtension->iActiveViews.Find(view);
+            if ( index >= 0 && index < iExtension->iActiveViews.Count() )
+                {
+                iExtension->iActiveViews.Remove(index);
+                view->AknViewDeactivated();
+                } 
+                
+                iViews->Delete( i );
+                CCoeAppUi::DeregisterView( *view );
+                delete view;
+                return;
+            }
 		}
 	}
 
@@ -618,12 +626,15 @@
             // (default granularity is 8) -> no memory allocation failures.
             if ( splitView )
                 {
-                iExtension->iActiveViews.Append( View( splitView->iViewIds[0] ) );
-                iExtension->iActiveViews.Append( View( splitView->iViewIds[1] ) );
+                error = iExtension->iActiveViews.Append( View( splitView->iViewIds[0] ) );
+                if (KErrNone == error)
+                    {
+                    error = iExtension->iActiveViews.Append( View( splitView->iViewIds[1] ) );
+                    }
                 }
             else
                 {
-                iExtension->iActiveViews.Append( item->iNewView );
+                error = iExtension->iActiveViews.Append( item->iNewView );
                 }
 
             iView = item->iNewView;
--- a/uifw/AvKon/src/aknchoicelist.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/aknchoicelist.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -119,7 +119,7 @@
         if ( AknsUtils::AvkonSkinEnabled() )
             {
             AknsUtils::GetCachedColor( AknsUtils::SkinInstance(),
-                                   color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG8 );
+                                   color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG19 );
             }
 
         ItemDrawer()->SetTextColor( color );
@@ -128,7 +128,7 @@
         if ( AknsUtils::AvkonSkinEnabled() )
             {
             AknsUtils::GetCachedColor( AknsUtils::SkinInstance(),
-                                   color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG8 );
+                                   color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG19 );
             }
 
         ItemDrawer()->SetHighlightedTextColor( color );
@@ -798,7 +798,7 @@
            TRgb textColor;
 
             if ( AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor, 
-                KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG8) == KErrNone )
+                KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6) == KErrNone )
                 {
                 TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( 
                     *iLabel, EColorLabelText, textColor) );
@@ -1080,7 +1080,7 @@
            TRgb textColor;
 
             if ( AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor, 
-                KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG8) == KErrNone )
+                KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6) == KErrNone )
                 {
                 TRAP_IGNORE( 
                     AknLayoutUtils::OverrideControlColorL( 
@@ -1515,7 +1515,7 @@
            TRgb textColor;
 
             if ( AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), textColor, 
-                KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG8) == KErrNone )
+                KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6) == KErrNone )
                 {
                 TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( 
                     *iLabel, EColorLabelText, textColor) );
--- a/uifw/AvKon/src/akncontext.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/akncontext.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-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"
@@ -11,7 +11,8 @@
 *
 * Contributors:
 *
-* Description:
+* Description: Context pane control used to display the application icon
+*              in status pane.
 *
 */
 
@@ -58,7 +59,6 @@
 public:
     CEikImage*  iContextImage;
     CEikImage*  iDefaultContextImage;
-    TInt        iCurrentColorScheme;
     };
 
 CAknContextPaneExtension::CAknContextPaneExtension()
@@ -91,7 +91,20 @@
 EXPORT_C void CAknContextPane::ConstructL()
     {
     CommonConstructL();
-    TRAP_IGNORE(SetPictureToDefaultL()); // Trapped because of Java midlet issues
+
+    // Perf optimization: We don't set the default picture if the context
+    // pane is not in current status pane layout. The picture will be created
+    // in SizeChanged() if a valid size is set for context pane, but at
+    // the moment context pane isn't used in any of the supported Avkon
+    // status pane layouts.
+    CEikStatusPaneBase* statusPane = CEikStatusPaneBase::Current();
+    if ( statusPane &&
+         statusPane->PaneCapabilities(
+             TUid::Uid( EEikStatusPaneUidContext ) ).IsInCurrentLayout() )
+        {
+        // Trapped because of Java midlet issues.
+        TRAP_IGNORE( SetPictureToDefaultL() );
+        }
     }
 
 
@@ -306,8 +319,14 @@
 
 EXPORT_C void CAknContextPane::SizeChanged()
     {
-    if (Rect() != TRect(0,0,0,0)) // Fix for Parent getting parent relative data. 
+    if ( !Rect().IsEmpty() ) // Fix for Parent getting parent relative data. 
         {
+        if ( !iExtension->iContextImage )
+            {
+            // Create the default picture if it doesn't exist yet. 
+            TRAP_IGNORE( SetPictureToDefaultL() );
+            }
+
         if (iExtension->iContextImage && iExtension->iContextImage->Bitmap()) 
             {
             TAknLayoutRect layoutRect;
@@ -362,8 +381,9 @@
 
 EXPORT_C void CAknContextPane::HandleResourceChange( TInt aType ) 
     {
-    if ( aType == KEikColorResourceChange || aType==KEikDynamicLayoutVariantSwitch )
+    if ( aType==KEikDynamicLayoutVariantSwitch )
         {
+        SizeChanged();
         DrawDeferred();
         }
     else if( aType == KAknsMessageSkinChange )
@@ -409,76 +429,63 @@
     {
     CWindowGc& gc=SystemGc();
 
-    // screen
-    TRect screenRect = iAvkonAppUi->ApplicationRect();
-    
-    //TAknWindowLineLayout screenLayout = AknLayout::screen();
-    //TRect screenRect = screenLayout.Rect();
-
-
-    // app window
-    TAknWindowLineLayout applicationWindowLayout =
-        AknLayout::application_window(screenRect);
-    
-    TAknLayoutRect applicationWindowLayoutRect;
-    applicationWindowLayoutRect.LayoutRect(screenRect, applicationWindowLayout);
-    TRect applicationWindowRect = applicationWindowLayoutRect.Rect(); 
-
-    // statuspane
-    TAknWindowLineLayout statusPaneLayout = 
-        AknLayout::status_pane(applicationWindowRect, 0);
-
-    TAknLayoutRect statusPaneLayoutRect;
-    statusPaneLayoutRect.LayoutRect(applicationWindowRect, statusPaneLayout);
-    TRect statusPaneRect = statusPaneLayoutRect.Rect(); 
-
-    // context pane
-    TAknWindowLineLayout contextPaneLayout = 
-        AknLayout::context_pane(statusPaneRect, 0);
-    
-    TAknLayoutRect contextPaneLayoutRect;
-    contextPaneLayoutRect.LayoutRect(statusPaneRect, contextPaneLayout);
-    TRect contextPaneRect = contextPaneLayoutRect.Rect(); 
-
-    TAknWindowLineLayout naviPaneGraphicsLayout = 
-        AknLayout::Status_pane_elements_Line_1();
-
-    TAknWindowLineLayout naviWipeGraphicsLayout = 
-        AknLayout::Status_pane_elements_Line_2();
-
-    TAknLayoutRect naviPaneGraphicsLayoutRect;
-    naviPaneGraphicsLayoutRect.LayoutRect(statusPaneRect, naviPaneGraphicsLayout);
-    TRect naviPaneGraphicsRect = naviPaneGraphicsLayoutRect.Rect(); 
-
-    TAknLayoutRect naviWipeGraphicsLayoutRect;
-    naviWipeGraphicsLayoutRect.LayoutRect(statusPaneRect, naviWipeGraphicsLayout);
-    TRect naviWipeGraphicsRect = naviWipeGraphicsLayoutRect.Rect(); 
-
-    TRect rect(Rect());
-
-    TRect barRect = contextPaneRect;
-    if (barRect.Intersects(naviPaneGraphicsRect))
-        {
-        barRect.Intersection(naviPaneGraphicsRect);
-        
-        // calculate new origo, relative to context pane.
-        barRect.iTl.iX -= contextPaneRect.iTl.iX;
-        barRect.iTl.iY -= contextPaneRect.iTl.iY;
-        barRect.iBr.iX -= contextPaneRect.iTl.iX;
-        barRect.iBr.iY -= contextPaneRect.iTl.iY;
-        }
-    else
-        {
-        barRect = TRect(0,0,0,0);
-        }
-    
-
+    TRect rect( Rect() );
     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
     MAknsControlContext* cc = AknsDrawUtils::ControlContext(this);
 
-        // Solid or wipe comes from background
-    if( !AknsDrawUtils::Background( skin, cc, this, gc, rect ) )
+    // Solid or wipe comes from background
+    if ( !AknsDrawUtils::Background( skin, cc, this, gc, rect ) )
         {
+        // screen
+        TRect screenRect = iAvkonAppUi->ApplicationRect();
+    
+        // app window
+        TAknWindowLineLayout applicationWindowLayout =
+            AknLayout::application_window(screenRect);
+        
+        TAknLayoutRect applicationWindowLayoutRect;
+        applicationWindowLayoutRect.LayoutRect(screenRect, applicationWindowLayout);
+        TRect applicationWindowRect = applicationWindowLayoutRect.Rect(); 
+    
+        // statuspane
+        TAknWindowLineLayout statusPaneLayout = 
+            AknLayout::status_pane(applicationWindowRect, 0);
+    
+        TAknLayoutRect statusPaneLayoutRect;
+        statusPaneLayoutRect.LayoutRect(applicationWindowRect, statusPaneLayout);
+        TRect statusPaneRect = statusPaneLayoutRect.Rect(); 
+    
+        // context pane
+        TAknWindowLineLayout contextPaneLayout = 
+            AknLayout::context_pane(statusPaneRect, 0);
+        
+        TAknLayoutRect contextPaneLayoutRect;
+        contextPaneLayoutRect.LayoutRect(statusPaneRect, contextPaneLayout);
+        TRect contextPaneRect = contextPaneLayoutRect.Rect(); 
+    
+        TAknWindowLineLayout naviPaneGraphicsLayout = 
+            AknLayout::Status_pane_elements_Line_1();
+    
+        TAknLayoutRect naviPaneGraphicsLayoutRect;
+        naviPaneGraphicsLayoutRect.LayoutRect(statusPaneRect, naviPaneGraphicsLayout);
+        TRect naviPaneGraphicsRect = naviPaneGraphicsLayoutRect.Rect();
+
+        TRect barRect( contextPaneRect );
+        if ( barRect.Intersects( naviPaneGraphicsRect ) )
+            {
+            barRect.Intersection( naviPaneGraphicsRect );
+            
+            // calculate new origo, relative to context pane.
+            barRect.iTl.iX -= contextPaneRect.iTl.iX;
+            barRect.iTl.iY -= contextPaneRect.iTl.iY;
+            barRect.iBr.iX -= contextPaneRect.iTl.iX;
+            barRect.iBr.iY -= contextPaneRect.iTl.iY;
+            }
+        else
+            {
+            barRect = TRect(0,0,0,0);
+            }
+
         // Default drawing if skinning is not available
         gc.Clear(rect); 
         gc.SetPenStyle(CGraphicsContext::ENullPen);
@@ -533,7 +540,19 @@
         }
     else
         {
-        TRAP_IGNORE(SetPictureToDefaultL()); // Trapped because of Java midlet issues
+        // Perf optimization: We don't set the default picture if the context
+        // pane is not in current status pane layout. The picture will be
+        // created in SizeChanged() if a valid size is set for context pane,
+        // but at the moment context pane isn't used in any of the supported
+        // Avkon status pane layouts.
+        CEikStatusPaneBase* statusPane = CEikStatusPaneBase::Current();
+        if ( statusPane &&
+             statusPane->PaneCapabilities(
+                 TUid::Uid( EEikStatusPaneUidContext ) ).IsInCurrentLayout() )
+            {
+            // Trapped because of Java midlet issues.
+            TRAP_IGNORE( SetPictureToDefaultL() );
+            }
         }
     }
 
--- a/uifw/AvKon/src/aknglobalpopupprioritycontroller.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/aknglobalpopupprioritycontroller.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -285,7 +285,10 @@
         if (priority >= shownPriority)
             {
             maxWindowPosition = MinChainWindowPosition(stacked);
-            iShownStack.Insert(aPopup, ii); // will not fail because overflow is already checked
+            if (KErrNone != iShownStack.Insert(aPopup, ii))
+                {
+                return EFalse;
+                }
             insertPos = ii;
             break;
             }
--- a/uifw/AvKon/src/aknindicator.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/aknindicator.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-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"
@@ -859,8 +859,6 @@
 
 void CAknIndicator::SetSvgIconSize( CFbsBitmap*& aBitmap, TInt aLayoutMode )
     {
-    TRect rect( Rect() );
-
     TInt indicatorUid = iUid;
     if (indicatorUid >= EAknNaviPaneEditorIndicatorDynamicUidRangeFirst &&
         indicatorUid <= EAknNaviPaneEditorIndicatorDynamicUidRangeLast)
@@ -871,51 +869,7 @@
     TSize size(10,10); // default size (every SVG icon needs to be initialized)
     TScaleMode aspectRatio = EAspectRatioPreservedAndUnusedSpaceRemoved;
 
-    TRect navipaneRect(0,0,0,0);
-    CEikStatusPaneBase* statusPane = CEikStatusPaneBase::Current();
-    if (statusPane)
-        {
-        CCoeControl* control = NULL;
-        TRAP_IGNORE(control = statusPane->ControlL(TUid::Uid( EEikStatusPaneUidNavi )));
-        if (control)
-            {
-            navipaneRect.SetSize( control->Size() );
-            }
-        }
-
-    // If navipane is not found, we get portrait normal navipanerect frop laf data which is usually right enough.
-    if (navipaneRect.Size() == TSize(0,0))
-        {
-        TInt battery = 0;
-        TRect statusPaneRect;
-        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane, statusPaneRect );
-
-        if ( AknStatuspaneUtils::IdleLayoutActive() )
-            {
-            if ( ( iIndicatorContext == CAknIndicatorContainer::EQueryEditorIndicators )
-                && ( statusPaneRect.Size() == TSize(0,0) ) )
-                {
-                battery = 0;
-                }
-            else
-                {
-                battery = 1;
-                }
-            }
-
-
-        // Navi pane
-        TAknWindowComponentLayout naviPaneLayout( AknLayoutScalable_Avkon::navi_pane(battery) );
-        TAknLayoutRect naviPaneLayoutRect;
-        naviPaneLayoutRect.LayoutRect(statusPaneRect, naviPaneLayout);
-        navipaneRect.SetSize( naviPaneLayoutRect.Rect().Size() );
-        }
-
-    // Screen
-    TRect screenRect;
-    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
-
-    switch (indicatorUid)
+    switch ( indicatorUid )
         {
         // Status pane's indicators
         case EAknIndicatorIrActive:
@@ -984,85 +938,16 @@
         case EAknIndicatorMecoServiceTab:
         case EAknIndicatorIntegratedIM:
             {
-            // Main pane
-            TRect mainPaneRect;
-            AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
-                                               mainPaneRect );
 
-            // statuspane, usual
-            TRect usualStatusPaneRect;
-            AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EStatusPane,
-                                               usualStatusPaneRect );
-
-            // status indicator pane elements
-            TRect statusIndicatorPaneElementsRect;
-            AknLayoutUtils::LayoutMetricsRect(
-                AknLayoutUtils::EIndicatorPane,
-                statusIndicatorPaneElementsRect );
-
-            // universal indicator pane (note statuspane as parent)
-            TAknLayoutRect universalIndicatorPaneLayoutRect;
-            universalIndicatorPaneLayoutRect.LayoutRect(
-                usualStatusPaneRect,
-                AknLayoutScalable_Avkon::uni_indicator_pane( 0 ) );
-            TRect universalIndicatorPaneRect(
-                universalIndicatorPaneLayoutRect.Rect() );
-
-            // universal indicator pane elements
-            TAknLayoutRect universalIndicatorPaneElementsLayoutRect;
-            universalIndicatorPaneElementsLayoutRect.LayoutRect(
-                universalIndicatorPaneRect,
-                AknLayoutScalable_Avkon::uni_indicator_pane_g1() );
-            TRect universalIndicatorPaneElementsRect(
-                universalIndicatorPaneElementsLayoutRect.Rect() );
-
-            if ( aLayoutMode == ELayoutModeUsual )
+            // Portrait extended cases
+            if ( AknStatuspaneUtils::ExtendedLayoutActive() &&
+                 AknStatuspaneUtils::IdleLayoutActive() &&
+                 !AknStatuspaneUtils::HDLayoutActive() )
                 {
-                size = universalIndicatorPaneElementsRect.Size();
+                aspectRatio = EAspectRatioPreserved;
                 }
 
-            if ( aLayoutMode == ELayoutModeWide )
-                {
-                size = statusIndicatorPaneElementsRect.Size();
-                }
-
-            // Stacon special cases
-            if ( AknStatuspaneUtils::StaconPaneActive() &&
-                 !AknStatuspaneUtils::IdleLayoutActive() &&
-                 !AknStatuspaneUtils::ExtendedStaconPaneActive())
-                {
-                size = Size();
-                }
-            else if ( AknStatuspaneUtils::ExtendedStaconPaneActive() )
-                {
-                size = Size();
-                }
-
-            // Flat special cases
-            if ( AknStatuspaneUtils::FlatLayoutActive() )
-                {
-                size = Size();
-                }
-
-            // Portrait extended cases
-            if ( AknStatuspaneUtils::ExtendedLayoutActive() )
-                {
-                size = Size();
-                if ( AknStatuspaneUtils::IdleLayoutActive() &&
-                     !AknStatuspaneUtils::HDLayoutActive() )
-                    {
-                    aspectRatio = EAspectRatioPreserved;
-                    }
-                }
-
-            // In landscape idle we use vertical indicators if parent
-            // is in vertical mode, otherwise horizontal.
-            if ( AknStatuspaneUtils::IdleLayoutActive() &&
-                 Layout_Meta_Data::IsLandscapeOrientation() &&
-                 iParent->Size().iWidth < iParent->Size().iHeight )
-                {
-                size = Size();
-                }
+            size = Size();
 
             break;
             }
@@ -1162,9 +1047,41 @@
         case EAknNaviPaneEditorIndicatorFnKeyLocked:
 #endif
             {
-            TAknWindowComponentLayout l1 = AknLayoutScalable_Avkon::navi_icon_pane(0);
-            TAknWindowComponentLayout l2 = AknLayoutScalable_Avkon::navi_icon_pane_g1();
-            TAknWindowComponentLayout layout = TAknWindowComponentLayout::Compose( l1, l2 );
+            TRect navipaneRect( 0, 0, 0, 0 );
+            CEikStatusPaneBase* statusPane = CEikStatusPaneBase::Current();
+            if ( statusPane )
+                {
+                CCoeControl* control = NULL;
+                TRAP_IGNORE(
+                    control = statusPane->ControlL(
+                        TUid::Uid( EEikStatusPaneUidNavi ) ) );
+                if ( control )
+                    {
+                    navipaneRect.SetSize( control->Size() );
+                    }
+                }
+        
+            // If navi pane is not found, we get portrait normal navi pane
+            // rect from LAF data which is usually right enough.
+            if ( navipaneRect.IsEmpty() )
+                {
+                TRect statusPaneRect;
+                AknLayoutUtils::LayoutMetricsRect(
+                    AknLayoutUtils::EStatusPane, statusPaneRect );
+
+                // Navi pane
+                TAknLayoutRect naviPaneLayoutRect;
+                naviPaneLayoutRect.LayoutRect(
+                    statusPaneRect, AknLayoutScalable_Avkon::navi_pane( 6 ) );
+                navipaneRect.SetSize( naviPaneLayoutRect.Rect().Size() );
+                }
+            
+            TAknWindowComponentLayout l1(
+                AknLayoutScalable_Avkon::navi_icon_pane( 0 ) );
+            TAknWindowComponentLayout l2(
+                AknLayoutScalable_Avkon::navi_icon_pane_g1() );
+            TAknWindowComponentLayout layout(
+                TAknWindowComponentLayout::Compose( l1, l2 ) );
 
             TAknLayoutRect layoutRect;
             layoutRect.LayoutRect( navipaneRect, layout );
@@ -1178,6 +1095,8 @@
         case EAknNaviPaneEditorIndicatorWaitBar:
         case EAknNaviPaneEditorIndicatorProgressBar:
             {
+            TRect rect( Rect() );
+
             TAknLayoutRect waitPaneComponentLayoutRect;
             waitPaneComponentLayoutRect.LayoutRect(
                 rect,
@@ -1198,28 +1117,30 @@
         case EAknNaviPaneEditorIndicatorWlanActive:
         case EAknNaviPaneEditorIndicatorWlanActiveSecure:
             {
-            // app window
-            TAknWindowComponentLayout applicationWindowLayout( AknLayoutScalable_Avkon::application_window(0) );
-            TAknLayoutRect applicationWindowLayoutRect;
-            applicationWindowLayoutRect.LayoutRect( screenRect, applicationWindowLayout );
-            TRect applicationWindowRect( applicationWindowLayoutRect.Rect() );
+            // Screen
+            TRect screenRect;
+            AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen,
+                                               screenRect );
 
-            // top area
-            TAknWindowComponentLayout topAreaLayout( AknLayoutScalable_Avkon::area_top_pane(1) );
+            // top area, skip the application window as it's the same
+            // size as the screen.
             TAknLayoutRect topAreaLayoutRect;
-            topAreaLayoutRect.LayoutRect( applicationWindowRect, topAreaLayout );
+            topAreaLayoutRect.LayoutRect(
+                screenRect, AknLayoutScalable_Avkon::area_top_pane( 1 ) );
             TRect topAreaRect( topAreaLayoutRect.Rect() );
 
             // small statuspane
-            TAknWindowComponentLayout smallStatusPaneLayout( AknLayoutScalable_Avkon::status_small_pane() );
             TAknLayoutRect smallStatusPaneLayoutRect;
-            smallStatusPaneLayoutRect.LayoutRect( topAreaRect, smallStatusPaneLayout );
+            smallStatusPaneLayoutRect.LayoutRect(
+                topAreaRect, AknLayoutScalable_Avkon::status_small_pane() );
             TRect smallStatusPaneRect( smallStatusPaneLayoutRect.Rect() );
 
             // icon pane
-            TAknWindowComponentLayout iconPaneLayout( AknLayoutScalable_Avkon::status_small_icon_pane() );
             TAknLayoutRect iconPaneLayoutRect;
-            iconPaneLayoutRect.LayoutRect( smallStatusPaneRect, iconPaneLayout );
+            iconPaneLayoutRect.LayoutRect(
+                smallStatusPaneRect,
+                AknLayoutScalable_Avkon::status_small_icon_pane() );
+
             TRect iconPaneRect( iconPaneLayoutRect.Rect() );
 
             size = iconPaneRect.Size();
--- a/uifw/AvKon/src/aknmessagequerydialog.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/aknmessagequerydialog.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -302,8 +302,11 @@
         else
             {
             // SetLinkTextL creates new callback in the callback array for the new link
-            iMsgQueryExtension->iFormatTextArray.Append( aLinkText.AllocL() );
-            iMsgQueryExtension->iFormatTypeArray.Append( EMsgQueryLink );
+			HBufC* linkText = aLinkText.AllocL();
+			CleanupStack::PushL( linkText );
+			iMsgQueryExtension->iFormatTextArray.AppendL( linkText );
+			CleanupStack::Pop( linkText );
+            iMsgQueryExtension->iFormatTypeArray.AppendL( EMsgQueryLink );
                
             // If the other method SetLink has been already called 
             // the new link is finished by adding the link count
@@ -346,7 +349,10 @@
         if ( iMsgQueryExtension->iCallBackArray.Count() < iMsgQueryExtension->iLinkCount )
             {
             // SetLink creates new callback in the callback array for the new link
-            iMsgQueryExtension->iCallBackArray.Append( aCallBack );                
+			if ( KErrNone != iMsgQueryExtension->iCallBackArray.Append( aCallBack ) )
+				{
+				return;
+				}
             }
         }         
     else if ( iMsgQueryExtension->iLinkCount < KMaxLinks ) 
@@ -359,7 +365,10 @@
         else
             {
             // SetLink creates new callback in the callback array for the new link
-            iMsgQueryExtension->iCallBackArray.Append( aCallBack );
+            if ( KErrNone != iMsgQueryExtension->iCallBackArray.Append( aCallBack ) )
+            	{
+            	return;
+            	}
                 
             // If the other method SetLinkText has been already called 
             // the new link is finished by adding the link count
@@ -688,7 +697,7 @@
             }
         delete messageBuf;
         }      
-     iMsgQueryExtension->iFormatTextLocationArray.Append( linkTextLocation );         
+     iMsgQueryExtension->iFormatTextLocationArray.AppendL( linkTextLocation );         
      return ETrue;
     }
     
--- a/uifw/AvKon/src/aknnavi.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/aknnavi.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -69,7 +69,6 @@
     ~CAknNavigationControlContainerExtension(){};
 
 public:
-    TInt                        iCurrentColorScheme;
     CAknNaviForegroundObserver* iForegroundObserver;
     TBool                       iDestructionOngoing;
     CFbsBitmap*                 iNaviColorBitmap;
@@ -144,7 +143,6 @@
         {
         iExtension =
             new (ELeave) CAknNavigationControlContainerExtension();
-        iExtension->iCurrentColorScheme = ColorScheme();
         iExtension->iForegroundObserver =
             CAknNaviForegroundObserver::NewL( this );
         iExtension->iStatusPane = CEikStatusPaneBase::Current();
@@ -1456,17 +1454,12 @@
         CCoeControl::HandleResourceChange( aType ) ;
         }
 
-    if ( aType == KEikColorResourceChange ||
-         aType == KEikDynamicLayoutVariantSwitch ||
+    if ( aType == KEikDynamicLayoutVariantSwitch ||
          aType == KAknsMessageSkinChange )
         {
-        TInt colorScheme = ColorScheme();
-        if ( colorScheme != iExtension->iCurrentColorScheme ||
-             aType == KEikDynamicLayoutVariantSwitch ||
+        if ( aType == KEikDynamicLayoutVariantSwitch ||
              aType == KAknsMessageSkinChange )
             {
-            iExtension->iCurrentColorScheme = colorScheme;
-
             // updating color bitmap
             TRAP_IGNORE( LoadNaviColorBitmapL() );
             }
@@ -2352,16 +2345,9 @@
     TRect screenRect;
     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
 
-    // app window
-    TAknLayoutRect applicationWindowLayoutRect;
-    applicationWindowLayoutRect.LayoutRect(
-        screenRect,
-        AknLayoutScalable_Avkon::application_window( 0 ) );
-    TRect applicationWindowRect( applicationWindowLayoutRect.Rect() );
-
-    // statuspane
+    // statuspane, skip application window because it's the same as screen.
     TAknLayoutRect statusPaneLayoutRect;
-    statusPaneLayoutRect.LayoutRect( applicationWindowRect,
+    statusPaneLayoutRect.LayoutRect( screenRect,
                                      AknLayoutScalable_Avkon::status_pane( 0 ) );
     TRect statusPaneRect( statusPaneLayoutRect.Rect() );
 
--- a/uifw/AvKon/src/aknsignal.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/aknsignal.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2002-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"
@@ -303,8 +303,6 @@
     iSignalIconControl->SetContainerWindowL( *this );
     iSignalStrengthControl->SetContainerWindowL( *this );
 
-    iTicker = CPeriodic::NewL( CActive::EPriorityLow );
-
     // Set flags to default values
     iPrivateFlags = 0;
 
@@ -381,10 +379,7 @@
 //
 void CAknSignalPane::DisableAnimation()
     {
-    if ( iTicker && iTicker->IsActive() )
-        {
-        iTicker->Cancel();
-        }
+    StopTicker();
     }
 
 
@@ -404,19 +399,14 @@
 
         iSignalIconControl->SetDrawBlank( EFalse );
 
-        if ( aGprsIconState != EAknSignalGprsIndicatorEstablishingContext &&
-             iTicker )
+        if ( aGprsIconState != EAknSignalGprsIndicatorEstablishingContext )
             {
-            iTicker->Cancel();
+            StopTicker();
             }
         else if ( aGprsIconState == EAknSignalGprsIndicatorEstablishingContext )
             {
-            if ( iTicker && !iTicker->IsActive() )
-                {
-                iTicker->Start( KAknIndicatorAnimationDelay,
-                                KAknIndicatorAnimationInterval,
-                                TCallBack( TickerCallback, this ) );
-                }
+            TRAP_IGNORE( StartTickerL( KAknIndicatorAnimationDelay,
+                                       KAknIndicatorAnimationInterval ) );
             }
         }
     }
@@ -769,19 +759,14 @@
 
         iSignalIconControl->SetDrawBlank( EFalse );
 
-        if ( aCommonPacketDataIconState != EAknSignalCommonPacketDataIndicatorEstablishingContext &&
-             iTicker )
+        if ( aCommonPacketDataIconState != EAknSignalCommonPacketDataIndicatorEstablishingContext )
             {
-            iTicker->Cancel();
+            StopTicker();
             }
         else if ( aCommonPacketDataIconState == EAknSignalCommonPacketDataIndicatorEstablishingContext )
             {
-            if ( iTicker && !iTicker->IsActive() )
-                {
-                iTicker->Start( KAknIndicatorAnimationDelay,
-                                KAknIndicatorAnimationInterval,
-                                TCallBack( TickerCallback, this ) );
-                }
+            TRAP_IGNORE( StartTickerL( KAknIndicatorAnimationDelay,
+                                       KAknIndicatorAnimationInterval ) );
             }
         }
     }
@@ -803,19 +788,14 @@
 
         iSignalIconControl->SetDrawBlank( EFalse );
 
-        if ( aEdgeIconState != EAknSignalEdgeIndicatorEstablishingContext &&
-             iTicker )
+        if ( aEdgeIconState != EAknSignalEdgeIndicatorEstablishingContext )
             {
-            iTicker->Cancel();
+            StopTicker();
             }
         else if ( aEdgeIconState == EAknSignalEdgeIndicatorEstablishingContext )
             {
-            if ( iTicker && !iTicker->IsActive() )
-                {
-                iTicker->Start( KAknIndicatorAnimationDelay,
-                                KAknIndicatorAnimationInterval,
-                                TCallBack( TickerCallback, this ) );
-                }
+            TRAP_IGNORE( StartTickerL( KAknIndicatorAnimationDelay,
+                                       KAknIndicatorAnimationInterval ) );
             }
         }
     }
@@ -837,19 +817,14 @@
 
         iSignalIconControl->SetDrawBlank( EFalse );
 
-        if ( aWcdmaIconState != EAknSignalWcdmaIndicatorEstablishingContext &&
-             iTicker )
+        if ( aWcdmaIconState != EAknSignalWcdmaIndicatorEstablishingContext )
             {
-            iTicker->Cancel();
+            StopTicker();
             }
         else if ( aWcdmaIconState == EAknSignalWcdmaIndicatorEstablishingContext )
             {
-            if ( iTicker && !iTicker->IsActive() )
-                {
-                iTicker->Start( KAknIndicatorAnimationDelay,
-                                KAknIndicatorAnimationInterval,
-                                TCallBack( TickerCallback, this ) );
-                }
+            TRAP_IGNORE( StartTickerL( KAknIndicatorAnimationDelay,
+                                       KAknIndicatorAnimationInterval ) );
             }
         }
     }
@@ -871,19 +846,14 @@
 
         iSignalIconControl->SetDrawBlank( EFalse );
 
-        if ( aHsdpaIconState != EAknSignalHsdpaIndicatorEstablishingContext &&
-             iTicker )
+        if ( aHsdpaIconState != EAknSignalHsdpaIndicatorEstablishingContext )
             {
-            iTicker->Cancel();
+            StopTicker();
             }
         else if ( aHsdpaIconState == EAknSignalHsdpaIndicatorEstablishingContext )
             {
-            if ( iTicker && !iTicker->IsActive() )
-                {
-                iTicker->Start( KAknIndicatorAnimationDelay,
-                                KAknIndicatorAnimationInterval,
-                                TCallBack( TickerCallback, this ) );
-                }
+            TRAP_IGNORE( StartTickerL( KAknIndicatorAnimationDelay,
+                                       KAknIndicatorAnimationInterval ) );
             }
         }
     }
@@ -909,25 +879,26 @@
 
         // Tick timer is only used when animating.
         if ( aCdmaIconState != EAknSignalCdmaIndicatorSending &&
-             aCdmaIconState != EAknSignalCdmaIndicatorReceiving &&
-             iTicker )
+             aCdmaIconState != EAknSignalCdmaIndicatorReceiving )
             {
-            iTicker->Cancel();
+            StopTicker();
             }
 
         switch ( aCdmaIconState )
             {
             case EAknSignalCdmaIndicatorSending:
             case EAknSignalCdmaIndicatorReceiving:
+                {
                 if ( iTicker && !iTicker->IsActive() )
                     {
                     // restart animation
                     iExtension->iCdmaAnimationIndex = 0;
-                    iTicker->Start( KAknIndicatorShortAnimationInterval,
-                                    KAknIndicatorShortAnimationInterval,
-                                    TCallBack( TickerCallback, this ) );
+                    TRAP_IGNORE(
+                        StartTickerL( KAknIndicatorShortAnimationInterval,
+                                      KAknIndicatorShortAnimationInterval ) );
                     }
                 break;
+                }
             default:
                 break;
             }
@@ -1084,4 +1055,42 @@
     iSignalState = aIconState;
     }
 
+
+// ---------------------------------------------------------------------------
+// CAknSignalPane::StartTickerL
+// Starts the animation timer.
+// ---------------------------------------------------------------------------
+//
+void CAknSignalPane::StartTickerL( TTimeIntervalMicroSeconds32 aDelay,
+                                   TTimeIntervalMicroSeconds32 aInterval )
+    {
+    if ( !iTicker )
+        {
+        iTicker = CPeriodic::NewL( CActive::EPriorityLow );
+        }
+
+    if ( iTicker && !iTicker->IsActive() )
+        {
+        iTicker->Start( aDelay,
+                        aInterval,
+                        TCallBack( TickerCallback, this ) );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CAknSignalPane::StopTicker
+// Stops the animation timer.
+// ---------------------------------------------------------------------------
+//
+void CAknSignalPane::StopTicker()
+    {
+    if ( iTicker )
+        {
+        iTicker->Cancel();
+        delete iTicker;
+        iTicker = NULL;
+        }
+    }
+
 //  End of File
--- a/uifw/AvKon/src/aknstatuspanedatapublisher.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/aknstatuspanedatapublisher.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -302,7 +302,10 @@
         {
         if( iStatusPaneStateData->iProcessList.Find( aClientId ) == KErrNotFound )
             {
-            iStatusPaneStateData->iProcessList.Append( aClientId );
+            if ( KErrNone != iStatusPaneStateData->iProcessList.Append( aClientId ) )
+            	{
+				return;
+            	}
             }
         }
     else
--- a/uifw/AvKon/src/aknutils.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/aknutils.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -530,11 +530,11 @@
     _AKNDEBUG(
             if ( aListBox )
                 {
-    		_AKNTRACE( "[%s][%s] ListBox Rect iTl: %d,%d; iBr: %d,%d", 
-    				"AknFind", __FUNCTION__, 
-    				aParentControl->Rect().iTl.iX, aParentControl->Rect().iTl.iY, 
-    				aParentControl->Rect().iBr.iX, aParentControl->Rect().iBr.iY 
-				);
+            _AKNTRACE( "[%s][%s] ListBox Rect iTl: %d,%d; iBr: %d,%d", 
+                    "AknFind", __FUNCTION__, 
+                    aParentControl->Rect().iTl.iX, aParentControl->Rect().iTl.iY, 
+                    aParentControl->Rect().iBr.iX, aParentControl->Rect().iBr.iY 
+                );
                 }
         );
     _AKNTRACE_FUNC_EXIT;
@@ -621,7 +621,7 @@
         
     AknLayoutUtils::LayoutControl(aListBox, aParentControl->Rect(), tempListArea);
     _AKNDEBUG(
-    		if ( aListBox )
+            if ( aListBox )
                 {
                 _AKNTRACE( "[%s][%s] ListBox Rect iTl: %d,%d; iBr: %d,%d", 
                             "AknFind", __FUNCTION__,
@@ -629,7 +629,7 @@
                             aListBox->Rect().iBr.iX, aListBox->Rect().iBr.iY 
                             );
                 }
-		);
+        );
     if ( aListBox )
         {
         aListBox->DrawNow();
@@ -762,7 +762,7 @@
  *
  * @since 5.0
  * @return @c ETrue If it is accent from Vietnamese language, otherwise EFalse. 
- */	
+ */ 
 inline TBool IsVietnameseSpecialCharacter( TChar aCh )
     {  
     if ( ( aCh >= 0x0300 && aCh <= 0x0303 ) || aCh == 0x0306 ||     
@@ -779,10 +779,10 @@
 inline TBool IsThaiSpecialCharacter( TChar aCh )
     {    
     if( ( aCh > 0xE46 && aCh < 0xE4F ) ||  aCh == 0xE3A )
-		{
-		return ETrue;
-		}       
-	return EFalse;
+        {
+        return ETrue;
+        }       
+    return EFalse;
     }
   
 // ---------------------------------------------------------------------------
@@ -790,25 +790,25 @@
 // ---------------------------------------------------------------------------
 //
 EXPORT_C TBool AknFind::IsAdaptiveFindMatch( const TDesC& aItemText, 
-										     const TDesC& aSearchText,
- 										 	 HBufC*& aNextChars )
-	{	
-	HBufC16* searchText( NULL );
-	TRAPD( error, searchText = HBufC16::NewL( KMatchingBufferLength ) );
-	if ( error == KErrNone )
-	    {
-	    TInt itemStringLength = aItemText.Length();
+                                             const TDesC& aSearchText,
+                                             HBufC*& aNextChars )
+    {   
+    HBufC16* searchText( NULL );
+    TRAPD( error, searchText = HBufC16::NewL( KMatchingBufferLength ) );
+    if ( error == KErrNone )
+        {
+        TInt itemStringLength = aItemText.Length();
         TInt searchTextLength = aSearchText.Length();    
         
         if ( searchTextLength < KMatchingBufferLength )
-        	{
-        	searchText->Des().Append( aSearchText );
-        	}
+            {
+            searchText->Des().Append( aSearchText );
+            }
         else
-        	{
-        	searchText->Des().Append( aSearchText.Left(KMatchingBufferLength-1) );
-        	}    
-    	
+            {
+            searchText->Des().Append( aSearchText.Left(KMatchingBufferLength-1) );
+            }    
+        
         searchText->Des().Append( KLitStar );
             
         TInt all_result = KErrNotFound;
@@ -821,34 +821,34 @@
                 if( result != KErrNotFound ) 
                     {
                     all_result = result;
-                    if( i < (itemStringLength-searchTextLength) )                	   	       	   		
+                    if( i < (itemStringLength-searchTextLength) )                                       
                         {                 
-                	   	 if( !(IsThaiSpecialCharacter(aItemText[i+searchTextLength])) && !(IsVietnameseSpecialCharacter( aItemText[i+searchTextLength]) ))
+                         if( !(IsThaiSpecialCharacter(aItemText[i+searchTextLength])) && !(IsVietnameseSpecialCharacter( aItemText[i+searchTextLength]) ))
                                 {
                                 TRAP_IGNORE( UpdateNextCharsL( aNextChars, aItemText[i+searchTextLength]) );   
                                 }   
                         }
-                    }                                                                  	   	
+                    }                                                                       
                 } // if (i==0 ..)        
-      	    } // for	 
-	    
-  	    if( all_result != KErrNotFound )
+            } // for     
+        
+        if( all_result != KErrNotFound )
             {
             delete searchText;
             return ETrue;
-           	}    
+            }    
         else 
             {
             delete searchText;
             return EFalse;
             }
-        	            		
+                                
          } // if (error == KErrNone)   
 
     delete searchText;                 
     return EFalse;
-	}
-	
+    }
+    
 
 /**
  * For Devanagari AS
@@ -978,41 +978,78 @@
     return ( aCh == 0x094D );
     }
 
+static void SortCharsForAdaptiveSearchL( TPtr &aChars )
+    {
+    const TInt KDefaultArraySize = 10;// the default length of for sort
+    CDesCArray* arrayFlat = new ( ELeave ) CDesCArrayFlat( KDefaultArraySize );
+    CleanupStack::PushL( arrayFlat );
+    
+    TInt length = aChars.Length();                 
+    TInt arrayCount( 0 );      
+      
+    for( TInt i = 0; i < length; i++ )
+        {
+        // the "IndicHalant" Chars occupys two spaces.
+        if ( ( i < length-2 ) && IsIndicHalantChar( aChars[i+1] ) )
+           {
+           arrayFlat->AppendL( aChars.Mid( i, 3 ) );
+           // One "IndicHalant" character occupys two spaces
+           i+=2;
+           ++arrayCount;
+           }
+       else
+           {
+           arrayFlat->AppendL( aChars.Mid( i, 1 ) );
+           ++arrayCount;
+           }
+        }  
+    
+    // Alphabetical sort        
+    arrayFlat->Sort( ECmpCollated );
+    aChars.Delete( 0, aChars.Length() );
+
+    for( TInt i = 0; i < arrayCount; i++ )
+        {
+        aChars.Append( arrayFlat->MdcaPoint( i ) );
+        }  
+    CleanupStack::PopAndDestroy( arrayFlat );  
+    }
+
 // ---------------------------------------------------------------------------
 // For Devanagari AS
 // AknFind::UpdateNextCharsL
 // ---------------------------------------------------------------------------
 //
 void AknFind::UpdateNextCharsL( HBufC*& aNextChars, const TDesC& aItemString )
-	{
-	_AKNTRACE_FUNC_ENTER;
-	TChar searchChar = aItemString[0];
-	    //Check if this is an Indic special ligature
-	    if ( IsIndicConsonant(searchChar) && aItemString.Length() > 2
-	            && IsSpecialIndicLigature(aItemString) 
-	            && KErrNotFound == (*aNextChars).Find(aItemString.Mid(0,3)) )
-	        {
-	        //Check if we have enough space for 3 more characters
-	        if( aNextChars->Des().Length() >= aNextChars->Des().MaxLength()-3 )
-	            {
-	            aNextChars = aNextChars->ReAllocL( aNextChars->Des().MaxLength()+10 );
-	            TInt length1 = aNextChars->Des().Length();
-	            TInt maxlength1 = aNextChars->Des().MaxLength();
-	            }       
-	        aNextChars->Des().Append( aItemString.Mid(0,3) );        
-	        }
-	    else
-	        {
-	        if ( !IsValidCharForASGrid(searchChar) ) 
-	            {
-	            return;	            
-	            }
-	        //check if this is an Indic combined Char
-	        if ( IsIndicCombinedChar(searchChar) )
-	            {
-	            searchChar = RemoveIndicNukta( searchChar );
-	            }
-	        //Now update the nextChars string
+    {
+    _AKNTRACE_FUNC_ENTER;
+    TChar searchChar = aItemString[0];
+        //Check if this is an Indic special ligature
+        if ( IsIndicConsonant(searchChar) && aItemString.Length() > 2
+                && IsSpecialIndicLigature(aItemString) 
+                && KErrNotFound == (*aNextChars).Find(aItemString.Mid(0,3)) )
+            {
+            //Check if we have enough space for 3 more characters
+            if( aNextChars->Des().Length() >= aNextChars->Des().MaxLength()-3 )
+                {
+                aNextChars = aNextChars->ReAllocL( aNextChars->Des().MaxLength()+10 );
+                TInt length1 = aNextChars->Des().Length();
+                TInt maxlength1 = aNextChars->Des().MaxLength();
+                }       
+            aNextChars->Des().Append( aItemString.Mid(0,3) );        
+            }
+        else
+            {
+            if ( !IsValidCharForASGrid(searchChar) ) 
+                {
+                return;             
+                }
+            //check if this is an Indic combined Char
+            if ( IsIndicCombinedChar(searchChar) )
+                {
+                searchChar = RemoveIndicNukta( searchChar );
+                }
+            //Now update the nextChars string
             TInt strLength = aNextChars->Length();
             for ( TInt i(0); i < strLength ; ++i )
                 {
@@ -1037,9 +1074,9 @@
                 aNextChars = aNextChars->ReAllocL( aNextChars->Des().MaxLength()+10 );
                 }       
             aNextChars->Des().Append( searchChar );   
-	        }
-	    _AKNTRACE_FUNC_EXIT;
-	}
+            }
+        _AKNTRACE_FUNC_EXIT;
+    }
 
 // -----------------------------------------------------------------------------
 // AknFind::UpdateNextCharsL
@@ -1068,25 +1105,25 @@
 // ---------------------------------------------------------------------------
 //
 EXPORT_C void AknFind::UpdateNextCharsFromString( HBufC*& aNextChars, const TDesC& aItemString )
-	{
-	TInt itemStringLength = aItemString.Length();
-	     
-	for( TInt i = 0; i < itemStringLength; i++ )
-	    {
-	    if ( i == 0 || IsFindWordSeparator( aItemString[i-1] ) )
-	        {  
-	        // If Indic letter
-	        if ( aItemString[i] >= 0x0900 && aItemString[i] <= 0x0980 )
-	            {
-	            TRAP_IGNORE( UpdateNextCharsL( aNextChars, aItemString.Mid(i) ) );
-	            }
-	        else  if (!(IsVietnameseSpecialCharacter( aItemString[i])))
-	            {
-	            TRAP_IGNORE( UpdateNextCharsL( aNextChars, aItemString[i] ) );
-	            }
-	        }
-	    }
-	}
+    {
+    TInt itemStringLength = aItemString.Length();
+         
+    for( TInt i = 0; i < itemStringLength; i++ )
+        {
+        if ( i == 0 || IsFindWordSeparator( aItemString[i-1] ) )
+            {  
+            // If Indic letter
+            if ( aItemString[i] >= 0x0900 && aItemString[i] <= 0x0980 )
+                {
+                TRAP_IGNORE( UpdateNextCharsL( aNextChars, aItemString.Mid(i) ) );
+                }
+            else  if (!(IsVietnameseSpecialCharacter( aItemString[i])))
+                {
+                TRAP_IGNORE( UpdateNextCharsL( aNextChars, aItemString[i] ) );
+                }
+            }
+        }
+    }
 
 // ---------------------------------------------------------------------------
 // UpdateItemTextAccordingToFlag
@@ -1468,6 +1505,10 @@
                 }
             ptr_temptext.Zero(); 
             }
+        
+        TPtr nextChars = iExtension->iNextChars->Des();
+        SortCharsForAdaptiveSearchL( nextChars );
+        
         iSearchField->SetAdaptiveGridChars( *(iExtension->iNextChars) ); 
         CleanupStack::PopAndDestroy ( temptext );
         }
@@ -1773,7 +1814,6 @@
     FetchSelectionIndexesFromListBoxL();
     }
 
-
 void CAknListBoxFilterItems::NoCriteriaL(TBool aUpdateAS)
     {
     if (iDisableChangesToShownIndexes) return;
@@ -1820,36 +1860,7 @@
         if( aUpdateAS )
             {
             TPtr nextChars = iExtension->iNextChars->Des(); 
-            CDesCArray* array = new (ELeave) CDesCArrayFlat(10);
-            CleanupStack::PushL(array);
-            
-            TInt length = nextChars.Length();                 
-            TInt count(0);      
-              
-            for( TInt i = 0; i < length; i++ )
-                {
-                if ( (i < length-2) && IsIndicHalantChar( nextChars[i+1] ) )
-                   {
-                   array->AppendL( nextChars.Mid(i,3) );
-                   i+=2;
-                   ++count;
-                   }
-               else
-                   {
-                   array->AppendL( nextChars.Mid(i,1) );
-                   ++count;
-                   }
-                }  
-            
-            // Alphabetical sort        
-            array->Sort( ECmpCollated );
-            nextChars.Delete( 0, nextChars.Length() );
-
-            for( TInt i = 0; i < count; i++ )
-                {
-                nextChars.Append(array->MdcaPoint(i));
-                }  
-            CleanupStack::PopAndDestroy(array);   
+            SortCharsForAdaptiveSearchL( nextChars );  
             
             iSearchField->SetAdaptiveGridChars( *(iExtension->iNextChars) );
             }
@@ -1913,36 +1924,7 @@
             }           
    
         TPtr nextChars = iExtension->iNextChars->Des(); 
-        CDesCArray* array = new (ELeave) CDesCArrayFlat(10);
-        CleanupStack::PushL(array);
-        
-        TInt length = nextChars.Length();                 
-        TInt count(0);      
-          
-        for( TInt i = 0; i < length; i++ )
-            {
-            if ( (i < length-2) && IsIndicHalantChar( nextChars[i+1] ) )
-               {
-               array->AppendL( nextChars.Mid(i,3) );
-               i+=2;
-               ++count;
-               }
-           else
-               {
-               array->AppendL( nextChars.Mid(i,1) );
-               ++count;
-               }
-            }  
-        
-        // Alphabetical sort        
-        array->Sort( ECmpCollated );
-        nextChars.Delete( 0, nextChars.Length() );
-
-        for( TInt i = 0; i < count; i++ )
-            {
-            nextChars.Append(array->MdcaPoint(i));
-            }  
-        CleanupStack::PopAndDestroy(array);   
+        SortCharsForAdaptiveSearchL( nextChars );
 
         iSearchField->SetAdaptiveGridChars( *(iExtension->iNextChars) ); 
         CleanupStack::PopAndDestroy( temptext );
@@ -1975,6 +1957,7 @@
         }
     }
 
+
 void CAknListBoxFilterItems::ReleaseCriteriaL( const TDesC &aCriteria )
     {
     if ( iDisableChangesToShownIndexes )
@@ -2012,7 +1995,11 @@
                 iShownIndexes->AppendL(i);
                 }
             ptr_temptext.Zero();    
-           }                
+           }  
+        
+        TPtr nextChars = iExtension->iNextChars->Des(); 
+        SortCharsForAdaptiveSearchL( nextChars );
+        
         iSearchField->SetAdaptiveGridChars( *(iExtension->iNextChars) ); 
         InstallEmptyTextL(); 
         CleanupStack::PopAndDestroy( temptext );
@@ -4838,7 +4825,7 @@
     {
     if ( aControl && aControl->FindBackground() )
         {        
-		DrawEmptyListImpl_real(  aRect, aGc, text, NULL, ETrue);        
+        DrawEmptyListImpl_real(  aRect, aGc, text, NULL, ETrue);        
         return;
         }
 
--- a/uifw/AvKon/src/aknview.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/src/aknview.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -44,6 +44,7 @@
 #endif // RD_SCALABLE_UI_V2
 
 #include <AknUtils.h>
+#include <layoutmetadata.cdl.h>
 #include "aknitemactionmenuregister.h"
 
 // MODULE DATA STRUCTURES
@@ -54,6 +55,8 @@
 
 
 // CLASS DECLARATION
+static const TUid KUidGlxApp = { 0x200009ee }; // App uid of photo
+static const TUid KUidVideoApp = { 0x200159b2 }; // App uid of video
 
 /**
 * Extension class.
@@ -856,11 +859,20 @@
 			}
 		}
 
-	if ( iCba )
-		{
-		if ( aVisible )
-			{			
-			iCba->DrawableWindow()->SetOrdinalPosition( 0 );
+	if (iCba)
+        {
+        if (aVisible)
+            {
+            //Added for fixing EAMI-856GRV and ESLM-85ZHQH:           
+            //As video app and photo app spend a long time at deactiveview,during this time only cba shows up,and this is ugly in landscape mode
+            //so the solution is to don't call SetOrdinalPosition in video app and photo app while in landscape mode
+            TUid appid = iAppUi->Application()->AppDllUid();
+            if (!(( appid == KUidVideoApp || appid == KUidGlxApp )
+                    && Layout_Meta_Data::IsLandscapeOrientation()))
+                {
+                iCba->DrawableWindow()->SetOrdinalPosition( 0 );
+                }
+
 			iCba->MakeVisible( ETrue );
 			iCba->DrawNow(); // This is needed because problems if TRANSPARENCY is set, see MTVN-6HXCN4
 			}
--- a/uifw/AvKon/srcdata/smiley.rss	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/srcdata/smiley.rss	Mon Jun 21 15:57:43 2010 +0300
@@ -305,7 +305,7 @@
             code = EAknSmileyAnimSilly;
             smileyIconId = EMbmSmileyQgn_indi_smiley_anim_silly;
             smileyStaticIconId = EMbmSmileyQgn_indi_smiley_silly;
-            strings = "8P 8p 8-P 8-p";
+            strings = "8-P 8-p";
             },
         SMILEY_ICON_ITEM
             {
--- a/uifw/AvKon/tsrc/bc/S60_SDKMCL/bctestmixmcl/inc/bctestmixmclgeneralcase.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/tsrc/bc/S60_SDKMCL/bctestmixmcl/inc/bctestmixmclgeneralcase.h	Mon Jun 21 15:57:43 2010 +0300
@@ -161,12 +161,12 @@
      /*
       * Tests ItemFinder.
       */
-     void TestItemFinder();
+     void TestItemFinderL();
 
      /**
       * Tests FindItemDialog.
       */
-     void TestFindItemDialog();
+     void TestFindItemDialogL();
 
     /**
      * Tests button component API.
--- a/uifw/AvKon/tsrc/bc/S60_SDKMCL/bctestmixmcl/src/bctestmixmclgeneralcase.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/tsrc/bc/S60_SDKMCL/bctestmixmcl/src/bctestmixmclgeneralcase.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -132,8 +132,8 @@
     TestAknListUtilsL(); 
     TestRadioButtonSettingPageL();
     TestPopupSettingPageL();   
-    TestItemFinder();
-    TestFindItemDialog();
+    TestItemFinderL();
+    TestFindItemDialogL();
     TestEditorKineticScrollingL();
     TestEnableKineticScrollingPhysicsL();
     TestAknPhysicsSuspendPhysicsL();
@@ -666,10 +666,10 @@
     }
 
 // -----------------------------------------------------------------------------
-// CBCTestMixMCLGeneralCase::TestItemFinder
+// CBCTestMixMCLGeneralCase::TestItemFinderL
 // -----------------------------------------------------------------------------
 //
-void CBCTestMixMCLGeneralCase::TestItemFinder()
+void CBCTestMixMCLGeneralCase::TestItemFinderL()
     {
     _LIT( KSetItemFinderObserverL,
             "CItemFinder::SetItemFinderObserverL() tested" );
@@ -686,10 +686,10 @@
 
 
 // -----------------------------------------------------------------------------
-// CBCTestMixMCLGeneralCase::TestFindItemDialog
+// CBCTestMixMCLGeneralCase::TestFindItemDialogL
 // -----------------------------------------------------------------------------
 //
-void CBCTestMixMCLGeneralCase::TestFindItemDialog()
+void CBCTestMixMCLGeneralCase::TestFindItemDialogL()
     {
     _LIT( KEnableSingleClick,
             "CFindItemDialog::EnableSingleClick() tested" );
--- a/uifw/AvKon/tsrc/bc/bctesttemplate/inc/bctesttemplatecontainer.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/tsrc/bc/bctesttemplate/inc/bctesttemplatecontainer.h	Mon Jun 21 15:57:43 2010 +0300
@@ -49,7 +49,7 @@
     * Set component control, and container will own the control
     * @param aControl pointer to a control.
     */
-    void SetControl( CCoeControl* aControl ); 
+    void SetControlL( CCoeControl* aControl ); 
     
     /**
      * Delete control
--- a/uifw/AvKon/tsrc/bc/bctesttemplate/src/bctesttemplatecontainer.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/AvKon/tsrc/bc/bctesttemplate/src/bctesttemplatecontainer.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -91,10 +91,10 @@
     }
     
 // ---------------------------------------------------------------------------
-// CBCTestTemplateContainer::SetControl
+// CBCTestTemplateContainer::SetControlL
 // ---------------------------------------------------------------------------
 //
-void CBCTestTemplateContainer::SetControl( CCoeControl* aControl )
+void CBCTestTemplateContainer::SetControlL( CCoeControl* aControl )
     {
     iControl = aControl;    
     if ( iControl )
--- a/uifw/EikStd/coctlinc/smileyiconrecord.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlinc/smileyiconrecord.h	Mon Jun 21 15:57:43 2010 +0300
@@ -76,6 +76,7 @@
     ~CSmileyIconRecord();
     
     void InsertIconL( CSmileyIcon* aIcon );
+    void DeleteIconAtPos( TInt aDocPos );
     void HandleTextDelete( TInt aStart, TInt aLength );
     void HandleTextInsert( TInt aStart, TInt aLength );
     void CancelSelection();
--- a/uifw/EikStd/coctlinc/smileymodel.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlinc/smileymodel.h	Mon Jun 21 15:57:43 2010 +0300
@@ -108,6 +108,7 @@
     TInt SmileyStringLength( TInt aNodeIndex );
     TText SmileyCode( TInt aNodeIndex );
     void ReplaceTextWithCodes( TDes& aText, TInt aDocPos, TInt aNodeIndex );
+    TBool IsSmileyBySemanticAnalysis(const TDesC& aText, TInt aSmileyLength);
 
 private:    
     TInt AddLinkAndImageInfoL( CSmileyInfo& aInfo, TInt aStrIndex );    
--- a/uifw/EikStd/coctlsrc/AknButton.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/AknButton.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-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"
@@ -290,7 +290,9 @@
     CAknsFrameBackgroundControlContext* iHighlightContext;  
     // buffer for visually ordered text
     TBuf<255 + KAknBidiExtraSpacePerLine> iVisualText; 
-    TBool iFeedbackEnabled; 
+    TBool iFeedbackEnabled;
+    TAknsItemID iBackgroundSkinIID;
+    TRect iBgFrameRect;
     };
 
 // ============================ MEMBER FUNCTIONS ===============================
@@ -1036,8 +1038,8 @@
 //
 EXPORT_C void CAknButtonState::SetFlags( const TInt aFlags )
     {
-    if ( iFlags & KAknButtonStateHasLatchedFrame != 
-        aFlags & KAknButtonStateHasLatchedFrame )
+    if ( ( iFlags & KAknButtonStateHasLatchedFrame ) != 
+        ( aFlags & KAknButtonStateHasLatchedFrame ) )
         {
         iExtension->iFlagsChanged = ETrue; 
         }
@@ -4578,10 +4580,15 @@
             frameIdIndex = KDimmedFrameId;
             }
 
-        if ( SkinIID( frameIdIndex ) != KAknsIIDNone )
+        TAknsItemID skinIID( SkinIID( frameIdIndex ) );
+
+        // Only change the background frame graphics if necessary.
+        if ( skinIID != KAknsIIDNone &&
+             skinIID != iExtension->iBackgroundSkinIID )
             {
-            iBgContext->SetFrame( SkinIID( frameIdIndex ) );
+            iBgContext->SetFrame( skinIID );
             iBgContext->SetCenter( SkinIID( ++frameIdIndex) );
+            iExtension->iBackgroundSkinIID = skinIID;
             }
         }
     if ( state )
@@ -4597,13 +4604,20 @@
 void CAknButton::SetFrameRects()
     {
     TRect rect( Rect() );
-    TAknLayoutRect centerLayout;
-    centerLayout.LayoutRect( rect,
-        AknLayoutScalable_Avkon::toolbar_button_pane_g1().LayoutLine() );
-    TRect innerRect( centerLayout.Rect() );
-
-    iBgContext->SetFrameRects( rect, innerRect ); 
-    iExtension->iHighlightContext->SetFrameRects( rect, innerRect ); 
+
+    // Only change the frame rects is the button rectangle is valid and the
+    // button size has changed.
+    if ( !rect.IsEmpty() && iExtension->iBgFrameRect != rect )
+        {
+        TAknLayoutRect centerLayout;
+        centerLayout.LayoutRect( rect,
+            AknLayoutScalable_Avkon::toolbar_button_pane_g1().LayoutLine() );
+        TRect innerRect( centerLayout.Rect() );
+
+        iBgContext->SetFrameRects( rect, innerRect );
+        iExtension->iHighlightContext->SetFrameRects( rect, innerRect );
+        iExtension->iBgFrameRect = rect;
+        }
     }
 
 // -----------------------------------------------------------------------------
--- a/uifw/EikStd/coctlsrc/AknToolbar.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/AknToolbar.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-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"
@@ -251,31 +251,26 @@
     aReader.ReadInt8();  //lines, not used currently
     iFlags = aReader.ReadInt32();
 
-    TBool enableTransparency = CAknEnv::Static()->TransparencyEnabled() && 
+    TBool enableTransparency = 
         ( ( !( iFlags & KAknToolbarFixed ) && 
                 !( iFlags & KAknToolbarFloatingUnTransparent ) ) || 
         ( iFlags & KAknToolbarTransparent && iFlags & KAknToolbarFixed ) ); 
 
-
-    if( enableTransparency ) 
+    if ( enableTransparency ) 
         {
         Window().SetRequiredDisplayMode( EColor16MA ); // Without this, ACT does not work in all cases in HW
-        TInt err = Window().SetTransparencyAlphaChannel();
-
-        if ( err == KErrNone ) // it should all ways be true in NGA
-            {
-            // Set the window initially completely transparent. This needs to be called only once.
-            Window().SetBackgroundColor(~0);
-            }
+        EnableWindowTransparency();
         }
 
-
-
-    iFrameContext = CAknsFrameBackgroundControlContext::NewL( KAknsIIDQsnFrPopupSub, 
-            TRect(), TRect(), ( iFlags & KAknToolbarFixed )? ETrue : EFalse );  
+    TRect dummyRect( 0, 0, 0, 0 );
+    iFrameContext = CAknsFrameBackgroundControlContext::NewL(
+        KAknsIIDQsnFrPopupSub, 
+        dummyRect,
+        dummyRect,
+        ( iFlags & KAknToolbarFixed ) ? ETrue : EFalse );  
 
     iBgContext = CAknsBasicBackgroundControlContext::NewL(
-        KAknsIIDQsnBgScreen, TRect(), ETrue );
+        KAknsIIDQsnBgScreen, dummyRect, ETrue );
 
     SetWithSliding( ETrue ); 
 
@@ -314,15 +309,20 @@
     // the rects correctly. 
     if ( iFlags & KAknToolbarFixed )
         {
-        if ( iFlags & KAknToolbarDefault )
+        SetFocusing( EFalse );
+        
+        // Don't set the size and position for default toolbar (never shown).
+        if ( !( iFlags & KAknToolbarDefault ) )
             {
-            SetDimmed( ETrue ); 
+            SetRect( CalculateSizeAndPosition() );
             }
-        SetFocusing( EFalse ); 
-        SetRect( CalculateSizeAndPosition() ); 
         }
 
-    AdjustAllButtons();
+    // Unnecessary for default toolbar (never shown).
+    if ( !( iFlags & KAknToolbarDefault ) )
+        {
+        AdjustAllButtons();
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -413,8 +413,9 @@
             iInternalFlags.Clear( EFixedShown );
             }
 
-        if ( visible && ( !AknLayoutUtils::PenEnabled() || 
-            ( !Layout_Meta_Data::IsLandscapeOrientation() && iFlags & KAknToolbarDefault ) ) )
+        if ( visible &&
+             !Layout_Meta_Data::IsLandscapeOrientation() &&
+             iFlags & KAknToolbarDefault )
             {
             return; 
             }
@@ -547,9 +548,7 @@
 //
 void CAknToolbar::ShowToolbarL()
     {
-    if ( iFlags & KAknToolbarFixed &&
-         ( !AknLayoutUtils::PenEnabled() ||
-           iFlags & KAknToolbarDefault ) )
+    if ( iFlags & KAknToolbarFixed && iFlags & KAknToolbarDefault )
         {
         if ( IsVisible() )
             {
@@ -592,12 +591,6 @@
         SetExtent( startPos, rect.Size() );
         UpdateControlPositions(); 
 
-        TBool redrawStoreEnabled(EFalse);
-        if( !CAknEnv::Static()->TransparencyEnabled() )
-            {
-            redrawStoreEnabled = Window().IsRedrawStoreEnabled();
-            }
-
         CTouchToolbarData* data = CheckRegistration( this );      
         if ( data && !(iFlags & KAknToolbarFixed) && iAvkonAppUi->IsForeground() )
             {
@@ -636,11 +629,6 @@
                 delete data;
                 GfxTransEffect::Deregister( this );
                 }
-
-            if ( !CAknEnv::Static()->TransparencyEnabled() && redrawStoreEnabled )
-                {
-                Window().EnableRedrawStore( ETrue );
-                }
             }
 
         // notify observer, for example touch pane, that toolbar was shown
@@ -745,11 +733,6 @@
     {
     if ( !iInternalFlags.IsSet( EShown ) ) // nothing to hide
         {
-        if ( iFlags & KAknToolbarDefault && !AknLayoutUtils::PenEnabled()
-              && IsVisible() )
-            {
-            MakeVisible( EFalse );
-            }
         return;
         }
 
@@ -1200,13 +1183,8 @@
             return;
             }
         }
-        
-    if ( aType == KAknToolbarSetVisible && iFlags & KAknToolbarDefault 
-            && !AknLayoutUtils::PenEnabled() )
-        {
-        return; 
-        }
-    else if ( aType == KAknToolbarSetVisible && !IsShown() )
+
+    if ( aType == KAknToolbarSetVisible && !IsShown() )
         {
         iInternalFlags.Set( ECalledFromFW );
         iInternalFlags.Clear( EDrawBackground ); 
@@ -1235,14 +1213,10 @@
             CAknButton* button = static_cast<CAknButton*>( item->Control() ); 
             button->ResetState();
             }
-        if ( iFlags & KAknToolbarDefault && !AknLayoutUtils::PenEnabled() && IsVisible() )
+
+        if ( iFlags & KAknToolbarFixed )
             {
-            TRAP_IGNORE( HideToolbarL() ); 
-            return; 
-            }
-        else if ( iFlags & KAknToolbarFixed )
-            {
-            if ( Layout_Meta_Data::IsLandscapeOrientation() && AknLayoutUtils::PenEnabled() )
+            if ( Layout_Meta_Data::IsLandscapeOrientation() )
                 {
                 iOrientation = EAknOrientationVertical; 
                 if ( ( iInternalFlags.IsSet( EFixedShown ) 
@@ -1262,7 +1236,7 @@
                         }
                     }
                 }
-            else if ( !( iFlags & KAknToolbarDefault ) && AknLayoutUtils::PenEnabled() )
+            else if ( !( iFlags & KAknToolbarDefault ) )
                 {
                 iOrientation = EAknOrientationHorizontal; 
                 if ( iInternalFlags.IsSet( EFixedShown ) && !iInternalFlags.IsSet( EShown ) )
@@ -1280,7 +1254,7 @@
                         }
                     }
                 }
-            else if ( ( !AknLayoutUtils::PenEnabled() || iFlags & KAknToolbarDefault ) && iInternalFlags.IsSet( EShown ) )
+            else if ( iFlags & KAknToolbarDefault && iInternalFlags.IsSet( EShown ) )
                 {
                 TRAP_IGNORE( HideToolbarL() ); 
                 return; 
@@ -2383,27 +2357,31 @@
             }
         } 
 
-    TRect rect = CalculateSizeAndPosition();
-    // Set focused item again to avoid panic in a case when toolbar has more 
-    // items in previous orientation and some of the items that do not 
-    // fit to toolbar in this orientation was focused. 
-    if ( IsFocused() )
-        {
-        TRAP_IGNORE( MoveHighlightL( iFocusedItem, EFalse ) ); 
-        }
-
-    if ( iInternalFlags.IsSet( EShown ) )
+    // Don't set the size and position for default toolbar (never shown).
+    if ( !( iFlags & KAknToolbarDefault ) )
         {
-        if ( !( iFlags & KAknToolbarFlexiblePosition ) )
+        TRect rect = CalculateSizeAndPosition();
+        // Set focused item again to avoid panic in a case when toolbar has
+        // more items in previous orientation and some of the items that do
+        // not  fit to toolbar in this orientation was focused. 
+        if ( IsFocused() )
             {
-            SetPosition( rect.iTl );
+            TRAP_IGNORE( MoveHighlightL( iFocusedItem, EFalse ) ); 
             }
-        else 
+    
+        if ( iInternalFlags.IsSet( EShown ) )
             {
-            UpdateControlPositions(); 
+            if ( !( iFlags & KAknToolbarFlexiblePosition ) )
+                {
+                SetPosition( rect.iTl );
+                }
+            else 
+                {
+                UpdateControlPositions(); 
+                }
+            SetSize( rect.Size() );
+            DrawDeferred();
             }
-        SetSize( rect.Size() );
-        DrawDeferred();
         }
     }
 
@@ -2639,14 +2617,10 @@
     {
     TBool toolbarNotVisible( !IsShown() && !( iFlags & KAknToolbarDefault ) );
     TBool fixedToolbar( iFlags & KAknToolbarFixed );
-    TBool landscapeOrientation( Layout_Meta_Data::IsLandscapeOrientation() );
-    TBool touchEnabled( AknLayoutUtils::PenEnabled() );
     TBool defaultContent( iFlags & KAknToolbarDefault );
 
     if ( toolbarNotVisible || 
          !fixedToolbar ||
-         ( defaultContent && !landscapeOrientation ) ||
-         !touchEnabled ||
          ( fixedToolbar && defaultContent ) )
         {
         return;
--- a/uifw/EikStd/coctlsrc/EIKEDWIN.CPP	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/EIKEDWIN.CPP	Mon Jun 21 15:57:43 2010 +0300
@@ -102,6 +102,10 @@
 #include "smileycustomwrap.h"
 #include <touchfeedback.h>
 
+// declare function
+void ReadSpecialCharFromSCTL( TPtr& ptr, TInt sctResourceId );
+void ReadSCTHeadPane( TResourceReader& aReader );
+
 GLDEF_C void Panic(TEikEdwinPanic aPanic)
     {
     _LIT(KPanicCat,"EIKON-EDWIN");
@@ -149,6 +153,11 @@
 
 const TInt KContentThreshold = 8;
 
+const TInt KNmericSCTLimit( 256 );
+const TInt KTInt16Length( sizeof( TInt16 ) );
+const TInt KTInt32Length( sizeof( TInt32 ) );
+const TInt KTUint32Length( sizeof( TUint32 ) );
+
 //
 // class CEikEdwin::CUndoBuffer
 //
@@ -641,7 +650,9 @@
     TCursorSelection select( aCursorSelection.iCursorPos, aCursorSelection.iAnchorPos );
     iEdwin.HandleSelectionForSmiley( select );
     iEdwin.iTextView->SetSelectionL( select );
-    iEdwin.ReportEdwinEventL(MEikEdwinObserver::EEventNavigation);
+    iEdwin.UpdateVertScrollBarThumbL();
+    iEdwin.UpdateHorizScrollBarThumb();
+    iEdwin.ReportEdwinEventL( MEikEdwinObserver::EEventNavigation );
     }
 
 void CEikEdwinFepSupport::GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const
@@ -667,13 +678,21 @@
                     EFalse ); )
                 }
             }
+        // Replace all 'i' following smiley code to invisbile placeholder for
+        // Touch Input can not recognize it as part of smiley code string.
         TInt smileyEndPos( 0 );
         for ( TInt i( 0 ); i < length; i++ )
             {
-            if ( aEditorContent[i] == CSmileyManager::KCompensateChar && 
-                i < smileyEndPos )
+            if ( aEditorContent[i] == CSmileyManager::KCompensateChar )
                 {
-                aEditorContent[i] = CSmileyManager::KPlaceHolder;
+                // when 'i' is the first character, it is unkonwn whether it is
+                // part of a smiley code string or not, so we have to use another 
+                // function to decide.
+                if ( ( i > 0 && i < smileyEndPos ) ||
+                     ( i == 0 && smiley->SmileyCodeByPos( aDocumentPosition ) > 0 ) )
+                    {
+                    aEditorContent[i] = CSmileyManager::KPlaceHolder;
+                    }
                 }
             else if ( smiley->IsSmileyCode( aEditorContent[i] ) )
                 {
@@ -707,7 +726,6 @@
     {
     __ASSERT_ALWAYS(iPositionOfInlineTextInDocument>=0,Panic(EEikPanicBadInlineEditingState9)); // assert that we're currently inline editing
     __ASSERT_DEBUG((iOriginalSelection.iCursorPos>=0) && (iOriginalSelection.iAnchorPos>=0) && (iPositionOfInsertionPointInDocument>=0) && (iPositionOfInlineTextInDocument>=0) && (iLengthOfInlineText>=0) && (iPointerEventHandlerDuringInlineEdit!=NULL),Panic(EEikPanicBadInlineEditingState10));
-    iEdwin.iEdwinExtension->iInlineEditing = EFalse;
     iCharsInserted = 0;
     iCharsDeleted = 0;
     TBool paragraphContainingStartPositionOfInlineTextHasChangedFormat=EFalse;
@@ -721,6 +739,9 @@
         {
         iEdwin.iUndoStore->SetNewText( select );
         }    
+
+    iEdwin.iEdwinExtension->iInlineEditing = EFalse;
+
     if ( iEdwin.IsSmileyEnabled() )
         {
         CAknEdwinState* state( iEdwin.EditorState() );
@@ -741,7 +762,14 @@
                     }
                 }
             iEdwin.SetAmountToFormatL( EFalse, ETrue );
-            iEdwin.DrawDeferred();
+
+            CAknEdwinState* edwinState = 
+                    static_cast<CAknEdwinState*>( iEdwin.iEdwinFepSupport->State( KNullUid ) );
+            
+            if ( !( edwinState->Flags() & EAknEditorFlagHideTextView ) )
+                {
+                iEdwin.DrawDeferred();
+                }
             }
         }
     iOriginalSelection.SetSelection(-1,-1);
@@ -2962,6 +2990,12 @@
                 {
                 TRAP_IGNORE( edwinState->ReportAknEdStateEventL( 
                     MAknEdStateObserver::EAknSyncEdwinState ) );
+                if ( edwinState->Flags() & EAknEditorFlagHideTextView )
+                    {
+                    iTextView->MakeVisible( ETrue );
+                    edwinState->SetFlags( edwinState->Flags() & 
+                        ~EAknEditorFlagHideTextView );
+                    }
                 }
             else
                 {
@@ -6023,6 +6057,8 @@
         
         // Actual scrolling is done by calling MoveScrollIndex
         iEdwinExtension->iPhysicsHandler->MoveScrollIndex( -textMovePixels );
+        iEdwinExtension->iEndBorderExceeded = EFalse; 
+        iEdwinExtension->iStartBorderExceeded = EFalse; 
         
         iEdwinExtension->iScrolledByScrollBar = EFalse;
     	}
@@ -6705,6 +6741,8 @@
         if ( iEdwinExtension )
         	{
 			iEdwinExtension->iThumbPos = KErrNotFound;
+	        iEdwinExtension->iEndBorderExceeded = EFalse; 
+	        iEdwinExtension->iStartBorderExceeded = EFalse; 
         	}
         SizeChanged();
         if ( !IsReadOnly() && !IsNonFocusing() 
@@ -7429,7 +7467,29 @@
                 break;
             }
 
-        return iEikonEnv->AllocReadResourceLC(resId);
+	    // get special character table resource ID
+        TInt sctResourceId = state->SpecialCharacterTableResourceId();
+		if ( sctResourceId && ( state->Flags() & EAknEditorFlagUseSCTNumericCharmap ) )
+			{
+		    // numericSCTBuf containing number and special characters
+			HBufC* numericSCTBuf = HBufC::NewLC( KNmericSCTLimit );
+			TPtr numericSCTPtr( numericSCTBuf->Des() );
+			
+			// read number characters and add them to numericSCTBuf
+			HBufC* numberResource = iEikonEnv->AllocReadResourceLC( resId );
+			TPtr numberResPtr( numberResource->Des() );
+			numericSCTPtr.Append( numberResPtr );
+			CleanupStack::PopAndDestroy( numberResource ); // numberResource
+			
+		    // read special characters from SCT by dialog ID
+		    ReadSpecialCharFromSCTL( numericSCTPtr, sctResourceId );
+		    
+		    return numericSCTBuf;
+			}
+		else
+			{
+		    return iEikonEnv->AllocReadResourceLC( resId );
+			}
         }
     else
         {
@@ -8287,7 +8347,22 @@
     if ( chinesePopup != ( aNewFlags & EAknEditorFlagChinesePopup ) )
         {
         TRAP_IGNORE( ReportChinesePopupEventL( chinesePopup == 0 ) );
-        }    
+        }
+    
+    if ( iTextView )
+        {
+        if ( ( aNewFlags & EAknEditorFlagHideTextView )
+                && !( aOldFlags & EAknEditorFlagHideTextView ) )
+            {
+            iTextView->MakeVisible( EFalse );
+            }
+        else if ( ( aOldFlags & EAknEditorFlagTouchInputModeOpened )
+                && !( aNewFlags & EAknEditorFlagTouchInputModeOpened ) )
+            {
+            iTextView->MakeVisible( ETrue );
+            DrawNow();
+            }
+        }
     }
 
 void CEikEdwin::ReportChinesePopupEventL( TBool aChinesePopupOpen )
@@ -8423,7 +8498,13 @@
         CleanupStack::PopAndDestroy( buf );
         if ( aRedraw )
             {
-            DrawDeferred();
+            CAknEdwinState* edwinState = 
+                static_cast<CAknEdwinState*>( iEdwinFepSupport->State( KNullUid ) );
+
+            if ( !( edwinState->Flags() & EAknEditorFlagHideTextView ) )
+                {
+                DrawDeferred();
+                }
             }
         }
     }
@@ -8972,5 +9053,75 @@
     }
 
 
+// ---------------------------------------------------------------------------
+// ReadSpecialCharFromSCTL
+// ---------------------------------------------------------------------------
+//
+void ReadSpecialCharFromSCTL( TPtr& ptr, TInt sctResourceId )
+	{
+	TResourceReader aReader;
+	CCoeEnv::Static()->CreateResourceReaderLC( aReader, sctResourceId );
+	aReader.Advance( KTInt32Length ); // Diaog Flag
+	HBufC* titleBar = aReader.ReadHBufCL(); // title bar
+	// for titleBar useless, release it.
+	delete titleBar;
+	titleBar = NULL;
+	// Page Selector Resource Id, Button Group Container Resource Id
+	aReader.Advance( KTInt32Length + KTInt32Length );
+	TInt lineCount = aReader.ReadInt16(); // line Count
+	for ( TInt ii = 0; ii < lineCount; ii++ )
+		{
+        TInt controlType = aReader.ReadInt16(); // control Type
+	    if ( controlType == EAknCtPopupHeadingPane )
+	    	{
+	        // read HeadPane
+	    	ReadSCTHeadPane( aReader );
+	    	}
+	    else if ( controlType == EAknCtSpecialCharacterMap )
+	    	{
+	        aReader.ReadTPtrC(); // caption text
+			aReader.Advance( KTInt16Length + KTInt32Length ); // captioned control ID, item flags
+			
+			TInt component_count = aReader.ReadInt16();
+			for ( TInt jj = 0; jj < component_count; jj++ )
+				{
+				TInt component_id = aReader.ReadInt16();
+				if ( component_id == EAknSCTLowerCase || component_id == EAknSCTUpperCase ||
+					component_id == EAknSCTNumeric )
+					{
+					HBufC* specialChar = aReader.ReadHBufCL();
+					ptr.Append( specialChar->Des() );
+					delete specialChar;
+					}
+				}
+	    	}
+	    else
+	    	{
+	        break;
+	    	}
+		}
+	CleanupStack::PopAndDestroy(); // aReader
+	}
+
+// ---------------------------------------------------------------------------
+// ReadSCTHeadPane
+// ---------------------------------------------------------------------------
+//
+void ReadSCTHeadPane( TResourceReader& aReader )
+	{
+	aReader.ReadTPtrC(); // caption text
+	// captioned control ID, item flags
+	aReader.Advance( KTInt16Length + KTInt32Length );
+	aReader.ReadTPtrC(); // text of head pane
+	aReader.ReadTPtrC(); // bitmap File Name of head pane
+	// bitmap Id, bitmap Mask Id,animation Id, layout of head pane
+	aReader.Advance( KTInt16Length + KTInt16Length + KTUint32Length + KTUint32Length );
+	aReader.ReadTPtrC(); // trailer
+	aReader.ReadTPtrC(); // bitmap File Name of captioned control
+	// bitmap Id, bitmap Mask Id of captioned control
+	aReader.Advance( KTInt16Length + KTInt16Length );
+	aReader.ReadTPtrC(); // Process ToolTip
+	}
+
 // End of File
 
--- a/uifw/EikStd/coctlsrc/EIKLBX.CPP	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/EIKLBX.CPP	Mon Jun 21 15:57:43 2010 +0300
@@ -4275,7 +4275,8 @@
         TBool allowed = ETrue;
 
         if ( iListBoxExt && iListBoxExt->iPhysics
-             && aEvent != MEikListBoxObserver::EEventFlickStopped )
+             && aEvent != MEikListBoxObserver::EEventFlickStopped 
+             && aEvent != MEikListBoxObserver::EEventFlickStarted )
             {
             allowed = iListBoxExt->iClickEventsAllowed;
             }
@@ -5149,6 +5150,7 @@
 
             // update index of the last down tapped item
             iListBoxExt->iLastDownTappedItem = itemIndex;
+            iListBoxExt->iMarkableListShiftKeyPressed = EFalse; 
 
             if ((! (Rect().Contains(aPointerEvent.iPosition))) && (iListBoxFlags & EPopout)) 
                 {
@@ -5312,7 +5314,7 @@
                             }
                         }
 
-                    if ( itemIndex == oldCurrentItemIndex )
+                    if ( itemIndex == oldCurrentItemIndex && !iListBoxExt->iSingleClickEnabled )
                         {
                         if ( shiftKeyPressed )
                             {
@@ -7150,7 +7152,15 @@
 
     if ( iListBoxExt && iListBoxExt->iMarkableListMarking )
         {
-        if ( iListBoxExt->iMarkableListShiftKeyPressed )
+        if ( iListBoxExt->iSingleClickEnabled )
+            {
+            if ( iListBoxExt->iMarkableListShiftKeyPressed )
+                {
+                iView->ToggleItemL( iView->CurrentItemIndex() );
+                iListBoxExt->iClickEventsAllowed = EFalse;
+                }
+            }
+        else if ( iListBoxExt->iMarkableListShiftKeyPressed )
            {
 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
            iListBoxExt->iAnchor = oldCurrentItemIndex;
--- a/uifw/EikStd/coctlsrc/EIKMENUB.CPP	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/EIKMENUB.CPP	Mon Jun 21 15:57:43 2010 +0300
@@ -182,6 +182,7 @@
                 {
                 changeState = ETrue;
                 dimCommands = EFalse;
+                iBar->iMenuPane->SetItemActionsStateL( ETrue );
                 }
             else if ( !iItemActionMenu->CollectionHighlightVisible() )
                 {
@@ -196,6 +197,7 @@
                         {
                         iBar->iMenuPane->SetItemDimmed( EAknCmdUnmark, ETrue ); 
                         } 
+                    iBar->iMenuPane->SetItemActionsStateL( ETrue );
                     dimMarkAndUnmark = ETrue; 
                     }
                 else 
@@ -1012,6 +1014,30 @@
             TInt resource =
                 ( *iTitleArray )[ titles ]->iData.iMenuPaneResourceId;
             iMenuPane->AddMenuItemsL( resource, 0, ETrue );
+            // Multiple marking mode active
+            if ( markedItems && resource == R_AVKON_MENUPANE_MARK_MULTIPLE )
+                {
+                if ( !marking->CollectionEmpty() )
+                    {
+                    iMenuPane->SetItemDimmed( EAknCmdMarkingModeMarkAll, EFalse );
+                    // Setting the item item specific so it will be shown in menu
+                    iMenuPane->SetItemSpecific( EAknCmdMarkingModeMarkAll, ETrue ); 
+                    }
+
+                if ( markedItems )
+                    {
+                    iMenuPane->SetItemDimmed( EAknCmdMarkingModeUnmarkAll, EFalse );
+                    // Setting the item item specific so it will be shown in menu
+                    iMenuPane->SetItemSpecific( EAknCmdMarkingModeUnmarkAll, ETrue ); 
+                    }
+
+                iMenuPane->SetItemDimmed( EAknCmdMarkingModeMarkOne, ETrue );
+                iMenuPane->SetItemDimmed( EAknCmdMarkingModeEnter, ETrue );
+                }
+            else if ( resource == R_AVKON_MENUPANE_MARK_MULTIPLE )
+                {
+                iMenuPane->SetItemDimmed( EAknCmdMarkingModeMarkOne, ETrue );
+                }
             iMenuObserver->DynInitMenuPaneL( resource, iMenuPane );
             if ( fepMenuObserver )
                 fepMenuObserver->DynInitMenuPaneL( resource, iMenuPane );
@@ -1020,22 +1046,18 @@
                 iActiveEditMenuObserver->DynInitMenuPaneL(
                         resource,iMenuPane );
                 }
-
-            if ( resource == R_AVKON_MENUPANE_MARK_MULTIPLE )
-                {
-                iMenuPane->SetItemDimmed( EAknCmdMarkingModeMarkOne, ETrue );
-                }
             iMenuPane->FilterDimmedItems();
             titles--;
             }
         iExt->SetItemCommandsStateL();
         iMenuPane->FilterDimmedItems();
         }
-
-    // Multiple marking mode active
-    if ( marking )
+    // If no marked items but marking mode is active we need to add "Mark all"
+    // and "Unmark all" to menu. 
+    else if ( marking )
         {
-        iMenuPane->AddMenuItemsL( R_AVKON_MENUPANE_MARK_MULTIPLE, 0, ETrue );
+        TInt resource( R_AVKON_MENUPANE_MARK_MULTIPLE ); 
+        iMenuPane->AddMenuItemsL( resource, 0, ETrue );
 
         if ( !marking->CollectionEmpty() )
             {
@@ -1049,6 +1071,7 @@
 
         iMenuPane->SetItemDimmed( EAknCmdMarkingModeMarkOne, ETrue );
         iMenuPane->SetItemDimmed( EAknCmdMarkingModeEnter, ETrue );
+        iMenuObserver->DynInitMenuPaneL( resource, iMenuPane ); 
         iMenuPane->FilterDimmedItems();
         }
 
--- a/uifw/EikStd/coctlsrc/EIKMENUP.CPP	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/EIKMENUP.CPP	Mon Jun 21 15:57:43 2010 +0300
@@ -239,7 +239,8 @@
         ESkipScrollbarUpdate,
         EHighlightEnabled,
         EHideViewSpecificCommands, 
-        EHideMarkAndUnmark
+        EHideMarkAndUnmark,
+        EHideItemActionCommands
         };
 
     /**
@@ -489,6 +490,12 @@
     _AKNTRACE( "delta = %d",  delta );
     _AKNTRACE( "iViewPosition(%d,%d)",  iViewPosition.iX, iViewPosition.iY );
     
+    //here checking the delta whether it is changed.
+    //if it is changed,the view must be drawn using the below code.
+    if ( delta != 0 )
+        {
+        aDrawNow = ETrue;
+    	}
     if ( aDrawNow )
         {
         if ( iFlags.IsClear( ESkipScrollbarUpdate ) )
@@ -1248,6 +1255,7 @@
         }
 		
     iFlags.Clear( EHideItemSpecificCommands );
+    iFlags.Clear( EHideItemActionCommands );
     iFlags.Clear( EContextSensitive );
     iFlags.Clear( EHighlightEnabled );
     iFlags.Clear( EHideViewSpecificCommands );
@@ -1356,9 +1364,16 @@
             {
             iFlags.Set( EContextSensitive );
             }
-        else if ( ownerFlags.IsSet( EHideItemSpecificCommands ) )
+        else
             {
-            iControl->SetItemCommandsStateL( ETrue );
+            if ( ownerFlags.IsSet( EHideItemSpecificCommands ) )
+                {
+                iControl->SetItemCommandsStateL( ETrue );
+                }
+            if ( ownerFlags.IsSet( EHideItemActionCommands ) )
+                {
+                iControl->SetItemActionsStateL( ETrue );
+                }
             }
         }
     }
@@ -2826,13 +2841,18 @@
             skin->GetCachedItemData( KAknsIIDQgnIndiSubmenu, EAknsITMaskedBitmap ) );
         if( itemData )
             {
+            AknIconUtils::SetSize( itemData->Bitmap(),cascadeRect.Rect().Size() );
             aGc.BitBltMasked( cascadeRect.Rect().iTl, itemData->Bitmap(),
                 cascadeRect.Rect().Size(), itemData->Mask(), ETrue );
             }
         else
             {
-            aGc.BitBltMasked( cascadeRect.Rect().iTl, iExtension->iCascadeBitmap,
-                cascadeRect.Rect().Size(), iExtension->iCascadeBitmapMask, ETrue );
+            if ( iExtension->iCascadeBitmap && iExtension->iCascadeBitmapMask )
+               {
+               AknIconUtils::SetSize( iExtension->iCascadeBitmap,cascadeRect.Rect().Size() );
+               aGc.BitBltMasked( cascadeRect.Rect().iTl, iExtension->iCascadeBitmap,
+                   cascadeRect.Rect().Size(), iExtension->iCascadeBitmapMask, ETrue );
+               }
             }
         }
     else
@@ -6616,6 +6636,34 @@
         }
     }
 
+// -----------------------------------------------------------------------------
+// CEikMenuPane::SetItemActionsStateL
+// -----------------------------------------------------------------------------
+//
+void CEikMenuPane::SetItemActionsStateL( TBool aDimmed )
+    {
+    if ( iExtension && iExtension->iFlags.IsSet(
+            CEikMenuPaneExtension::ESingleClickEnabled ) )
+        {
+        if ( aDimmed )
+            {
+            iExtension->iFlags.Set(
+                    CEikMenuPaneExtension::EHideItemActionCommands );
+            }
+
+        for ( TInt i = 0; i < iItemArray->Count(); ++i )
+            {
+            CEikMenuPaneItem* item = iItemArray->At( i );
+            TBool itemActionItem(
+                    item->iData.iFlags & EEikMenuItemAction );
+            // Dim item specific items
+            if ( aDimmed && itemActionItem )
+                {
+                item->iData.iFlags |= EEikMenuItemDimmed;
+                }
+            }
+        }
+    }
 
 // -----------------------------------------------------------------------------
 // CEikMenuPane::AddMenuItemsToItemActionMenuL
--- a/uifw/EikStd/coctlsrc/EIKSCRLB.CPP	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/EIKSCRLB.CPP	Mon Jun 21 15:57:43 2010 +0300
@@ -1320,25 +1320,31 @@
                     if ( extension->iShowPopup && extension->iPopupController )
                         {
                         TPoint infoPoint = PositionRelativeToScreen();
-
+                        
                         if ( iOrientation == EVertical )
                             {
                             if ( AknLayoutUtils::LayoutMirrored() )
+                            	{
+								TRect mainPaneRect( 0, 0, 0, 0 );    
+                                AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, 
+                                                mainPaneRect );
+                                TInt mainPaneWidth = mainPaneRect.Width();
+                                infoPoint.iX += ( mainPaneWidth - infoPoint.iX + Rect().Width() ) / 2 ;
+                                infoPoint.iY += aPointerEvent.iPosition.iY;
+                                extension->iPopupController->SetPositionAndAlignment (
+                                    infoPoint, EHRightVCenter );
+                                }
+                            else
                                 {
-                                infoPoint.iX += Rect().Width();
+                                infoPoint.iX = infoPoint.iX / 2;
                                 infoPoint.iY += aPointerEvent.iPosition.iY;
                                 extension->iPopupController->SetPositionAndAlignment (
                                     infoPoint, EHLeftVCenter );
                                 }
-                            else
-                                {
-                                infoPoint.iY += aPointerEvent.iPosition.iY;
-                                extension->iPopupController->SetPositionAndAlignment (
-                                    infoPoint, EHRightVCenter );
-                                }
                             }
                         else if ( iOrientation == EHorizontal )
                             {
+                            //infoPoint.iY = infoPoint.iY / 2;
                             infoPoint.iX += aPointerEvent.iPosition.iX;
                             extension->iPopupController->SetPositionAndAlignment(
                                 infoPoint, EHCenterVBottom );
--- a/uifw/EikStd/coctlsrc/aknedwinphysicshandler.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/aknedwinphysicshandler.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -218,7 +218,11 @@
         {
         return;
         }
-
+    if ( !IsBouncing() )
+        {
+        iFlags.Clear( EFlagBouncingDown ); 
+        iFlags.Clear( EFlagBouncingUp ); 
+        }
     iWorldIndex += aPixelsToMove;
     ScrollView( EFalse );
     }
--- a/uifw/EikStd/coctlsrc/eikcba.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/eikcba.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -1337,9 +1337,6 @@
     // Skin background is not drawn by embedded CBA.
     if ( !iFlags.IsSet( ECbaEmbedded ) )
         {
-        TRect screen;
-        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
-
         // Construct background control context, SizeChanged will update
         // the layout rectangle.
         iBgIID = AknStatuspaneUtils::IdleLayoutActive() ?
@@ -1353,50 +1350,10 @@
             2 );
 
         // Other context for staconpane
-
-        // There is a need for two layers in each context: one for wallpaper, 
-        // the other for skin graphics.
-        iStaconBgContextTop = CAknsMaskedLayerBackgroundControlContext::NewL(
-            KAknsIIDWallpaper, TRect( 0, 0, 1, 1 ), ETrue, ECbaLayerN );
-        iStaconBgContextBottom = CAknsMaskedLayerBackgroundControlContext::NewL(
-            KAknsIIDWallpaper, TRect( 0, 0, 1, 1 ), ETrue, ECbaLayerN );
-            
-        for ( TInt i = 0; i < ECbaLayerN; i++ )
-            {
-            iStaconBgContextBottom->SetLayerImage( i, KAknsIIDNone );
-            }
-        
-        TAknWindowLineLayout layout( AknLayoutScalable_Avkon::area_top_pane(2).LayoutLine() );
-        TAknLayoutRect layoutRect;
-        layoutRect.LayoutRect( screen, layout );
-        TRect staconTop( layoutRect.Rect() );
-    
-        layout = AknLayoutScalable_Avkon::area_bottom_pane(2).LayoutLine();
-        layoutRect.LayoutRect( screen, layout );        
-        TRect staconBottom( layoutRect.Rect() );
-    
-        // Set layers to stacon contexts.
-        // Set bottom as parent to top, so that top is re-drawn, if bottom is drawn.
-        iStaconBgContextTop->SetLayerImage( ECbaLayerWallpaper, KAknsIIDWallpaper );
-        iStaconBgContextTop->SetLayerRect( ECbaLayerWallpaper, screen );
-        iStaconBgContextTop->SetLayerImage( ECbaLayerBackground, KAknsIIDQsnBgAreaStaconRt );
-        iStaconBgContextTop->SetLayerRect( ECbaLayerBackground, staconTop );
-    
-        iStaconBgContextBottom->SetLayerImage( ECbaLayerWallpaper, KAknsIIDWallpaper );
-        iStaconBgContextBottom->SetLayerRect( ECbaLayerWallpaper, screen );
-        iStaconBgContextBottom->SetLayerImage( ECbaLayerBackground, KAknsIIDQsnBgAreaStaconRb );
-        iStaconBgContextBottom->SetLayerRect( ECbaLayerBackground, staconBottom );
-        iStaconBgContextBottom->SetParentPos( TPoint( 0, 0 ) );
-    
-        iStaconBgContextTop->SetParentContext( iStaconBgContextBottom );
-    
-        TBool idle = AknLayoutFlags() & EAknLayoutCbaInStaconPaneIdle;
-        if ( idle )
-            {
-            iStaconBgContextTop->SetLayerMaskAndSizeL( KAknsIIDQgnGrafBgLscTopMaskIcon, staconTop );
-            iStaconBgContextBottom->SetLayerMaskAndSizeL( KAknsIIDQgnGrafBgLscBottomMaskIcon, staconBottom );
-            }
-
+        if ( AknStatuspaneUtils::StaconPaneActive() )
+            {
+            CheckAndCreateStaconContextsL();
+            }
         }
 
     iExtension->UpdateSoftkeyFrameL( EFalse );
@@ -4304,6 +4261,11 @@
                 {
                 DoLayoutChange();
                 SetBoundingRect( TRect() );
+                if( iExtension->iIfMskIconSet 
+                	    && ( iCbaFlags & EEikCbaFlagAppMskIcon ) )
+                    {
+                    TRAP_IGNORE( UpdateIconL() );
+                    }
                 if ( iFlags.IsSet( ECbaInsideDialog )
                         || iFlags.IsSet( ECbaEmbedded ) )
                     {
@@ -4534,6 +4496,9 @@
             // Always provide top object to mop-chain.
             // Bottom is parent of Top, so bottom is re-drawn
             // automatically when top is drawn.
+            // Ensure that the context exists.
+            TRAP_IGNORE( CheckAndCreateStaconContextsL() );
+
             _AKNTRACE_FUNC_EXIT;
             return MAknsControlContext::SupplyMopObject( aId, iStaconBgContextTop );
             }
@@ -5741,6 +5706,8 @@
     TRect screen( iAvkonAppUi->ApplicationRect() );
     TBool softKeysUpAndDownMirrored = EFalse;
 
+    TRAP_IGNORE( CheckAndCreateStaconContextsL() );
+    
     TInt variety = 0;
     if (AknLayoutFlags() & EAknLayoutCbaInStaconPaneLeft)
         {
@@ -7918,6 +7885,80 @@
     }
 
 
+// ---------------------------------------------------------------------------
+// CEikCba::CheckAndCreateStaconContextsL
+// Creates the skin background contexts used in StaCon layout.
+// ---------------------------------------------------------------------------
+//
+void CEikCba::CheckAndCreateStaconContextsL()
+    {
+    if ( !iStaconBgContextTop && !iStaconBgContextBottom )
+        {
+        TRect screen;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen );
+        
+        // There is a need for two layers in each context: one for wallpaper, 
+        // the other for skin graphics.
+        if ( !iStaconBgContextTop )
+            {
+            iStaconBgContextTop =
+                CAknsMaskedLayerBackgroundControlContext::NewL(
+                    KAknsIIDWallpaper, TRect( 0, 0, 1, 1 ), ETrue, ECbaLayerN );
+            }
+        
+        if ( !iStaconBgContextBottom )
+            {
+            iStaconBgContextBottom =
+                CAknsMaskedLayerBackgroundControlContext::NewL(
+                    KAknsIIDWallpaper, TRect( 0, 0, 1, 1 ), ETrue, ECbaLayerN );
+            }
+            
+        for ( TInt i = 0; i < ECbaLayerN; i++ )
+            {
+            iStaconBgContextBottom->SetLayerImage( i, KAknsIIDNone );
+            }
+    
+        TAknLayoutRect layoutRect;
+        layoutRect.LayoutRect( screen,
+                               AknLayoutScalable_Avkon::area_top_pane( 2 ) );
+        TRect staconTop( layoutRect.Rect() );
+    
+        layoutRect.LayoutRect( screen,
+                               AknLayoutScalable_Avkon::area_bottom_pane( 2 ) );        
+        TRect staconBottom( layoutRect.Rect() );
+    
+        // Set layers to stacon contexts.
+        // Set bottom as parent to top, so that top is re-drawn, if bottom is drawn.
+        iStaconBgContextTop->SetLayerImage( ECbaLayerWallpaper,
+                                            KAknsIIDWallpaper );
+        iStaconBgContextTop->SetLayerRect( ECbaLayerWallpaper, screen );
+        iStaconBgContextTop->SetLayerImage( ECbaLayerBackground,
+                                            KAknsIIDQsnBgAreaStaconRt );
+        iStaconBgContextTop->SetLayerRect( ECbaLayerBackground, staconTop );
+    
+        iStaconBgContextBottom->SetLayerImage( ECbaLayerWallpaper,
+                                               KAknsIIDWallpaper );
+        iStaconBgContextBottom->SetLayerRect( ECbaLayerWallpaper, screen );
+        iStaconBgContextBottom->SetLayerImage( ECbaLayerBackground,
+                                               KAknsIIDQsnBgAreaStaconRb );
+        iStaconBgContextBottom->SetLayerRect( ECbaLayerBackground, staconBottom );
+        iStaconBgContextBottom->SetParentPos( TPoint( 0, 0 ) );
+    
+        iStaconBgContextTop->SetParentContext( iStaconBgContextBottom );
+    
+        TBool idle = AknLayoutFlags() & EAknLayoutCbaInStaconPaneIdle;
+        if ( idle )
+            {
+            iStaconBgContextTop->SetLayerMaskAndSizeL(
+                KAknsIIDQgnGrafBgLscTopMaskIcon, staconTop );
+            iStaconBgContextBottom->SetLayerMaskAndSizeL(
+                KAknsIIDQgnGrafBgLscBottomMaskIcon, staconBottom );
+            }
+        }
+    }
+
+
+
 //
 // class CEikCbaButton
 //
@@ -8753,12 +8794,14 @@
         {       
         TInt priorities( reader.ReadInt16() ); // Amount of priorities for current button.
         RArray<TInt> arr;
+        CleanupClosePushL( arr );
         for ( TInt ii = 0; ii < priorities; ii++ )
             {
             TInt8 commandType( reader.ReadInt8() );
-            arr.Append( commandType );
-            }
-        iPriorities.Append( arr );
+            arr.AppendL( commandType );
+            }
+        iPriorities.AppendL( arr );
+        CleanupStack::Pop(); //arr
         }
     
     CleanupStack::PopAndDestroy(); // reader
--- a/uifw/EikStd/coctlsrc/eikspane.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/eikspane.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -2663,6 +2663,7 @@
     else if ( aParentControl )
         {
         SetContainersL( *this, *aParentControl );
+        MakeVisible( aParentControl->IsVisible() );
         }
     }
 
--- a/uifw/EikStd/coctlsrc/smileyiconrecord.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/smileyiconrecord.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -84,7 +84,8 @@
         return;
         }
     TInt index( 0 );
-    for ( ; index < iIconArray.Count(); index++ )
+    TInt count( iIconArray.Count() );
+    for ( ; index < count; index++ )
         {
         if ( iIconArray[index]->DocPos() >= aIcon->DocPos() )
             {
@@ -102,7 +103,8 @@
     {
     DeleteIconsIn( aStart, aLength );
     TInt index( FirstIndexAfter( aStart ) );
-    for ( ; index != KErrNotFound && index < iIconArray.Count(); index++ )
+    TInt count( iIconArray.Count() );
+    for ( ; index != KErrNotFound && index < count; index++ )
         {
         TInt newPos( iIconArray[index]->DocPos() - aLength );
         iIconArray[index]->SetDocPos( newPos );
@@ -116,7 +118,8 @@
 void CSmileyIconRecord::HandleTextInsert( TInt aStart, TInt aLength )
     {
     TInt index( FirstIndexAfter( aStart ) );
-    for ( ; index != KErrNotFound && index < iIconArray.Count(); index++ )
+    TInt count( iIconArray.Count() );
+    for ( ; index != KErrNotFound && index < count; index++ )
         {
         TInt newPos( iIconArray[index]->DocPos() + aLength );
         iIconArray[index]->SetDocPos( newPos );
@@ -130,11 +133,11 @@
 CSmileyIcon* CSmileyIconRecord::SmileyIconAtPos( TInt aDocPos )
     {
     TInt count( iIconArray.Count() );
-    for ( TInt i( 0 ); i < iIconArray.Count(); i++ )
+    for ( TInt i( 0 ); i < count; i++ )
         {
         CSmileyIcon* icon( iIconArray[i] );
-        if ( iIconArray[i]->DocPos() <= aDocPos && 
-            iIconArray[i]->DocPos() + iIconArray[i]->SmileyLength() > aDocPos )
+        if ( icon->DocPos() <= aDocPos && 
+             icon->DocPos() + icon->SmileyLength() > aDocPos )
             {
             return iIconArray[i];
             }
@@ -143,12 +146,33 @@
     }
 
 // ---------------------------------------------------------------------------
+// CSmileyIconRecord::DeleteIconAtPos
+// ---------------------------------------------------------------------------
+//
+void CSmileyIconRecord::DeleteIconAtPos( TInt aDocPos )
+    {
+    TInt count( iIconArray.Count() );
+    for ( TInt i( 0 ); i < count; i++ )
+        {
+        CSmileyIcon* icon( iIconArray[i] );
+        if ( icon->DocPos() <= aDocPos && 
+             icon->DocPos() + icon->SmileyLength() > aDocPos )
+            {
+            iIconArray.Remove( i );
+            delete icon;            
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
 // CSmileyIconRecord::SmileyRange
 // ---------------------------------------------------------------------------
 //
 void CSmileyIconRecord::CancelSelection()
     {
-    for ( TInt i( 0 ); i < iIconArray.Count(); i++ )
+    TInt count( iIconArray.Count() );
+    for ( TInt i( 0 ); i < count; i++ )
         {
         iIconArray[i]->EnableHighlight( EFalse );
         }
@@ -220,7 +244,8 @@
     {
     TInt i = ( aSearchStart < 0 || aSearchStart >= iIconArray.Count() ? 0 : 
         aSearchStart );
-    for ( ; i < iIconArray.Count(); i++ )
+    TInt count( iIconArray.Count() );
+    for ( ; i < count; i++ )
         {
         if ( iIconArray[i]->DocPos() >= aDocPos )
             {
@@ -236,7 +261,8 @@
 //
 TInt CSmileyIconRecord::FirstIndexIn( TInt aStart, TInt aLength )
     {
-    for ( TInt i( 0 ); i < iIconArray.Count(); i++ )
+    TInt count( iIconArray.Count() );
+    for ( TInt i( 0 ); i < count; i++ )
         {
         if ( iIconArray[i]->DocPos() < aStart + aLength && 
             iIconArray[i]->EndPos() > aStart )
--- a/uifw/EikStd/coctlsrc/smileymanager.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/smileymanager.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -115,18 +115,33 @@
             {
             TInt smileyLength( iModel->SmileyStringLength( index ) );
             TInt docPos( aStart + i );
-            CSmileyIcon* icon( iIconRecord->SmileyIconAtPos( docPos ) );
-            if ( !icon || ( icon && !icon->IsDisabled() ) )
+            
+            if( iModel->IsSmileyBySemanticAnalysis( aText.Left( docPos + smileyLength ), 
+				smileyLength ) )
                 {
-                if ( !icon )
+                TText smileyCode( iModel->SmileyCode( index ) );
+                CSmileyIcon* icon( iIconRecord->SmileyIconAtPos( docPos ) );
+                // If icon is existed but smiley codes are different, it means smiely 
+				// string has been changed and editor doesn't know it, so delete old icon 
+				// and create a new one. Otherwise, nothing needs to do since the icon is 
+				// already existed.
+                if ( icon && icon->Code() != smileyCode )
                     {
-                    TText smileyCode( iModel->SmileyCode( index ) );
-                    AddSmileyToRecordL( aText.Mid( i, smileyLength ), docPos, 
-                        smileyCode );
+                    iIconRecord->DeleteIconAtPos( docPos );
+                    icon = NULL;
                     }
-                iModel->ReplaceTextWithCodes( aText, i, index );
-                ret = ETrue;
+                if ( !icon || ( icon && !icon->IsDisabled() ) )
+                    {
+                    if ( !icon )
+                        {                    
+                        AddSmileyToRecordL( aText.Mid( i, smileyLength ), docPos, 
+                            smileyCode );
+                        }
+                    iModel->ReplaceTextWithCodes( aText, i, index );
+                    ret = ETrue;
+                    }
                 }
+
             i += smileyLength;
             }
         else
@@ -279,7 +294,7 @@
 TInt CSmileyManager::SmileyLength( TInt aDocPos )
     {
     CSmileyIcon* icon( iIconRecord->SmileyIconAtPos( aDocPos ) );
-    if ( icon )
+    if ( icon && !icon->IsDisabled() )
         {
         return icon->SmileyLength();
         }
--- a/uifw/EikStd/coctlsrc/smileymodel.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/coctlsrc/smileymodel.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -390,3 +390,89 @@
         aText[i + aDocPos] = CSmileyManager::KPlaceHolder;
         }
     }
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+const char KStartSymbol[] = {'(', '<', '[', '{'};
+const char KEndSymbol[] = {')', '>', ']', '}'};
+
+TInt IndexFrom(const char* const aPtr, TInt aLength, TInt aChar)
+    {
+    for(TInt i=0; i<aLength; i++)
+        {
+        if(aPtr[i] == aChar) return i;
+        }
+
+    return KErrNotFound;
+    }
+
+TBool HavePairedSymbol(const TDesC& aText, TInt aSmileyLength)
+    {
+    char stack[5];
+    TInt pos = 0;
+    
+    TInt i = aText.Length() - 1;
+    const TInt smileyPos = aText.Length() - aSmileyLength;
+
+    for(TInt i=aText.Length()-1; i>=0; i--)
+        {
+        TInt index = IndexFrom(KEndSymbol, sizeof(KEndSymbol), aText[i]); // detect end symbol
+        if(KErrNotFound != index) // push
+            {
+            stack[pos++] = KStartSymbol[index];
+            }
+        else if(pos) // detect start symbol
+            {
+            if(stack[pos-1] == aText[i]) // meet a start symbol
+                {
+                pos--;
+                if(!pos) return (smileyPos > i);
+                }
+            }
+
+        if(smileyPos == i) // smiley combination finished
+            {
+            if(!pos) return EFalse;
+            }
+        }
+
+    return EFalse;
+    }
+
+TBool IsPartOfUrl(const TDesC& aText)
+    {
+    const TInt end = aText.Length() - 1;
+    TInt pos = end;
+    while(pos > 0)
+        {
+        const TUint16 word = aText[--pos];
+        if(word == ' ' || word == 0x2029)
+            {
+            break;
+            }
+        }
+    
+    TInt length = end - pos;
+    if(length > 5)
+        {
+        TPtrC field(aText.Mid(pos,length));
+        pos = field.Find(_L(":\\\\"));
+        if(KErrNotFound == pos) pos = field.Find(_L("://"));
+        if(KErrNotFound != pos)
+            {
+            return ETrue;
+            }    
+        }
+    
+    return EFalse;
+    }
+
+TBool CSmileyModel::IsSmileyBySemanticAnalysis(const TDesC& aText, TInt aSmileyLength)
+    {
+    if(HavePairedSymbol(aText, aSmileyLength)) return EFalse;
+
+    if(IsPartOfUrl(aText)) return EFalse;
+
+    return ETrue;
+    }
--- a/uifw/EikStd/dlgsrc/EIKDIALG.CPP	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/dlgsrc/EIKDIALG.CPP	Mon Jun 21 15:57:43 2010 +0300
@@ -2673,9 +2673,14 @@
 		{
 		control = dlgPage->LineOnPageOrNull(i++);
 		if (control)
-			aControls.Append(control);
+			{
+			if ( KErrNone != aControls.Append(control) )
+				{
+				return;
+				}
+			}
 		}
-		while (control != NULL);
+	while (control != NULL);
 	}
 
 EXPORT_C TInt CEikDialog::DialogFlags()
--- a/uifw/EikStd/srvuisrc/eikkeysoundserver.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/EikStd/srvuisrc/eikkeysoundserver.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -36,7 +36,7 @@
 _LIT(KKeySoundServerSemaphoreName,"KeySoundServerSemaphore");
 _LIT(KKeySoundServerDll,"AtSoundServerClient.dll");
 
-const TInt KKeySoundServerStackSize     = 1024*4; // 4K
+const TInt KKeySoundServerStackSize     = 1024*8; // 8K
 const TInt KAknSoundInfoMapGranularity  = 16;
 const TInt KKeyClickPreference          = 0x00140001;
 const TInt KKeySoundServerBufExpandSize = 1024*1; // 1K
--- a/uifw/eikctl/src/EIKMFNE.CPP	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/eikctl/src/EIKMFNE.CPP	Mon Jun 21 15:57:43 2010 +0300
@@ -2448,11 +2448,6 @@
                     }
                 else 
                     {
-                    if (IsDimmed())
-                        SetGcToDimmedVideo(aGc);
-                    else
-                        SetGcToNormalVideo(aGc);
-
                     // Note!! This is taking responsibility away from the CEikMfne Field for drawing
                     // Skin background is drawn for the fields here
                     if( SkinningBackground() && !iFlags[EUseOverrideColors] )
@@ -2486,6 +2481,15 @@
                         // Set up null brush GC here for the upcoming draw
                         aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
                         }
+                    // set aGc for drawing field text
+                    if ( IsDimmed() )
+                        {
+                        SetGcToDimmedVideo( aGc );
+                        }
+                    else
+                        {
+                        SetGcToNormalVideo( aGc );
+                        }
                     }
                 // This draw must only draw the text with a null brush or draw block highlight 
                 iFields[i]->Draw(aGc, font, topLeftOfField);
--- a/uifw/ganes/inc/HgVgMediaWallRenderer.h	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/ganes/inc/HgVgMediaWallRenderer.h	Mon Jun 21 15:57:43 2010 +0300
@@ -218,7 +218,7 @@
     /**
      * Sorts quads by z from iQuads to sorted quads.
      */
-    void SortQuads(TInt aNumVisibleNumQuads);
+    void SortQuadsL(TInt aNumVisibleNumQuads);
    
     /**
      * Draws quads using VG
--- a/uifw/ganes/src/HgItem.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/ganes/src/HgItem.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -67,9 +67,9 @@
 //
 CHgItem::CHgItem( TInt aFlags, CGulIcon* aIcon ) :
     iIcon( aIcon ),
-    iFlags( aFlags )
+    iFlags( aFlags ),
+    iTime(0)
     {
-    iTime.HomeTime();
     }
 
 // -----------------------------------------------------------------------------
--- a/uifw/ganes/src/HgScroller.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/ganes/src/HgScroller.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -1059,7 +1059,8 @@
         {
         // Show first item's time.
         TInt selectedItem = CurrentIndex();
-        if( selectedItem >= 0 && selectedItem < iItems.Count() )
+        if( selectedItem >= 0 && selectedItem < iItems.Count()
+                && iItems[selectedItem]->Time().Int64() )
             {
             TRAP_IGNORE(
                     iItems[selectedItem]->Time().FormatL( iPopupText1, KGanesMonthString );
--- a/uifw/ganes/src/HgVgMediaWall.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/ganes/src/HgVgMediaWall.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -145,7 +145,7 @@
     
     
     SetMopParent( aParent );
-    SetFlags( EHgVgMediaWallDrawToWindowGC | EHgVgMediaWallUninitialized );
+    SetFlags( EHgVgMediaWallUninitialized );
     
     }
 
@@ -161,7 +161,8 @@
 
 #ifdef MEDIAWALL_ORIENTATION_FIX    
     TSize screenSize = iCoeEnv->ScreenDevice()->SizeInPixels();
-    if (aRect == TRect(TPoint(0,0), screenSize) && iMediaWallStyle == EHgVgMediaWallStyleCoverflowFullScreen)
+    if (aRect == TRect(TPoint(0,0), screenSize) 
+            && iMediaWallStyle == EHgVgMediaWallStyleCoverflowFullScreen)
         {
         Window().FixNativeOrientation();
         }
@@ -175,7 +176,7 @@
 //
 EXPORT_C void CHgVgMediaWall::RefreshScreen( TInt aIndex )
     {
-    
+    ClearFlags(EHgVgMediaWallDrawToWindowGC);
     if( !iIsForeground  )
         {
         return;
@@ -184,19 +185,11 @@
     if( !iAnimationTimer->IsActive() )
         {    
         if( /*iMediaWallStyle == EHgVgMediaWallStyleGrid ||*/ 
-                (aIndex >= FirstIndexOnScreen() && aIndex <= FirstIndexOnScreen() + ItemsOnScreen()) )
+                (aIndex >= FirstIndexOnScreen() 
+                        && aIndex <= FirstIndexOnScreen() + ItemsOnScreen()) )
             {
-  
             UpdateLabelsAndPopup();
-            if(iFlags & EHgVgMediaWallDrawToWindowGC)
-                {
-                DrawNow();
-                }
-            else
-                {
-                DrawOpenVG();
-                }
-        
+            DrawNow();
             }
         }
     }
@@ -374,34 +367,19 @@
         return;
         }
     
-    CHgVgMediaWall* self = const_cast<CHgVgMediaWall*>(this);           
-
-    if( iFlags & EHgVgMediaWallDrawToWindowGC )
+    if(iFlags & EHgVgMediaWallDrawToWindowGC)
         {
-        CFbsBitmap* screenshot = NULL;
-        screenshot = self->DrawToBitmap();
-        if (screenshot)
-            {
-            SystemGc().BitBlt( Rect().iTl,screenshot );
-            delete screenshot;
-            }
-        else
-            {
-            // draw with alpha to make a hole to composition layer
-            SystemGc().SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
-            SystemGc().SetBrushColor(TRgb(0,0,0,0));
-            SystemGc().Clear();
-            DrawOpenVG();
-            }
+        CHgVgMediaWall* self = const_cast<CHgVgMediaWall*>(this);
+        self->ClearFlags(EHgVgMediaWallDrawToWindowGC);
+        FillSystemGcWithSkin( );
+        return;
         }
-    else
-        {
-        // draw with alpha to make a hole to composition layer
-        SystemGc().SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
-        SystemGc().SetBrushColor(TRgb(0,0,0,0));
-        SystemGc().Clear();
-        DrawOpenVG();
-        }
+    
+    // draw with alpha to make a hole to composition layer
+    SystemGc().SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+    SystemGc().SetBrushColor(TRgb(0,0,0,0));
+    SystemGc().Clear();
+    DrawOpenVG();
     }
 
 // -----------------------------------------------------------------------------
@@ -445,7 +423,8 @@
 // CHgVgMediaWall::ChangeStyleL()
 // -----------------------------------------------------------------------------
 //
-EXPORT_C void CHgVgMediaWall::ChangeStyleL( THgVgMediaWallStyle aStyle, const TRect& aRect, TBool /*aReuseSurface*/ )
+EXPORT_C void CHgVgMediaWall::ChangeStyleL( THgVgMediaWallStyle aStyle, 
+        const TRect& aRect, TBool /*aReuseSurface*/ )
     {
     
     // If animation is on, stop it before changing style.    
@@ -710,8 +689,9 @@
         }
                 
     // inform observer if needed
-    if (iMediaWallStyle != EHgVgMediaWallStyleGrid && 
-            (iItems.Count() > 0 && iSelectionObserver && !aDontUpdateObserver && !iPointerDown))
+    if (iMediaWallStyle != EHgVgMediaWallStyleGrid 
+            && (iItems.Count() > 0 && iSelectionObserver 
+                    && !aDontUpdateObserver && !iPointerDown))
         {
         TRAP_IGNORE(iSelectionObserver->HandleSelectL(iSelectedIndex, this);)
         }
@@ -1085,7 +1065,9 @@
         }
     else
         {
-        iAnimationState = aOpening ? EHgVgMediaWallAnimationStateOpening : EHgVgMediaWallAnimationStateClosing;        
+        iAnimationState = aOpening 
+                ? EHgVgMediaWallAnimationStateOpening 
+                    : EHgVgMediaWallAnimationStateClosing;        
         
         StartAnimationTimer();        
         }    
@@ -1102,7 +1084,8 @@
         return NULL;
     
 #ifdef MEDIAWALL_ORIENTATION_FIX    
-    return iEGL->GetSurfaceToBitmap(iRect, iMediaWallStyle == EHgVgMediaWallStyleCoverflowFullScreen);        
+    return iEGL->GetSurfaceToBitmap(iRect, 
+            iMediaWallStyle == EHgVgMediaWallStyleCoverflowFullScreen);        
 #else
     return iEGL->GetSurfaceToBitmap(iRect, EFalse);            
 #endif
@@ -1181,9 +1164,6 @@
     
             iAnimationTimer->Cancel();
             }
-    
-        SetFlags( EHgVgMediaWallDrawToWindowGC  );
-        DrawNow();
         }
     
     if( aType == KEikMessageUnfadeWindows )
@@ -1191,15 +1171,8 @@
         ClearFlags( EHgVgMediaWallDrawToWindowGC );
         DrawNow();
         }
-
-    if( aType == KEikDynamicLayoutVariantSwitch && !(iFlags & EHgVgMediaWallDrawToWindowGC) )
-        {
-        SetFlags( EHgVgMediaWallDrawToWindowGC );
-        DrawNow();
-        }
     }
 
-
 // ---------------------------------------------------------------------------
 // CHgVgMediaWall::InitItemsL()
 // ---------------------------------------------------------------------------
@@ -1253,16 +1226,13 @@
 
     iIsForeground = EFalse;
     
-    // draw screenshot using window gc, this is needed
-    // for nga effects to work
-    DrawNow();
-    
     // free textures    
     FreeItemsImages();
     // free other resources
     DestroyRendering();
 
-    SetFlags( EHgVgMediaWallUninitialized | EHgVgMediaWallDrawToWindowGC );
+    SetFlags( EHgVgMediaWallUninitialized );
+    DrawNow();
     
     iCoeEnv->WsSession().Flush();
     }
@@ -1413,8 +1383,9 @@
 
 void CHgVgMediaWall::HandleTransitionAnimationStop()
     {
-    if (iAnimationTimer->IsActive() && (iAnimationState == EHgVgMediaWallAnimationStateTransition ||
-            iAnimationState == EHgVgMediaWallAnimationStateFastTransition))
+    if (iAnimationTimer->IsActive() 
+            && (iAnimationState == EHgVgMediaWallAnimationStateTransition ||
+                    iAnimationState == EHgVgMediaWallAnimationStateFastTransition))
         {
         // stop to this location
         iSpring->Reset();    
@@ -1582,7 +1553,8 @@
     iScrollBar->SetViewPosition( TPoint(iSelectedIndex, 0) );
     
 #ifdef MEDIAWALL_ORIENTATION_FIX
-    iScrollBar->EnableLandscapeRendering( iMediaWallStyle == CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen );
+    iScrollBar->EnableLandscapeRendering( 
+            iMediaWallStyle == CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen );
 #endif
     
     }
@@ -1886,7 +1858,8 @@
 // CHgVgMediaWall::HandleDragging()
 // ---------------------------------------------------------------------------
 //
-void CHgVgMediaWall::HandleDragging(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent)
+void CHgVgMediaWall::HandleDragging(
+        const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent)
     {    
 
     switch (aEvent.State())
@@ -1991,7 +1964,8 @@
 // CHgVgMediaWall::HandleDragStart()
 // ---------------------------------------------------------------------------
 //
-void CHgVgMediaWall::HandleDragStart(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& /*aEvent*/)
+void CHgVgMediaWall::HandleDragStart(
+        const AknTouchGestureFw::MAknTouchGestureFwDragEvent& /*aEvent*/)
     {
     
     // cancel ongoing animation.
@@ -2019,7 +1993,8 @@
 // CHgVgMediaWall::HandleDragOn()
 // ---------------------------------------------------------------------------
 //
-void CHgVgMediaWall::HandleDragOn(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent)
+void CHgVgMediaWall::HandleDragOn(
+        const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent)
     {
 
     // calculate delta of dragging
@@ -2063,7 +2038,8 @@
 // CHgVgMediaWall::HandleDragStop()
 // ---------------------------------------------------------------------------
 //
-void CHgVgMediaWall::HandleDragStop(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& /*aEvent*/)
+void CHgVgMediaWall::HandleDragStop(
+        const AknTouchGestureFw::MAknTouchGestureFwDragEvent& /*aEvent*/)
     {   
     iPointerDown = EFalse;
     if (iMediaWallStyle == EHgVgMediaWallStyleGrid)
@@ -2118,7 +2094,10 @@
                 iMediaWallStyle == EHgVgMediaWallStyleGrid)
             {
             // when scrollbar is being dragged we draw letter popup
-            if (iLetterPopup && (iScrollBarHit || (iKeyScrollingState != ENoKeyScrolling && dist > KDrawLetterPopupDistance)))
+            if (iLetterPopup && 
+                    (iScrollBarHit 
+                            || (iKeyScrollingState != ENoKeyScrolling 
+                                    && dist > KDrawLetterPopupDistance)))
                 {
                 iLetterPopup->Draw(iRect, KMaxLetterPopupOpacity);                    
                 }
@@ -2139,7 +2118,8 @@
     if (iScrollBar || iHideSKButton)
         {
         TReal alpha = 1.0f;
-        if (iAnimationState == EHgVgMediaWallAnimationStateOpening || iAnimationState == EHgVgMediaWallAnimationStateClosing)
+        if (iAnimationState == EHgVgMediaWallAnimationStateOpening 
+                || iAnimationState == EHgVgMediaWallAnimationStateClosing)
             alpha = 1.0f - iAnimationAlpha;
         else if (iAnimationState == EHgVgMediaWallAnimationStateItemOpened)
             alpha = 0.0f;
@@ -2174,11 +2154,13 @@
             DrawOpenVG();
 
             if (iMediaWallObserver)
-                iMediaWallObserver->HandleMediaWallEvent((TInt)EHgVgMediaWallEventRequestShowSoftkeys, this);
+                iMediaWallObserver->HandleMediaWallEvent(
+                        EHgVgMediaWallEventRequestShowSoftkeys, this);
 
             }
         // if screen is hit when button is not visible, show button and scrollbar
-        else if (!iHideSKButton->IsEnabled() && aEvent.iType == TPointerEvent::EButton1Down)
+        else if (!iHideSKButton->IsEnabled() 
+                && aEvent.iType == TPointerEvent::EButton1Down)
             {
             
             if (iScrollBar)    
@@ -2189,7 +2171,8 @@
             DrawOpenVG();
 
             if (iMediaWallObserver)
-                iMediaWallObserver->HandleMediaWallEvent((TInt)EHgVgMediaWallEventRequestHideSoftkeys, this);
+                iMediaWallObserver->HandleMediaWallEvent(
+                        EHgVgMediaWallEventRequestHideSoftkeys, this);
             
             }
         }
--- a/uifw/ganes/src/HgVgMediaWallRenderer.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uifw/ganes/src/HgVgMediaWallRenderer.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -115,7 +115,9 @@
         {
         TQuad* q = new (ELeave)TQuad;
         q->iItemIndex = -1;
-        iQuads.Append(q);
+        CleanupStack::PushL(q);
+        iQuads.AppendL(q);
+        CleanupStack::Pop(q);
         }
     CreateGround();
     }
@@ -200,14 +202,14 @@
 // Sorts quads from iQuads to iSortedQuads.
 // -----------------------------------------------------------------------------
 //
-void CHgVgMediaWallRenderer::SortQuads(TInt aNumQuads)
+void CHgVgMediaWallRenderer::SortQuadsL(TInt aNumQuads)
     {
     
     iSortedQuads.Reset();
     
     for(TInt i = 0; i < aNumQuads; ++i)
         {
-        iSortedQuads.Append(iQuads[i]);
+        iSortedQuads.AppendL(iQuads[i]);
         }
     
     for (TInt i = 1; i < aNumQuads; i++)
@@ -223,10 +225,8 @@
                 }
             }
         }
-        
     }
 
-
 // -----------------------------------------------------------------------------
 // CHgVgScrollBar::GetItemIndex
 // gets index of the item under pointer position.
@@ -1062,7 +1062,7 @@
         TransformQuads(itemsOnScreen, 
                 iReflectionsEnabled, iFov, aOpeningAnimationType);
 
-        SortQuads(itemsOnScreen);
+        TRAP_IGNORE( SortQuadsL(itemsOnScreen); )
         
         if (iReflectionsEnabled)
             DrawQuads(ETrue);
--- a/uiutils/Findutil/src/FindUtilChinese.cpp	Wed Jun 09 09:58:37 2010 +0300
+++ b/uiutils/Findutil/src/FindUtilChinese.cpp	Mon Jun 21 15:57:43 2010 +0300
@@ -325,14 +325,17 @@
 	    {
 	    if (wordInterpretationBuf[i] == KSeperator) 
 	        {
-	        aSpellList.Append((wordInterpretationBuf.MidTPtr(start, i-start)).Alloc());
+	        HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, i-start)).AllocLC();
+	        aSpellList.AppendL(tmpStr);
+	        CleanupStack::Pop(tmpStr);
 	        start = i + 1;
 	        }
 	    }
-	        
-	aSpellList.Append((wordInterpretationBuf.MidTPtr(start, len-start)).Alloc());   	
 
-    
+	HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, len-start)).AllocLC();
+	aSpellList.AppendL(tmpStr);
+    CleanupStack::Pop(tmpStr);
+
     return ETrue;
 	}
 
@@ -465,12 +468,16 @@
 	        {
 	        if (wordInterpretationBuf[i] == KSeperator) 
 	            {
-	            aSpellList.Append((wordInterpretationBuf.MidTPtr(start, i-start)).Alloc());
+	            HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, i-start)).AllocLC();
+	            aSpellList.AppendL(tmpStr);
+	            CleanupStack::Pop(tmpStr);
 	            start = i + 1;
 	            }
 	        }
-	        
-	    aSpellList.Append((wordInterpretationBuf.MidTPtr(start, len-start)).Alloc());   	
+
+	    HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, len-start)).AllocLC();
+	    aSpellList.AppendL(tmpStr);   	
+        CleanupStack::Pop(tmpStr);
 	    }
     //Could look advanced cangjie as normal and easy cangjie
     else 
@@ -482,14 +489,17 @@
 	        {
 	        if (wordInterpretationBuf[i] == KSeperator) 
 	            {
-	            aSpellList.Append((wordInterpretationBuf.MidTPtr(start, i-start)).Alloc());
+	            HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, i-start)).AllocLC();
+	            aSpellList.AppendL(tmpStr);
+                CleanupStack::Pop(tmpStr);
 	            start = i + 1;
 	            }
 	        }
-        
-    	aSpellList.Append((wordInterpretationBuf.MidTPtr(start, len-start)).Alloc()); 
-    	 
-    	
+
+	    HBufC16* tmpStr = (wordInterpretationBuf.MidTPtr(start, len-start)).AllocLC();
+    	aSpellList.AppendL(tmpStr); 
+        CleanupStack::Pop(tmpStr);
+
     	iPtiEngine->GetSpelling(aHZUnicode, wordInterpretationBuf, EPtiCangJie);
 	    len = wordInterpretationBuf.Length();
         start = 0;
@@ -497,12 +507,16 @@
 	        {
 	        if (wordInterpretationBuf[i] == KSeperator) 
 	            {
-	            aSpellList.Append((wordInterpretationBuf.MidTPtr(start, i-start)).Alloc());
+	            tmpStr = (wordInterpretationBuf.MidTPtr(start, i-start)).AllocLC();
+	            aSpellList.AppendL(tmpStr);
+                CleanupStack::Pop(tmpStr);
 	            start = i + 1;
 	            }
 	        }
-        
-    	aSpellList.Append((wordInterpretationBuf.MidTPtr(start, len-start)).Alloc());  
+
+	    tmpStr = (wordInterpretationBuf.MidTPtr(start, len-start)).AllocLC();
+    	aSpellList.AppendL(tmpStr);
+        CleanupStack::Pop(tmpStr);
 	    }
     
     return ETrue;