Revision: 201007 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 12 Mar 2010 15:43:43 +0200
branchRCL_3
changeset 5 aabf2c525e0f
parent 3 8ca85d2f0db7
child 6 9f56a4e1b8ab
Revision: 201007 Kit: 201008
classicui_plat/avkon_localised_texts_api/loc/avkon.loc
classicui_plat/avkon_settings_api/inc/AvkonInternalCRKeys.h
classicui_plat/battery_pane_api/inc/aknbattery.h
classicui_plat/emergency_call_support_api/inc/AknEcs.h
classicui_plat/extended_options_menu_api/inc/aknitemactionmenu.h
classicui_plat/ganes_api/inc/ganes/HgScroller.h
classicui_plat/ganes_api/inc/ganes/HgVgMediaWall.h
classicui_plat/screensaver_runtime_api/inc/ScreensaverInternalPSKeys.h
classicui_plat/special_character_table_api/group/bld.inf
classicui_plat/special_character_table_api/inc/AknCharMap.h
classicui_plat/special_character_table_api/inc/AknSmileyUtils.h
classicui_plat/transition_effect_utilities_api/inc/akntransitionutils.h
classicui_pub/editors_api/inc/EIKEDWIN.H
classicui_pub/generic_button_api/inc/AknButton.h
classicui_pub/status_pane_api/inc/eikspane.h
classicui_pub/ui_framework_definitions_api/inc/avkon.hrh
commonuis/CommonUi/conf/commonui.confml
commonuis/CommonUi/src/ItemFinder.cpp
psln/Src/PslnGeneralThemeContainer.cpp
uifw/AknGlobalUI/AknCapServer/inc/AknEikSgcs.h
uifw/AknGlobalUI/AknCapServer/src/AknCapServerShutdown.cpp
uifw/AknGlobalUI/AknCapServer/src/AknEikSgcs.cpp
uifw/AknGlobalUI/AknCapServer/src/aknKeyFilter.cpp
uifw/AknGlobalUI/OldStyleNotif/Src/aknkeylocknotifier.cpp
uifw/AvKon/EABI/AVKONU.DEF
uifw/AvKon/bwins/AVKONU.def
uifw/AvKon/conf/s60/avkon.confml
uifw/AvKon/conf/s60/avkon_101F876E.crml
uifw/AvKon/group/avkon.mmp
uifw/AvKon/inc/AknSmileyImage.h
uifw/AvKon/inc/AknSmileyModel.h
uifw/AvKon/inc/aknemptycontrol.h
uifw/AvKon/src/AknAppUi.cpp
uifw/AvKon/src/AknCharMap.cpp
uifw/AvKon/src/AknEcs.cpp
uifw/AvKon/src/AknIndicatorContainer.cpp
uifw/AvKon/src/AknPopupField.cpp
uifw/AvKon/src/AknQueryControl.cpp
uifw/AvKon/src/AknSctDialog.cpp
uifw/AvKon/src/AknSettingPage.cpp
uifw/AvKon/src/AknSmileyImage.cpp
uifw/AvKon/src/AknSmileyModel.cpp
uifw/AvKon/src/AknSmileyUtils.cpp
uifw/AvKon/src/AknViewAppUi.cpp
uifw/AvKon/src/aknbattery.cpp
uifw/AvKon/src/akndigitalclock.cpp
uifw/AvKon/src/akndiscreetpopupcontrol.cpp
uifw/AvKon/src/aknemptycontrol.cpp
uifw/AvKon/src/aknlists.cpp
uifw/AvKon/src/aknmessagequerydialog.cpp
uifw/AvKon/src/aknnavi.cpp
uifw/AvKon/src/aknnavilabel.cpp
uifw/AvKon/src/aknsignal.cpp
uifw/AvKon/src/akntabgrp.cpp
uifw/AvKon/src/akntitle.cpp
uifw/AvKon/src/aknview.cpp
uifw/AvKon/src/eikfrlbd.cpp
uifw/AvKon/srcdata/avkon.rss
uifw/AvKon/tsrc/bc/bctestdom3.2/bctestdomaiwakn/sis/bctestdomaiwakn.pkg
uifw/AvKon/tsrc/bc/bctestdom5.0/bctestdomaiwakn/sis/bctestdomaiwakn.pkg
uifw/EikStd/EABI/EIKCOCTLU.DEF
uifw/EikStd/bwins/EIKCOCTLU.DEF
uifw/EikStd/coctlinc/aknedwinphysicshandler.h
uifw/EikStd/coctlinc/aknitemactionmenuregister.h
uifw/EikStd/coctlinc/aknstyluspopupmenucontent.h
uifw/EikStd/coctlsrc/AknButton.cpp
uifw/EikStd/coctlsrc/EIKEDWIN.CPP
uifw/EikStd/coctlsrc/EIKLBV.CPP
uifw/EikStd/coctlsrc/EIKMENUP.CPP
uifw/EikStd/coctlsrc/aknedwinphysicshandler.cpp
uifw/EikStd/coctlsrc/aknitemactionmenu.cpp
uifw/EikStd/coctlsrc/aknitemactionmenuregister.cpp
uifw/EikStd/coctlsrc/aknstyluspopupmenucontent.cpp
uifw/EikStd/coctlsrc/aknstyluspopupmenuphysicshandler.cpp
uifw/EikStd/coctlsrc/akntoolbarextension.cpp
uifw/EikStd/coctlsrc/akntoolbarextensionview.cpp
uifw/EikStd/coctlsrc/eikcba.cpp
uifw/EikStd/coctlsrc/eikspane.cpp
uifw/EikStd/dlgsrc/EIKDPAGE.CPP
uifw/ganes/inc/HgConstants.h
uifw/ganes/inc/HgVgLabel.h
uifw/ganes/src/HgGrid.cpp
uifw/ganes/src/HgList.cpp
uifw/ganes/src/HgPopupDrawer.cpp
uifw/ganes/src/HgScrollbar.cpp
uifw/ganes/src/HgScroller.cpp
uifw/ganes/src/HgVgEGL.cpp
uifw/ganes/src/HgVgLabel.cpp
uifw/ganes/src/HgVgMediaWall.cpp
uifw/ganes/src/HgVgScrollBar.cpp
--- a/classicui_plat/avkon_localised_texts_api/loc/avkon.loc	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/avkon_localised_texts_api/loc/avkon.loc	Fri Mar 12 15:43:43 2010 +0200
@@ -4265,4 +4265,23 @@
 //r: TB9.2
 #define qtn_chi_chinese_user_db_note_confirm_deletions "Delete %N Phrase?"
 
+//d: Edit menu item to activate pinyin phrase input mode.
+//d: Only Chinese.
+//l: list_single_pane_t1_cp2
+//r: TB9.2
+#define text_chi_input_pinyin_phrase "Pinyin phrase"
+
+//d: Edit menu item to activate zhuyin phrase input mode.
+//d: Only Chinese.
+//l: list_single_pane_t1_cp2
+//r: TB9.2
+#define text_chi_input_zhuyin_phrase "Zhuyin phrase"
+
+//d: Edit menu item to activate stroke phrase input mode.
+//d: Only Chinese.
+//l: list_single_pane_t1_cp2
+//r: TB9.2
+#define text_chi_input_stroke_phrase "Stroke phrase"
+
+
 // End of File
--- a/classicui_plat/avkon_settings_api/inc/AvkonInternalCRKeys.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/avkon_settings_api/inc/AvkonInternalCRKeys.h	Fri Mar 12 15:43:43 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-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"
@@ -294,6 +294,11 @@
 
 const TUint32 KAknKeyboardSlideOpen = 0x00000017;
 
+/**
+* The operator's service call phone number. Could vary by operator.
+*/
+const TUint32 KAknServiceCallNumber = 0x00000018;
+
 const TUid KCRUidLeaveAppsInMemory = { 0x102858F2 };
 
 /**
--- a/classicui_plat/battery_pane_api/inc/aknbattery.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/battery_pane_api/inc/aknbattery.h	Fri Mar 12 15:43:43 2010 +0200
@@ -26,6 +26,7 @@
 class CAknBatteryIcon;
 class CAknBatteryStrength;
 class CAknBatteryDataObserver;
+class CEikStatusPaneBase;
 
 /**
 * A default control in the status pane's battery pane. 
@@ -153,6 +154,7 @@
     CAknBatteryDataObserver* iDataObserver;
     CPeriodic* 			     iTicker;
     TBool                    iIsActiveIdle;
+    CEikStatusPaneBase*      iStatusPane;
     };
 
 #endif // AKNBATTERY_H
--- a/classicui_plat/emergency_call_support_api/inc/AknEcs.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/emergency_call_support_api/inc/AknEcs.h	Fri Mar 12 15:43:43 2010 +0200
@@ -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"
@@ -38,6 +38,9 @@
 // Maximum length of an emergency number
 const TInt KAknEcsMaxMatchingLength = 6;
 
+// Minimum length of service call number
+const TInt KAknServiceCallMinLength = 3;
+
 // Separator character for the emergency number string
 _LIT( KAknEcsSeparator, " ");
 
@@ -80,7 +83,8 @@
         EPartialMatch, // Not in use.
         ECompleteMatch,
         ECompleteMatchThenSendKey,
-        ECallAttempted
+        ECallAttempted,
+        EServiceNumMatch
         };
 
 public:
@@ -249,6 +253,11 @@
     */
     void AttemptEmergencyCall();
 
+    /**
+    * Wraps up the code that actually initiates the service call
+    */
+    void MakeServiceCallL();
+
 public:
     /**
     * This callback is called by a CIdle object to state that the call has been
@@ -294,7 +303,8 @@
     /** Pointer to emergency call observer object */
     CPhCltEmergencyCallObserver* iEmergencyCallObserver;
     
-    TInt iSpare_2;
+    /** Boolean to check if service call is enabled during device or key lock */
+    TBool iServiceCallEnabled;
     };
 
 //
--- a/classicui_plat/extended_options_menu_api/inc/aknitemactionmenu.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/extended_options_menu_api/inc/aknitemactionmenu.h	Fri Mar 12 15:43:43 2010 +0200
@@ -74,16 +74,20 @@
      * 
      * @internal
      * @param aCollection Collection.
+     * @param aOwner Menu's owner.
      */
-    static CAknItemActionMenu* NewL( MAknCollection& aCollection );
+    static CAknItemActionMenu* NewL( MAknCollection& aCollection,
+            MObjectProvider* aOwner );
 
     /**
      * Two-phased constructor.
      * 
      * @internal
      * @param aCollection Collection.
+     * @param aOwner Menu's owner.
      */
-    static CAknItemActionMenu* NewLC( MAknCollection& aCollection );
+    static CAknItemActionMenu* NewLC( MAknCollection& aCollection,
+            MObjectProvider* aOwner );
 
     /**
      * Destructor.
@@ -198,13 +202,22 @@
      * @return Collection count.
      */
     TInt CollectionCount() const;
+    
+    /**
+     * Returns pointer to item action menu's owner.
+     *
+     * @return Menu's owner
+     */
+    MObjectProvider* Owner() const;
 
 private:
 
     /**
      * C++ constructor.
-     */
-    CAknItemActionMenu();
+     *
+     * @param aOwner Menu's owner.
+     */     
+    CAknItemActionMenu( MObjectProvider* aOwner );
 
     /**
      * Symbian second-phase constructor.
@@ -297,6 +310,12 @@
      * Own.
      */
     CAknItemActionMenuData* iMenuData;
+    
+    /**
+     * Pointer to menu's owner. 
+     * Not own
+     */
+    MObjectProvider* iOwner;
     };
 
 #endif // C_AKNITEMACTIONMENU_H
--- a/classicui_plat/ganes_api/inc/ganes/HgScroller.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/ganes_api/inc/ganes/HgScroller.h	Fri Mar 12 15:43:43 2010 +0200
@@ -44,6 +44,7 @@
 class CHgKeyUtils;
 class CHgTextFind;
 class CAknItemActionMenu;
+class CFont;
 
 // CLASS DECLARATION
 class CHgScroller : 
@@ -421,6 +422,8 @@
      */
     void StopKeyScrolling();
     
+    void ReleasePopupFont();
+    
 protected:
     CAknPhysics* iPhysics; // Physics engine. Own
     CHgScrollBufferManager* iManager; // Own
@@ -430,6 +433,7 @@
     CHgTextFind* iTextFind; // Text find utility to communicate with FEP. Own
     CAknLongTapDetector* iDetector; // Longtap detector for single click. Own
     CAknItemActionMenu* iActionMenu; // Item action menu for single click. Not Own
+    CFont* iPopupFont; // font to be used with popup drawer
     
     // Observers
     MHgSelectionObserver* iSelectionObserver; // Not Own
--- a/classicui_plat/ganes_api/inc/ganes/HgVgMediaWall.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/ganes_api/inc/ganes/HgVgMediaWall.h	Fri Mar 12 15:43:43 2010 +0200
@@ -107,7 +107,9 @@
      */
     enum THgVgMediaWallMode
         {
-        EHgVgMediaWallDrawToWindowGC = 0x0001
+        EHgVgMediaWallDrawToWindowGC = 0x0001,
+        EHgVgMediaWallFaded = 0x0002,
+        EHgVgMediaWallUninitialized = 0x0004
         };
         
 public: 
@@ -664,6 +666,8 @@
      */
     void InitPopupL(TInt aLayoutVariant);
     
+    static TInt DelayedInit( TAny* aSelf);
+    
 protected:
     CHgScrollBufferManager* iManager; // Own
     
@@ -774,7 +778,8 @@
     
     CAlfCompositionSource* iCompositionSource;    
     
-    CFbsBitmap* iSurfaceBitmap;    
+    CFbsBitmap* iSurfaceBitmap;
+    CPeriodic* iDelayedInit;
     };
 
        
--- a/classicui_plat/screensaver_runtime_api/inc/ScreensaverInternalPSKeys.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/screensaver_runtime_api/inc/ScreensaverInternalPSKeys.h	Fri Mar 12 15:43:43 2010 +0200
@@ -122,6 +122,9 @@
  */
 const TUint32 KScreenSaverNoPowerSaveMode = 0x00000007;
 
+#define PUCSCREENSAVERCHANGES
+const TUint32 KScreenSaverActivate = 0x00000008;
+
 #endif // SCREENSAVER_INTERNAL_PS_KEYS_H
 
 // End of file
--- a/classicui_plat/special_character_table_api/group/bld.inf	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/special_character_table_api/group/bld.inf	Fri Mar 12 15:43:43 2010 +0200
@@ -25,4 +25,5 @@
 PRJ_EXPORTS
 
 ../inc/AknSctDialog.h     MW_LAYER_PLATFORM_EXPORT_PATH(aknSctDialog.h)
-../inc/AknCharMap.h     MW_LAYER_PLATFORM_EXPORT_PATH(aknCharMap.h)
+../inc/AknCharMap.h       MW_LAYER_PLATFORM_EXPORT_PATH(aknCharMap.h)
+../inc/AknSmileyUtils.h   MW_LAYER_PLATFORM_EXPORT_PATH(AknSmileyUtils.h)
--- a/classicui_plat/special_character_table_api/inc/AknCharMap.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/special_character_table_api/inc/AknCharMap.h	Fri Mar 12 15:43:43 2010 +0200
@@ -69,6 +69,7 @@
 class CAknCharMapHistory;
 class CAknCharMapExtension;
 class MAknSctFocusHandler;
+
 /**
  * Special character table control for AVKON
  *
@@ -448,8 +449,10 @@
     TPoint CursorPos();
 
 private:
-    void HandleFocusStatusChanged(TBool aIsFocused=ETrue);
     TBool EmotionsAreAllReadyToDraw(TInt aIndex, TInt aCount) const;
+    void SmileyStillImageLoaded(TChar aSmileyCode);
+    void SmileyAnimationChanged(TChar aSmileyCode);
+    void SetSmileyAnimationActivityInCurrentPageL(TBool aIsActive);
     void GetFocusSctName(TChar& aChar, TDes& aName) const;
     TBool HaveBufferToAppendFocusSct() const;
     TBool AppendFocusSctToDestinationBufferL();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/classicui_plat/special_character_table_api/inc/AknSmileyUtils.h	Fri Mar 12 15:43:43 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  AVKON smiley utils.
+*
+*/
+
+
+
+
+#ifndef AKNSMILEYUTILS_H
+#define AKNSMILEYUTILS_H
+
+// INCLUDES
+#include <AknUtils.h>
+
+// CLASS DECLARATION
+
+
+////////////////////////////////////////////////////////////////////
+
+class CAknSmileyIcon : public CBase
+    {
+protected:
+    CAknSmileyIcon();
+
+protected:
+    virtual ~CAknSmileyIcon();
+
+public:
+    virtual const CFbsBitmap* Image() const;
+    virtual const CFbsBitmap* Mask() const;
+    virtual TBool ReadyToDraw() const;
+    virtual const TSize& Size() const;
+    virtual void PlayAnimationL(TInt aRepeat=0, TInt aDelay=0);
+    virtual void StopAnimation();
+    };
+
+////////////////////////////////////////////////////////////////////
+
+class MAknSmileyObserver
+    {
+public:
+    virtual void SmileyStillImageLoaded(CAknSmileyIcon* aSmileyIcon)=0;
+    virtual void SmileyAnimationChanged(CAknSmileyIcon* aSmileyIcon)=0;
+    };
+
+////////////////////////////////////////////////////////////////////
+
+class CAknSmileyManager : public CBase
+    {
+public:
+    IMPORT_C static CAknSmileyManager* NewL(MAknSmileyObserver* aObserver);
+    IMPORT_C ~CAknSmileyManager();
+
+private:
+    CAknSmileyManager();
+    void ConstructL(MAknSmileyObserver* aObserver);
+
+public:
+    IMPORT_C TInt ConvertCodesToTextL(TDes& aText);
+    IMPORT_C TInt ConvertTextToCodesL(TDes& aText);
+    IMPORT_C const TDesC& Text(TChar aCode) const;
+    IMPORT_C TBool IsSmiley(TChar aCode) const;
+
+public:
+    IMPORT_C void SetSize(const TSize& aSize);
+    IMPORT_C void SetSizeByFont(const CFont* aFont);
+    
+public:
+    IMPORT_C void DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TPoint& aPosition) const;
+    IMPORT_C void DrawText(CWindowGc& aGc, const TDesC& aText, const TAknLayoutText& aLayout, TBool aUseLogicalToVisualConversion=EFalse) const;
+    IMPORT_C void DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TRect& aBox, TInt aBaselineOffset, 
+                           CGraphicsContext::TTextAlign aAlignment=CGraphicsContext::ELeft, TInt aLeftMargin=0) const;
+
+public:
+    IMPORT_C TInt Count() const;
+    IMPORT_C CAknSmileyIcon* Smiley(TChar aCode) const;
+    IMPORT_C CAknSmileyIcon* operator[](TInt aIndex) const;
+    
+public:
+    class CExtension;
+    CExtension* iExtension;
+    
+    };
+
+#endif // AKNSMILEYUTILS_H
--- a/classicui_plat/transition_effect_utilities_api/inc/akntransitionutils.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_plat/transition_effect_utilities_api/inc/akntransitionutils.h	Fri Mar 12 15:43:43 2010 +0200
@@ -54,6 +54,8 @@
 #define KGfxSequenceMiddleControlUid TUid::Uid( 0x2000B475 )
 #define KGfxSequenceLastControlUid TUid::Uid( 0x2000B476 )
 
+#define KGfxTransEffectToolbarExtensionControlUid TUid::Uid( 0x2000B47A )
+
 // Enumerations for notifying tfx server (used via 
 // GfxTransEffect::NotifyExternalState)
 enum TGfxTransNotification 
--- a/classicui_pub/editors_api/inc/EIKEDWIN.H	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_pub/editors_api/inc/EIKEDWIN.H	Fri Mar 12 15:43:43 2010 +0200
@@ -478,6 +478,10 @@
          * If ETrue, ongoing scrolling is caused by moving scrollbar thumb.
          */
         TBool iScrolledByScrollBar;
+         /**
+         * Record formatted height of layout
+         */
+        TInt iRecordFormattedHeight;
         };
 
 public:
--- a/classicui_pub/generic_button_api/inc/AknButton.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_pub/generic_button_api/inc/AknButton.h	Fri Mar 12 15:43:43 2010 +0200
@@ -236,7 +236,11 @@
                           const TAknsItemID& aPressedId = KAknsIIDNone,
                           const TAknsItemID& aHoverId = KAknsIIDNone );
         
-        
+        /*
+         * Update extension
+         * @param aResource resource ID
+         */
+        void UpdateExtensionInfoL( TInt aResource );
         
     protected: // New functions
 
--- a/classicui_pub/status_pane_api/inc/eikspane.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_pub/status_pane_api/inc/eikspane.h	Fri Mar 12 15:43:43 2010 +0200
@@ -50,6 +50,11 @@
 const TInt KStatusPaneCapsInCurrentLayoutBit = 4;
 
 /**
+* Status pane flag indicating that statuspane is transparent.
+* 
+*/
+const TInt KStatusPaneTransparentBit = 8;
+/**
  * The @c MEikStatusPaneObserver interface allows a status pane observer to
  * pick up changes in the size or position of the status pane. Such events
  * will be as a result of layout changes which cause an actual change in the
@@ -494,6 +499,23 @@
     */
     IMPORT_C void CommonPrepareForAppExit();
 
+public:
+    /**
+     * Enable transparency of status pane and its contents.
+     * From @c CEikStatusPaneBase.
+     *
+     * @param aTransparent If @c ETrue the status pane and its
+     *                 contents are set aTransparent.
+     */
+    IMPORT_C void EnableTransparent( TBool aTransparent );
+    
+    /**
+      * Gets the transparency of the status pane.
+      * 
+      * @return @c ETrue if the status pane is transparent.
+      */
+    IMPORT_C TBool IsTransparent() const;
+    
 private:
 
     void DoSwitchLayoutL( TInt aLayoutResourceId, TDrawCmd aDraw );
--- a/classicui_pub/ui_framework_definitions_api/inc/avkon.hrh	Fri Feb 19 23:04:46 2010 +0200
+++ b/classicui_pub/ui_framework_definitions_api/inc/avkon.hrh	Fri Mar 12 15:43:43 2010 +0200
@@ -376,7 +376,12 @@
     EPenInputCmdHwrInputToLandscape,
     EPenInputCmdSwitchToVkeyBasedInput,
     EPenInputCmdWritingSpeed,
-    EPenInputCmdGuidingLine,    
+    EPenInputCmdGuidingLine,
+        
+    EChinFepCmdModePinyinPhrase,
+    EChinFepCmdModeZhuyinPhrase,
+    EChinFepCmdModeStrokePhrase,    
+
     /**
     * @deprecated
     * Do not use.
Binary file commonuis/CommonUi/conf/commonui.confml has changed
--- a/commonuis/CommonUi/src/ItemFinder.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/commonuis/CommonUi/src/ItemFinder.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -923,6 +923,10 @@
             {
             break; // Item not visible.
             }
+        if( end >= ( pos + len ) )
+        	{
+			end = pos + len - 1;
+        	}
         TInt lastLine = (*iEditor)->TextLayout()->GetLineNumber( end );
         TInt nextLine = 0;
         TInt lastPos = start;
--- a/psln/Src/PslnGeneralThemeContainer.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/psln/Src/PslnGeneralThemeContainer.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -592,6 +592,11 @@
     // First stop timer.
     iPreviewIdle->Cancel();
     
+    // No re-preview the same theme
+    if( iActiveSkinItemIndex == iListBox->CurrentItemIndex() )
+        {
+        return;
+        }
 
     // Check free mem
     TInt freeMem = 0;
@@ -607,13 +612,13 @@
         return;
         }
 
+    iActiveSkinItemIndex = iListBox->CurrentItemIndex();
     // Ignore download skin item if it is available.
     TInt modifier = IsEmbeddedLinkVisible();
-    TInt activeSkinIndex = iListBox->CurrentItemIndex() - modifier;
+    TInt activeSkinIndex = iActiveSkinItemIndex - modifier;
     
     TBool usbAttached = static_cast<CPslnUi*>( ControlEnv()->AppUi() )->USBAttachState();
             
-    iActiveSkinItemIndex = iListBox->CurrentItemIndex();
     if( iModel->IsValidForPreview(activeSkinIndex) == EFalse )
         {
         // If skin file didn't valid, preview active skin.
--- a/uifw/AknGlobalUI/AknCapServer/inc/AknEikSgcs.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AknGlobalUI/AknCapServer/inc/AknEikSgcs.h	Fri Mar 12 15:43:43 2010 +0200
@@ -133,6 +133,13 @@
     void DoMoveApp();
     TInt RefreshLayoutIfRequiredL();
     
+    void UpdateIdleState();
+    void DoChangeIdleState();
+    static TInt ChangeIdleStateCallBack(TAny* aThis);
+    TInt  ForegroundWgId();
+    TBool IsIdleForeground();
+    void SetIdleState(TBool aFlag);
+    
 private:
     CWgStates* iWgStates;
     RWsSession& iWs;
@@ -143,6 +150,7 @@
     TInt iLastTopSpWg;
     TInt iLastScreenModeSet;
     CLayoutChangeCallBack* iLayoutChangeCallBack;
+    CPeriodic* iChangeIdleState;
     struct SRelinquishedThread
         {
         RThread iThread;
--- a/uifw/AknGlobalUI/AknCapServer/src/AknCapServerShutdown.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AknGlobalUI/AknCapServer/src/AknCapServerShutdown.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -119,7 +119,7 @@
       // instigated the shutdown.
       if ((uid != aRequesterUID) && ( uid != KCapServerUid ) && ( uid != KFepSwitchWGId ) && 
              ( doomed->Caption() != EIKON_SERVER_BACKDROP_WINDOW_GROUP_NAME ) &&
-			  !IsSystemCriticalThread( thd ) )  
+			  !IsSystemCriticalThread( thd ) && (!doomed->IsSystem()) && (uid.iUid != 0))
          {
          TApaTask* harbingerOfDoom = new (ELeave) TApaTask(iWs);
          CleanupDeletePushL(harbingerOfDoom);
--- a/uifw/AknGlobalUI/AknCapServer/src/AknEikSgcs.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AknGlobalUI/AknCapServer/src/AknEikSgcs.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -50,11 +50,13 @@
 #include <LayoutPack.cdl.h>
 #include <CdlRefs.h>
 const TInt KCdlEComInterfaceId = 0x101f8243;
+const TInt KMatrixMenuAppId = 0x101F4CD2;
 
 const TInt KLayoutChangeTimeout = 2000000; // 2s
 const TInt KWgStatesGranularity = 4;
 const TInt KRelinquishedThreadListGranularity = 4;
 const TInt KRemoveBlankDelay = 200000; // 0.2s
+const TInt KChangeIdleStateDelay = 200000; // 0.2s
 // Drawing is slower when transparency is enabled. The time needs to be
 // big enough to account for slowest drawing application.
 const TInt KRemoveBlankDelayTransparency = 1500000; // 1.5s
@@ -412,6 +414,8 @@
 	iLayoutNotifier = CEComPluginNotifier::NewL(KNullUid, callback);
 	iLayoutNotifier->Start();
 	EComPluginUtils::GetInfoArrayL(TUid::Uid(KCdlEComInterfaceId), iPrevPluginInfo);
+	
+	iChangeIdleState = CPeriodic::NewL(CActive::EPriorityStandard);  
     }
 
 TInt CEikSgcServer::LayoutInstallationCallBack(TAny* aPtr)
@@ -513,6 +517,7 @@
     delete iWgStates;
     delete iRemoveBlankCallBack;
     delete iLayoutNotifier;
+    delete iChangeIdleState;
     }
 
 void CEikSgcServer::HandleWindowGroupListChangeL()
@@ -522,7 +527,7 @@
         {
         ReOrderWgStatesL(wgIds);
         PostChangeRecalcL();
-        UpdateNotificationsInIdleAllowedKey();
+        UpdateIdleState();
         }
     CleanupStack::PopAndDestroy( wgIds );
     }
@@ -565,7 +570,7 @@
         LOGTEXT1("  understandsPartialForegroundChanged: %d", understandsPartialForegroundChanged);
         LOGTEXT1("  fullScreenChanged: %d",                   fullScreenChanged);        
         
-        UpdateNotificationsInIdleAllowedKey();
+        UpdateIdleState();
         }
     
     LOGTEXT0("CEikSgcServer::HandleWindowGroupParamChangeL - EXIT");
@@ -1308,74 +1313,67 @@
         }
     }
 
-void CEikSgcServer::UpdateNotificationsInIdleAllowedKey()
+TInt  CEikSgcServer::ForegroundWgId()
     {
     // First, get screensaver window group identifier.
     TApaTaskList taskList(CEikonEnv::Static()->WsSession());
     const TApaTask screensaverTask = taskList.FindApp(KScreensaverAppUid);
     const TInt screensaverWgId = screensaverTask.WgId();
-    
+
+    const TInt wgCount = iWgStates->Count();
+    TInt ii = FocusWgIndex();
+
+    LOGTEXT0("======================================");LOGTEXT1("Window groups: %d", wgCount);LOGTEXT1("Idle wg id: %d", idleWgId);LOGTEXT1("Screensaver wg id: %d", screensaverWgId);LOGTEXT1("Focus window group: %d", ii);LOGTEXT0("======================================");
+
+    // Loops window groups from top to bottom, starting from focus window group.
+    // (Index 0 contains the foreground window group.)
+    while (ii < wgCount)
+        {
+        const TWgState& state = iWgStates->At(ii);
+        const TInt currentWgId = state.WgId();
+
+        LOGTEXT0("\n");LOGTEXT1("  Window group id: %d", currentWgId);LOGTEXT1("  UnderstandsPartialForeground: %d", state.UnderstandsPartialForeground());LOGTEXT1("  IsFullScreen: %d", state.IsFullScreen());
+
+        // Ignores non-application window groups (e.g. incall bubble), partial screen
+        // applications and screensaver. 
+        if (state.UnderstandsPartialForeground() && state.IsFullScreen()
+                && currentWgId != screensaverWgId)
+            {
+            return currentWgId;
+            }
+        ++ii;
+        }
+    return KErrNotFound;
+    }
+
+TBool CEikSgcServer::IsIdleForeground()
+    {
+    TApaTaskList taskList(CEikonEnv::Static()->WsSession());
     // Get also idle window group identifier.
     TVwsViewId idleView;
     if (AknDef::GetPhoneIdleViewId(idleView) != KErrNone)
         {
-        return;
+        return EFalse;
         }
-        
     const TApaTask idleTask = taskList.FindApp(idleView.iAppUid);
-    const TInt idleWgId = idleTask.WgId();
-    
-    // Then go through window groups skipping partial apps and screensaver - 
-    // check if idleWgId follows.
-    TBool result = EFalse;
-    TBool found = EFalse;
-    const TInt wgCount = iWgStates->Count();
-    TInt ii = FocusWgIndex();
-        
-    LOGTEXT0("======================================");
-    LOGTEXT1("Window groups: %d",      wgCount);
-    LOGTEXT1("Idle wg id: %d",         idleWgId);
-    LOGTEXT1("Screensaver wg id: %d",  screensaverWgId);
-    LOGTEXT1("Focus window group: %d", ii);
-    LOGTEXT0("======================================");
-                
-    // Loops window groups from top to bottom, starting from focus window group.
-    // (Index 0 contains the foreground window group.)
-    while (ii < wgCount && !found)
+    return (idleTask.WgId() == ForegroundWgId());
+    }
+
+void CEikSgcServer::SetIdleState(TBool aFlag)
+    {
+    // Update the P&S key only if the value has been changed.
+    if ((iNotificationsInIdleAllowed && !aFlag)
+            || (!iNotificationsInIdleAllowed && aFlag))
         {
-        const TWgState& state = iWgStates->At(ii);
-        const TInt currentWgId = state.WgId();
-        
-        LOGTEXT0("\n");
-        LOGTEXT1("  Window group id: %d",              currentWgId);
-        LOGTEXT1("  UnderstandsPartialForeground: %d", state.UnderstandsPartialForeground());
-        LOGTEXT1("  IsFullScreen: %d",                 state.IsFullScreen());
-        
-        // Ignores non-application window groups (e.g. incall bubble), partial screen
-        // applications and screensaver. 
-        if (state.UnderstandsPartialForeground() &&
-            state.IsFullScreen()                 && 
-            currentWgId != screensaverWgId)        
-            {
-            // Check if current app is idle.
-            result = (idleWgId == currentWgId);
-            found = ETrue;
-            
-            LOGTEXT0("\n");
-            LOGTEXT1("Window group found. Result: %d", result);
-            }
-            
-        ii++;
+        iNotificationsInIdleAllowed = aFlag;
+        RProperty::Set(KPSUidAvkonDomain, KAknNotificationsInIdleAllowed,aFlag);
         }
-        
-    // Update the P&S key only if the value has been changed.
-    if ((iNotificationsInIdleAllowed && !result) || (!iNotificationsInIdleAllowed && result))
-        {
-        iNotificationsInIdleAllowed = result;
-        RProperty::Set(KPSUidAvkonDomain, KAknNotificationsInIdleAllowed, result);
-        }
-    } 
-    
+    }
+
+void CEikSgcServer::UpdateNotificationsInIdleAllowedKey()
+    {
+    SetIdleState(IsIdleForeground());
+    }     
 
 TInt CEikSgcServer::RemoveBlankCallBack( TAny* aThis )
     {
@@ -1493,6 +1491,36 @@
     	}
 	}
 
+void CEikSgcServer::UpdateIdleState()
+    {
+    if (ForegroundWgId() == KMatrixMenuAppId)
+        {
+        UpdateNotificationsInIdleAllowedKey();
+        return;
+        }
+
+    if (iChangeIdleState && iChangeIdleState->IsActive())
+        {
+        iChangeIdleState->Cancel();
+        }
+
+    iChangeIdleState->Start(KChangeIdleStateDelay, KChangeIdleStateDelay, TCallBack(ChangeIdleStateCallBack, this));
+    }
+
+void CEikSgcServer::DoChangeIdleState()
+    {
+    if(iChangeIdleState)
+        {
+        iChangeIdleState->Cancel();
+        }
+
+    UpdateNotificationsInIdleAllowedKey();
+    }
+TInt CEikSgcServer::ChangeIdleStateCallBack(TAny* aThis)
+    {
+    static_cast<CEikSgcServer*>(aThis)->DoChangeIdleState();
+    return EFalse;
+    }
 
 //
 // CAknSgcServerImpl
--- a/uifw/AknGlobalUI/AknCapServer/src/aknKeyFilter.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AknGlobalUI/AknCapServer/src/aknKeyFilter.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -302,6 +302,14 @@
                {
                menuThread.SetProcessPriority(EPriorityForeground);  
                }
+               
+            //start different fullscreen effect when launching appshell
+            GfxTransEffect::BeginFullScreen(
+                AknTransEffect::EApplicationActivate,
+                TRect(),
+                AknTransEffect::EParameterType,
+                AknTransEffect::GfxTransParam( iHomeViewId.iAppUid ) );   
+               
             // matrix menu will bring itself foreground when getting the message below
             task.SendMessage( KUidApaMessageSwitchOpenFile , KNullDesC8 );
             }
--- a/uifw/AknGlobalUI/OldStyleNotif/Src/aknkeylocknotifier.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AknGlobalUI/OldStyleNotif/Src/aknkeylocknotifier.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -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"
@@ -1960,6 +1960,7 @@
             break;
             }
         case CAknEcsDetector::ECompleteMatch:
+        case CAknEcsDetector::EServiceNumMatch:
             {
             iEcsNote->SetEmergencyNumber( aEcsDetector->CurrentMatch() );
             iEcsNote->ShowNote( CAknNoteDialog::ENoTimeout,
--- a/uifw/AvKon/EABI/AVKONU.DEF	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/EABI/AVKONU.DEF	Fri Mar 12 15:43:43 2010 +0200
@@ -4579,4 +4579,24 @@
 	_ZN19CAknBitmapAnimation15StartAnimationLEi @ 4578 NONAME
 	_ZN14CAknPopupField19CloseSelectionListLEv @ 4579 NONAME
 	_ZN12AknListUtils13DrawSeparatorER16CGraphicsContextRK5TRectRK4TRgb @ 4580 NONAME
+	_ZN17CAknSmileyManager13SetSizeByFontEPK5CFont @ 4581 NONAME
+	_ZN17CAknSmileyManager19ConvertCodesToTextLER6TDes16 @ 4582 NONAME
+	_ZN17CAknSmileyManager19ConvertTextToCodesLER6TDes16 @ 4583 NONAME
+	_ZN17CAknSmileyManager4NewLEP18MAknSmileyObserver @ 4584 NONAME
+	_ZN17CAknSmileyManager7SetSizeERK5TSize @ 4585 NONAME
+	_ZN17CAknSmileyManagerD0Ev @ 4586 NONAME
+	_ZN17CAknSmileyManagerD1Ev @ 4587 NONAME
+	_ZN17CAknSmileyManagerD2Ev @ 4588 NONAME
+	_ZNK17CAknSmileyManager4TextE5TChar @ 4589 NONAME
+	_ZNK17CAknSmileyManager5CountEv @ 4590 NONAME
+	_ZNK17CAknSmileyManager6SmileyE5TChar @ 4591 NONAME
+	_ZNK17CAknSmileyManager8DrawTextER9CWindowGcRK7TDesC16PK5CFontRK5TRectiN16CGraphicsContext10TTextAlignEi @ 4592 NONAME
+	_ZNK17CAknSmileyManager8DrawTextER9CWindowGcRK7TDesC16PK5CFontRK6TPoint @ 4593 NONAME
+	_ZNK17CAknSmileyManager8DrawTextER9CWindowGcRK7TDesC16RK14TAknLayoutTexti @ 4594 NONAME
+	_ZNK17CAknSmileyManager8IsSmileyE5TChar @ 4595 NONAME
+	_ZNK17CAknSmileyManagerixEi @ 4596 NONAME
+	_ZTI14CAknSmileyIcon @ 4597 NONAME
+	_ZTI17CAknSmileyManager @ 4598 NONAME
+	_ZTV14CAknSmileyIcon @ 4599 NONAME
+	_ZTV17CAknSmileyManager @ 4600 NONAME
 
--- a/uifw/AvKon/bwins/AVKONU.def	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/bwins/AVKONU.def	Fri Mar 12 15:43:43 2010 +0200
@@ -3453,4 +3453,18 @@
 	?StartAnimationL@CAknBitmapAnimation@@QAEXH@Z @ 3452 NONAME ; void CAknBitmapAnimation::StartAnimationL(int)
 	?CloseSelectionListL@CAknPopupField@@QAEXXZ @ 3453 NONAME ; void CAknPopupField::CloseSelectionListL(void)
 	?DrawSeparator@AknListUtils@@SAXAAVCGraphicsContext@@ABVTRect@@ABVTRgb@@@Z @ 3454 NONAME ; void AknListUtils::DrawSeparator(class CGraphicsContext &, class TRect const &, class TRgb const &)
+	?SetSize@CAknSmileyManager@@QAEXABVTSize@@@Z @ 3455 NONAME ; void CAknSmileyManager::SetSize(class TSize const &)
+	?DrawText@CAknSmileyManager@@QBEXAAVCWindowGc@@ABVTDesC16@@PBVCFont@@ABVTPoint@@@Z @ 3456 NONAME ; void CAknSmileyManager::DrawText(class CWindowGc &, class TDesC16 const &, class CFont const *, class TPoint const &) const
+	?NewL@CAknSmileyManager@@SAPAV1@PAVMAknSmileyObserver@@@Z @ 3457 NONAME ; class CAknSmileyManager * CAknSmileyManager::NewL(class MAknSmileyObserver *)
+	?Smiley@CAknSmileyManager@@QBEPAVCAknSmileyIcon@@VTChar@@@Z @ 3458 NONAME ; class CAknSmileyIcon * CAknSmileyManager::Smiley(class TChar) const
+	?Text@CAknSmileyManager@@QBEABVTDesC16@@VTChar@@@Z @ 3459 NONAME ; class TDesC16 const & CAknSmileyManager::Text(class TChar) const
+	??ACAknSmileyManager@@QBEPAVCAknSmileyIcon@@H@Z @ 3460 NONAME ; class CAknSmileyIcon * CAknSmileyManager::operator[](int) const
+	?SetSizeByFont@CAknSmileyManager@@QAEXPBVCFont@@@Z @ 3461 NONAME ; void CAknSmileyManager::SetSizeByFont(class CFont const *)
+	?ConvertCodesToTextL@CAknSmileyManager@@QAEHAAVTDes16@@@Z @ 3462 NONAME ; int CAknSmileyManager::ConvertCodesToTextL(class TDes16 &)
+	?ConvertTextToCodesL@CAknSmileyManager@@QAEHAAVTDes16@@@Z @ 3463 NONAME ; int CAknSmileyManager::ConvertTextToCodesL(class TDes16 &)
+	?Count@CAknSmileyManager@@QBEHXZ @ 3464 NONAME ; int CAknSmileyManager::Count(void) const
+	?DrawText@CAknSmileyManager@@QBEXAAVCWindowGc@@ABVTDesC16@@ABVTAknLayoutText@@H@Z @ 3465 NONAME ; void CAknSmileyManager::DrawText(class CWindowGc &, class TDesC16 const &, class TAknLayoutText const &, int) const
+	?DrawText@CAknSmileyManager@@QBEXAAVCWindowGc@@ABVTDesC16@@PBVCFont@@ABVTRect@@HW4TTextAlign@CGraphicsContext@@H@Z @ 3466 NONAME ; void CAknSmileyManager::DrawText(class CWindowGc &, class TDesC16 const &, class CFont const *, class TRect const &, int, enum CGraphicsContext::TTextAlign, int) const
+	??1CAknSmileyManager@@UAE@XZ @ 3467 NONAME ; CAknSmileyManager::~CAknSmileyManager(void)
+	?IsSmiley@CAknSmileyManager@@QBEHVTChar@@@Z @ 3468 NONAME ; int CAknSmileyManager::IsSmiley(class TChar) const
 
Binary file uifw/AvKon/conf/s60/avkon.confml has changed
Binary file uifw/AvKon/conf/s60/avkon_101F876E.crml has changed
--- a/uifw/AvKon/group/avkon.mmp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/group/avkon.mmp	Fri Mar 12 15:43:43 2010 +0200
@@ -280,6 +280,7 @@
 SOURCE          akndiscreetpopupdata.cpp
 SOURCE          akndiscreetpopupserverhandler.cpp
 
+SOURCE          AknSmileyUtils.cpp
 SOURCE          AknSmileyModel.cpp
 SOURCE          AknSmileyImage.cpp
 SOURCE          akncombinedpane.cpp
@@ -344,6 +345,7 @@
 LIBRARY         viewcli.lib
 LIBRARY         aknphysics.lib
 LIBRARY         HWRMLightClient.lib
+LIBRARY         aiwdialdata.lib
 
 DEFFILE AVKON.DEF
 
--- a/uifw/AvKon/inc/AknSmileyImage.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/inc/AknSmileyImage.h	Fri Mar 12 15:43:43 2010 +0200
@@ -50,6 +50,8 @@
 
 ////////////////////////////////////////////////////////////////////
 
+// CSmileyImage can be a still or animated svg image
+
 class CSmileyImage : public CBase, public MAknIconObserver
     {
 public:
@@ -71,46 +73,45 @@
     const CFbsBitmap* Image() const;
     const CFbsBitmap* Mask() const;
 
-private: // from MAknIconObserver
-    void BitmapChanged(CFbsBitmap* aBitmap);
+private:
+    void BitmapChanged(CFbsBitmap* aBitmap); // from MAknIconObserver
+    void MonitorAnimationEndedL();
 
 private:
     void DoLoadL();
     void DoRelease();
-    void StopAnyAsynchronousTask();
-
-    void MonitorAnimationEndedL();
-    void HandleAnimationEndedL();
+    void DoHandleEndedL();
 
 private:
-    void StartLoadAsynchronousL(TInt aRepeat, TInt aDelayMicroSeconds=0);
+    inline void StopAsynchronousTaskTimer();
+ 
+    void StartLoadAsynchronousL(TInt aDelayMicroSeconds=0);
     static TInt StartLoadAsynchronousCallBackL(TAny* aPtr);
-    
-private:
+
     void StopAnimationAsynchronousL(TInt aDelayMicroSeconds=0);
     static TInt StopAnimationAsynchronousCallBackL(TAny* aPtr);
 
 private:
-    TAknsItemID             iImageSkinItem;
-    TInt                    iImagePkgItem;
+    TAknsItemID             iImageSkinItemId;
+    const TInt              iImageMifPkgItemId;
     const TBool             iIsAnimation;
-    TSize                   iSize;
+
+private:
     MSmileyImageObserver*   iImageObserver;
     CPeriodic*              iAsynchronousTaskTimer;
 
 private:
+    TSize                   iSize;
     CFbsBitmap*             iFrame;
     CFbsBitmap*             iFrameMask;
-    
-private:
+    TBool                   iReadyToDraw;
+
+private: // for animation
+    TInt                    iRepeatCount;
     CFbsBitmap*             iFrameSnap;
     TInt                    iFrameCounter;
     TInt                    iSameFrameCounter;
 
-private:
-    TBool                   iReadyToDraw;
-    TInt                    iRepeatCount;
-
     };
 
 
--- a/uifw/AvKon/inc/AknSmileyModel.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/inc/AknSmileyModel.h	Fri Mar 12 15:43:43 2010 +0200
@@ -23,7 +23,8 @@
 
 // INCLUDES
 #include <AknIconObserver.h>
-
+#include <AknsItemID.h>
+#include "AknSmileyUtils.h"
 #include "AknSmileyImage.h"
 
 
@@ -33,6 +34,8 @@
 ////////////////////////////////////////////////////////////////////
 
 const TInt KSmileyNameLength = 8;
+typedef TBuf<KSmileyNameLength> TSmileyText;
+typedef RArray<TSmileyText> RSmileyTextArray;
 
 NONSHARABLE_CLASS(TSmileyIconInfo)
     {
@@ -40,69 +43,53 @@
     TSmileyIconInfo();
     TSmileyIconInfo(const TSmileyIconInfo& aInfo);
     void Reset();
-
-    TBuf<KSmileyNameLength> iName;
-    TInt iId;
-    TAknsItemID iSkinItemID;    // from skin
-    TInt iDefaultThumbnailID;   // from mif
-    TInt iDefaultAnimationID;   // from mif
-    };
-
-////////////////////////////////////////////////////////////////////
-
-class CSmileyIcon;
-
-class MSmileyIconObserver
-    {
-public:
-    virtual void ThumbnailLoaded(CSmileyIcon* aSmileyIcon)=0;
-    virtual void AnimationChanged(CSmileyIcon* aSmileyIcon)=0;
+    
+    TInt iIndex;
+    TAknsItemID iSkinItemID;        // from skin
+    TInt iDefaultStillImageID;      // from mif
+    TInt iDefaultAnimationImageID;  // from mif
     };
 
 ////////////////////////////////////////////////////////////////////
 
-class CSmileyIcon : public CBase, public MSmileyImageObserver
+class CSmileyIcon : public CAknSmileyIcon, public MSmileyImageObserver
     {
 public:
-    static CSmileyIcon* NewL(const TSmileyIconInfo& aInfo, MSmileyIconObserver* aObserver);
+    static CSmileyIcon* NewL(const TSmileyIconInfo& aInfo, MAknSmileyObserver* aObserver);
     virtual ~CSmileyIcon();
 
 private:
-    CSmileyIcon(const TSmileyIconInfo& aInfo, MSmileyIconObserver* aObserver);
-    void ConstructL();
-
-public:
-    const TDesC& Name() const               { return iInfo.iName; }
-    TInt Id() const                         { return iInfo.iId; }
-
-    TBool ReadyToDraw() const;
-    const CFbsBitmap* Image() const;
-    const CFbsBitmap* Mask() const;
+    CSmileyIcon(MAknSmileyObserver* aObserver);
+    void ConstructL(const TSmileyIconInfo& aInfo);
 
-public:
-    void LoadThumbnailL();
-    TBool ThumbnailReady() const;
-    
-    void PlayAnimationL(TInt aRepeat, TInt aDelay);
-    void StopAnimation();
-
-public:
-    void SetSize(const TSize& aSize);
-    const TSize& Size() const;
+public: // from AknSmileyIcon
+    virtual const CFbsBitmap* Image() const;
+    virtual const CFbsBitmap* Mask() const;
+    virtual TBool ReadyToDraw() const;
+    virtual void SetSize(const TSize& aSize);
+    virtual const TSize& Size() const;
+    virtual void PlayAnimationL(TInt aRepeat=0, TInt aDelay=0);
+    virtual void StopAnimation();
 
 private: // from MSmileyImageObserver
     virtual void BitmapChanged(CSmileyImage* aSmileyImage, CFbsBitmap* aBitmap);
+    
+public:
+    TInt Index() const;
+    void LoadStillImageL(TInt aDelay=0);
+    TBool StillImageIsReadyToDraw() const;
+    TBool AnimationImageIsReadyToDraw() const;
 
-private:
-    TBool ShouldShowAnimation() const;
+    void AddText(const TDesC& aText);
+    const TDesC& Text(TInt aVariate=0) const;
+    TInt TextVariate() const;
 
 private:
-    const TSmileyIconInfo   iInfo;
-    MSmileyIconObserver*    iSmileyIconObserver;
-
-    CSmileyImage*           iThumbnailImage;
+    MAknSmileyObserver*     iSmileyIconObserver;
+    TInt                    iIndex;
+    CSmileyImage*           iStillImage;
     CSmileyImage*           iAnimationImage;
-
+    RSmileyTextArray        iTextArray;
     };
 
 typedef RArray<CSmileyIcon*> RSmileyIconPtrArray;
@@ -122,44 +109,77 @@
     void DoNextTaskL();
 
 private:
-    RSmileyIconPtrArray     iTaskArray;
-    TBool                   iIsLoading;
+    RSmileyIconPtrArray     iLoadingTaskArray;
     
     };
 
 ////////////////////////////////////////////////////////////////////
 
-class CSmileyModel : public CBase, public MSmileyIconObserver
+class CSmileyTextTreeNode;
+
+class CSmileyModel : public CBase, public MAknSmileyObserver
     {
 public:
-    CSmileyModel(MSmileyIconObserver* aObserver);
-    ~CSmileyModel();
+    CSmileyModel(MAknSmileyObserver* aObserver);
+    virtual ~CSmileyModel();
 
 public:
     void LoadResourceL();
     void ReleaseResource();
-    void LoadThumbnailAsyn(TInt aIndex);
-    void SetSize(const TSize& aSize);
 
 public:
-    enum TIconId
-        {
-        EIconSwitchToSmiley = 0, 
-        EIconSwitchToSct,
-        EIconSmiley
-        };
+    TInt ConvertCodesToTextL(TDes& aText);
+    TInt ConvertTextToCodesL(TDes& aText);
+    const TDesC& Text(TChar aCode) const;
+    TBool IsSmiley(TChar aCode) const;
+    
+public:
+    void SetSize(const TSize& aSize);
+    void SetSizeByFont(const CFont* aFont);
+    
+public:
+    void DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TPoint& aPosition) const;
+    void DrawText(CWindowGc& aGc, const TDesC& aText, const TAknLayoutText& aLayout, TBool aUseLogicalToVisualConversion=EFalse) const;
+    void DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TRect& aBox, TInt aBaselineOffset, 
+                  CGraphicsContext::TTextAlign aAlignment=CGraphicsContext::ELeft, TInt aLeftMargin=0) const;
 
-    CSmileyIcon* operator[](TInt aIndex) const;
+private:
+    void DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TRect& aBox, const TPoint& aOffset) const;
+    
+public:
     TInt Count() const;
+    CAknSmileyIcon* Smiley(TChar aCode) const;
+    CAknSmileyIcon* operator[](TInt aIndex) const;
 
 private: // from MSmileyIconObserver
-    virtual void ThumbnailLoaded(CSmileyIcon* aSmileyIcon);
-    virtual void AnimationChanged(CSmileyIcon* aSmileyIcon);
+    virtual void SmileyStillImageLoaded(CAknSmileyIcon* aSmileyIcon);
+    virtual void SmileyAnimationChanged(CAknSmileyIcon* aSmileyIcon);
+
+public: // for smiley picker
+    CAknSmileyIcon* SwitchToSmileyIcon() const;
+    CAknSmileyIcon* SwitchToSctIcon() const;
+    TChar SwitchToSmileyCode() const;
+    TChar SwitchToSctCode() const;
+
+    TChar SmileyCode(TInt aIndex, TInt aVariate=0) const;
+    TChar SmileyCode(CAknSmileyIcon* aSmileyIcon) const;
+    void LoadStillImagesL(const TDesC& aText);
+    void LoadStillImageL(TChar aChar);
 
 private:
-    MSmileyIconObserver*        iSmileyIconObserver;
+    const TDesC& Text(TInt aIndex, TInt aVariate=0) const;
+    TInt ArrayCount() const;
+    TChar EncodeSmileyCode(TInt aIndex, TInt aVariate) const;
+    TBool DecodeSmileyCode(TChar aCode, TInt& aIndex, TInt& aVariate) const;
+
+private:
+    MAknSmileyObserver*         iSmileyIconObserver;
+    CSmileyTnumbnailAsynLoader  iSmileyLoader;
     RSmileyIconPtrArray         iSmileyIconArray;
-    CSmileyTnumbnailAsynLoader  iSmileyThumbnailLoader;
+    TUint                       iBaseCode;
+    
+    CSmileyTextTreeNode*        iTextSearchTree;
+    TBuf<1024*2>                iConvertBuffer;
     
     };
 
--- a/uifw/AvKon/inc/aknemptycontrol.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/inc/aknemptycontrol.h	Fri Mar 12 15:43:43 2010 +0200
@@ -107,6 +107,7 @@
 
     TInt iSpare;
     TBool iIsActiveIdle;
+    CEikStatusPaneBase*         iStatusPane;
     };
 
 #endif // C_AKNEMPTYCONTROL_H
--- a/uifw/AvKon/src/AknAppUi.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknAppUi.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -88,6 +88,7 @@
 #include <touchfeedback.h>
 
 #include <aknpointereventmodifier.h>
+#include <aknitemactionmenuregister.h>
 
 // UIDS for dialler view
 const TUid KPhoneAppUid = { 0x100058B3 };
@@ -683,6 +684,8 @@
             }
         }
 
+    AknItemActionMenuRegister::SetConstructingMenuBarOwnerL( this );
+
 #ifdef AVKON_RDEBUG_INFO
     RDebug::Print(_L("Entering CEikAppUi::BaseConstructL()"));    
 #endif
@@ -1547,20 +1550,20 @@
         User::LeaveIfError( apparcSession.Connect() );
         CleanupClosePushL( apparcSession );
         TApaAppInfo appInfo;
-        TInt err = apparcSession.GetAppInfo( appInfo, this->Application()->AppDllUid() );
-        
+
         // +2 for colon and line end
-        HBufC* captionBuffer = 
-            HBufC::NewLC( KApaMaxAppCaption + KAknBidiExtraSpacePerLine + 2 ); 
-
-//        CleanupStack::PushL( captionBuffer );
+        HBufC* captionBuffer = HBufC::NewLC(KApaMaxAppCaption + KAknBidiExtraSpacePerLine + 2);
         TPtr caption = captionBuffer->Des();
 
-        if ( err == KErrNone )
+        CEikApplication *application = this->Application();
+        if (NULL != application)
             {
-            caption = appInfo.iCaption;
+            if (KErrNone == apparcSession.GetAppInfo(appInfo, application->AppDllUid()))
+                {
+                caption = appInfo.iCaption;
+                }
             }
-
+        
         // Lets remove trailing spaces
         caption.TrimRight();
         
--- a/uifw/AvKon/src/AknCharMap.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknCharMap.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -102,49 +102,6 @@
 
 
 // ----------------------------------------------------------------------------
-// TEmotionUtils definition
-// ----------------------------------------------------------------------------
-//
-
-const TUint KEmotionCharBase = 0xf880;
-
-class TEmotionUtils
-    {
-public:
-    static TBool IsEmotionChar(TChar aChar);
-    static TChar EmotionChar(TInt aId);
-    static TInt EmotionId(TChar aChar);
-    static TChar EmotionSwitchToSmileyChar();
-    static TChar EmotionSwitchToSctChar();
-    };
-
-TBool TEmotionUtils::IsEmotionChar(TChar aChar)
-    {
-    return (aChar >= KEmotionCharBase);
-    }
-
-TChar TEmotionUtils::EmotionChar(TInt aId)
-    {
-    return (KEmotionCharBase + aId);
-    }
-
-TInt TEmotionUtils::EmotionId(TChar aChar)
-    {
-    return (TInt)(aChar - KEmotionCharBase);
-    }
-
-TChar TEmotionUtils::EmotionSwitchToSmileyChar()
-    {
-    return KEmotionCharBase + CSmileyModel::EIconSwitchToSmiley;
-    }
-
-TChar TEmotionUtils::EmotionSwitchToSctChar()
-    {
-    return KEmotionCharBase + CSmileyModel::EIconSwitchToSct;
-    }
-
-
-// ----------------------------------------------------------------------------
 // CAknCharMapHistory definition
 // ----------------------------------------------------------------------------
 //
@@ -219,7 +176,7 @@
         * @param aHistoryType The kind of charctor map, refer to THistoryType
         * @param aChar    Insert a character
         */
-        void InsertChar(THistoryType aHistoryType, const TChar aChar);
+        void InsertChar(THistoryType aHistoryType, const TChar aChar, TBool aIsEmotion);
 
     private:
         /**
@@ -477,7 +434,7 @@
     public CBase,
     public MObjectProvider,
     public MAknSctFocusHandler,
-    public MSmileyIconObserver
+    public MAknSmileyObserver
     {
     public:
         CAknCharMapExtension();
@@ -499,19 +456,23 @@
         MObjectProvider* MopNext();
         
     private: // from MSmileyIconObserver
-        virtual void ThumbnailLoaded(CSmileyIcon* aSmileyIcon);
-        virtual void AnimationChanged(CSmileyIcon* aSmileyIcon);
+        virtual void SmileyStillImageLoaded(CAknSmileyIcon* aSmileyIcon);
+        virtual void SmileyAnimationChanged(CAknSmileyIcon* aSmileyIcon);
         
     public:
         TBool IsEmotionEnabled() const;
         TBool IsShowingEmotion() const;
+        void SwitchEmotionVisibilityL();
         TBool NeedEmotionSwitchIcon() const;
         HBufC* ReadEmotionHBufCL();
-        void LoadEmotionTumbnails(const TDesC& aSctChars);
+        void LoadEmotionTumbnails(const TDesC& aChars);
         void SetEmotionSize(const TSize& aSize);
-
-        CSmileyIcon* EmotionIcon(TChar aEmotionChar);
-        TBool DrawEmotion(CWindowGc& aGc, const TRect& aRect, TChar aEmotionChar);
+        TBool IsEmotionChar(TChar aChar);
+        TChar SwitchToSctChar();
+        TChar SwitchToEmotionChar();
+        CAknSmileyIcon* EmotionIcon(TChar aChar);
+        const TDesC& EmotionText(TChar aChar);
+        TBool DrawEmotion(CWindowGc& aGc, const TRect& aRect, CAknSmileyIcon* aSmileyIcon);
         void HandleFocusStatusChanged(TChar aChar, TBool aIsFocused);
 
     public: // data
@@ -552,7 +513,7 @@
         
     public: // for Emotion
         HBufC* iCharsSmiley;
-        CSmileyModel iSmileyModel;
+        CSmileyModel* iSmileyModel;
         TChar iLastFocusedSmileyChar;
         TBool iIsShowingEmotion;
         TBool iIsEnableEmotion;
@@ -567,6 +528,11 @@
         * Is highlight visible
         */
         TBool iHighlightVisible;         
+
+        /**
+        * Is keyboard event
+        */
+        TBool iKeyBrdEvent;
     };
 
 // ----------------------------------------------------------------------------
@@ -778,7 +744,7 @@
     {
     delete iIdle;
     iIdle = 0;
-    iIdle = CIdle::NewL(CActive::EPriorityIdle);
+    iIdle = CIdle::NewL(CActive::EPriorityStandard);
     iIdle->Start(TCallBack(DoTableExit, this));
     }
 
@@ -2456,15 +2422,15 @@
 // Extension class implementation
 // ----------------------------------------------------------------------------
 //
-CAknCharMapExtension::CAknCharMapExtension() : iSmileyModel(this)
-,iSingleClickEnabled( iAvkonAppUi->IsSingleClickCompatible() )
+CAknCharMapExtension::CAknCharMapExtension() : iSingleClickEnabled( iAvkonAppUi->IsSingleClickCompatible() )
     {
     iObserver = NULL;
     iPictographsBuffer = FeatureManager::FeatureSupported(KFeatureIdJapanesePicto);
     iPictographsBufferGrouping = FeatureManager::FeatureSupported(KFeatureIdJapanesePictographsGrouping);
     iKineticScrolling = CAknPhysics::FeatureEnabled();
 
-    TRAP_IGNORE(iSmileyModel.LoadResourceL());
+    TRAP_IGNORE(iSmileyModel = new (ELeave) CSmileyModel(this));
+    TRAP_IGNORE(iSmileyModel->LoadResourceL());
     }
 
 TTypeUid::Ptr CAknCharMapExtension::MopSupplyObject(TTypeUid aId)
@@ -2479,6 +2445,8 @@
 
 CAknCharMapExtension::~CAknCharMapExtension()
     {
+    delete iSmileyModel;
+    
     delete iCharsSmiley;
     delete iCharsQwerty;
     delete iBgContext;
@@ -2513,7 +2481,6 @@
     if(iCharMapProxy->EnterControl(aX, aY))
         {
         iFocusHandler = this;
-        iCharMapProxy->HandleFocusStatusChanged();
         return ETrue;
         }
     else
@@ -2538,14 +2505,16 @@
     return ETrue;
     }
 
-void CAknCharMapExtension::ThumbnailLoaded(CSmileyIcon* /*aSmileyIcon*/)
-    {
-    iCharMapProxy->DrawDeferred();
-    }
-
-void CAknCharMapExtension::AnimationChanged(CSmileyIcon* /*aSmileyIcon*/)
-    {
-    iCharMapProxy->DrawCursor();
+void CAknCharMapExtension::SmileyStillImageLoaded(CAknSmileyIcon* aSmileyIcon)
+    {
+    iCharMapProxy->SmileyStillImageLoaded(iSmileyModel->SmileyCode(aSmileyIcon));
+    }
+
+void CAknCharMapExtension::SmileyAnimationChanged(CAknSmileyIcon* aSmileyIcon)
+    {
+    iCharMapProxy->SmileyAnimationChanged(iSmileyModel->SmileyCode(aSmileyIcon));
+    
+    User::After(30); // for slow down the AO of this animation
     }
 
 TBool CAknCharMapExtension::IsEmotionEnabled() const
@@ -2558,6 +2527,11 @@
     return iIsShowingEmotion;
     }
 
+void CAknCharMapExtension::SwitchEmotionVisibilityL()
+    {
+    iIsShowingEmotion = !iIsShowingEmotion;
+    }
+
 TBool CAknCharMapExtension::NeedEmotionSwitchIcon() const
     {
     // Emotion switch char
@@ -2567,53 +2541,62 @@
 
 HBufC* CAknCharMapExtension::ReadEmotionHBufCL()
     {
-    TInt smileyCount = iSmileyModel.Count();
+    TInt smileyCount = iSmileyModel->Count();
     HBufC* charsSmiley = HBufC::NewL(smileyCount);
     TPtr charsSmileyPtr(charsSmiley->Des());
-    for(TInt id(CSmileyModel::EIconSmiley); id<smileyCount; id++)
-        {
-        charsSmileyPtr.Append(TEmotionUtils::EmotionChar(id));
+    for(TInt index(0); index<smileyCount; index++)
+        {
+        charsSmileyPtr.Append(iSmileyModel->SmileyCode(index));
         }
     
     return charsSmiley;
     }
 
-void CAknCharMapExtension::LoadEmotionTumbnails(const TDesC& aSctChars)
-    {
-    for(TInt i(0); i<aSctChars.Length(); i++)
-        {
-        iSmileyModel.LoadThumbnailAsyn(TEmotionUtils::EmotionId(aSctChars[i]));
-        }
+void CAknCharMapExtension::LoadEmotionTumbnails(const TDesC& aChars)
+    {
+    iSmileyModel->LoadStillImagesL(aChars);
     }
 
 void CAknCharMapExtension::SetEmotionSize(const TSize& aSize)
     {
     TInt unit = Min(aSize.iWidth, aSize.iHeight);
-    iSmileyModel.SetSize(TSize(unit,unit));
-    }
-
-CSmileyIcon* CAknCharMapExtension::EmotionIcon(TChar aEmotionChar)
-    {
-    if(TEmotionUtils::IsEmotionChar(aEmotionChar))
-        {
-        return iSmileyModel[TEmotionUtils::EmotionId(aEmotionChar)];
-        }
-    else
-        {
-        return NULL;
-        }
-    }
-
-TBool CAknCharMapExtension::DrawEmotion(CWindowGc& aGc, const TRect& aRect, TChar aEmotionChar)
-    {
-    CSmileyIcon* icon = EmotionIcon(aEmotionChar);
-    if(icon && icon->ReadyToDraw())
-        {
-        TRect iconRect(TPoint(),icon->Size());
+    iSmileyModel->SetSize(TSize(unit,unit));
+    }
+
+TBool CAknCharMapExtension::IsEmotionChar(TChar aChar)
+    {
+    return iSmileyModel->IsSmiley(aChar);
+    }
+
+TChar CAknCharMapExtension::SwitchToSctChar()
+    {
+    return iSmileyModel->SwitchToSctCode();
+    }
+
+TChar CAknCharMapExtension::SwitchToEmotionChar()
+    {
+    return iSmileyModel->SwitchToSmileyCode();
+    }
+
+CAknSmileyIcon* CAknCharMapExtension::EmotionIcon(TChar aChar)
+    {
+    return iSmileyModel->Smiley(aChar);
+    }
+
+const TDesC& CAknCharMapExtension::EmotionText(TChar aChar)
+    {
+    return iSmileyModel->Text(aChar);
+    }
+
+TBool CAknCharMapExtension::DrawEmotion(CWindowGc& aGc, const TRect& aRect, CAknSmileyIcon* aSmileyIcon)
+    {
+    if(aSmileyIcon && aSmileyIcon->ReadyToDraw())
+        {
+        TRect iconRect(TPoint(),aSmileyIcon->Size());
         TInt xoffset = (aRect.Width() - iconRect.Width()) / 2;
         TInt yoffset = (aRect.Height() - iconRect.Height()) / 2;
 
-        aGc.BitBltMasked(aRect.iTl+TPoint(xoffset,yoffset), icon->Image(), iconRect, icon->Mask(), FALSE);
+        aGc.BitBltMasked(aRect.iTl+TPoint(xoffset,yoffset), aSmileyIcon->Image(), iconRect, aSmileyIcon->Mask(), FALSE);
         return ETrue;
         }
     else
@@ -2627,13 +2610,13 @@
 
 void CAknCharMapExtension::HandleFocusStatusChanged(TChar aChar, TBool aIsFocused)
     {
-    CSmileyIcon* lastIcon = EmotionIcon(iLastFocusedSmileyChar);
+    CAknSmileyIcon* lastIcon = EmotionIcon(iLastFocusedSmileyChar);
     if(lastIcon)
         {
         lastIcon->StopAnimation();
         }
     
-    CSmileyIcon* focusedIcon = EmotionIcon(aChar);
+    CAknSmileyIcon* focusedIcon = EmotionIcon(aChar);
     if(focusedIcon)
         {
         if(aIsFocused)
@@ -2830,13 +2813,13 @@
 // Insert a character which select on SCT/Picto.
 // -----------------------------------------------------------------------------
 //
-void CAknCharMapHistory::InsertChar(THistoryType aHistoryType, const TChar aChar)
+void CAknCharMapHistory::InsertChar(THistoryType aHistoryType, const TChar aChar, TBool aIsEmotion)
     {
     __ASSERT_ALWAYS((EHistoryTypeFull<=aHistoryType && aHistoryType<EHistoryTypeMax), Panic(EAknPanicInvalidValue));
 
     InsertCharToHistoryBuf(iMixedHistoryArray[aHistoryType], aChar);
 
-    if(TEmotionUtils::IsEmotionChar(aChar))
+    if(aIsEmotion)
         {
         InsertCharToHistoryBuf(iEmotionHistory, aChar);
         }
@@ -3009,8 +2992,8 @@
 
     // load Emotion icon resource, but not load images
     TSize iconSize(iGridItemWidth,iGridItemHeight);
-    iconSize.iWidth = iconSize.iWidth * 2 / 3;
-    iconSize.iHeight = iconSize.iHeight * 2 / 3;
+    iconSize.iWidth = iconSize.iWidth * 3 / 4;
+    iconSize.iHeight = iconSize.iHeight * 3 / 4;
     Extension()->SetEmotionSize(iconSize);
     }
 
@@ -3186,6 +3169,7 @@
         iShowPagesRef = &iSpecialCharPages;
         
         // default
+        iSpecialCharCase = EAknSCTLowerCase;
         iChars = iCharsBufferLower;
         
         if(iExtension->iCharsSmiley && iExtension->IsShowingEmotion())
@@ -3269,7 +3253,7 @@
         pageNavi->MakeVisible(PageCount()>1);
         }
     
-    HandleFocusStatusChanged();
+    SetSmileyAnimationActivityInCurrentPageL(ETrue);
     
     }
 
@@ -3456,10 +3440,10 @@
              code == EKeyLeftArrow || code == EKeyRightArrow || 
              code == EKeyEnter )
             {
+            iExtension->iKeyBrdEvent = ETrue;
             iExtension->iHighlightVisible = ETrue;
             iCursorPos = TPoint( 0, 0 );
             DrawCursor();
-            HandleFocusStatusChanged();
             return EKeyWasConsumed;
             }
         }
@@ -4004,19 +3988,26 @@
 
         // Sets the character case because the buffer content may have changed.
         SetCharacterCaseL(iSpecialCharCase);
-
-        // status after layout switch.
-        TInt recentLengthAfterSwitch = iMaxColumns; // recentLength has changed after switch
         TInt cursorIndexAfterSwitch;
-        if(cursorIndexBeforeSwitch < recentLengthBeforeSwitch)
+        if ( !iExtension->iKeyBrdEvent )
             {
             cursorIndexAfterSwitch = cursorIndexBeforeSwitch;
             }
         else
             {
-            cursorIndexAfterSwitch = cursorIndexBeforeSwitch - recentLengthBeforeSwitch + recentLengthAfterSwitch;
-            }
-
+            // status after layout switch.
+            TInt recentLengthAfterSwitch = iMaxColumns; // recentLength has
+                                                        // changed after switch
+            if ( cursorIndexBeforeSwitch < recentLengthBeforeSwitch )
+                {
+                cursorIndexAfterSwitch = cursorIndexBeforeSwitch;
+                }
+            else
+                {
+                cursorIndexAfterSwitch = cursorIndexBeforeSwitch -
+                            recentLengthBeforeSwitch + recentLengthAfterSwitch;
+                }
+            }
         // the new first row is the top row on the page where the new focus is.
         TInt pageVolume = iMaxColumns * iExtension->iMaxVisibleRows;
         iFirstVisibleRow = (cursorIndexAfterSwitch / pageVolume * pageVolume) / iMaxColumns;
@@ -4105,15 +4096,26 @@
         iOffscreenBgDrawn = EFalse;
         }
 
-    else if ( aType == KAknsMessageSkinChange )
+    else if( aType == KAknsMessageSkinChange )
         {
         iOffscreenBgDrawn = EFalse;
         }
-    else if ( aType == KAknMessageFocusLost && iExtension->iHighlightVisible )
-        {
-        iExtension->iHighlightVisible = EFalse;
-        DrawCursor();
-        }
+
+    else if(aType == KEikMessageFadeAllWindows) // focus gained // KEikMessageWindowsFadeChange
+        {
+        SetSmileyAnimationActivityInCurrentPageL(ETrue);
+        }
+    
+    else if(aType == KAknMessageFocusLost) // focus lost
+        {
+        SetSmileyAnimationActivityInCurrentPageL(EFalse);
+		
+    	if ( iExtension->iHighlightVisible )
+        	{
+        	iExtension->iHighlightVisible = EFalse;
+        	DrawCursor();
+        	}
+    	}
     }
 
 void CAknCharMap::EnableNavigationButtonsL()
@@ -4691,9 +4693,10 @@
             KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG19 );
         }
     
-    if(TEmotionUtils::IsEmotionChar(symbol[0]))
-        {
-        iExtension->DrawEmotion(aGc, textLayout.TextRect(), symbol[0]);
+    CAknSmileyIcon* icon = iExtension->EmotionIcon(symbol[0]);
+    if(icon) 
+        {
+        iExtension->DrawEmotion( aGc, textLayout.TextRect(), icon );
         }
     else
         {
@@ -4845,8 +4848,8 @@
 
     if ( feedback && spec )
         {
-        TInt orphans = NumberOfVisibleChars() % iMaxColumns;
-        TInt rows = NumberOfVisibleChars() / iMaxColumns;
+        TInt orphans = numberOfCells % iMaxColumns;
+        TInt rows = numberOfCells / iMaxColumns;
         CAknCharMap* mutableThis = MUTABLE_CAST( CAknCharMap* ,this );
         TInt recentChars = mutableThis->LengthOfRecentChar();    
         TRect rectMain;
@@ -5339,8 +5342,6 @@
                 pt.iX = index;
                 }
             }
-        
-        HandleFocusStatusChanged();
 
         iCursorPos = pt;
         UpdateScrollIndicatorL();
@@ -5377,8 +5378,6 @@
             {
             UpdateScrollIndicatorL();
             }
-        
-        HandleFocusStatusChanged();
 
         if (oldFirstVisibleRow == iFirstVisibleRow)
             {
@@ -5719,7 +5718,7 @@
 
 TInt CAknCharMap::NextPageL()
     {
-    HandleFocusStatusChanged(EFalse);
+    SetSmileyAnimationActivityInCurrentPageL(EFalse);
     
     TInt page(0);
     iFirstVisibleRow =
@@ -5758,7 +5757,7 @@
         }
     UpdateHeadingPane( ETrue );
     UpdateScrollIndicatorL();
-    HandleFocusStatusChanged();
+    SetSmileyAnimationActivityInCurrentPageL(ETrue);
     DrawNow();
 
     return page;
@@ -5766,7 +5765,7 @@
 
 TInt CAknCharMap::PrevPageL()
     {
-    HandleFocusStatusChanged(EFalse);
+    SetSmileyAnimationActivityInCurrentPageL(EFalse);
     
     TInt page(0);
     TInt firstVisibleRow =
@@ -5803,7 +5802,7 @@
         }
     UpdateHeadingPane( ETrue );
     UpdateScrollIndicatorL();
-    HandleFocusStatusChanged();
+    SetSmileyAnimationActivityInCurrentPageL(ETrue);
     DrawNow();
 
     return page;
@@ -6447,6 +6446,8 @@
 //--------------------------------------------------------------------------
 EXPORT_C void CAknCharMap::HandlePointerEventL(const TPointerEvent& aPointerEvent)
     {
+    iExtension->iKeyBrdEvent = EFalse;
+
     if ( AknLayoutUtils::PenEnabled() && Rect().Contains(aPointerEvent.iPosition))
         {
         if (iExtension->iFocusHandler->FocusedControl() != this)// Tapping will move focus to grid.
@@ -6566,8 +6567,6 @@
                                 {
                                 iExtension->iHighlightVisible = ETrue;
                                 }
-                        
-                            HandleFocusStatusChanged();
                             }
                         
                         DrawCursor();
@@ -6815,8 +6814,7 @@
             {
             iExtension->iObserver->HandleControlEventL(this, MCoeControlObserver::EEventRequestFocus);
             }
-        
-        HandleFocusStatusChanged();
+
         DrawDeferred();
         }
     }
@@ -6880,14 +6878,14 @@
         TPtrC textHistory = iCharMapHistory->RecentString(historyType, CAknCharMapHistory::EHistoryFilterTextOnly);
         
         *charsBuf = InsertSwitchCharAndHistoryToCharsBufL(*charsBuf, 
-                                                          TEmotionUtils::EmotionSwitchToSmileyChar(), 
+                                                          iExtension->SwitchToEmotionChar(), 
                                                           textHistory);
         }
     
     // Emotion history
     TPtrC emotionHistory = iCharMapHistory->RecentString(CAknCharMapHistory::EHistoryTypeFull, CAknCharMapHistory::EHistoryFilterEmotionOnly);
     iExtension->iCharsSmiley = InsertSwitchCharAndHistoryToCharsBufL(iExtension->iCharsSmiley, 
-                                                                     TEmotionUtils::EmotionSwitchToSctChar(), 
+                                                                     iExtension->SwitchToSctChar(), 
                                                                      emotionHistory);
 
     // ETrue are set to each variable when setting the recent used characters.
@@ -6904,7 +6902,7 @@
         for (TInt index=0; index<aHistory.Length(); index++)
             {
             TChar txt = aHistory[index];
-            if(aCharsBuf->Locate(txt)!=KErrNotFound || TEmotionUtils::IsEmotionChar(txt) || txt==KHistoryEmptyChar)
+            if(aCharsBuf->Locate(txt)!=KErrNotFound || Extension()->IsEmotionChar(txt) || txt==KHistoryEmptyChar)
                 {
                 insertBuffer.Append(txt);
                 }
@@ -7019,7 +7017,8 @@
     
     if (historyType > CAknCharMapHistory::EHistoryTypeNull)
         {
-        iCharMapHistory->InsertChar(historyType, aChar);
+        TBool isEmotion = Extension()->IsEmotionChar(aChar);
+        iCharMapHistory->InsertChar(historyType, aChar, isEmotion);
         }
 
     // Save recent data
@@ -7152,8 +7151,8 @@
         {
         return;
         }
-    
-    HandleFocusStatusChanged(aHighlight);
+
+    SetSmileyAnimationActivityInCurrentPageL(aHighlight);
     
     CWindowGc& gc = SystemGc();
     if( !CAknEnv::Static()->TransparencyEnabled() )
@@ -7309,7 +7308,7 @@
             {
             if (ptrrecent[index] != KHistoryEmptyChar)
                 {
-                if(TEmotionUtils::IsEmotionChar(ptrrecent[index]))
+                if(Extension()->IsEmotionChar(ptrrecent[index]))
                     {
                     continue;
                     }
@@ -7321,7 +7320,7 @@
                         ptrrecent.Delete(index,1);
                         ptrrecent.Append(KHistoryEmptyChar);
                         index--;
-                        }                       
+                        }
                     }
                 }
             }
@@ -7346,7 +7345,7 @@
     
     iExtension->LoadEmotionTumbnails(*iChars);
 
-    HandleFocusStatusChanged();
+    SetSmileyAnimationActivityInCurrentPageL(ETrue);
     }
 
 // -----------------------------------------------------------------------------
@@ -7813,8 +7812,6 @@
 
 TBool CAknCharMap::LeaveControl()
     {
-    HandleFocusStatusChanged(EFalse);
-    
     CWindowGc& gc = SystemGc();
     if( !CAknEnv::Static()->TransparencyEnabled() )
         {
@@ -8030,15 +8027,6 @@
 
 // for emotion added
 
-void CAknCharMap::HandleFocusStatusChanged(TBool aIsFocused)
-    {
-    TInt focusPos = iCursorPos.iX + (iFirstVisibleRow + iCursorPos.iY) * iMaxColumns;
-    if(focusPos>=0 && focusPos<iChars->Length())
-        {
-        aIsFocused &= (iExtension->iFocusHandler->FocusedControl()==this);
-        iExtension->HandleFocusStatusChanged((*iChars)[focusPos], aIsFocused);
-        }
-    }
 
 TBool CAknCharMap::EmotionsAreAllReadyToDraw(TInt aIndex, TInt aCount) const
     {
@@ -8046,8 +8034,8 @@
         {
         if(aIndex < iChars->Length())
             {
-            TChar name = (*iChars)[aIndex++];
-            CSmileyIcon* icon = iExtension->EmotionIcon(name);
+            TChar code = (*iChars)[aIndex++];
+            CAknSmileyIcon* icon = Extension()->EmotionIcon(code);
             if(icon && !icon->ReadyToDraw())
                 {
                 return EFalse;
@@ -8062,21 +8050,89 @@
     return ETrue;
     }
 
+void CAknCharMap::SmileyStillImageLoaded(TChar aChar)
+    {
+    const CAknSmileyIcon* loadedIcon = Extension()->EmotionIcon(aChar);
+    
+    for(TInt i(0); i<iChars->Length(); i++)
+        {
+        TChar code = (*iChars)[i];
+        CAknSmileyIcon* icon = Extension()->EmotionIcon(code);
+        if(icon == loadedIcon)
+            {
+            if((i%iMaxColumns == 0) || (i == iChars->Length()-1))
+                {
+                DrawDeferred(); // a new line is finished
+                }
+            }
+        }
+    }
+
+void CAknCharMap::SmileyAnimationChanged(TChar aChar)
+    {
+    const CAknSmileyIcon* loadedIcon = Extension()->EmotionIcon(aChar);
+    TInt pageVolume = iExtension->iMaxVisibleRows * iMaxColumns;
+    
+    for(TInt i(0); i<iChars->Length(); i++)
+        {
+        TChar code = (*iChars)[i];
+        CAknSmileyIcon* icon = iExtension->EmotionIcon(code);
+        if(icon == loadedIcon)
+            {
+            TInt index = i % pageVolume;
+            TPoint pos(index%iMaxColumns, index/iMaxColumns);
+            
+            // grid is focused and cursor pos is same with the current index.
+            TBool highlighted = EFalse;
+            if(iExtension->iFocusHandler->FocusedControl()==this && iCursorPos==pos)
+                {
+                highlighted = (!iExtension->iMenuSct || iExtension->iMenuSctHighlighted);
+                }
+
+            DrawCell(index, highlighted);
+            }
+        }
+    }
+
+const TInt KAnimationRepeat = 30;
+const TInt KAnimationDelay = 1000*1000;
+
+void CAknCharMap::SetSmileyAnimationActivityInCurrentPageL(TBool aIsActive)
+    {
+    TInt begin = iFirstVisibleRow * iMaxColumns;
+    TInt end = iExtension->iMaxVisibleRows * iMaxColumns + begin;
+    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)
+           )
+            {
+            icon->PlayAnimationL(KAnimationRepeat, KAnimationDelay);
+            }
+        else
+            {
+            icon->StopAnimation();
+            }
+        }
+    }
+
 void CAknCharMap::GetFocusSctName(TChar& aChar, TDes& aName) const
     {
     TInt pos = iMaxColumns * (iFirstVisibleRow + iCursorPos.iY) + iCursorPos.iX;
-    
+
     aChar = (*iChars)[pos];
-    
+
     aName.Zero();
-    
-    if(TEmotionUtils::IsEmotionChar(aChar))
-        {
-        CSmileyIcon* icon = iExtension->EmotionIcon(aChar);
-        if ( icon )
-            {
-            aName.Append(icon->Name());
-            }
+
+    if(Extension()->IsEmotionChar(aChar))
+        {
+        aName.Append(Extension()->EmotionText(aChar));
         }
     else
         {
@@ -8102,7 +8158,7 @@
     GetFocusSctName(sctChar, sctName);
 
     if(Extension()->NeedEmotionSwitchIcon() && 
-       (sctChar==TEmotionUtils::EmotionSwitchToSctChar() || sctChar==TEmotionUtils::EmotionSwitchToSmileyChar()))
+       (sctChar==Extension()->SwitchToSctChar() || sctChar==Extension()->SwitchToEmotionChar()))
         {
         SwitchSctAndEmotionL();
         }
@@ -8141,10 +8197,14 @@
     {
     if(Extension()->IsEmotionEnabled())
         {
-        Extension()->iIsShowingEmotion = !Extension()->IsShowingEmotion();
+        Extension()->SwitchEmotionVisibilityL();
+        
+        SetSmileyAnimationActivityInCurrentPageL(EFalse);
         
         SetCharacterCaseL(iSpecialCharCase);
         
+        SetSmileyAnimationActivityInCurrentPageL(ETrue);
+        
         CAknSctTableNavi* tableNavi = Extension()->iTableNavi;
         if(tableNavi)
             {
--- a/uifw/AvKon/src/AknEcs.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknEcs.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2007 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"
@@ -35,9 +35,16 @@
 #include <AvkonInternalCRKeys.h>
 #include <PtiDefs.h>
 #include <e32property.h>
+#include <AiwCommon.hrh>
+#include <aiwdialdata.h>
+#include <AiwServiceHandler.h>
+#include <centralrepository.h>
 
 #include "akntrace.h"
 
+const TInt KAknKeyScanCodeBegin = 33;
+const TInt KAknKeyScanCodeEnd   = 126;
+
 // CLASS DECLARATIONS
 
 /** Class for getting emergency call events */
@@ -98,13 +105,17 @@
         enum TStatus
             {
             ENoMatch,
-            ECompleteMatch
+            ECompleteMatch,
+            EServiceNumMatch
             };
     public:
         /**
         * C++ constructor
+        *
+        * @param aPhCltEmergencyCall  Emergency call client
+        * @param aServiceCallEnabled  Is service call feature enabled during device or key lock.
         */
-        CAknMatchingCharacterQueue( CPhCltEmergencyCall* aPhCltEmergencyCall );
+        CAknMatchingCharacterQueue( CPhCltEmergencyCall* aPhCltEmergencyCall, TBool aServiceCallEnabled );
 
         /**
         * C++ destructor
@@ -173,6 +184,15 @@
         */
         TInt IndexOfCurrentMatch() const;
 
+        /**
+        * Validates the service number.
+        *
+        * @param aNumber Service number to be validated from CenRep.
+        *
+        * @return Returns ETrue if aNumber is a service number, EFalse if not.
+        */
+        TBool ValidateServiceNumberL( const TDesC& aNumber );
+
     private:
         /**
         * Update the status of the queue
@@ -187,6 +207,7 @@
         CPhCltEmergencyCall* iPhCltEmergencyCall; 
         TStatus iStatus;      // Holds the status;
         TInt iMatchPosition;  // Position in iCharBuffer from where the match starts.
+        TBool iServiceCallFeature;  // True if service call feature is enabled.
 
         TAny* iSpare;
     };
@@ -218,8 +239,8 @@
 //
 
 
-CAknMatchingCharacterQueue::CAknMatchingCharacterQueue( CPhCltEmergencyCall* aPhCltEmergencyCall ) 
-        : iPhCltEmergencyCall( aPhCltEmergencyCall )
+CAknMatchingCharacterQueue::CAknMatchingCharacterQueue( CPhCltEmergencyCall* aPhCltEmergencyCall, TBool aServiceCallEnabled )
+        : iPhCltEmergencyCall( aPhCltEmergencyCall ), iServiceCallFeature( aServiceCallEnabled )
     {
     _AKNTRACE_FUNC_ENTER;
     Reset();
@@ -256,7 +277,7 @@
         }
     iCharBuffer.Append( aNewChar );
     UpdateStatus( EFalse );
-    _AKNTRACE_FUNC_ENTER;
+    _AKNTRACE_FUNC_EXIT;
     }
 
 void CAknMatchingCharacterQueue::SetBuffer( const TDesC& aNewBuffer )
@@ -324,17 +345,65 @@
         iMatchPosition = cbLength - bLength;
         iStatus = ECompleteMatch;
         }
+    else if ( iServiceCallFeature && cbLength >= KAknServiceCallMinLength )
+        {
+        // Check if this is a service call
+        TBool isServiceNum = EFalse;
+        TRAP_IGNORE( isServiceNum = ValidateServiceNumberL( iCharBuffer ) );
+
+        if ( isServiceNum )
+            {
+            iMatchPosition = 0;
+            iStatus = EServiceNumMatch;
+            }
+        else
+            {
+            iMatchPosition = cbLength;
+            iStatus = ENoMatch;
+            }
+        }
     else
         {
         iMatchPosition = cbLength;
         iStatus = ENoMatch;
         }
-    
     _AKNTRACE( "[%s][%s] iStatus: %d", "CAknMatchingCharacterQueue", 
                 		__FUNCTION__,iStatus );
     _AKNTRACE_FUNC_EXIT;
     }
 
+// -----------------------------------------------------------------------------
+// CAknMatchingCharacterQueue::ValidateServiceNumber
+// 
+// Validates the service phone number.
+// -----------------------------------------------------------------------------
+//
+TBool CAknMatchingCharacterQueue::ValidateServiceNumberL( const TDesC& aNumber )
+    {
+    _AKNTRACE_FUNC_ENTER;
+	TBool isServiceNum = EFalse;
+    HBufC* serviceNum = HBufC::NewLC( KAknEcsMaxMatchingLength );
+    CRepository* cenRep = CRepository::NewLC( KCRUidAvkon );
+    TPtr bufPtr = serviceNum->Des();
+
+    if( cenRep->Get( KAknServiceCallNumber, bufPtr ) != KErrNone )
+        {
+        CleanupStack::PopAndDestroy( cenRep );
+        CleanupStack::PopAndDestroy( serviceNum );
+        return EFalse;
+        }
+
+    // Check if aNumber matches serviceNum
+    if ( aNumber.Compare( *serviceNum ) == 0 )
+        {
+        isServiceNum = ETrue;
+		}
+
+    CleanupStack::PopAndDestroy( cenRep );
+    CleanupStack::PopAndDestroy( serviceNum );
+    _AKNTRACE_FUNC_EXIT;
+    return isServiceNum;
+    }
 
 //
 //
@@ -370,7 +439,12 @@
     iEmergencyCallObserver = new (ELeave) CPhCltEmergencyCallObserver( this );
     // Phone client interface
     iPhCltEmergencyCall = CPhCltEmergencyCall::NewL( iEmergencyCallObserver );
-    iQueue = new (ELeave) CAknMatchingCharacterQueue(iPhCltEmergencyCall);
+
+    // Check if service call is allowed during device and key lock
+    iServiceCallEnabled = 
+        FeatureManager::FeatureSupported( KFeatureIdFfServiceCallWhilePhoneLocked );
+
+    iQueue = new (ELeave) CAknMatchingCharacterQueue( iPhCltEmergencyCall, iServiceCallEnabled );
     iQueue->ConstructL();
 
     DetermineState();
@@ -423,14 +497,24 @@
     _AKNTRACE_FUNC_ENTER;
     _AKNTRACE( "[%s][%s] aEvent.type(): %d, aEvent.Key()->iScanCode :%d", "CAknEcsDetector", 
                             		__FUNCTION__,aEvent.Type(),aEvent.Key()->iScanCode );
-    
     if ( aEvent.Type() == EEventKeyDown || 
-    // EKeyPhoneEnd/EKeyNo doesn't send EEVentKeyDown events, so EEventKey is used instead
-    ( ( aEvent.Key()->iScanCode == EStdKeyNo ) && ( aEvent.Type() == EEventKey ) ) 
-        )
+        // EKeyPhoneEnd/EKeyNo doesn't send EEVentKeyDown events, so EEventKey is used instead
+       ( ( aEvent.Key()->iScanCode == EStdKeyNo ) && ( aEvent.Type() == EEventKey ) ) )
         {
         AddChar( (TText)(aEvent.Key()->iScanCode ) ); // top 16 ( in Unicode build) bits removed
-        }    
+        }
+
+    if ( iServiceCallEnabled )
+        {
+        // When Cancel is pressed we need to clear the queue
+        if ( iState == EServiceNumMatch && aEvent.Type() == EEventPointer && 
+        	   aEvent.Pointer()->iType == TPointerEvent::EButton1Down )
+            {
+            // Clear the queue, set state to EEmpty, and cancel any pending timeout
+            Reset();
+            iKeyTimeoutTimer->Cancel();
+            }
+        }
     _AKNTRACE_FUNC_EXIT;
     }
 
@@ -440,27 +524,46 @@
     _AKNTRACE_FUNC_ENTER;
     _AKNTRACE( "[%s][%s] aNewChar: %s", "CAknEcsDetector", 
                                 		__FUNCTION__, &aNewChar );
-    
+
     if (aNewChar == EKeyQwertyOn || aNewChar == EKeyQwertyOff)
-    	{ 
+        { 
         _AKNTRACE_FUNC_EXIT;
-    	return;   // return directly if the aNewChar is slide open/closed.
-    	}
-
+        return;   // return directly if the aNewChar is slide open/closed.
+        }
+	
     iKeyTimeoutTimer->Cancel(); // there might be pending timeout; clear it
-    if ( aNewChar == EStdKeyYes || aNewChar ==EKeyPhoneSend )
+    if ( aNewChar == EStdKeyYes || aNewChar == EKeyPhoneSend )
         {
-        if ( State() == ECompleteMatch )
+        if ( iServiceCallEnabled )
             {
-            _AKNTRACE( "[%s][%s] SetState( ECompleteMatchThenSendKey )", "CAknEcsDetector", 
-                                            		__FUNCTION__ );
-            SetState( ECompleteMatchThenSendKey );
+            if ( iState == ECompleteMatch || iState == EServiceNumMatch )
+                {
+                _AKNTRACE( "[%s][%s] SetState( ECompleteMatchThenSendKey )", "CAknEcsDetector", 
+                                            		    __FUNCTION__ );
+                SetState( ECompleteMatchThenSendKey );
+                }
+            }
+        else
+            {
+            if ( iState == ECompleteMatch )
+                {
+                _AKNTRACE( "[%s][%s] SetState( ECompleteMatchThenSendKey )", "CAknEcsDetector", 
+                                                        __FUNCTION__ );
+                SetState( ECompleteMatchThenSendKey );
+                }
             }
         // else do nothing with it...
         }
     else
         {
         TText scanCode = aNewChar;
+
+        if ( scanCode < KAknKeyScanCodeBegin || scanCode > KAknKeyScanCodeEnd )
+            {
+            // Just return since it is an invalid character
+            return;
+            }
+
 #ifdef RD_INTELLIGENT_TEXT_INPUT 
         // Convert scan code to number value here 
         // for 4*10, 3*11, half-qwerty key pad
@@ -588,6 +691,13 @@
             case CAknMatchingCharacterQueue::ECompleteMatch:
                 bestState = ECompleteMatch;
                 break;
+            case CAknMatchingCharacterQueue::EServiceNumMatch:
+                if ( iServiceCallEnabled )
+                    {
+                    bestState = EServiceNumMatch;
+                    break;
+                    }
+                // Fall through to default case if service call feature is off
             default:
                 __ASSERT_DEBUG( 0, Panic(EAknEcsPanicBadState) );
                 break;
@@ -632,12 +742,24 @@
     iQueue->Reset();
     iQueue->SetBuffer(aNewBuffer);
     DetermineState();
-    if ( State() == ECompleteMatch )
+
+    if ( iServiceCallEnabled )
         {
-        _AKNTRACE( "[%s][%s] State() == ECompleteMatch ", "CAknEcsDetector", 
-                                                		__FUNCTION__ );
-        iKeyTimeoutTimer->Start( KEcsInterKeyTimeout,
-            KEcsInterKeyTimeout, TCallBack( CancelMatch, this ) );
+        if ( iState == ECompleteMatch || iState == EServiceNumMatch )
+            {
+            iKeyTimeoutTimer->Start( KEcsInterKeyTimeout,
+                KEcsInterKeyTimeout, TCallBack( CancelMatch, this ) );
+            }
+        }
+    else
+        {
+        if ( iState == ECompleteMatch )
+            {
+            _AKNTRACE( "[%s][%s] State() == ECompleteMatch ", "CAknEcsDetector", 
+                                                		    __FUNCTION__ );
+            iKeyTimeoutTimer->Start( KEcsInterKeyTimeout,
+                KEcsInterKeyTimeout, TCallBack( CancelMatch, this ) );
+            }
         }
     _AKNTRACE_FUNC_EXIT;
     }
@@ -684,6 +806,19 @@
                 }
             break;
 
+        case EServiceNumMatch:
+            if ( iServiceCallEnabled )
+                {
+                if ( aNewState == ECompleteMatchThenSendKey )
+                    {
+                    RelinquishCapturedKeys();
+                    _AKNTRACE( "[%s][%s] Make Service Call", "CAknEcsDetector", 
+                                                                		__FUNCTION__);
+                    TRAP_IGNORE( MakeServiceCallL() );
+                    }
+                }
+            break;
+
         default:
             break;
 
@@ -738,6 +873,51 @@
     _AKNTRACE_FUNC_EXIT;
     }
 
+void CAknEcsDetector::MakeServiceCallL()
+    {
+    _AKNTRACE_FUNC_ENTER;
+    if ( iServiceCallEnabled )
+        {
+        CAiwServiceHandler* aiwServiceHandler = CAiwServiceHandler::NewLC();
+        RCriteriaArray interest;
+        CleanupClosePushL( interest );
+
+        CAiwCriteriaItem* criteria = CAiwCriteriaItem::NewLC( KAiwCmdCall,
+                                         KAiwCmdCall, _L8( "*" ) );
+        TUid base;
+        base.iUid = KAiwClassBase;
+        criteria->SetServiceClass( base );
+        User::LeaveIfError( interest.Append( criteria ) );
+        aiwServiceHandler->AttachL( interest );
+
+        CAiwDialData* dialData = CAiwDialData::NewLC();
+        dialData->SetCallType( CAiwDialData::EAIWForcedCS );
+        dialData->SetPhoneNumberL( CurrentMatch() );
+        dialData->SetWindowGroup( AIWDialData::KAiwGoToIdle );
+
+        CAiwGenericParamList& paramList = aiwServiceHandler->InParamListL();
+        dialData->FillInParamListL( paramList );
+
+        TRAPD( err, aiwServiceHandler->ExecuteServiceCmdL( KAiwCmdCall, paramList,
+                    aiwServiceHandler->OutParamListL(), 0, NULL ) );
+        __ASSERT_DEBUG( err == KErrNone, Panic( EAknEcsPanicDialLLeft ) );
+
+        //reset the queue
+        iQueue->Reset();
+
+        CleanupStack::PopAndDestroy( dialData );
+        CleanupStack::PopAndDestroy( criteria );
+        CleanupStack::PopAndDestroy( &interest );
+        CleanupStack::PopAndDestroy( aiwServiceHandler );
+
+        if( err != KErrNone )
+            {
+            User::Leave( err );
+            }
+        }
+    _AKNTRACE_FUNC_EXIT;
+    }
+
 EXPORT_C void CAknEcsDetector::SetObserver( MAknEcsObserver* aObserver )
     {
     iObserver = aObserver;
--- a/uifw/AvKon/src/AknIndicatorContainer.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknIndicatorContainer.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -112,7 +112,8 @@
     TInt                        iFlags;
     TBool                       iIncallBubbleDisabled;
     TBool                       iIsForeground;
-    TBool                       iIsActiveIdle;
+    CEikStatusPaneBase*         iStatusPane;
+    MTouchFeedback*             iFeedback;
     };
 
 
@@ -140,6 +141,29 @@
         }
 
     TRAP_IGNORE( CCoeEnv::Static()->AddMessageMonitorObserverL( *this ) );
+    
+    iFeedback = MTouchFeedback::Instance();
+    if ( iFeedback &&
+         iIndicatorContainer->iIndicatorContext ==
+                 CAknIndicatorContainer::EUniversalIndicators )
+        {
+        // Tactile feedback is only used for universal indicator pane.
+        CFeedbackSpec* fbSpec = CFeedbackSpec::New();
+        if ( fbSpec )
+            {
+            fbSpec->AddFeedback( ETouchEventStylusDown,
+                                 ETouchFeedbackSensitiveButton );
+            fbSpec->AddFeedback( ETouchEventStylusUp,
+                                 ETouchFeedbackSensitiveButton,
+                                 ETouchFeedbackVibra );
+
+            iFeedback->SetFeedbackArea( iIndicatorContainer,
+                                        0,
+                                        iIndicatorContainer->Rect(),
+                                        fbSpec );
+            delete fbSpec; 
+            }  
+        }
     }
 
 
@@ -150,7 +174,7 @@
     iSmallStatusPaneLayout      = AknStatuspaneUtils::SmallLayoutActive();
     iIncallBubbleAllowedInUsual = ETrue;
     iIsForeground = static_cast<CAknAppUi*>( CEikonEnv::Static()->EikAppUi() )->IsForeground();
-    iIsActiveIdle = AknStatuspaneUtils::IsActiveIdle();
+    iStatusPane = CEikStatusPaneBase::Current();
     }
 
 
@@ -160,6 +184,12 @@
     delete iDataObserver;
 
     CCoeEnv::Static()->RemoveMessageMonitorObserver( *this );
+    
+    MTouchFeedback* feedback = MTouchFeedback::Instance();
+    if ( feedback )
+        {
+        feedback->RemoveFeedbackForControl( iIndicatorContainer );
+        }
     }
 
 
@@ -609,6 +639,13 @@
             AknStatuspaneUtils::ExtendedStaconPaneActive() ||
             ( AknStatuspaneUtils::StaconPaneActive() &&
               !AknStatuspaneUtils::IdleLayoutActive() ) );
+        
+        if ( iExtension && iExtension->iFeedback )
+            {
+            iExtension->iFeedback->ChangeFeedbackArea( this,
+                                                       0,
+                                                       Rect() );
+            }
         }
 
     AknsUtils::RegisterControlPosition( this );
@@ -828,7 +865,8 @@
 
 EXPORT_C void CAknIndicatorContainer::Draw( const TRect& /*aRect*/ ) const
     {
-    if ( iExtension->iIsActiveIdle )
+    if ( iExtension->iStatusPane && 
+         iExtension->iStatusPane->IsTransparent() )
         {
         return;
         }
@@ -1035,7 +1073,8 @@
     {
     CAknControl::HandlePointerEventL( aPointerEvent );
 
-    if ( AknLayoutUtils::PenEnabled() && iExtension )
+    // Pointer events are only handled in the universal indicator container.
+    if ( iExtension && iIndicatorContext == EUniversalIndicators )
         {
         TRect rect( Rect() );
 
@@ -1051,32 +1090,23 @@
                     // set flag that down was inside indicator
                     iExtension->iFlags |=
                         EAknIndicatorsButton1DownInIndicatorPaneRect;
-
-                    if ( iIndicatorContext == EUniversalIndicators &&
-                         iExtension->iFlags & EAknIndicatorsButton1DownInIndicatorPaneRect
-                          )
-                        {
-                        MTouchFeedback* feedback = MTouchFeedback::Instance();
-
-                        if ( feedback )
-                            {
-                            feedback->InstantFeedback( this, ETouchFeedbackSensitiveButton );
-                            }
-                        }
                     }
                 break;
                 }
 
             case TPointerEvent::EButton1Up:
                 {
-                // Currently the small digital clock pane and universal
-                // indicator pane are regarded as one touch responsive area from
-                // which the universal indicator popup should open on tap,
-                // so upon pointer up event it must be checked here if
-                // the down event happened inside this control, but the up event
-                // inside digital clock pane area.
+                // Currently the small digital clock pane, universal
+                // indicator pane and battery pane (in status pane layouts
+                // where it's adjacent to universal indicator or digital
+                // clock pane) are regarded as one touch responsive
+                // area from which the universal indicator popup should
+                // open on tap, so upon pointer up event it must be checked
+                // here if the down event happened inside this control,
+                // but the up event inside digital clock or battery pane area.
                 CEikStatusPaneBase* sp = CEikStatusPaneBase::Current();
-                TRect clockRect( 0, 0, 0, 0 );
+                TBool pointerUpInClockArea( EFalse );
+                TBool pointerUpInBatteryArea( EFalse );
 
                 if ( sp )
                     {
@@ -1084,29 +1114,50 @@
                         TUid::Uid( EEikStatusPaneUidDigitalClock ) );
                     if ( clockPane )
                         {
-                        clockRect = TRect( clockPane->PositionRelativeToScreen(),
-                                           clockPane->Size() );
+                        TRect clockRect( clockPane->PositionRelativeToScreen(),
+                                         clockPane->Size() );
+                        pointerUpInClockArea =
+                            clockRect.Contains( aPointerEvent.iParentPosition );
+                        }
+                    
+                    if ( !AknStatuspaneUtils::ExtendedFlatLayoutActive() )
+                        {
+                        CCoeControl* batteryPane = sp->ContainerControlL(
+                            TUid::Uid( EEikStatusPaneUidBattery ) );
+                        if ( batteryPane )
+                            {
+                            TRect batteryRect(
+                                batteryPane->PositionRelativeToScreen(),
+                                batteryPane->Size() );
+                            pointerUpInBatteryArea =
+                                batteryRect.Contains( aPointerEvent.iParentPosition );
+                            }
                         }
                     }
 
                 // if indicator's rect contains pointer up position
-                if ( iIndicatorContext == EUniversalIndicators &&
-                     ( ( iExtension->iFlags & EAknIndicatorsButton1DownInIndicatorPaneRect &&
+                if ( ( iExtension->iFlags & EAknIndicatorsButton1DownInIndicatorPaneRect &&
                          rect.Contains( aPointerEvent.iPosition ) ) ||
-                       clockRect.Contains( aPointerEvent.iParentPosition ) ) )
+                       pointerUpInClockArea ||
+                       pointerUpInBatteryArea )
                     {
-                    MTouchFeedback* feedback = MTouchFeedback::Instance();
-                    if ( feedback )
+                    if ( iExtension->iFeedback &&
+                         ( pointerUpInClockArea || pointerUpInBatteryArea ) )
                         {
-                        feedback->InstantFeedback( this,
-                                                   ETouchFeedbackSensitiveButton,
-                                                   ETouchFeedbackVibra,
-                                                   aPointerEvent );
+                        // The pointer down was received in another control,
+                        // so the tactile feedback must be given directly.
+                        iExtension->iFeedback->InstantFeedback(
+                            this,
+                            ETouchFeedbackSensitiveButton,
+                            ETouchFeedbackVibra,
+                            aPointerEvent );
                         }
+
                     CAknSmallIndicator* indicatorNotifier = CAknSmallIndicator::NewLC( TUid::Uid( 0 ) );
                     indicatorNotifier->HandleIndicatorTapL();
                     CleanupStack::PopAndDestroy( indicatorNotifier );
                     }
+
                 // Up happened, reset button down flag
                 iExtension->iFlags &=
                     ( ~EAknIndicatorsButton1DownInIndicatorPaneRect );
--- a/uifw/AvKon/src/AknPopupField.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknPopupField.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -443,7 +443,12 @@
     case EAknPopupFieldSelectionListMode:
             {
             __ASSERT_DEBUG(iSelectionList != NULL, Panic(EAknPanicPopupFieldSelectionListDoesntExist));
-            iSelectionList->SetRect(rect);
+            // When Form loses focus, If its child control listbox's size or position is not changed, 
+            // do not invoke "iSelectionList->SetRect(rect);". 
+            if ((iSelectionList->Position() != rect.iTl) || (iSelectionList->Size() != rect.Size()))
+                {
+                iSelectionList->SetRect(rect);
+                }
             AknsUtils::RegisterControlPosition(this);
             AknsUtils::RegisterControlPosition(iSelectionList);
             TRect listBoxRect = iExtension->iFormFieldRect; //iSelectionList->Rect();
--- a/uifw/AvKon/src/AknQueryControl.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknQueryControl.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -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"
@@ -225,12 +225,14 @@
                                                     CAknEcsDetector::TState aUpdatedState )
     {
 	_AKNTRACE( "[%s][%s] aUpdatedState: %d", "TAknQueryEcsObserver", __FUNCTION__,aUpdatedState);
-    TRAP_IGNORE( iParent->SetEcsCbaVisibleL( aUpdatedState == CAknEcsDetector::ECompleteMatch ) );
+    TRAP_IGNORE( iParent->SetEcsCbaVisibleL( aUpdatedState == CAknEcsDetector::ECompleteMatch || 
+                                             aUpdatedState == CAknEcsDetector::EServiceNumMatch ) );
     
     // Hide the emergency call number again.
     // Number should be visible only in Partial or Complete match state
     if ( aUpdatedState != CAknEcsDetector::EPartialMatch &&
-         aUpdatedState != CAknEcsDetector::ECompleteMatch  )
+         aUpdatedState != CAknEcsDetector::ECompleteMatch && 
+         aUpdatedState != CAknEcsDetector::EServiceNumMatch )
         {
         if ( iParent->QueryType() == EPinLayout )
             {
@@ -376,7 +378,7 @@
     _AKNTRACE_FUNC_ENTER;
     // Construct extension
     CAknQueryExtension::CreateExtensionL( this );
-	iExtension = new (ELeave)CAknQueryControlExtension;
+    iExtension = new (ELeave)CAknQueryControlExtension;
     
     iEcsObserver   = new (ELeave) TAknQueryEcsObserver(this);
     iEditIndicator = CAknQueryEditIndicator::NewL(this);
@@ -1138,6 +1140,7 @@
                     TBool reveal = EFalse;
                     TInt ecsState( iEcsDetector->State() );
                     if ( ( ecsState == CAknEcsDetector::ECompleteMatch ) ||
+                         ( ecsState == CAknEcsDetector::EServiceNumMatch ) ||
                          ( ecsState == CAknEcsDetector::ECompleteMatchThenSendKey ) )
                         {
                         // Further check to ensure that the matched number is the entire buffer
@@ -1146,9 +1149,10 @@
                             {
                             reveal = ETrue;
                             
-                            if ( ecsState == CAknEcsDetector::ECompleteMatch )
+                            if ( ecsState == CAknEcsDetector::ECompleteMatch || 
+                                 ecsState == CAknEcsDetector::EServiceNumMatch )
                                 {
-                                SetEcsCbaVisibleL( ETrue );                                            
+                                SetEcsCbaVisibleL( ETrue );
                                 }
                             }
                         }
@@ -3508,7 +3512,8 @@
     _AKNTRACE_FUNC_ENTER;
     if ( iEcsDetector )
         {
-        if ( iEcsDetector->State() == CAknEcsDetector::ECompleteMatch )
+        if ( iEcsDetector->State() == CAknEcsDetector::ECompleteMatch || 
+             iEcsDetector->State() == CAknEcsDetector::EServiceNumMatch )
             {
             // Further check to ensure that the matched number is the
             // entire buffer. Get the matched text and see if is the same
--- a/uifw/AvKon/src/AknSctDialog.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknSctDialog.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -55,6 +55,8 @@
 #include <AknTasHook.h>
 #include "aknsctfocushandler.h"
 
+#include <eikdialogext.h>
+
 //
 // class CAknCharMapDialog
 //
@@ -531,8 +533,9 @@
 	/// -- Change Window Priority for dialog and CBA 
 	
 	DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront); //
-	ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront); 	
-
+	ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront);
+	
+	CEikDialog::Extension()->SetPriority(CActive::EPriorityStandard);
     }
 
 EXPORT_C void CAknCharMapDialog::SetSizeAndPosition( const TSize& aSize )
--- a/uifw/AvKon/src/AknSettingPage.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknSettingPage.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -1391,6 +1391,17 @@
 	{
     AknItemActionMenuRegister::SetOverridingMenuBarOwnerL( NULL );
 
+	if ( GfxTransEffect::IsRegistered( this ) )
+	    {
+        GfxTransEffect::Begin( this, KGfxControlDisappearAction );
+        MakeVisible( EFalse );
+        GfxTransEffect::End( this );
+	    }
+	else
+	    {
+        MakeVisible( EFalse );
+	    }
+	    
 	if ( aAccept )
 		{
 		AcceptSettingL();
@@ -1403,17 +1414,6 @@
 		if ( iSettingPageObserver )
 			iSettingPageObserver->HandleSettingPageEventL(this, MAknSettingPageObserver::EEventSettingCancelled);
 		}
-	
-	if ( GfxTransEffect::IsRegistered( this ) )
-	    {
-        GfxTransEffect::Begin( this, KGfxControlDisappearAction );
-        MakeVisible( EFalse );
-        GfxTransEffect::End( this );
-	    }
-	else
-	    {
-        MakeVisible( EFalse );
-	    }
 
 	iEikonEnv->RemoveFromStack(iCba);
 	delete iCba;
--- a/uifw/AvKon/src/AknSmileyImage.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknSmileyImage.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -16,7 +16,6 @@
 */
 
 
-
 #include <AknUtils.h>
 #include <AknsUtils.h>
 #include <AknIconUtils.h>
@@ -24,9 +23,9 @@
 
 #include "AknSmileyImage.h"
 
-const TInt KFrameMaxInterval = 3*1000*1000; // 30s
+const TInt KFrameMaxInterval = 3*1000*1000; // 3s
 const TInt KFrameMonitorStep = 5;           // monitor once per 5 call, for increase performence 
-const TInt KMaxSameFrameRepeat = 6;         // 5 * 6, animation frame keep same for 6 times will be stopped
+const TInt KMaxSameFrameRepeat = 6;         // 5 * 6, animation whose frame keep the same for 6 times call back, it will be stopped
 
 #define DELZ(ptr) {delete (ptr); (ptr)=NULL;}
 
@@ -64,7 +63,7 @@
 
 TBool BmpUtils::BitmpIsSame(const CFbsBitmap* aDesBmp, const CFbsBitmap* aSrcBmp)
     {
-    if(!aDesBmp || !aSrcBmp) return FALSE;
+    if(!aDesBmp || !aSrcBmp) return EFalse;
     
     if(aDesBmp->SizeInPixels() == aSrcBmp->SizeInPixels())
         {
@@ -75,13 +74,13 @@
         aDesBmp->BeginDataAccess();
         aSrcBmp->BeginDataAccess();
         TInt result = Mem::Compare((TUint8*)aDesBmp->DataAddress(), length, (TUint8*)aSrcBmp->DataAddress(), length);
-        aSrcBmp->EndDataAccess(TRUE);
-        aDesBmp->EndDataAccess(TRUE);
+        aSrcBmp->EndDataAccess(ETrue);
+        aDesBmp->EndDataAccess(ETrue);
         
-        if(result == KErrNone) return TRUE;
+        if(result == KErrNone) return ETrue;
         }
     
-    return FALSE;
+    return EFalse;
     }
 
 
@@ -121,11 +120,11 @@
     }
 
 CSmileyImage::CSmileyImage(const TAknsItemID& aSkinImage, TInt aPkgImage, TBool aIsAnimation, MSmileyImageObserver* aObserver) : 
-iImagePkgItem(aPkgImage), 
+iImageMifPkgItemId(aPkgImage), 
 iIsAnimation(aIsAnimation), 
 iImageObserver(aObserver)
     {
-    iImageSkinItem.Set(aSkinImage);
+    iImageSkinItemId.Set(aSkinImage);
     }
 
 CSmileyImage::~CSmileyImage()
@@ -137,7 +136,16 @@
 
 void CSmileyImage::LoadL(TInt aRepeat, TInt aDelay)
     {
-    StartLoadAsynchronousL(aRepeat, aDelay);
+    iRepeatCount = aRepeat;
+    
+    if(aDelay > 0)
+        {
+        StartLoadAsynchronousL(aDelay);
+        }
+    else
+        {
+        DoLoadL();
+        }
     }
 
 void CSmileyImage::Release()
@@ -179,69 +187,13 @@
 
 void CSmileyImage::BitmapChanged(CFbsBitmap* aBitmap)
     {
-    iReadyToDraw = TRUE; // animation is ready
+    iReadyToDraw = ETrue; // animation is ready
 
     if(iImageObserver) iImageObserver->BitmapChanged(this, aBitmap);
 
     TRAP_IGNORE(MonitorAnimationEndedL());
     }
 
-void CSmileyImage::DoLoadL()
-    {
-    StopAnyAsynchronousTask();
-    
-    if(iFrame) return;
-
-    TFileName smileyMifName;
-    SmileyUtils::GetCustomizableResPath(smileyMifName, KSmileyMif);
-    if(iImageSkinItem.iMinor > 0)
-        {
-        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
-        TRAP_IGNORE( AknsUtils::CreateColorIconL(skin, iImageSkinItem, 
-                                               KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG19, 
-                                               iFrame, iFrameMask, 
-                                               smileyMifName, iImagePkgItem, iImagePkgItem, 
-                                               AKN_LAF_COLOR(215)));
-        }
-    else
-        {
-        TRAP_IGNORE( AknIconUtils::CreateIconL(iFrame, iFrameMask, smileyMifName, iImagePkgItem, iImagePkgItem));
-        }
-    
-    if(iIsAnimation) // the first frame of animation svg is blank without correct content
-        {
-        iReadyToDraw = FALSE;
-        AknIconUtils::SetObserver(iFrame, this);
-        
-        StopAnimationAsynchronousL(KFrameMaxInterval);
-        }
-    else // the first frame of static svg has correct content
-        {
-        iReadyToDraw = TRUE;
-        if(iImageObserver) iImageObserver->BitmapChanged(this, iFrame);
-        }
-
-    AknIconUtils::SetSize(iFrame, iSize);
-    }
-
-void CSmileyImage::DoRelease()
-    {
-    StopAnyAsynchronousTask();
-    
-    if(!iFrame) return;
-
-    DELZ(iFrame);
-    DELZ(iFrameMask);
-    iFrameSnap->Reset();
-    
-    iReadyToDraw = FALSE;
-    }
-
-void CSmileyImage::StopAnyAsynchronousTask()
-    {
-    iAsynchronousTaskTimer->Cancel();
-    }
-
 void CSmileyImage::MonitorAnimationEndedL()
     {
     // for animation doesn't call back
@@ -251,13 +203,16 @@
     iFrameCounter++;
     if(iFrameCounter % KFrameMonitorStep) return;
     
+    // for not call back any more
+    StopAnimationAsynchronousL(KFrameMaxInterval);
+    
     // monitor the end of animation clip, replay or stop animation if ended
     if(BmpUtils::BitmpIsSame(iFrameSnap, iFrame))
         {
         iSameFrameCounter++;
         if(iSameFrameCounter > KMaxSameFrameRepeat)
             {
-            StopAnimationAsynchronousL();
+            StopAnimationAsynchronousL(); // can not stop animation synchronously
             }
         }
     else
@@ -267,7 +222,59 @@
         }
     }
 
-void CSmileyImage::HandleAnimationEndedL()
+void CSmileyImage::DoLoadL()
+    {
+    StopAsynchronousTaskTimer();
+
+    if(iFrame) return;
+
+    TFileName smileyMifName;
+    SmileyUtils::GetCustomizableResPath(smileyMifName, KSmileyMif);
+    
+    if(iImageSkinItemId.iMinor > 0)
+        {
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        TRAPD(err, AknsUtils::CreateColorIconL(skin, iImageSkinItemId, 
+                                               KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG19, 
+                                               iFrame, iFrameMask, 
+                                               smileyMifName, iImageMifPkgItemId, iImageMifPkgItemId, 
+                                               AKN_LAF_COLOR(215)));
+        }
+    else
+        {
+        TRAPD(err, AknIconUtils::CreateIconL(iFrame, iFrameMask, smileyMifName, iImageMifPkgItemId, iImageMifPkgItemId));
+        }
+    
+    if(iIsAnimation) // the first frame of animation svg is blank without correct content
+        {
+        iReadyToDraw = EFalse;
+        AknIconUtils::SetObserver(iFrame, this);
+        StopAnimationAsynchronousL(KFrameMaxInterval); // monitor for no callback
+        }
+    else // the first frame of static svg has correct content
+        {
+        iReadyToDraw = ETrue;
+        if(iImageObserver) iImageObserver->BitmapChanged(this, iFrame);
+        }
+
+    AknIconUtils::SetSize(iFrame, iSize);
+    TUid i = iFrame->ExtendedBitmapType();
+    }
+
+void CSmileyImage::DoRelease()
+    {
+    StopAsynchronousTaskTimer();
+
+    if(!iFrame) return;
+
+    DELZ(iFrame);
+    DELZ(iFrameMask);
+    iFrameSnap->Reset();
+    
+    iReadyToDraw = EFalse;
+    }
+
+void CSmileyImage::DoHandleEndedL()
     {
     DoRelease();
     
@@ -278,33 +285,36 @@
         }
     }
 
-void CSmileyImage::StartLoadAsynchronousL(TInt aRepeat, TInt aDelayMicroSeconds)
+void CSmileyImage::StopAsynchronousTaskTimer()
     {
-    iRepeatCount = aRepeat;
+    iAsynchronousTaskTimer->Cancel();
+    }
 
-    iAsynchronousTaskTimer->Cancel();
+void CSmileyImage::StartLoadAsynchronousL(TInt aDelayMicroSeconds)
+    {
+    StopAsynchronousTaskTimer();
     iAsynchronousTaskTimer->Start(aDelayMicroSeconds, 1, TCallBack(StartLoadAsynchronousCallBackL,this));
     }
 
 TInt CSmileyImage::StartLoadAsynchronousCallBackL(TAny* aPtr)
     {
     CSmileyImage* self = (CSmileyImage*)aPtr;
-    self->StopAnyAsynchronousTask();
+    self->StopAsynchronousTaskTimer();
     self->DoLoadL();
     return KErrNone;
     }
 
 void CSmileyImage::StopAnimationAsynchronousL(TInt aDelayMicroSeconds)
     {
-    iAsynchronousTaskTimer->Cancel();
+    StopAsynchronousTaskTimer();
     iAsynchronousTaskTimer->Start(aDelayMicroSeconds, 1, TCallBack(StopAnimationAsynchronousCallBackL,this));
     }
 
 TInt CSmileyImage::StopAnimationAsynchronousCallBackL(TAny* aPtr)
     {
     CSmileyImage* self = (CSmileyImage*)aPtr;
-    self->StopAnyAsynchronousTask();
-    self->HandleAnimationEndedL();
+    self->StopAsynchronousTaskTimer();
+    self->DoHandleEndedL();
     return KErrNone;
     }
 
--- a/uifw/AvKon/src/AknSmileyModel.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknSmileyModel.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -15,7 +15,6 @@
 *
 */
 
-
 #include <barsread.h>
 #include <AknUtils.h>
 #include <aknlayoutscalable_avkon.cdl.h>
@@ -23,6 +22,9 @@
 #include <centralrepository.h>
 #include <AvkonInternalCRKeys.h>
 
+#include <AknBidiTextUtils.h>
+#include <AknPanic.h>
+
 #include <smiley.rsg>
 #include <smiley.mbg>
 
@@ -40,21 +42,17 @@
     }
 
 TSmileyIconInfo::TSmileyIconInfo(const TSmileyIconInfo& aInfo) : 
-iName(aInfo.iName), 
-iId(aInfo.iId), 
 iSkinItemID(aInfo.iSkinItemID), 
-iDefaultThumbnailID(aInfo.iDefaultThumbnailID), 
-iDefaultAnimationID(aInfo.iDefaultAnimationID)
+iDefaultStillImageID(aInfo.iDefaultStillImageID), 
+iDefaultAnimationImageID(aInfo.iDefaultAnimationImageID)
     {
     }
 
 void TSmileyIconInfo::Reset()
     {
-    iName.Zero();
-    iId = 0;
     iSkinItemID.Set(0, 0);
-    iDefaultThumbnailID = 0;
-    iDefaultAnimationID = 0;
+    iDefaultStillImageID = 0;
+    iDefaultAnimationImageID = 0;
     }
 
 
@@ -63,76 +61,83 @@
 // CSmileyIcon
 ///////////////////////////////////////////////////////////////////////////////////////////////
 
-CSmileyIcon* CSmileyIcon::NewL(const TSmileyIconInfo& aInfo, MSmileyIconObserver* aObserver)
+CSmileyIcon* CSmileyIcon::NewL(const TSmileyIconInfo& aInfo, MAknSmileyObserver* aObserver)
     {
-    CSmileyIcon* self = new (ELeave) CSmileyIcon(aInfo, aObserver);
+    CSmileyIcon* self = new (ELeave) CSmileyIcon(aObserver);
     CleanupStack::PushL(self);
-    self->ConstructL();
+    self->ConstructL(aInfo);
     CleanupStack::Pop(); // self;
     return self;
     }
 
-void CSmileyIcon::ConstructL()
+void CSmileyIcon::ConstructL(const TSmileyIconInfo& aInfo)
     {
-    iThumbnailImage = CSmileyImage::NewL(iInfo.iSkinItemID, iInfo.iDefaultThumbnailID, FALSE, this);
+    iIndex = aInfo.iIndex;
+    
+    iStillImage = CSmileyImage::NewL(aInfo.iSkinItemID, aInfo.iDefaultStillImageID, EFalse, this);
     
-    if(iInfo.iSkinItemID.iMinor==0 && iInfo.iDefaultAnimationID>0)
+    if(aInfo.iSkinItemID.iMinor==0 && aInfo.iDefaultAnimationImageID>0)
         {
-        iAnimationImage = CSmileyImage::NewL(iInfo.iSkinItemID, iInfo.iDefaultAnimationID, TRUE, this);
+        TAknsItemID nullID;
+        nullID.Set(0, 0);
+        iAnimationImage = CSmileyImage::NewL(nullID, aInfo.iDefaultAnimationImageID, ETrue, this);
         }
     }
 
-CSmileyIcon::CSmileyIcon(const TSmileyIconInfo& aInfo, MSmileyIconObserver* aObserver) : 
-iInfo(aInfo), iSmileyIconObserver(aObserver)
+CSmileyIcon::CSmileyIcon(MAknSmileyObserver* aObserver) : iSmileyIconObserver(aObserver)
     {
     }
 
 CSmileyIcon::~CSmileyIcon()
     {
-    delete iThumbnailImage;
+    delete iStillImage;
     delete iAnimationImage;
-    }
-
-TBool CSmileyIcon::ReadyToDraw() const
-    {
-    TBool thumbnailCanDraw = iThumbnailImage->ReadyToDraw();
-    TBool animationCanDraw = iAnimationImage ? iAnimationImage->ReadyToDraw() : FALSE;
     
-    return (thumbnailCanDraw || animationCanDraw);
+    iTextArray.Close();
     }
 
 const CFbsBitmap* CSmileyIcon::Image() const
     {
-    if(ShouldShowAnimation())
+    if(AnimationImageIsReadyToDraw())
         {
         return iAnimationImage->Image();
         }
     else
         {
-        return iThumbnailImage->Image();
+        return iStillImage->Image();
         }
     }
 
 const CFbsBitmap* CSmileyIcon::Mask() const
     {
-    if(ShouldShowAnimation())
+    if(AnimationImageIsReadyToDraw())
         {
         return iAnimationImage->Mask();
         }
     else
         {
-        return iThumbnailImage->Mask();
+        return iStillImage->Mask();
         }
     }
 
-void CSmileyIcon::LoadThumbnailL()
+TBool CSmileyIcon::ReadyToDraw() const
     {
-    iThumbnailImage->LoadL();
+    return StillImageIsReadyToDraw() || AnimationImageIsReadyToDraw();
     }
 
-TBool CSmileyIcon::ThumbnailReady() const
+void CSmileyIcon::SetSize(const TSize& aSize)
     {
-    return iThumbnailImage->ReadyToDraw();
+    iStillImage->SetSize(aSize);
+    
+    if(iAnimationImage)
+        {
+        iAnimationImage->SetSize(aSize);
+        }
+    }
+
+const TSize& CSmileyIcon::Size() const
+    {
+    return iStillImage->Size();
     }
 
 void CSmileyIcon::PlayAnimationL(TInt aRepeat, TInt aDelay)
@@ -151,36 +156,72 @@
         }
     }
 
-void CSmileyIcon::SetSize(const TSize& aSize)
+void CSmileyIcon::BitmapChanged(CSmileyImage* aSmileyImage, CFbsBitmap* /*aBitmap*/)
     {
-    iThumbnailImage->SetSize(aSize);
-    
-    if(iAnimationImage)
+    if(aSmileyImage == iStillImage)
         {
-        iAnimationImage->SetSize(aSize);
+        if(iSmileyIconObserver) iSmileyIconObserver->SmileyStillImageLoaded(this);
+        }
+    else
+        {
+        if(iSmileyIconObserver) iSmileyIconObserver->SmileyAnimationChanged(this);
         }
     }
 
-const TSize& CSmileyIcon::Size() const
+TInt CSmileyIcon::Index() const
+    {
+    return iIndex;
+    }
+
+void CSmileyIcon::LoadStillImageL(TInt aDelay)
     {
-    return iThumbnailImage->Size();
+    iStillImage->LoadL(0, aDelay);
+    }
+
+TBool CSmileyIcon::StillImageIsReadyToDraw() const
+    {
+    return iStillImage->ReadyToDraw();
+    }
+
+TBool CSmileyIcon::AnimationImageIsReadyToDraw() const
+    {
+    return (iAnimationImage && iAnimationImage->ReadyToDraw());
     }
 
-void CSmileyIcon::BitmapChanged(CSmileyImage* aSmileyImage, CFbsBitmap* /*aBitmap*/)
+void CSmileyIcon::AddText(const TDesC& aText) // for spliting strings = ":P :p :-P :-p";
     {
-    if(aSmileyImage == iThumbnailImage)
+    TPtrC ptr(aText);
+
+    while(ptr.Length())
         {
-        if(iSmileyIconObserver) iSmileyIconObserver->ThumbnailLoaded(this);
+        TInt left = ptr.Find(_L(" "));
+        TInt right = ptr.Length() - left - 1;
+        if(left == KErrNotFound)
+            {
+            left = ptr.Length();
+            right = 0;
+            }
+
+        iTextArray.Append(ptr.Left(left));
+        ptr.Set(ptr.Right(right));
+        }
+    }
+
+const TDesC& CSmileyIcon::Text(TInt aVariate) const
+    {
+    if(aVariate>=0 && aVariate<TextVariate())
+        {
+        return iTextArray[aVariate];
         }
     else
         {
-        if(iSmileyIconObserver) iSmileyIconObserver->AnimationChanged(this);
+        return KNullDesC;
         }
     }
 
-TBool CSmileyIcon::ShouldShowAnimation() const
+TInt CSmileyIcon::TextVariate() const
     {
-    return (iAnimationImage && iAnimationImage->ReadyToDraw());
+    return iTextArray.Count();
     }
 
 
@@ -196,15 +237,16 @@
 
 CSmileyTnumbnailAsynLoader::~CSmileyTnumbnailAsynLoader()
     {
-    iTaskArray.Close();
+    iLoadingTaskArray.Close();
     }
 
 void CSmileyTnumbnailAsynLoader::AddTaskL(CSmileyIcon* aSmileyIcon)
     {
     if(aSmileyIcon)
         {
-        iTaskArray.Append(aSmileyIcon);
-        if(!iIsLoading)
+        TBool isIdel = (TaskCount() == 0);
+        iLoadingTaskArray.Append(aSmileyIcon);
+        if(isIdel)
             {
             DoNextTaskL();
             }
@@ -213,45 +255,203 @@
 
 void CSmileyTnumbnailAsynLoader::DiscardAll()
     {
-    iTaskArray.Reset();
+    iLoadingTaskArray.Reset();
     }
 
 TInt CSmileyTnumbnailAsynLoader::TaskCount() const
     {
-    return iTaskArray.Count();
+    return iLoadingTaskArray.Count();
     }
 
 void CSmileyTnumbnailAsynLoader::DoNextTaskL()
     {
-    TInt count = TaskCount();
-    if(count > 0)
+    if(TaskCount() > 0)
         {
-        CSmileyIcon* icon = iTaskArray[0];
-        iTaskArray.Remove(0);
+        CSmileyIcon* icon = iLoadingTaskArray[0];
+        iLoadingTaskArray.Remove(0);
         
-        if(icon->ThumbnailReady())
+        if(icon->StillImageIsReadyToDraw())
             {
             DoNextTaskL();
             }
         else
             {
-            icon->LoadThumbnailL();
-            iIsLoading = TRUE;
+            icon->LoadStillImageL(1); // 1 is for asynchronous
             }
         }
+    }
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////
+// CSmileyTextTreeNode
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+NONSHARABLE_CLASS(CSmileyTextTreeNode) : public CBase
+    {
+public:
+    CSmileyTextTreeNode(TChar aChar);
+    ~CSmileyTextTreeNode();
+
+    TChar Char() const;
+    TChar LastChildChar() const;
+    TChar FirstChildChar() const;
+
+    CSmileyTextTreeNode* AddTreeL(const TDesC& aText, TChar aCode);
+    TInt ChildCount() const;
+    CSmileyTextTreeNode* Child(TInt aIndex) const;
+    CSmileyTextTreeNode* Child(TChar aChar) const;
+    
+private:
+    CSmileyTextTreeNode* AddChildL(TChar aChar);
+    
+private:
+    TChar   iChar;
+    
+    typedef CArrayPtrFlat<CSmileyTextTreeNode> CSmileyTextTreeNodeArrayPtrFlat;
+    CSmileyTextTreeNodeArrayPtrFlat* iChildArray;
+    
+    };
+
+
+CSmileyTextTreeNode::CSmileyTextTreeNode(TChar aChar) : iChar(aChar)
+    {
+    }
+
+CSmileyTextTreeNode::~CSmileyTextTreeNode()
+    {
+    if(iChildArray)
+        {
+        iChildArray->ResetAndDestroy();
+        delete iChildArray;
+        }
+    }
+
+TChar CSmileyTextTreeNode::Char() const
+    {
+    return iChar;
+    }
+
+TChar CSmileyTextTreeNode::LastChildChar() const
+    {
+    if(iChildArray)
+        {
+        TInt index = iChildArray->Count() - 1;
+        return iChildArray->At(index)->Char();
+        }
+    else
+        {
+        return 0;
+        }
+    }
+
+TChar CSmileyTextTreeNode::FirstChildChar() const
+    {
+    if(iChildArray)
+        {
+        return iChildArray->At(0)->Char();
+        }
     else
         {
-        iIsLoading = FALSE;
+        return 0;
+        }
+    }
+
+CSmileyTextTreeNode* CSmileyTextTreeNode::AddTreeL(const TDesC& aText, TChar aCode)
+    {
+    TInt length = aText.Length();
+    if(length > 0)
+        {
+        CSmileyTextTreeNode* node = AddChildL(aText[0]);
+        return node->AddTreeL(aText.Right(length-1), aCode);
+        }
+    else
+        {
+        return AddChildL(aCode);
+        }
+    }
+
+TInt CSmileyTextTreeNode::ChildCount() const
+    {
+    if(iChildArray)
+        {
+        return iChildArray->Count();
+        }
+    else
+        {
+        return 0;
+        }
+    }
+
+CSmileyTextTreeNode* CSmileyTextTreeNode::Child(TInt aIndex) const
+    {
+    if(aIndex>=0 && aIndex<ChildCount())
+        {
+        return iChildArray->At(aIndex);
+        }
+    else
+        {
+        return NULL;
         }
     }
 
+CSmileyTextTreeNode* CSmileyTextTreeNode::Child(TChar aChar) const
+    {
+    if(iChildArray)
+        {
+        for(TInt i=iChildArray->Count()-1; i>=0; i--)
+            {
+            CSmileyTextTreeNode* node = iChildArray->At(i);
+            if(node->Char() == aChar)
+                {
+                return node;
+                }
+            }
+        }
+    
+    return NULL;
+    }
+
+CSmileyTextTreeNode* CSmileyTextTreeNode::AddChildL(TChar aChar)
+    {
+    // new
+    if(!iChildArray)
+        {
+        iChildArray = new (ELeave) CSmileyTextTreeNodeArrayPtrFlat(1);
+        }
+    
+    // sequential search
+    TInt pos = 0;
+    for(; pos<iChildArray->Count(); pos++)
+        {
+        CSmileyTextTreeNode* node = iChildArray->At(pos);
+        TChar character = node->Char();
+        if(aChar == character)
+            {
+            return node;
+            }
+        else if(aChar < character)
+            {
+            break;
+            }
+        }
+    
+    CSmileyTextTreeNode* node = new (ELeave) CSmileyTextTreeNode(aChar);
+    iChildArray->InsertL(pos, node);
+    return node;
+    }
+
 
 
 ///////////////////////////////////////////////////////////////////////////////////////////////
 // CSmileyModel
 ///////////////////////////////////////////////////////////////////////////////////////////////
 
-CSmileyModel::CSmileyModel(MSmileyIconObserver* aObserver) : iSmileyIconObserver(aObserver)
+const TUint16 KBaseCodeOn = 0xf880;
+const TUint16 KBaseCodeOff = 0x7FFF;
+_LIT(KPlaceHolder, "\xf880i");
+
+CSmileyModel::CSmileyModel(MAknSmileyObserver* aObserver) : iSmileyIconObserver(aObserver)
     {
     }
 
@@ -265,18 +465,6 @@
 void CSmileyModel::LoadResourceL()
     {
     if(Count() > 0) return;
-    
-    // append sct & smiley switch icon
-        {
-        TSmileyIconInfo info;
-        info.iSkinItemID = KAknsIIDQgnIndiSwitchSmiley2;
-        info.iDefaultThumbnailID = EMbmSmileyQgn_indi_switch_smiley2;
-        iSmileyIconArray.Append(CSmileyIcon::NewL(info, this));
-        
-        info.iSkinItemID = KAknsIIDQgnIndiSwitchSct2;
-        info.iDefaultThumbnailID = EMbmSmileyQgn_indi_switch_sct2;
-        iSmileyIconArray.Append(CSmileyIcon::NewL(info, this));
-        }
 
     // append image resourece
     TResourceReader reader;
@@ -285,48 +473,74 @@
     TInt offset = CCoeEnv::Static()->AddResourceFileL(smileyRscName);
     CCoeEnv::Static()->CreateResourceReaderLC(reader, R_SMILEY_ICONS_INFO);
 
+    iBaseCode = KBaseCodeOn;
+    TInt index = 0;
+    
+    iTextSearchTree = new (ELeave) CSmileyTextTreeNode(0);
+    
     TInt count(reader.ReadInt16());
-    for(TInt id(1); id<=count; id++)
+    for(TInt i(0); i<count; i++)
         {
         TSmileyIconInfo info;
-        
-        info.iId = id; // id
-        
+
         TBool isAnimation = (reader.ReadInt16() == 1);
-        TInt16 code = reader.ReadInt16();
+        TInt code = reader.ReadInt16();
         TInt bmpId1 = reader.ReadInt32();
         TInt maskId1 = reader.ReadInt32();
         TInt bmpId2 = reader.ReadInt32();
         TInt maskId2 = reader.ReadInt32();
         
+        if(iBaseCode > code) iBaseCode = code;
+        
+        info.iIndex = index++;
+
         if(bmpId2 > 0)
             {
-            info.iDefaultThumbnailID = bmpId2;
-            info.iDefaultAnimationID = bmpId1;
+            info.iDefaultStillImageID = bmpId2;
+            info.iDefaultAnimationImageID = bmpId1;
             }
         else
             {
-            info.iDefaultThumbnailID = bmpId1;
-            info.iDefaultAnimationID = 0;
+            info.iDefaultStillImageID = bmpId1;
+            info.iDefaultAnimationImageID = 0;
             }
 
         TBuf<64> smileyName = reader.ReadTPtrC(); // strings
-        TInt pos = smileyName.Find(_L(" "));
-        if(pos > 0) smileyName.SetLength(pos);
-        info.iName = smileyName;
-
-        iSmileyIconArray.Append(CSmileyIcon::NewL(info, this));
+        
+        CSmileyIcon* icon = CSmileyIcon::NewL(info, this);
+        icon->AddText(smileyName);
+        iSmileyIconArray.Append(icon);
+        
+        // build text search tree
+        for(TInt j=0; j<icon->TextVariate(); j++)
+            {
+            iTextSearchTree->AddTreeL(icon->Text(j), SmileyCode(i,j));
+            }
         }
     
     CCoeEnv::Static()->DeleteResourceFile(offset);
     CleanupStack::PopAndDestroy(); // reader
+    
+    // sct & smiley switch icon
+    TSmileyIconInfo info;
+    info.iIndex = index++;
+    info.iSkinItemID = KAknsIIDQgnIndiSwitchSmiley2;
+    info.iDefaultStillImageID = EMbmSmileyQgn_indi_switch_smiley2;
+    iSmileyIconArray.Append(CSmileyIcon::NewL(info,this));
+
+    info.iIndex = index++;
+    info.iSkinItemID = KAknsIIDQgnIndiSwitchSct2;
+    info.iDefaultStillImageID = EMbmSmileyQgn_indi_switch_sct2;
+    iSmileyIconArray.Append(CSmileyIcon::NewL(info,this));
 
     }
 
 void CSmileyModel::ReleaseResource()
     {
+    if(Count() == 0) return;
+
     // reset array
-    for(TInt i(0); i<Count(); i++)
+    for(TInt i(0); i<ArrayCount(); i++)
         {
         delete iSmileyIconArray[i];
         iSmileyIconArray[i] = NULL;
@@ -334,25 +548,410 @@
     iSmileyIconArray.Reset();
     
     // reset task loader
-    iSmileyThumbnailLoader.DiscardAll();
+    iSmileyLoader.DiscardAll();
+    
+    delete iTextSearchTree;
+    iTextSearchTree = NULL;
+    
+    iBaseCode = 0x7FFF; // max value
+    }
+
+TInt CSmileyModel::ConvertCodesToTextL(TDes& aText)
+    {
+    TInt converted = 0;
+    iConvertBuffer.Zero();
+    
+    // deal all
+    TInt pos = 0;
+    while(pos < aText.Length())
+        {
+        TChar character = aText[pos++];
+        if(IsSmiley(character))
+            {
+            converted++;
+            pos++; // jump the 'i'
+            iConvertBuffer.Append(Text(character));
+            }
+        else
+            {
+            iConvertBuffer.Append(character);
+            }
+        }
+    
+    // replace
+    if(converted)
+        {
+        aText.Copy(iConvertBuffer);
+        }
+
+    return converted;
     }
 
-void CSmileyModel::LoadThumbnailAsyn(TInt aIndex)
+TInt CSmileyModel::ConvertTextToCodesL(TDes& aText)
     {
-    TRAP_IGNORE(iSmileyThumbnailLoader.AddTaskL((*this)[aIndex]));
+    TInt converted = 0;
+    iConvertBuffer.Zero();
+
+    CSmileyTextTreeNode* node = iTextSearchTree;
+    TChar lastChar = node->LastChildChar();
+    TChar firstChar = node->FirstChildChar();
+    TInt matchedLength = 0;
+
+    // deal all
+    TInt pos = 0;
+    while(pos < aText.Length())
+        {
+        TChar character = aText[pos++];
+        iConvertBuffer.Append(character);
+
+        if(!(character<firstChar || character>lastChar)) // is possible
+            {
+            CSmileyTextTreeNode* find = node->Child(character);
+            if(find)
+                {
+                matchedLength++; // character is mathed
+                
+                CSmileyTextTreeNode* child = find->Child(0);
+                if(child && child->ChildCount()==0) // whole combination is matched
+                    {
+                    converted++;
+                    
+                    TChar code = child->Char();
+
+                    // replace with code
+                    iConvertBuffer.SetLength(iConvertBuffer.Length() - matchedLength);
+                    iConvertBuffer.Append(code);
+                    iConvertBuffer.Append('i');
+
+                    // load thumnail
+                    LoadStillImageL(code);
+
+                    // restart
+                    matchedLength = 0;
+                    node = iTextSearchTree;
+                    }
+                else
+                    {
+                    node = find;
+                    }
+
+                lastChar = node->LastChildChar();
+                firstChar = node->FirstChildChar();
+                continue;
+                }
+            }
+        
+        // character is not matched
+        if(matchedLength)
+            {
+            matchedLength = 0;
+            node = iTextSearchTree;
+            lastChar = node->LastChildChar();
+            firstChar = node->FirstChildChar();
+            }
+        }
+    
+    // replace
+    if(converted)
+        {
+        aText.Copy(iConvertBuffer);
+        }
+
+    return converted;
+    }
+
+TBool CSmileyModel::IsSmiley(TChar aCode) const
+    {
+    return (aCode >= iBaseCode);
+    }
+
+const TDesC& CSmileyModel::Text(TChar aCode) const
+    {
+    TInt index, variate;
+    if(DecodeSmileyCode(aCode, index, variate))
+        {
+        return Text(index, variate);
+        }
+    else
+        {
+        return KNullDesC;
+        }
     }
 
 void CSmileyModel::SetSize(const TSize& aSize)
     {
-    for(TInt i(0); i<Count(); i++)
+    if(ArrayCount() && iSmileyIconArray[0]->Size()!=aSize)
+        {
+        for(TInt i(0); i<ArrayCount(); i++)
+            {
+            iSmileyIconArray[i]->SetSize(aSize);
+            }
+        }
+    }
+
+void CSmileyModel::SetSizeByFont(const CFont* aFont)
+    {
+    TSize size(aFont->TextWidthInPixels(KPlaceHolder),aFont->HeightInPixels());
+    SetSize(size);
+    }
+
+void CSmileyModel::DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TPoint& aPosition) const
+    {
+    TPtrC ptr = aText;
+    TPoint pos = aPosition;
+    
+    aGc.UseFont(aFont);
+    
+    TBool metSmileyNotReady = EFalse;
+ 
+    while(ptr.Length())
         {
-        iSmileyIconArray[i]->SetSize(aSize);
+        TInt i = 0;
+        for(; i<aText.Length(); i++) // find next smiley code
+            {
+            if(IsSmiley(ptr[i]))
+                {
+                break;
+                }
+            }
+        
+        if(i > 0) // have text
+            {
+            TPtrC txt = ptr.Left(i);
+            aGc.DrawText(txt, pos);
+            pos += TPoint(aFont->TextWidthInPixels(txt),0);
+
+            ptr.Set(ptr.Right(ptr.Length()-i));
+            i = 0;
+            }
+        
+        if(ptr.Length()) // breaked by smiley code
+            {
+            CAknSmileyIcon* icon = Smiley(ptr[i]);
+            if(icon)
+                {
+                TSize size = icon->Size();
+                TPoint tl = pos;
+                tl.iY = tl.iY - (size.iHeight + aFont->HeightInPixels()) / 2;
+                if(!metSmileyNotReady && icon->ReadyToDraw())
+                    {
+                    aGc.BitBltMasked(tl, icon->Image(), TRect(size), icon->Mask(), EFalse);
+                    }
+                else
+                    {
+                    metSmileyNotReady = ETrue;
+                    }
+                pos += TPoint(aFont->TextWidthInPixels(ptr.Left(2)),0);
+                }
+            
+            ptr.Set(ptr.Right(ptr.Length()-2));
+            }
         }
     }
 
-CSmileyIcon* CSmileyModel::operator[](TInt aIndex) const
+void CSmileyModel::DrawText(CWindowGc& aGc, const TDesC& aText, const TAknLayoutText& aLayout, TBool aUseLogicalToVisualConversion) const
+    {
+    // adapter variables
+    const CFont* font = aLayout.Font();
+    TRect textRect = aLayout.TextRect();
+    TInt offset = aLayout.BaselineOffset();
+    CGraphicsContext::TTextAlign align = aLayout.Align();
+    
+    // belows are all from 
+    // void TAknLayoutText::DrawText(CGraphicsContext& aGc,const TDesC& aText,TBool aUseLogicalToVisualConversion, const TRgb &aColor) const
+    
+    __ASSERT_DEBUG(font, Panic(EAknPanicLayoutTextNotCalled));
+    
+    //aGc.UseFont( font );
+    //aGc.SetPenColor( aColor );
+    if ( aText.Length() )
+        {
+        HBufC* visualBuf = NULL;
+        TPtrC text( aText );
+        
+        if ( aUseLogicalToVisualConversion )
+            {
+            visualBuf = HBufC::New( aText.Length() + KAknBidiExtraSpacePerLine );
+            
+            // In OOM, logical to visual conversion is not performed...
+            
+            if ( visualBuf )
+                {
+                *visualBuf = aText; // copy
+                TPtr ptr = visualBuf->Des();
+                
+                TInt maxWidth = textRect.Size().iWidth;
+                
+                // Logical to visual conversion.
+                AknBidiTextUtils::ConvertToVisualAndClip(
+                    aText,
+                    ptr,
+                    *font,
+                    maxWidth,
+                    maxWidth );
+                
+                // for smiley begin
+                const TInt length = ptr.Length();
+                if(length>1 && IsSmiley(ptr[length-2]))
+                    {
+                    if(ptr[length-1] != 'i')
+                        {
+                        // smiley is clipped for visual, del this smiley
+                        ptr.Delete(length-2, 1);
+                        }
+                    }
+                // for smiley end
+
+                text.Set( ptr );
+                }
+            }
+        
+        // Calculate x-offset based on the used alignment
+        TInt margin = 0;
+        if ( align != CGraphicsContext::ELeft )
+            {
+            // Measure the full width of the text (ie. what DrawText needs)
+            TInt textWidth = AknBidiTextUtils::MeasureTextBoundsWidth( *font, text,CFont::TMeasureTextInput::EFVisualOrder );
+            
+            const TInt extraWidth = textRect.Width() - textWidth;
+            if ( align == CGraphicsContext::ECenter )
+                {
+                margin = extraWidth / 2;
+                }
+            else // right aligned
+                {
+                margin = extraWidth;
+                }
+            }
+
+        // Need to make the drawing rectangle bigger to account for underlines
+        TRect drawRect(textRect);
+        TInt height = drawRect.Height();
+        // The underline position is not available from the GC. The following code imitates what Symbian CFbsBitGC implements.
+        // (height-offset) is the part below the baseline. Check if it sufficient
+        TInt extraHeightForUnderlining =   1 + Max(1, height/10)-(height-offset);
+        if ( extraHeightForUnderlining > 0 )
+            drawRect.iBr.iY += extraHeightForUnderlining;
+
+        // for smiley
+        //aGc.DrawText( text, drawRect, offset, CGraphicsContext::ELeft, margin );
+        DrawText(aGc, text, font, drawRect, offset, CGraphicsContext::ELeft, margin);
+        
+        delete visualBuf;
+        }
+    
+    //aGc.DiscardFont(); // Release the font cache
+    }
+
+void CSmileyModel::DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TRect& aBox, TInt aBaselineOffset, 
+                            CGraphicsContext::TTextAlign aAlignment, TInt aLeftMargin) const
     {
-    if(aIndex>=0 && aIndex<Count())
+    TInt boxWidth = aBox.Width();
+    TInt textWidth = aFont->TextWidthInPixels(aText);
+    
+    TPoint offset;
+    offset.iY = aBaselineOffset;
+    
+    switch(aAlignment)
+        {
+        case CGraphicsContext::ELeft:
+            offset.iX = aLeftMargin;
+            break;
+            
+        case CGraphicsContext::ERight:
+            offset.iX = boxWidth - textWidth - aLeftMargin;
+            break;
+            
+        case CGraphicsContext::ECenter:
+            offset.iX = (boxWidth - textWidth) / 2;
+            break;
+            
+        default:
+            break;
+        }
+    
+    DrawText(aGc, aText, aFont, aBox, offset);
+    }
+
+void CSmileyModel::DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TRect& aBox, const TPoint& aOffset) const
+    {
+    TPtrC ptr = aText;
+    TPoint offset = aOffset;
+    
+    aGc.UseFont(aFont);
+    
+    TInt fontH = aFont->HeightInPixels();
+    
+    TBool metSmileyNotReady = EFalse;
+ 
+    while(ptr.Length())
+        {
+        TInt i = 0;
+        for(; i<ptr.Length(); i++) // find next smiley code
+            {
+            if(IsSmiley(ptr[i]))
+                {
+                break;
+                }
+            }
+        
+        if(i > 0) // have text
+            {
+            TPtrC txt = ptr.Left(i);
+            aGc.DrawText(txt, aBox, offset.iY, CGraphicsContext::ELeft, offset.iX);
+            offset.iX += aFont->TextWidthInPixels(txt);
+
+            ptr.Set(ptr.Right(ptr.Length()-i));
+            i = 0;
+            }
+        
+        if(ptr.Length()) // breaked by smiley code
+            {
+            CAknSmileyIcon* icon = Smiley(ptr[i]);
+            if(icon)
+                {
+                TSize size = icon->Size();
+                TPoint tl = aBox.iTl + offset;
+                tl.iY = tl.iY - (size.iHeight + fontH) / 2;
+                TRect imgWindow(tl, size);
+                imgWindow.Intersection(aBox);
+                if(!imgWindow.IsEmpty())
+                    {
+                    TRect innerRect = TRect(imgWindow.iTl-tl,imgWindow.Size());
+                    if(!metSmileyNotReady && icon->ReadyToDraw())
+                        {
+                        aGc.BitBltMasked(imgWindow.iTl, icon->Image(), innerRect, icon->Mask(), EFalse);
+                        }
+                    else
+                        {
+                        metSmileyNotReady = ETrue;
+                        }
+                    }
+
+                offset += TPoint(aFont->TextWidthInPixels(ptr.Left(2)),0);
+                }
+            
+            ptr.Set(ptr.Right(ptr.Length()-2));
+            }
+        }
+    }
+
+CAknSmileyIcon* CSmileyModel::Smiley(TChar aCode) const
+    {
+    TInt index, variate;
+    if(DecodeSmileyCode(aCode, index, variate))
+        {
+        return (*this)[index];
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+CAknSmileyIcon* CSmileyModel::operator[](TInt aIndex) const
+    {
+    if(aIndex>=0 && aIndex<ArrayCount())
         {
         return iSmileyIconArray[aIndex];
         }
@@ -364,19 +963,117 @@
 
 TInt CSmileyModel::Count() const
     {
+    return iSmileyIconArray.Count() - 2;
+    }
+
+CAknSmileyIcon* CSmileyModel::SwitchToSmileyIcon() const
+    {
+    return (*this)[Count()];
+    }
+
+CAknSmileyIcon* CSmileyModel::SwitchToSctIcon() const
+    {
+    return (*this)[Count()+1];
+    }
+
+TChar CSmileyModel::SwitchToSmileyCode() const
+    {
+    return SmileyCode(Count());
+    }
+
+TChar CSmileyModel::SwitchToSctCode() const
+    {
+    return SmileyCode(Count()+1);
+    }
+
+TChar CSmileyModel::SmileyCode(TInt aIndex, TInt aVariate) const
+    {
+    return EncodeSmileyCode(aIndex, aVariate);
+    }
+
+TChar CSmileyModel::SmileyCode(CAknSmileyIcon* aSmileyIcon) const
+    {
+    if(aSmileyIcon)
+        {
+        CSmileyIcon* icon = static_cast<CSmileyIcon*>(aSmileyIcon);
+        return EncodeSmileyCode(icon->Index(), 0);
+        }
+    else
+        {
+        return 0;
+        }
+    }
+
+void CSmileyModel::LoadStillImagesL(const TDesC& aText)
+    {
+    for(TInt i(0); i<aText.Length(); i++)
+        {
+        LoadStillImageL(aText[i]);
+        }
+    }
+
+void CSmileyModel::LoadStillImageL(TChar aChar)
+    {
+    CSmileyIcon* icon = static_cast<CSmileyIcon*>(Smiley(aChar));
+    iSmileyLoader.AddTaskL(icon);
+    }
+
+const TDesC& CSmileyModel::Text(TInt aIndex, TInt aVariate) const
+    {
+    CSmileyIcon* icon = static_cast<CSmileyIcon*>((*this)[aIndex]);
+    if(icon)
+        {
+        return icon->Text(aVariate);
+        }
+    else
+        {
+        return KNullDesC;
+        }
+    }
+
+TInt CSmileyModel::ArrayCount() const
+    {
     return iSmileyIconArray.Count();
     }
 
-void CSmileyModel::ThumbnailLoaded(CSmileyIcon* aSmileyIcon)
+TChar CSmileyModel::EncodeSmileyCode(TInt aIndex, TInt aVariate) const
     {
-    TRAP_IGNORE(iSmileyThumbnailLoader.DoNextTaskL());
-
-    if(iSmileyIconObserver) iSmileyIconObserver->ThumbnailLoaded(aSmileyIcon);
+    if(aVariate)
+        {
+        return (iBaseCode + aIndex + (aVariate<<8));
+        }
+    else
+        {
+        return (iBaseCode + aIndex);
+        }
     }
 
-void CSmileyModel::AnimationChanged(CSmileyIcon* aSmileyIcon)
+#define KMaskL 0x00FF
+
+TBool CSmileyModel::DecodeSmileyCode(TChar aCode, TInt& aIndex, TInt& aVariate) const
     {
-    if(iSmileyIconObserver) iSmileyIconObserver->AnimationChanged(aSmileyIcon);
+    if(aCode >= iBaseCode)
+        {
+        aIndex = (aCode&KMaskL) - (iBaseCode&KMaskL);
+        aVariate = (aCode>>8) - (iBaseCode>>8);
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+void CSmileyModel::SmileyStillImageLoaded(CAknSmileyIcon* aSmileyIcon)
+    {
+    TRAP_IGNORE(iSmileyLoader.DoNextTaskL());
+
+    if(iSmileyIconObserver) iSmileyIconObserver->SmileyStillImageLoaded(aSmileyIcon);
+    }
+
+void CSmileyModel::SmileyAnimationChanged(CAknSmileyIcon* aSmileyIcon)
+    {
+    if(iSmileyIconObserver) iSmileyIconObserver->SmileyAnimationChanged(aSmileyIcon);
     }
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uifw/AvKon/src/AknSmileyUtils.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -0,0 +1,167 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+
+#include "AknSmileyUtils.h"
+#include "AknSmileyModel.h"
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////
+// CAknSmileyIcon
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+CAknSmileyIcon::CAknSmileyIcon()
+    {
+    
+    }
+
+CAknSmileyIcon::~CAknSmileyIcon()
+    {
+    
+    }
+
+const CFbsBitmap* CAknSmileyIcon::Image() const
+    {
+    return NULL;
+    }
+
+const CFbsBitmap* CAknSmileyIcon::Mask() const
+    {
+    return NULL;
+    }
+
+TBool CAknSmileyIcon::ReadyToDraw() const
+    {
+    return FALSE;
+    }
+
+const TSize& CAknSmileyIcon::Size() const
+    {
+    return TSize();
+    }
+
+void CAknSmileyIcon::PlayAnimationL(TInt /*aRepeat*/, TInt /*aDelay*/)
+    {
+
+    }
+
+void CAknSmileyIcon::StopAnimation()
+    {
+
+    }
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////
+// CAknSmileyManager
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+class CAknSmileyManager::CExtension : public CSmileyModel
+    {
+public:
+    CExtension(MAknSmileyObserver* aObserver) : CSmileyModel(aObserver) {};
+    };
+
+EXPORT_C CAknSmileyManager* CAknSmileyManager::NewL(MAknSmileyObserver* aObserver)
+    {
+    CAknSmileyManager* self = new (ELeave) CAknSmileyManager();
+    CleanupStack::PushL(self);
+    self->ConstructL(aObserver);
+    CleanupStack::Pop(); // self;
+    return self;
+    }
+
+void CAknSmileyManager::ConstructL(MAknSmileyObserver* aObserver)
+    {
+    iExtension = new (ELeave) CExtension(aObserver);
+    iExtension->LoadResourceL();
+    }
+
+CAknSmileyManager::CAknSmileyManager()
+    {
+    
+    }
+
+EXPORT_C CAknSmileyManager::~CAknSmileyManager()
+    {
+    delete iExtension;
+    }
+
+EXPORT_C TInt CAknSmileyManager::ConvertCodesToTextL(TDes& aText)
+    {
+    return iExtension->ConvertCodesToTextL(aText);
+    }
+
+EXPORT_C TInt CAknSmileyManager::ConvertTextToCodesL(TDes& aText)
+    {
+    return iExtension->ConvertTextToCodesL(aText);
+    }
+
+EXPORT_C const TDesC& CAknSmileyManager::Text(TChar aCode) const
+    {
+    return iExtension->Text(aCode);
+    }
+
+EXPORT_C TBool CAknSmileyManager::IsSmiley(TChar aCode) const
+    {
+    return iExtension->IsSmiley(aCode);
+    }
+
+EXPORT_C void CAknSmileyManager::SetSize(const TSize& aSize)
+    {
+    iExtension->SetSize(aSize);
+    }
+
+EXPORT_C void CAknSmileyManager::SetSizeByFont(const CFont* aFont)
+    {
+    iExtension->SetSizeByFont(aFont);
+    }
+
+EXPORT_C void CAknSmileyManager::DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TPoint& aPosition) const
+    {
+    iExtension->DrawText(aGc, aText, aFont, aPosition);
+    }
+
+EXPORT_C void CAknSmileyManager::DrawText(CWindowGc& aGc, const TDesC& aText, const TAknLayoutText& aLayout, TBool aUseLogicalToVisualConversion) const
+    {
+    iExtension->DrawText(aGc, aText, aLayout, aUseLogicalToVisualConversion);
+    }
+
+EXPORT_C void CAknSmileyManager::DrawText(CWindowGc& aGc, const TDesC& aText, const CFont* aFont, const TRect& aBox, TInt aBaselineOffset, 
+                                          CGraphicsContext::TTextAlign aAlignment, TInt aLeftMargin) const
+    {
+    iExtension->DrawText(aGc, aText, aFont, aBox, aBaselineOffset, aAlignment, aLeftMargin);
+    }
+
+EXPORT_C TInt CAknSmileyManager::Count() const
+    {
+    return iExtension->Count();
+    }
+
+EXPORT_C CAknSmileyIcon* CAknSmileyManager::Smiley(TChar aCode) const
+    {
+    return iExtension->Smiley(aCode);
+    }
+
+EXPORT_C CAknSmileyIcon* CAknSmileyManager::operator[](TInt aIndex) const
+    {
+    return iExtension->operator[](aIndex);
+    }
+
+
+// end of file
+
--- a/uifw/AvKon/src/AknViewAppUi.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/AknViewAppUi.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -27,6 +27,10 @@
 #include <aknclearer.h>
 #include <AknUtils.h>
 #include <akntoolbar.h>
+#include <akntranseffect.h>
+#include <centralrepository.h>
+
+
 #include "aknview.h"
 #include "aknshut.h"
 #include "aknenv.h"
@@ -43,6 +47,10 @@
 // CONSTANTS
 const TInt KAknAppUiViewsGranularity = 1;
 const TInt KAknViewAsyncPriority = EActivePriorityRedrawEvents + 10;
+const TUid KCRUidThemes = { 0x102818E8 }; // defined in pslninternalcrkeys.h
+const TUint32 KThemesTransitionEffects = 0x00000009; //defined in pslninternalcrkeys.h
+
+
 #ifdef RD_SPLIT_VIEW
 const TInt KAknSplitViewSize = 2;
 
@@ -229,11 +237,25 @@
 	AddToStackL( iExtension->iNavigator, ECoeStackPriorityDefault - 1, ECoeStackFlagRefusesFocus );
 #endif // RD_SPLIT_VIEW
 	
+	
+	// disable CAknLocalScreenClearer when fullscreen effect is on
+	CRepository *uiThemeCenRep =  CRepository::NewL( KCRUidThemes );
+	CleanupStack::PushL( uiThemeCenRep );
+	TInt effectValue = 0;
+	TBool themeEffectDisabled = ETrue;
+	if ( KErrNone == uiThemeCenRep->Get( KThemesTransitionEffects, effectValue ) )
+        {
+        themeEffectDisabled = effectValue & AknTransEffect::EFullScreenTransitionsOff;
+        }
+
 	if ( iEikonEnv->RootWin().OrdinalPosition() == 0 && // only clear the window for foreground apps
-	     iExtension->iUseDefaultScreenClearer )
+	     iExtension->iUseDefaultScreenClearer && themeEffectDisabled )
 		{
 		iClearer = CAknLocalScreenClearer::NewL( ETrue );
 		}
+	
+	CleanupStack::PopAndDestroy( uiThemeCenRep ); // uiThemeCenRep
+	
 	}
 
 // -----------------------------------------------------------------------------
--- a/uifw/AvKon/src/aknbattery.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/aknbattery.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -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"
@@ -25,6 +25,9 @@
 #include <aknlayoutscalable_avkon.cdl.h>
 #include <layoutmetadata.cdl.h>
 
+#include <AknSmallIndicator.h>
+#include <touchfeedback.h>
+
 #include <AknTasHook.h>
 #include "AknUtils.h"
 #include "aknconsts.h"
@@ -66,6 +69,13 @@
 EXPORT_C CAknBatteryPane::~CAknBatteryPane()
     {
     AKNTASHOOK_REMOVE();
+    
+    MTouchFeedback* feedback = MTouchFeedback::Instance();
+    if ( feedback )
+        {
+        feedback->RemoveFeedbackForControl( this );
+        }
+    
     AknsUtils::DeregisterControlPosition( this );
 
     delete iBatteryIconControl;
@@ -95,6 +105,26 @@
     iPrivateFlags = 0; // reset flags
     iDataObserver = new (ELeave) CAknBatteryDataObserver( this );
     iIsActiveIdle = AknStatuspaneUtils::IsActiveIdle();
+    
+    MTouchFeedback* feedback = MTouchFeedback::Instance();
+    if ( feedback )
+        {
+        CFeedbackSpec* fbSpec = CFeedbackSpec::New();
+        if ( fbSpec )
+            {
+            fbSpec->AddFeedback( ETouchEventStylusDown,
+                                 ETouchFeedbackSensitiveButton );
+            fbSpec->AddFeedback( ETouchEventStylusUp,
+                                 ETouchFeedbackSensitiveButton,
+                                 ETouchFeedbackVibra );
+
+            feedback->SetFeedbackArea( this,
+                                       0,
+                                       Rect(),
+                                       fbSpec );
+            delete fbSpec; 
+            }        
+        }
     }
 
 
@@ -326,6 +356,25 @@
         iBatteryStrengthControl, parent, batteryStrenghtLayout );
 
     AknsUtils::RegisterControlPosition( this );
+    
+    MTouchFeedback* feedback = MTouchFeedback::Instance();
+    if ( feedback )
+        {
+        if ( AknStatuspaneUtils::ExtendedFlatLayoutActive() )
+            {
+            // Disable tactile feedback in extended flat layout because
+            // the battery pane isn't adjacent to the universal indicator
+            // and small digital clock pane.
+            feedback->EnableFeedbackForControl( this, EFalse );
+            }
+        else
+            {
+            feedback->EnableFeedbackForControl( this, ETrue );
+            feedback->ChangeFeedbackArea( this,
+                                          0,
+                                          parent );
+            }
+        }
     }
 
 
@@ -347,10 +396,12 @@
 //
 EXPORT_C void CAknBatteryPane::Draw( const TRect& /*aRect*/ ) const
     {
-    if ( iIsActiveIdle )
+    if ( iStatusPane && 
+         iStatusPane->IsTransparent() )
         {
         return;
         }
+        
 
     // Don't allow normal background drawing if
     // background is already drawn with a background drawer.
@@ -513,55 +564,111 @@
 
 // ---------------------------------------------------------------------------
 // CAknBatteryPane::HandlePointerEventL
-// Processes battery pane's pointer events. Actually this does nothing yet.
+// Processes battery pane's pointer events.
 // ---------------------------------------------------------------------------
 //
 void CAknBatteryPane::HandlePointerEventL( const TPointerEvent& aPointerEvent )
     {
-    if ( AknLayoutUtils::PenEnabled() )
+    if ( IsDimmed() )
         {
-        if ( IsDimmed() )
+        iPrivateFlags &= (~EAknBatteryPaneButton1DownInBatteryRect);
+        return;
+        }
+
+    // Get the rect of battery pane.
+    TRect rect( Rect() );
+
+    // Switch by type
+    switch ( aPointerEvent.iType )
+        {
+        case TPointerEvent::EButton1Down:
             {
-            iPrivateFlags &= (~EAknBatteryPaneButton1DownInBatteryRect);
-            return;
+            // if battery pane's rect contains pointer down position
+            if ( rect.Contains( aPointerEvent.iPosition ) )
+                {
+                // set flag that pointerdown was inside battery pane
+                iPrivateFlags |= EAknBatteryPaneButton1DownInBatteryRect;
+                }
             }
-
-        // Get the rect of battery pane.
-        TRect rect( Rect() );
+            break;
 
-        // Switch by type
-        switch ( aPointerEvent.iType )
+        case TPointerEvent::EButton1Up:
             {
-            case TPointerEvent::EButton1Down:
+            if ( !AknStatuspaneUtils::ExtendedFlatLayoutActive() )
                 {
-                // if battery pane's rect contains pointer down position
-                if ( rect.Contains( aPointerEvent.iPosition ) )
+                // Currently the small digital clock pane, universal
+                // indicator pane and battery pane (in status pane layouts
+                // where it's adjacent to universal indicator or digital
+                // clock pane) are regarded as one touch responsive
+                // area from which the universal indicator popup should
+                // open on tap, so upon pointer up event it must be checked
+                // here if the down event happened inside this control,
+                // but the up event inside digital clock or indicator
+                // pane area.
+                CEikStatusPaneBase* sp = CEikStatusPaneBase::Current();
+                TBool pointerUpInIndicatorArea( EFalse );
+                TBool pointerUpInClockArea( EFalse );
+                    
+                if ( sp )
                     {
-                    // set flag that pointerdown was inside battery pane
-                    iPrivateFlags |= EAknBatteryPaneButton1DownInBatteryRect;
+                    CCoeControl* clockPane = sp->ContainerControlL(
+                        TUid::Uid( EEikStatusPaneUidDigitalClock ) );
+                    if ( clockPane )
+                        {
+                        TRect clockRect(
+                            clockPane->PositionRelativeToScreen(),
+                            clockPane->Size() );
+                        pointerUpInClockArea =
+                            clockRect.Contains( aPointerEvent.iParentPosition );
+                        }
+                        
+                    CCoeControl* indicatorPane = sp->ContainerControlL(
+                        TUid::Uid( EEikStatusPaneUidIndic ) );
+                    if ( indicatorPane )
+                        {
+                        TRect indicatorRect(
+                            indicatorPane->PositionRelativeToScreen(),
+                            indicatorPane->Size() );
+                        pointerUpInIndicatorArea =
+                            indicatorRect.Contains( aPointerEvent.iParentPosition );
+                        }
+                    }
+    
+                if ( ( iPrivateFlags & EAknBatteryPaneButton1DownInBatteryRect &&
+                       rect.Contains( aPointerEvent.iPosition ) ) ||
+                     pointerUpInClockArea ||
+                     pointerUpInIndicatorArea )
+                    {
+                    if ( pointerUpInClockArea || pointerUpInIndicatorArea )
+                        {
+                        MTouchFeedback* feedback = MTouchFeedback::Instance();
+                        if ( feedback )
+                            {
+                            // The pointer down was received in another
+                            // control, so the tactile feedback must be
+                            // given directly.
+                            feedback->InstantFeedback(
+                                this,
+                                ETouchFeedbackSensitiveButton,
+                                ETouchFeedbackVibra,
+                                aPointerEvent );
+                            }
+                        }
+
+                    CAknSmallIndicator* indicatorNotifier =
+                        CAknSmallIndicator::NewLC( TUid::Uid( 0 ) );
+                    indicatorNotifier->HandleIndicatorTapL();
+                    CleanupStack::PopAndDestroy( indicatorNotifier );
                     }
                 }
-                break;
 
-            case TPointerEvent::EButton1Up:
-                {
-                // if battery pane's rect contains pointer down position and
-                // Button1Down was clicked inside battery rect
-                if ( iPrivateFlags&EAknBatteryPaneButton1DownInBatteryRect &&
-                    rect.Contains( aPointerEvent.iPosition ) )
-                    {
-                    // Up happened inside battery pane's rect
-                    // activate something
-                    }
+            // Up happened, reset button down flag
+            iPrivateFlags &= (~EAknBatteryPaneButton1DownInBatteryRect);
+            }
+            break;
 
-                // Up happened, reset button down flag
-                iPrivateFlags &= (~EAknBatteryPaneButton1DownInBatteryRect);
-                }
-                break;
-
-            default:
-                break;
-            }
+        default:
+            break;
         }
     }
 
--- a/uifw/AvKon/src/akndigitalclock.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/akndigitalclock.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -355,72 +355,100 @@
 
 // -----------------------------------------------------------------------------
 // CAknDigitalClock::HandlePointerEventL
-// Starts clock application in down event.
+// Opens the universal indicator popup upon tap.
 // -----------------------------------------------------------------------------
 //
 void CAknDigitalClock::HandlePointerEventL( const TPointerEvent& aPointerEvent )
     {
-    CAknControl:: HandlePointerEventL( aPointerEvent );
+    CAknControl::HandlePointerEventL( aPointerEvent );
 
-    if ( AknLayoutUtils::PenEnabled() )
+    // Do nothing if dimmed.
+    if ( IsDimmed() || Window().IsFaded() )
         {
-        // Do nothing if dimmed.
-        if ( IsDimmed() ||
-             Window().IsFaded() )
-            {
-            return;
-            }
+        return;
+        }
+
+    TRect rect( Rect() );
 
-        TRect rect( Rect() );
+    // Currently the small digital clock pane, universal
+    // indicator pane and battery pane (in status pane layouts
+    // where it's adjacent to universal indicator or digital
+    // clock pane) are regarded as one touch responsive
+    // area from which the universal indicator popup should
+    // open on tap, so upon pointer up event it must be checked
+    // here if the down event happened inside this control,
+    // but the up event inside battery or indicator pane area.
+    TBool pointerUpInIndicatorArea( EFalse );
+    TBool pointerUpInBatteryArea( EFalse );
 
-        // Currently the small digital clock pane and universal
-        // indicator pane are regarded as one touch responsive area from
-        // which the universal indicator popup should open on tap,
-        // so upon pointer up event it must be checked here if
-        // the down event happened inside this control, but the up event
-        // inside indicator pane area.
-        TRect indicatorRect( 0, 0, 0, 0 );
+    if ( iFlags & EAknDigitalClockInStatusPane &&
+         aPointerEvent.iType == TPointerEvent::EButton1Up )
+        {
+        CEikStatusPaneBase* sp = CEikStatusPaneBase::Current();
 
-        if ( iFlags & EAknDigitalClockInStatusPane &&
-             aPointerEvent.iType == TPointerEvent::EButton1Up )
+        if ( sp )
             {
-            CEikStatusPaneBase* sp = CEikStatusPaneBase::Current();
-
-            if ( sp )
+            CCoeControl* indicatorPane = sp->ContainerControlL(
+                TUid::Uid( EEikStatusPaneUidIndic ) );
+            if ( indicatorPane )
                 {
-                CCoeControl* indicatorPane = sp->ContainerControlL(
-                    TUid::Uid( EEikStatusPaneUidIndic ) );
-                if ( indicatorPane )
+                TRect indicatorRect( indicatorPane->PositionRelativeToScreen(),
+                                     indicatorPane->Size() );
+                pointerUpInIndicatorArea =
+                    indicatorRect.Contains( aPointerEvent.iParentPosition );
+                }
+            
+            if ( !AknStatuspaneUtils::ExtendedFlatLayoutActive() )
+                {
+                CCoeControl* batteryPane = sp->ContainerControlL(
+                    TUid::Uid( EEikStatusPaneUidBattery ) );
+                if ( batteryPane )
                     {
-                    indicatorRect =
-                        TRect( indicatorPane->PositionRelativeToScreen(),
-                               indicatorPane->Size() );
+                    TRect batteryRect( batteryPane->PositionRelativeToScreen(),
+                                       batteryPane->Size() );
+                    pointerUpInBatteryArea =
+                        batteryRect.Contains( aPointerEvent.iParentPosition );
                     }
                 }
             }
+        }
 
-        if ( aPointerEvent.iType == TPointerEvent::EButton1Down &&
-             rect.Contains( aPointerEvent.iPosition ) )
+    if ( aPointerEvent.iType == TPointerEvent::EButton1Down &&
+         rect.Contains( aPointerEvent.iPosition ) )
+        {
+        // Set flag that down event was inside the clock.
+        iFlags |= EAknDigitalClockButton1DownReceived;
+
+        // tactile feedback is done with SetFeedbackArea
+        }
+    else if ( aPointerEvent.iType == TPointerEvent::EButton1Up &&
+              ( ( iFlags & EAknDigitalClockButton1DownReceived &&
+                  rect.Contains( aPointerEvent.iPosition ) ) ||
+                pointerUpInIndicatorArea ||
+                pointerUpInBatteryArea ) )
+        {
+        if ( pointerUpInIndicatorArea || pointerUpInBatteryArea )
             {
-            // Set flag that down event was inside the clock.
-            iFlags |= EAknDigitalClockButton1DownReceived;
-
-            // tactile feedback is done with SetFeedbackArea
+            MTouchFeedback* feedback = MTouchFeedback::Instance();
+            if ( feedback )
+                {
+                // The pointer down was received in another control,
+                // so the tactile feedback must be given directly.
+                feedback->InstantFeedback( this,
+                                           ETouchFeedbackSensitiveButton,
+                                           ETouchFeedbackVibra,
+                                           aPointerEvent );
+                }
             }
-        else if ( aPointerEvent.iType == TPointerEvent::EButton1Up &&
-                  ( ( iFlags & EAknDigitalClockButton1DownReceived &&
-                      rect.Contains( aPointerEvent.iPosition ) ) ||
-                    ( indicatorRect.Contains( aPointerEvent.iParentPosition ) ) ) )
-            {
-            // Launch the universal indicator popup.
-            CAknSmallIndicator* indicatorNotifier =
-                CAknSmallIndicator::NewLC( TUid::Uid( 0 ) );
-            indicatorNotifier->HandleIndicatorTapL();
-            CleanupStack::PopAndDestroy( indicatorNotifier );
+    
+        // Launch the universal indicator popup.
+        CAknSmallIndicator* indicatorNotifier =
+            CAknSmallIndicator::NewLC( TUid::Uid( 0 ) );
+        indicatorNotifier->HandleIndicatorTapL();
+        CleanupStack::PopAndDestroy( indicatorNotifier );
 
-            // Up event received, reset button down flag.
-            iFlags &= ( ~EAknDigitalClockButton1DownReceived );
-            }
+        // Up event received, reset button down flag.
+        iFlags &= ( ~EAknDigitalClockButton1DownReceived );
         }
     }
 
--- a/uifw/AvKon/src/akndiscreetpopupcontrol.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/akndiscreetpopupcontrol.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -189,12 +189,15 @@
 
     GfxTransEffect::Deregister( this );
 
+    delete iTimer;	
+    delete iDrawer;
+
     if ( iInternalFlags.IsSet( EGlobal ) )
         {
+        CloseWindow();
         iWindowGroup.Close();
         }
-    delete iTimer;	
-    delete iDrawer;
+
     _AKNTRACE_FUNC_EXIT;
     }
 
--- a/uifw/AvKon/src/aknemptycontrol.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/aknemptycontrol.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -44,7 +44,9 @@
 CAknEmptyControl::CAknEmptyControl()
 	{
 	AKNTASHOOK_ADD( this, "CAknEmptyControl" );
-    iIsActiveIdle = AknStatuspaneUtils::IsActiveIdle();
+//  iIsActiveIdle = AknStatuspaneUtils::IsActiveIdle();
+// Use interface of statuspane transparency instead of check if it is active idle
+  iStatusPane = CEikStatusPaneBase::Current();	
     }
 
 
@@ -106,8 +108,8 @@
 // ---------------------------------------------------------------------------
 //
 void CAknEmptyControl::Draw( const TRect& /*aRect*/ ) const
-    {
-    if ( iIsActiveIdle )
+    {      
+    if ( iStatusPane && iStatusPane->IsTransparent() )
         {
         return;
         }
--- a/uifw/AvKon/src/aknlists.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/aknlists.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2009 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"
@@ -1424,6 +1424,16 @@
     }
 
 // -----------------------------------------------------------------------------
+// SetupListL
+// -----------------------------------------------------------------------------
+//
+static void SetupListL( CEikFormattedCellListBox* aListBox,
+                        const TAknWindowComponentLayout& aNormalLayout )
+    {
+    SetupStretchableListL( aListBox, aNormalLayout, aNormalLayout );
+    }
+
+// -----------------------------------------------------------------------------
 // ShowAllRows
 // -----------------------------------------------------------------------------
 //
@@ -3482,15 +3492,11 @@
     CFormattedCellListBoxData* formattedCellData( itemDrawer->FormattedCellData() );
     if ( !formattedCellData->SecondRowHidden() )
         {
-        SetupStretchableListL( this,
-                              AknLayoutScalable_Avkon::list_double_pane( 0 ),
-                              AknLayoutScalable_Avkon::list_double_pane_vc( 0 ) );
+        SetupListL( this, AknLayoutScalable_Avkon::list_double_pane( 0 ) );
         }
     else
         {
-        SetupStretchableListL( this,
-                              AknLayoutScalable_Avkon::list_single_pane( 0 ),
-                              AknLayoutScalable_Avkon::list_double_pane_vc( 0 ) );
+        SetupListL( this, AknLayoutScalable_Avkon::list_single_pane( 0 ) );
         }
 
     SetSeparatorLinePosition( this, EAColumn );
@@ -3499,46 +3505,37 @@
         {
         // Assertion fails in CFormattedCellListBoxData::DrawFormattedSimple if 
         // this cell does not exist.
-        formattedCellData->SetStretchableTextSubCellL( 0,
-            AknLayoutScalable_Avkon::list_double_pane_t1( 0 ),
-            AknLayoutScalable_Avkon::list_double_pane_vc_t1( 0 ) );
-
-        formattedCellData->SetStretchableTextSubCellL( 1,
-            AknLayoutScalable_Avkon::list_double_pane_t1( 0 ),
-            AknLayoutScalable_Avkon::list_double_pane_vc_t1( 0 ) );
-
-        formattedCellData->SetStretchableTextSubCellL( 2,
-            AknLayoutScalable_Avkon::list_double_pane_t2( 0 ),
-            AknLayoutScalable_Avkon::list_double_pane_vc_t2( 0 ) );
+        formattedCellData->SetTextSubCellL( 0,
+            AknLayoutScalable_Avkon::list_double_pane_t1( 0 ) );
+
+        formattedCellData->SetTextSubCellL( 1,
+            AknLayoutScalable_Avkon::list_double_pane_t1( 0 ) );
+
+        formattedCellData->SetTextSubCellL( 2,
+            AknLayoutScalable_Avkon::list_double_pane_t2( 0 ) );
             
-        formattedCellData->SetStretchableGraphicSubCellL( 3,
-            AknLayoutScalable_Avkon::list_double_pane_g1( 0 ),
-            AknLayoutScalable_Avkon::list_double_pane_vc_g1( 0 ) );
-
-        formattedCellData->SetStretchableGraphicSubCellL( 4,
-            AknLayoutScalable_Avkon::list_double_pane_g2( 0 ),
-            AknLayoutScalable_Avkon::list_double_pane_vc_g2( 0 ) );
+        formattedCellData->SetGraphicSubCellL( 3,
+            AknLayoutScalable_Avkon::list_double_pane_g1( 0 ) );
+
+        formattedCellData->SetGraphicSubCellL( 4,
+            AknLayoutScalable_Avkon::list_double_pane_g2( 0 ) );
 
         // Conditional subcells must be added in priority order!
-        formattedCellData->SetStretchableConditionalSubCellL( 4,
-            AknLayoutScalable_Avkon::list_double_pane_t1( 2 ),
-            AknLayoutScalable_Avkon::list_double_pane_vc_t2( 2 ), 1, 2 );
-
-        formattedCellData->SetStretchableConditionalSubCellL( 3,
-            AknLayoutScalable_Avkon::list_double_pane_t1( 1 ),
-            AknLayoutScalable_Avkon::list_double_pane_vc_t2( 1 ), 1, 2 );
+        formattedCellData->SetConditionalSubCellL( 4,
+            AknLayoutScalable_Avkon::list_double_pane_t1( 2 ), 1 );
+
+        formattedCellData->SetConditionalSubCellL( 3,
+            AknLayoutScalable_Avkon::list_double_pane_t1( 1 ), 1 );
         }
     else
         {
         // Assertion fails in CFormattedCellListBoxData::DrawFormattedSimple if 
         // this cell does not exist.
-        formattedCellData->SetStretchableTextSubCellL( 0,
-            AknLayoutScalable_Avkon::list_single_pane_t1( 0 ),
-            AknLayoutScalable_Avkon::list_double_pane_vc_t1( 0 ) );
-
-        formattedCellData->SetStretchableTextSubCellL( 1,
-            AknLayoutScalable_Avkon::list_single_pane_t1( 0 ),
-            AknLayoutScalable_Avkon::list_double_pane_vc_t1( 0 ) );
+        formattedCellData->SetTextSubCellL( 0,
+            AknLayoutScalable_Avkon::list_single_pane_t1( 0 ) );
+
+        formattedCellData->SetTextSubCellL( 1,
+            AknLayoutScalable_Avkon::list_single_pane_t1( 0 ) );
         }        
 
     itemDrawer->SetItemMarkReverse( ETrue );
--- a/uifw/AvKon/src/aknmessagequerydialog.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/aknmessagequerydialog.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -51,6 +51,24 @@
 const TInt KBoldStartTagLength = 22;
 const TInt KBoldEndTagLength = 23;
 
+NONSHARABLE_CLASS(CAknAsynCallbackRunner) : public CActive
+    {
+public:
+    CAknAsynCallbackRunner( CAknMessageQueryDialogExtension* aMsgQueryExtension );
+    ~CAknAsynCallbackRunner();
+    
+public:
+// new functions
+    void AsyncCallbackRunL( TInt aCurLink );
+    
+// from CActive
+    void DoCancel();
+    void RunL();
+    
+private:
+    CAknMessageQueryDialogExtension* iMsgQueryExtension;
+    TInt iCurLink;
+    };
 
 class CAknMessageQueryDialogExtension : public CBase, public CAknExtendedInputCapabilities::MAknEventObserver,
                                         public MAknHeadingPaneTouchObserver
@@ -60,6 +78,7 @@
                                                                           iControlRegisted( EFalse ) {}
     ~CAknMessageQueryDialogExtension()
         {       
+        delete iAsyncCallbackRunner;
         TInt count = iFormatTextArray.Count();
         for ( TInt i = 0; i < count; i++ )
             {
@@ -69,13 +88,6 @@
         iFormatTextLocationArray.Close();
         iFormatTextArray.Close();
         iFormatTypeArray.Close();
-        
-        if ( iDestroyedPtr )
-            {
-            // Mark the object as destroyed.
-            *iDestroyedPtr = ETrue;
-            iDestroyedPtr = NULL;
-            }
         }
             
     /** From CAknExtendedInputCapabilities::MAknEventObserver
@@ -99,6 +111,15 @@
             iCtrl->DehighlightLink();
             }
         }
+    
+    void ExecuteLinkCallbackL( TInt aCurLink )
+        {
+        if ( !iAsyncCallbackRunner )
+            {
+            iAsyncCallbackRunner = new( ELeave ) CAknAsynCallbackRunner( this );
+            }
+        iAsyncCallbackRunner->AsyncCallbackRunL( aCurLink );
+        }
 
 public:
     
@@ -114,16 +135,49 @@
     TInt iButtonGroupPreviouslyChanged;
     CAknMessageQueryDialog* iParent;
     TBool iControlRegisted; 
-    CAknMessageQueryControl* iCtrl;
+    CAknMessageQueryControl* iCtrl;    
+    
+    TBool iIsInEditor;
     
-    /**
-    * @c iDestroyedPtr is used for the object destruction check.
-    * If it has non-null value, the destruction check is turned on, and
-    * the value points to a local boolean variable that keeps the destroyed state.
-    */
-    TBool* iDestroyedPtr;
-    TBool iIsInEditor;
+    CAknAsynCallbackRunner* iAsyncCallbackRunner;
     };
+
+CAknAsynCallbackRunner::CAknAsynCallbackRunner( 
+    CAknMessageQueryDialogExtension* aMsgQueryExtension ) : 
+    CActive( EPriorityStandard ), iMsgQueryExtension( aMsgQueryExtension )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+CAknAsynCallbackRunner::~CAknAsynCallbackRunner()
+    {
+    Cancel();
+    }
+
+void CAknAsynCallbackRunner::AsyncCallbackRunL( TInt aCurLink )
+    {
+    iCurLink = aCurLink;
+    if ( !IsActive() )
+        {        
+        iStatus = KRequestPending;
+        TRequestStatus* status = &iStatus;
+        User::RequestComplete( status, KErrNone );
+        SetActive();
+        }
+    }
+
+void CAknAsynCallbackRunner::DoCancel()
+    {
+    }
+
+void CAknAsynCallbackRunner::RunL()
+    {
+    if ( iMsgQueryExtension && iCurLink >= 0 && 
+        iCurLink < iMsgQueryExtension->iCallBackArray.Count() )
+        {
+        iMsgQueryExtension->iCallBackArray[iCurLink].CallBack();
+        }
+    }
     
 
 EXPORT_C CAknMessageQueryDialog* CAknMessageQueryDialog::NewL( TDesC& aMessage, const TTone& aTone )
@@ -1007,21 +1061,8 @@
         return EFalse;
         }
     TInt curLink = control->CurrentLink();
-    /**
-    * The local @c destroyed variable keeps track of the object destroyed state.
-    */
-    TBool destroyed = EFalse;
-    iMsgQueryExtension->iDestroyedPtr = &destroyed;
-    TRAPD( err, iMsgQueryExtension->iCallBackArray[curLink].CallBack() );
-    if ( !destroyed )
-        {
-        iMsgQueryExtension->iDestroyedPtr = NULL;
-        }
-    User::LeaveIfError( err );
-    if ( !destroyed )
-        {
-        control->DehighlightLink();
-        }
+    TRAPD( err, iMsgQueryExtension->ExecuteLinkCallbackL( curLink ) );
+    control->DehighlightLink();
     _AKNTRACE_FUNC_EXIT;
     return ETrue;
     }
--- a/uifw/AvKon/src/aknnavi.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/aknnavi.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -57,6 +57,8 @@
 #include "AknDebug.h"
 
 const TInt KAknNaviPaneStackGranularity = 2;
+
+#define Min( x , y ) ((( x ) < ( y )) ? ( x ) : ( y ))
 /**
 * Extension class for CAknNavigationControlContainer.
 */
@@ -72,7 +74,7 @@
     TBool                       iDestructionOngoing;
     CFbsBitmap*                 iNaviColorBitmap;
     TInt                        iPreferredNaviDecoratorLayoutStyle;
-    TBool                       iIsActiveIdle;
+    CEikStatusPaneBase*         iStatusPane;
     };
 
 
@@ -145,7 +147,7 @@
         iExtension->iCurrentColorScheme = ColorScheme();
         iExtension->iForegroundObserver =
             CAknNaviForegroundObserver::NewL( this );
-        iExtension->iIsActiveIdle = AknStatuspaneUtils::IsActiveIdle();
+        iExtension->iStatusPane = CEikStatusPaneBase::Current();
         }
 
     if ( !iNaviPaneControls )
@@ -1579,7 +1581,8 @@
 EXPORT_C void CAknNavigationControlContainer::Draw(
     const TRect& /*aRect*/ ) const
     {
-    if ( iExtension->iIsActiveIdle )
+    if ( iExtension->iStatusPane && 
+         iExtension->iStatusPane->IsTransparent() )
         {
         return;
         }
@@ -1924,6 +1927,24 @@
                 }
             }
 
+       TInt minOrd = -1;
+       
+       if ( titlewindow )
+           {
+           minOrd = titlewindow->OrdinalPosition();
+           }
+       
+        if( naviwindow )
+           {
+           minOrd = Min( minOrd, naviwindow->OrdinalPosition() );
+           }
+
+       if ( emptywindow )
+           {
+           minOrd = Min( minOrd, emptywindow->OrdinalPosition() );
+           }
+
+     
         const TInt last = iNaviPaneControls->Count() - 1;
         if ( ( last < 0 || !( iNaviPaneControls->At( last ) ) ) ||
              ( last >= 0 &&
@@ -1935,36 +1956,20 @@
             // Minus ordinal ordinal position number always means set
             // the window to be the last one of the windows with the same
             // ordinal priority
-            if ( iExtension->iIsActiveIdle )//Added for active idle's transparent
-            	{
+            
             if ( titlewindow )
                 {
-                titlewindow->SetOrdinalPosition( 4 );
+                titlewindow->SetOrdinalPosition( minOrd );
                 }
             if ( naviwindow )
                 {
-                naviwindow->SetOrdinalPosition( 5 );
+                naviwindow->SetOrdinalPosition( minOrd + 1  );
                 }
             if ( emptywindow )
                 {
-                emptywindow->SetOrdinalPosition( 6 );
-                }
-              }
-           else
-             {
-             if ( titlewindow )
-                {
-                titlewindow->SetOrdinalPosition( -1 );
+                emptywindow->SetOrdinalPosition( minOrd + 2 );
                 }
-            if ( naviwindow )
-                {
-                naviwindow->SetOrdinalPosition( -1 );
-                }
-            if ( emptywindow )
-                {
-                emptywindow->SetOrdinalPosition( -1 );
-                }
-             }
+             
             }
         else
             {
@@ -1972,36 +1977,19 @@
             // Minus ordinal ordinal position number always means set
             // the window to be the last one of the windows with the same
             // ordinal priority
-            if ( iExtension->iIsActiveIdle )//Added for active idle's transparent
-            	{
+           
             if ( naviwindow )
                 {
-                naviwindow->SetOrdinalPosition( 4 );
+                naviwindow->SetOrdinalPosition( minOrd );
                 }
             if ( titlewindow )
                 {
-                titlewindow->SetOrdinalPosition( 5 );
+                titlewindow->SetOrdinalPosition( minOrd + 1 );
                 }
             if ( emptywindow )
                 {
-                emptywindow->SetOrdinalPosition( 6 );
-                }
-              }
-              else
-              	{
-             if ( naviwindow )
-                {
-                naviwindow->SetOrdinalPosition( -1 );
-                }
-            if ( titlewindow )
-                {
-                titlewindow->SetOrdinalPosition( -1 );
-                }
-            if ( emptywindow )
-                {
-                emptywindow->SetOrdinalPosition( -1 );
-                }
-              	}
+                emptywindow->SetOrdinalPosition( minOrd + 2 );
+                }              	
             }
 
         // Finally request titlepane to refresh itself.
--- a/uifw/AvKon/src/aknnavilabel.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/aknnavilabel.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -241,8 +241,7 @@
 
     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
     TAknLayoutText layoutText( LayoutText() );
-    if ( AknStatuspaneUtils::StaconPaneActive() ||
-         AknStatuspaneUtils::FlatLayoutActive() )
+    if ( AknStatuspaneUtils::StaconPaneActive() )
         {
         AknsUtils::GetCachedColor( skin,
                                    color,
--- a/uifw/AvKon/src/aknsignal.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/aknsignal.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -82,7 +82,7 @@
     CFbsBitmap* iCdmaStaticIcons[5];    // non-animated icons
     CFbsBitmap* iCdmaStaticMasks[5];    // non-animated masks (needed because of AknIconUtils)
 
-    TBool       iIsActiveIdle;
+    CEikStatusPaneBase*      iStatusPane;
     };
 
 
@@ -289,7 +289,8 @@
     // off by default
     iExtension->iCdmaSignalState    = EAknSignalCdmaIndicatorOff;
     iExtension->iCdmaAnimationIndex = 0;
-    iExtension->iIsActiveIdle = AknStatuspaneUtils::IsActiveIdle();
+
+		iExtension->iStatusPane = CEikStatusPaneBase::Current();
 
     iSignalIconControl = CAknSignalIcon::NewL();
     iSignalIconControl->SetDrawBlank( EFalse );
@@ -531,8 +532,9 @@
 // ---------------------------------------------------------------------------
 //
 EXPORT_C void CAknSignalPane::Draw( const TRect& /*aRect*/ ) const
-    {
-    if ( iExtension->iIsActiveIdle )
+    {     
+    if ( iExtension->iStatusPane && 
+         iExtension->iStatusPane->IsTransparent() )
         {
         return;
         }
--- a/uifw/AvKon/src/akntabgrp.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/akntabgrp.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -2622,10 +2622,6 @@
                     iNumberOfTabsShown, positionActive + 1, &gc,
                     iExtension->iTabBackgroundLayout);
 
-            iExtension->iTabSvgGraphics->DrawTabGroupNarrowBackgroundL(
-                    CAknTabGroupGraphics::EMaskOnly, iLongTabs,
-                    iNumberOfTabsShown, positionActive + 1, &gc,
-                    iExtension->iTabBackgroundLayout);
             }
         else
             {
@@ -2647,15 +2643,6 @@
                                        : iExtension->iTabBackgroundLayout,
                     iExtension->iTabsHidden, animation);
 
-            iExtension->iTabSvgGraphics->DrawTabGroupBackgroundL(
-                    CAknTabGroupGraphics::EMaskOnly,
-                    iLongTabs,
-                    iNumberOfTabsShown,
-                    positionActive + 1,
-                    &gc,
-                    animationOngoing ? iExtension->iNextTabBackgroundLayout
-                                       : iExtension->iTabBackgroundLayout,
-                    iExtension->iTabsHidden, animation);
             }
         }
     else
--- a/uifw/AvKon/src/akntitle.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/akntitle.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -96,6 +96,8 @@
 
     TBool                    iImageAutoscaling;
     TBool                    iSmallImageAutoscaling;
+    
+    CEikStatusPaneBase*      iStatusPane;
     };
 
 
@@ -212,6 +214,9 @@
         // set flags to default values
         iExtension->iFlags = 0;
         }
+    
+    iExtension->iStatusPane = CEikStatusPaneBase::Current();
+    	
     }
 
 
@@ -676,9 +681,9 @@
 //
 EXPORT_C void CAknTitlePane::Draw( const TRect& aRect ) const
     {
-    const TUid KActiveIdle2Uid = {0x102750F0};
-
-    if ( AppUid() == KActiveIdle2Uid )
+    	      
+    if ( iExtension->iStatusPane && 
+         iExtension->iStatusPane->IsTransparent() )
         {
         CWindowGc& gc = SystemGc();
         TRgb rgb(TRgb::Color16MA(0));
--- a/uifw/AvKon/src/aknview.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/aknview.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -532,6 +532,11 @@
 //
 EXPORT_C void CAknView::HandleStatusPaneSizeChange()
 	{
+	 if ( Cba() )
+	     {
+	     TRect cbaRect( 0,0,0,0 );
+	     Cba()->SetBoundingRect( cbaRect );
+	     }
 	}
 
 // -----------------------------------------------------------------------------
--- a/uifw/AvKon/src/eikfrlbd.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/src/eikfrlbd.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -15,6 +15,12 @@
 *
 */
 
+#ifdef __ARMCC__
+#pragma push
+#pragma O3
+#pragma Otime
+#pragma arm
+#endif // __ARMCC__
 
 #include <eikfrlbd.h>
 #include <aknlists.h>
@@ -4026,6 +4032,12 @@
     }
 
 
+struct TCellInfo
+    {
+    TBool iTextNull;
+    TPtrC iTextPtr;
+    };
+
 void 
 CFormattedCellListBoxData::DrawFormattedOld( TListItemProperties& aProperties,
                                              CWindowGc& aGc,
@@ -4035,6 +4047,7 @@
                                              const TColors& aColors ) const
     {
     _AKNTRACE_FUNC_ENTER;
+    
     TRect aRect(aItemRect);
     const TColors *subcellColors = &aColors;
     
@@ -4052,31 +4065,42 @@
         font=CEikonEnv::Static()->NormalFont();
         }
     
-    TInt extraVerticalSpace=(aRect.Height()-font->HeightInPixels());
-    TInt baseLineOffset=extraVerticalSpace/2+font->AscentInPixels();
     TRect textRect=aRect;
     textRect.iBr.iX=aRect.iTl.iX;
     TInt subcell=0;
     TInt subcell2=0;
-    TPtrC text;
-    TBool textNull[30];
-    TRgb bmpBackColor, bmpForeColor;
+
+    TCellInfo textNull[30];
     TRect textShadowRect;           // For transparent list
     TRgb textShadowColour = AKN_LAF_COLOR_STATIC(215);    // Black shadow for item text.
 
-    MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() );
     TBool layoutMirrored = AknLayoutUtils::LayoutMirrored();
     TBool skinEnabled = AknsUtils::AvkonSkinEnabled();
     
-    if (!cc)
-        {
-        cc = SkinBackgroundContext();
-        }
-
-    Mem::FillZ( textNull, sizeof( textNull ) );
 
     // cache the text states.
     subcell = 0;
+    
+    SSubCell defaultCell;
+    TMargins tm = {0,0,0,0};
+    defaultCell.iPosition = TPoint(0,0);
+    defaultCell.iSize = TSize(0,0);
+    defaultCell.iRealSize = TSize(0,0);
+    defaultCell.iRealTextSize = TSize(0,0);
+    defaultCell.iMargin = tm;
+    defaultCell.iUseSubCellColors = EFalse;
+    defaultCell.iColors = defaultcolors;
+    defaultCell.iGraphics = EFalse;
+    defaultCell.iAlign = CGraphicsContext::ELeft;
+    defaultCell.iBaseline = 0;
+    defaultCell.iNumberCell = EFalse;
+    defaultCell.iTextClipGap = 0;
+    defaultCell.iNotAlwaysDrawn = EFalse;
+    defaultCell.iTransparent = EFalse;
+    defaultCell.iBaseFont = 0;
+    SSubCell* sc;
+    
+    
     for(;;)
         {
         if (subcell>lastSubCell)
@@ -4084,10 +4108,27 @@
             break;
             }
         
-        TextUtils::ColumnText(text,subcell, aText);
-        if (text == KNullDesC && SubCellIsNotAlwaysDrawn(subcell))
+        TInt subcellindex = 0;
+        TInt subcellfound = 0;
+        subcellfound = FindSubCellIndex(subcellindex,subcell);
+        if (subcellfound != KErrNotFound)
+            {
+            sc = &(iSubCellArray->At(subcellindex));
+            }
+        else
             {
-            textNull[subcell] = ETrue;
+            sc = &defaultCell;
+            }
+        
+        TextUtils::ColumnText(textNull[subcell].iTextPtr,subcell, aText);
+        
+        if (textNull[subcell].iTextPtr == KNullDesC && sc->iNotAlwaysDrawn)
+            {
+            textNull[subcell].iTextNull = ETrue;
+            }
+        else
+            {
+            textNull[subcell].iTextNull = EFalse;
             }
 
         subcell++;
@@ -4103,33 +4144,58 @@
             break;
             }
         
-        if (textNull[subcell])
+        if (textNull[subcell].iTextNull)
             {
             ++subcell;
             continue;
             }
         
-        TRect bRect(SubCellPosition(subcell),SubCellSize(subcell));
-        TMargins m(SubCellMargins(subcell));
-        TRect cRect(bRect.iTl+TSize(m.iLeft,m.iTop),bRect.Size()-TSize(m.iRight+m.iLeft,m.iBottom+m.iTop));
+        TInt subcellindex = 0;
+        TInt subcellfound = 0;
+        subcellfound = FindSubCellIndex(subcellindex,subcell);
+        if (subcellfound != KErrNotFound)
+            {
+            sc = &(iSubCellArray->At(subcellindex));
+            }
+        else
+            {
+            sc = &defaultCell;
+            }
         
-        for (subcell2=subcell+1; subcell2<=lastSubCell; subcell2++) 
+        TRect bRect = TRect(sc->iPosition,sc->iSize);
+        TMargins m = sc->iMargin;
+        TRect cRect = TRect(bRect.iTl+TSize(m.iLeft,m.iTop),bRect.Size()-TSize(m.iRight+m.iLeft,m.iBottom+m.iTop));
+        const TBool istrans = sc->iTransparent;
+        if (!layoutMirrored)
             {
-            if (textNull[subcell2])
+            for (subcell2=subcell+1; subcell2<=lastSubCell; subcell2++) 
                 {
-                continue;
-                }
-            
-            // This is called O(N^2) times - Do not put anything extra to it, it'll slow down drawing!
-            TRect bRect2 = TRect(SubCellPosition(subcell2),SubCellSize(subcell2));
-            if (cRect.Intersects(bRect2) && bRect.Intersects(bRect2) && !SubCellIsTransparent(subcell) && !SubCellIsTransparent(subcell2)) 
-                {
-                if (!layoutMirrored)
+                if (textNull[subcell2].iTextNull)
+                    {
+                    continue;
+                    }
+                
+                // This is called O(N^2) times - Do not put anything extra to it, it'll slow down drawing!
+                TRect bRect2 = TRect(SubCellPosition(subcell2),SubCellSize(subcell2));
+                if (cRect.Intersects(bRect2) && bRect.Intersects(bRect2) && !istrans && !SubCellIsTransparent(subcell2)) 
                     {
                     cRect.iBr.iX = bRect2.iTl.iX;
                     bRect.iBr.iX = bRect2.iTl.iX;
                     }
-                else
+                }
+            }
+        else
+            {
+            for (subcell2=subcell+1; subcell2<=lastSubCell; subcell2++) 
+                {
+                if (textNull[subcell2].iTextNull)
+                    {
+                    continue;
+                    }
+                
+                // This is called O(N^2) times - Do not put anything extra to it, it'll slow down drawing!
+                TRect bRect2 = TRect(SubCellPosition(subcell2),SubCellSize(subcell2));
+                if (cRect.Intersects(bRect2) && bRect.Intersects(bRect2) && !istrans && !SubCellIsTransparent(subcell2)) 
                     {
                     cRect.iTl.iX = bRect2.iBr.iX;
                     bRect.iTl.iX = bRect2.iBr.iX;
@@ -4138,6 +4204,8 @@
             }
         SetSubCellRealTextSize(subcell, cRect.Size());
         SetSubCellRealSize(subcell, bRect.Size());
+        sc->iRealTextSize = cRect.Size();
+        sc->iRealSize = bRect.Size();
         subcell++;
         }
     
@@ -4151,16 +4219,29 @@
             break;
             }
         
-        if (textNull[subcell])
+        if (textNull[subcell].iTextNull)
             {
             ++ subcell;
             continue;
             }
         
+        
+        TInt subcellindex = 0;
+        TInt subcellfound = 0;
+        subcellfound = FindSubCellIndex(subcellindex,subcell);
+        if (subcellfound != KErrNotFound)
+            {
+            sc = &(iSubCellArray->At(subcellindex));
+            }
+        else
+            {
+            sc = &defaultCell;
+            }
+        
         // SetPosition, SetSize and margins support
-        TRect bRect(SubCellPosition(subcell),SubCellRealSize(subcell));
-        TMargins m(SubCellMargins(subcell));
-        TRect cRect(bRect.iTl+TSize(m.iLeft,m.iTop),SubCellRealTextSize(subcell));
+        TRect bRect = TRect(sc->iPosition,sc->iRealSize);
+        TMargins m = sc->iMargin;
+        TRect cRect = TRect(bRect.iTl+TSize(m.iLeft,m.iTop),sc->iRealTextSize);
         
         
         if (bRect.iBr.iX == 0)
@@ -4171,19 +4252,19 @@
         
         if ( layoutMirrored ) 
             {
-            TRect bRect = TRect(SubCellPosition(subcell),SubCellSize(subcell));
+            TRect bRect = TRect(sc->iPosition,sc->iSize);
             TRect cRect2 = TRect(bRect.iTl+TSize(m.iLeft,m.iTop),bRect.Size()-TSize(m.iRight+m.iLeft,m.iBottom+m.iTop));
             
-            TInt shift = (cRect2.Size() - SubCellRealTextSize(subcell)).iWidth;
+            TInt shift = (cRect2.Size() - sc->iRealTextSize).iWidth;
             cRect.iTl.iX += shift;
             cRect.iBr.iX += shift;
             }
         
-        textRect.SetRect(aItemRect.iTl+cRect.iTl,cRect.Size());
+        textRect=TRect(aItemRect.iTl+cRect.iTl,cRect.Size());
         
-        if (UseSubCellColors(subcell))
+        if (sc->iUseSubCellColors)
             {
-            subcellColors = &SubCellColors(subcell);
+            subcellColors = &sc->iColors;
             }
         else
             {
@@ -4194,14 +4275,11 @@
             {
             aGc.SetPenColor(subcellColors->iHighlightedText);
             aGc.SetBrushColor(subcellColors->iHighlightedBack); 
-            bmpBackColor = subcellColors->iHighlightedBack;
-            bmpForeColor = subcellColors->iHighlightedText;
             if ( skinEnabled && iExtension )
                 {
                 if ( iExtension->iHighlightedTextColor != NULL )
                     {
                     aGc.SetPenColor( iExtension->iHighlightedTextColor );
-                    bmpForeColor = iExtension->iHighlightedTextColor;
                     }
                 }
             }
@@ -4209,15 +4287,12 @@
             {
             aGc.SetPenColor(subcellColors->iText);
             aGc.SetBrushColor(subcellColors->iBack);
-            bmpBackColor = subcellColors->iBack;
-            bmpForeColor = subcellColors->iText;
             
             if ( skinEnabled && iExtension )
                 {
                 if ( iExtension->iTextColor != NULL )
                     {
                     aGc.SetPenColor( iExtension->iTextColor );
-                    bmpForeColor = iExtension->iTextColor;
                     }
                 }
             }
@@ -4226,56 +4301,60 @@
         
         // The following draws subcells to textRect
         if (textRect.iBr.iX!=textRect.iTl.iX)
-            {
-            TextUtils::ColumnText(text,subcell,aText);
-            
+            {          
             // graphics or text column
-            CGraphicsContext::TTextAlign align=SubCellAlignment(subcell);
-            if (!SubCellIsGraphics(subcell))
+            CGraphicsContext::TTextAlign align=sc->iAlign;
+            if (!sc->iGraphics)
                 {
                 const CFont* rowAndCellFont=RowAndSubCellFont(iExtension->iCurrentlyDrawnItemIndex,subcell);
-                const CFont* cellFont=Font(aProperties, subcell);
+                const CFont* cellFont=sc->iBaseFont;
                 const CFont* tempFont=(cellFont) ? cellFont : font;
                 const CFont* usedFont=(rowAndCellFont) ? rowAndCellFont : tempFont;
                 aGc.UseFont(usedFont);
                 SetUnderlineStyle( aProperties, aGc, subcell );
                 
                 // baseline calc needed for each cell.
-                baseLineOffset = SubCellBaselinePos(subcell);
+                TInt baseLineOffset = sc->iBaseline;
                 baseLineOffset -= cRect.iTl.iY;
                 if (!baseLineOffset)
                     {
                     baseLineOffset = (cRect.Size().iHeight-usedFont->HeightInPixels())/2 + usedFont->AscentInPixels();
                     }
                 
-                TBuf<KMaxColumnDataLength + KAknBidiExtraSpacePerLine> clipbuf = 
-                    text.Left(KMaxColumnDataLength);
+                TBuf<KMaxColumnDataLength + KAknBidiExtraSpacePerLine> clipbuf;// = sc->iColumnText.Left(KMaxColumnDataLength);
                 
                 // Note that this potentially modifies the text so its lenght in pixels
                 // might increase. Therefore, this should always be done before
                 // wrapping/clipping text. In some cases, WordWrapListItem is called
                 // before coming here. Is it certain that it is not done for number subcells?
-                if (SubCellIsNumberCell(subcell))
+                TBool bufset = EFalse;
+                if (sc->iNumberCell)
                     {
+                    clipbuf = textNull[subcell].iTextPtr.Left(KMaxColumnDataLength);
                     AknTextUtils::LanguageSpecificNumberConversion(clipbuf);
+                    bufset = ETrue;
                     }
                 
                 TBool clipped( EFalse );
-                TInt clipgap = SubCellTextClipGap( subcell );
+                TInt clipgap = sc->iTextClipGap;
                 
                 if ( iExtension->iUseLogicalToVisualConversion &&
                      subcell != iExtension->iFirstWordWrappedSubcellIndex &&
                      subcell != iExtension->iSecondWordWrappedSubcellIndex )
                     {
                     TInt maxClipWidth = textRect.Size().iWidth + clipgap;
-                    
+                
                     clipped = AknBidiTextUtils::ConvertToVisualAndClip(
-                        text.Left(KMaxColumnDataLength), 
+                        textNull[subcell].iTextPtr.Left(KMaxColumnDataLength), 
                         clipbuf,
                         *usedFont,
-                        textRect.Size().iWidth, 
+                        textRect.Width(), 
                         maxClipWidth );
                     }
+                else if (!bufset)
+                    {
+                    clipbuf = textNull[subcell].iTextPtr.Left(KMaxColumnDataLength);
+                    }
                 
                 if (clipped) 
                     {
@@ -4319,7 +4398,7 @@
                     // Let marquee know if it needs to do bidi conversion.
                     marquee->UseLogicalToVisualConversion( clipped );
                     
-                    if ( marquee->DrawText( aGc, textRect, text, baseLineOffset, align, *usedFont ) )
+                    if ( marquee->DrawText( aGc, textRect, textNull[subcell].iTextPtr, baseLineOffset, align, *usedFont ) )
                         {
                         // All the loops have been executed -> the text needs to be truncated.
                         aGc.DrawText( clipbuf, textRect, baseLineOffset, align, 0 );
@@ -4366,7 +4445,7 @@
                 }
             else // Graphics subcell
                 {
-                TLex lex(text);
+                TLex lex(textNull[subcell].iTextPtr);
                 TInt index;
                 __ASSERT_ALWAYS(lex.Val(index)==KErrNone,Panic(EAknPanicFormattedCellListInvalidBitmapIndex));
                 __ASSERT_DEBUG(iIconArray, Panic(EAknPanicOutOfRange));
@@ -4405,14 +4484,14 @@
                     
                     TSize size=bitmap->SizeInPixels();
                     
-                    if (size.iWidth>textRect.Size().iWidth)
+                    if (size.iWidth>textRect.Width())
                         {
-                        size.iWidth = textRect.Size().iWidth;
+                        size.iWidth = textRect.Width();
                         }
                     
-                    if (size.iHeight>textRect.Size().iHeight)
+                    if (size.iHeight>textRect.Height())
                         {
-                        size.iHeight = textRect.Size().iHeight;
+                        size.iHeight = textRect.Height();
                         }
                     
                     TPoint bmpPos=textRect.iTl;
@@ -4498,6 +4577,9 @@
         }
     return NULL;
     }
-    
+
+#ifdef __ARMCC__
+#pragma pop
+#endif // __ARMCC__
     
 // End of File
--- a/uifw/AvKon/srcdata/avkon.rss	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/AvKon/srcdata/avkon.rss	Fri Mar 12 15:43:43 2010 +0200
@@ -149,6 +149,9 @@
         MENU_ITEM { command=EChinFepCmdModePinyin; txt=text_chi_input_pinyin; },
         MENU_ITEM { command=EChinFepCmdModeZhuyin; txt=text_chi_input_zhuyin; },
         MENU_ITEM { command=EChinFepCmdModeStroke; txt=text_chi_input_stroke; },
+        MENU_ITEM { command=EChinFepCmdModePinyinPhrase; flags=EEikMenuItemDimmed; txt=text_chi_input_pinyin_phrase; },
+        MENU_ITEM { command=EChinFepCmdModeZhuyinPhrase; flags=EEikMenuItemDimmed; txt=text_chi_input_zhuyin_phrase; },
+        MENU_ITEM { command=EChinFepCmdModeStrokePhrase; flags=EEikMenuItemDimmed; txt=text_chi_input_stroke_phrase; },
         MENU_ITEM { cascade=r_avkon_fep_cmd_mode_japin_edit_predict_on_submenu; command=EJapanFepCmdModePredictiveOn; flags=EEikMenuItemDimmed; txt=qtn_japin_edit_predict; },
         MENU_ITEM { cascade=r_avkon_fep_cmd_mode_japin_edit_predict_off_submenu; command=EJapanFepCmdModePredictiveOff; flags=EEikMenuItemDimmed; txt=qtn_japin_edit_predict; },
         MENU_ITEM { command=EAknCmdT9PredictiveT9Off; flags=EEikMenuItemDimmed; txt=qtn_editing_state_indicator_list_prediction_off; },
@@ -9784,6 +9787,9 @@
         MENU_ITEM { command=EChinFepCmdModePinyin; txt=text_chi_input_pinyin; },
         MENU_ITEM { command=EChinFepCmdModeZhuyin; txt=text_chi_input_zhuyin; },
         MENU_ITEM { command=EChinFepCmdModeStroke; txt=text_chi_input_stroke; },
+        MENU_ITEM { command=EChinFepCmdModePinyinPhrase; flags=EEikMenuItemDimmed; txt=text_chi_input_pinyin_phrase; },
+        MENU_ITEM { command=EChinFepCmdModeZhuyinPhrase; flags=EEikMenuItemDimmed; txt=text_chi_input_zhuyin_phrase; },
+        MENU_ITEM { command=EChinFepCmdModeStrokePhrase; flags=EEikMenuItemDimmed; txt=text_chi_input_stroke_phrase; },
         MENU_ITEM { command=EChinFepCmdModeZhuyinFind; txt=qtn_chi_find_zhuyin; },
         MENU_ITEM { command=EChinFepCmdModeStrokeFind; txt=qtn_chi_find_stroke; },
         MENU_ITEM { command=EAknCmdEditModeAlpha; flags=EEikMenuItemDimmed; txt=qtn_editing_shift_menu_alpha; },
@@ -9824,6 +9830,9 @@
         MENU_ITEM { command=EChinFepCmdModePinyin; txt=text_chi_input_pinyin; },
         MENU_ITEM { command=EChinFepCmdModeZhuyin; txt=text_chi_input_zhuyin; },
         MENU_ITEM { command=EChinFepCmdModeStroke; txt=text_chi_input_stroke; },
+        MENU_ITEM { command=EChinFepCmdModePinyinPhrase; flags=EEikMenuItemDimmed; txt=text_chi_input_pinyin_phrase; },
+        MENU_ITEM { command=EChinFepCmdModeZhuyinPhrase; flags=EEikMenuItemDimmed; txt=text_chi_input_zhuyin_phrase; },
+        MENU_ITEM { command=EChinFepCmdModeStrokePhrase; flags=EEikMenuItemDimmed; txt=text_chi_input_stroke_phrase; },
         MENU_ITEM { cascade=r_avkon_fep_cmd_mode_japin_edit_predict_on_submenu; command=EJapanFepCmdModePredictiveOn; flags=EEikMenuItemDimmed; txt=qtn_japin_edit_predict; },
         MENU_ITEM { cascade=r_avkon_fep_cmd_mode_japin_edit_predict_off_submenu; command=EJapanFepCmdModePredictiveOff; flags=EEikMenuItemDimmed; txt=qtn_japin_edit_predict; },
         MENU_ITEM { command=EAknCmdT9PredictiveT9Off; flags=EEikMenuItemDimmed; txt=qtn_editing_state_indicator_list_prediction_off; },
Binary file uifw/AvKon/tsrc/bc/bctestdom3.2/bctestdomaiwakn/sis/bctestdomaiwakn.pkg has changed
Binary file uifw/AvKon/tsrc/bc/bctestdom5.0/bctestdomaiwakn/sis/bctestdomaiwakn.pkg has changed
--- a/uifw/EikStd/EABI/EIKCOCTLU.DEF	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/EABI/EIKCOCTLU.DEF	Fri Mar 12 15:43:43 2010 +0200
@@ -2006,4 +2006,6 @@
 	_ZN11CEikListBox11MakeVisibleEi @ 2005 NONAME
 	_ZN7CEikCba25EnableItemSpecificSoftkeyEi @ 2006 NONAME
 	_ZNK11CEikListBox17ItemsInSingleLineEv @ 2007 NONAME
+	_ZN18CEikStatusPaneBase17EnableTransparentEi @ 2008 NONAME
+	_ZNK18CEikStatusPaneBase13IsTransparentEv @ 2009 NONAME
 
--- a/uifw/EikStd/bwins/EIKCOCTLU.DEF	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/bwins/EIKCOCTLU.DEF	Fri Mar 12 15:43:43 2010 +0200
@@ -1617,4 +1617,5 @@
 	?MakeVisible@CEikListBox@@UAEXH@Z @ 1616 NONAME ; void CEikListBox::MakeVisible(int)
 	?EnableItemSpecificSoftkey@CEikCba@@QAEXH@Z @ 1617 NONAME ; void CEikCba::EnableItemSpecificSoftkey(int)
 	?ItemsInSingleLine@CEikListBox@@QBEHXZ @ 1618 NONAME ; int CEikListBox::ItemsInSingleLine(void) const
-
+	?EnableTransparent@CEikStatusPaneBase@@QAEXH@Z @ 1619 NONAME ; void CEikStatusPaneBase::EnableTransparent(int)
+	?IsTransparent@CEikStatusPaneBase@@QBEHXZ @ 1620 NONAME ; int CEikStatusPaneBase::IsTransparent(void) const
--- a/uifw/EikStd/coctlinc/aknedwinphysicshandler.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlinc/aknedwinphysicshandler.h	Fri Mar 12 15:43:43 2010 +0200
@@ -126,6 +126,12 @@
      */
     TBool DragThresholdExceeded( const TPoint& aCurrentPosition ) const;
     
+    /**
+     * Disables dragging until next pointer up.
+     *
+     */
+    void DisableDragging();
+    
     
 public: // From base class MAknPhysicsObserver.
 
--- a/uifw/EikStd/coctlinc/aknitemactionmenuregister.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlinc/aknitemactionmenuregister.h	Fri Mar 12 15:43:43 2010 +0200
@@ -25,6 +25,7 @@
 class CAknItemActionMenuRegisterArray;
 class CAknItemActionMenu;
 class MObjectProvider;
+class CAknView;
 
 /**
  * Item action menu register.
@@ -239,6 +240,31 @@
      * @return Overriding object menu bar.
      */
     CEikMenuBar* OverridingObjectMenuBar();
+    
+    /**
+     * Returns pointer to component that owns the current view. This is either
+     * application UI, active view or a dialog. This component is the one that
+     * owns the possible menubar.
+     * 
+     * @return Current view owner.
+     */
+    MObjectProvider* Owner() const;
+    
+    /**
+     * Returns pointer to currently active view.
+     * 
+     * @param aAppUi Application UI.
+     * @return Active view or NULL.
+     */
+    CAknView* View( CAknAppUi* aAppUi ) const;
+    
+    /**
+     * Returns pointer to current application UI.
+     * 
+     * @return Application UI or NULL.
+     */
+    static CAknAppUi* AppUI();
+    
 
     /**
      * Registers collection to item action menu.
@@ -272,13 +298,11 @@
             CEikMenuBar& aMenuBar, CAknItemActionMenu& aItemActionMenu );
 
     /**
-     * Adds observers with aMenuBar to item action menu.
+     * Adds observers that have the same owner and aItemAction to the menu.
      * 
-     * @param aMenuBar Menu bar.
      * @param aItemActionMenu Item action menu.
      */
-    void AddObserversToItemActionMenuL(
-            CEikMenuBar* aMenuBar, CAknItemActionMenu& aItemActionMenu );
+    void AddObserversToItemActionMenuL( CAknItemActionMenu& aItemActionMenu );
 
     /**
      * Creates register instance. 
@@ -320,7 +344,8 @@
          */
         TAknUnregisteredObserverData(
                 CEikMenuBar* aMenuBar,
-                MAknCollectionObserver& aObserver );
+                MAknCollectionObserver& aObserver,
+                MObjectProvider* aOwner );
 
     public:
         /**
@@ -332,6 +357,11 @@
          * Observer.
          */
         MAknCollectionObserver& iObserver;
+        
+        /**
+         * Current menubar owner.
+         */
+        MObjectProvider* iOwner;
         };
 
     /**
--- a/uifw/EikStd/coctlinc/aknstyluspopupmenucontent.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlinc/aknstyluspopupmenucontent.h	Fri Mar 12 15:43:43 2010 +0200
@@ -195,7 +195,7 @@
      *
      * @aParam aItem Item to be selected
      */ 
-    void SelectItem( TInt aItem );
+    void SelectItemL( TInt aItem );
     
 private:
 	
--- a/uifw/EikStd/coctlsrc/AknButton.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/AknButton.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -1070,7 +1070,21 @@
     LoadButtonIcon( iPressedIcon );
     LoadButtonIcon( iHoverIcon );
     }
-
+// -----------------------------------------------------------------------------
+// CAknButtonState::UpdateExtensionInfoL
+// Updates extension information. 
+// -----------------------------------------------------------------------------
+void CAknButtonState::UpdateExtensionInfoL( TInt aResource )
+	{
+	if ( iExtension )
+		{
+		iExtension->ConfigureExtensionFromResourceL( aResource );
+		LoadButtonIcon( iIcon );
+	    LoadButtonIcon( iDimmedIcon );
+	    LoadButtonIcon( iPressedIcon );
+	    LoadButtonIcon( iHoverIcon );
+		}
+	}
 // -----------------------------------------------------------------------------
 // CAknButtonState::SizeChanged
 // Scales function graphics to the given size
--- a/uifw/EikStd/coctlsrc/EIKEDWIN.CPP	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/EIKEDWIN.CPP	Fri Mar 12 15:43:43 2010 +0200
@@ -5630,6 +5630,8 @@
     TRect viewRect( AdjustedViewRect() );
     const TInt formattedLines = Max(1, iLayout->NumFormattedLines());
     const TInt formattedHeight = iLayout->FormattedHeightInPixels();    
+    const TBool formattedHeightchanged( formattedHeight != iEdwinExtension->iRecordFormattedHeight );
+    iEdwinExtension->iRecordFormattedHeight = formattedHeight;
     const TInt viewRectHeight = viewRect.Height();
     const TInt totalChars = iText->DocumentLength();    
     const TInt formattedLength = Min( totalChars, iLayout->FormattedLength() );
@@ -5647,7 +5649,7 @@
             aVertModel.iThumbSpan = viewRectHeight;
             aVertModel.iScrollSpan = formattedHeight;            
             aVertModel.iThumbPosition = iEdwinExtension->iThumbPos;   
-            if ( aVertModel.iThumbPosition == KErrNotFound )
+            if ( aVertModel.iThumbPosition == KErrNotFound || formattedHeightchanged )
                 {
                 if ( bottomPos == totalChars )
                     {
@@ -6655,10 +6657,16 @@
         {
     case KEikDynamicLayoutVariantSwitch:
         {
+        if ( KineticScrollingEnabled() )
+            {
+            iEdwinExtension->iPhysicsHandler->DisableDragging();
+            }
+        
         iEdwinExtension->iThumbPos = KErrNotFound;
         SizeChanged();
         if ( !IsReadOnly() && !IsNonFocusing() 
-                && !( iEdwinUserFlags & EDisplayOnly ) )
+                && !( iEdwinUserFlags & EDisplayOnly )
+                && !KineticScrollingEnabled() )
             {
             TInt docPos = CursorPos();
             TRect viewRect( AdjustedViewRect() );
@@ -8565,6 +8573,7 @@
     	}
     else
     	{
+        HandleSelectionForSmiley( TCursorSelection( 0, 0 ) );
     	SetAknEditorFlags( edwinState->Flags() & ~EAknEditorFlagSelectionVisible );
     	}
     return;
--- a/uifw/EikStd/coctlsrc/EIKLBV.CPP	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/EIKLBV.CPP	Fri Mar 12 15:43:43 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 1997-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"
@@ -972,7 +972,7 @@
 
             if ( !drawingInitiated )
 			    {
-                TRect rect( ItemPos(aItemIndex), ItemSize(aItemIndex) );
+                TRect rect( ItemPos(aItemIndex), iItemDrawer->ItemCellSize() );
 			    rect.Intersection( iViewRect );
 			    iWin->Invalidate( rect );
 			    iWin->BeginRedraw( rect );
--- a/uifw/EikStd/coctlsrc/EIKMENUP.CPP	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/EIKMENUP.CPP	Fri Mar 12 15:43:43 2010 +0200
@@ -3873,6 +3873,18 @@
                 }
             iExtension->iShowCascadeTransition = ETrue;
             CloseCascadeMenu();  
+            // Submenu of submenu was closed
+            if ( iCascadeMenuPane  )
+                {
+                iCascadeMenuPane->iExtension->EnableHighlight( EFalse );
+                iCascadeMenuPane->RepaintHighlight();
+                iExtension->iDownOnMenuArea = EFalse;
+                }
+            else
+                {
+                iExtension->EnableHighlight( EFalse );
+                RepaintHighlight();            
+                }
             IgnoreEventsUntilNextPointerUp();
             _AKNTRACE( "[%s]", "HandlePointerEventL return 2" );
             _AKNTRACE_FUNC_EXIT;
@@ -4210,8 +4222,18 @@
                         //Just close sub menu
                         iExtension->iShowCascadeTransition = ETrue;
                         CloseCascadeMenu();
-                        iExtension->EnableHighlight( EFalse );
-                        RepaintHighlight();
+                        // Submenu of submenu was closed
+                        if ( iCascadeMenuPane  )
+                            {
+                            iCascadeMenuPane->iExtension->EnableHighlight( EFalse );
+                            iCascadeMenuPane->RepaintHighlight();
+                            iExtension->iDownOnMenuArea = EFalse;
+                            }
+                        else
+                            {
+                            iExtension->EnableHighlight( EFalse );
+                            RepaintHighlight();            
+                            }
                         IgnoreEventsUntilNextPointerUp();                                                                  
                         break;
                         }
@@ -4321,8 +4343,17 @@
                             }
                         iExtension->iShowCascadeTransition = ETrue;
                         CloseCascadeMenu(); //Just close sub menu.
-                        iExtension->EnableHighlight( EFalse );
-                        RepaintHighlight();
+                        // Submenu of submenu was closed
+                        if ( iCascadeMenuPane  )
+                            {
+                            iCascadeMenuPane->iExtension->EnableHighlight( EFalse );
+                            iCascadeMenuPane->RepaintHighlight();
+                            }
+                        else
+                            {
+                            iExtension->EnableHighlight( EFalse );
+                            RepaintHighlight();                        
+                            }
                         IgnoreEventsUntilNextPointerUp();
                         }
                     else
@@ -4359,7 +4390,8 @@
             TPoint drag = iExtension->iStartPoint - 
                 aPointerEvent.iPosition;
             TInt threshold = drag.iY;      
-            if( Abs( threshold ) > iExtension->iPhysics->DragThreshold() )
+            if( Abs( threshold ) > iExtension->iPhysics->DragThreshold() 
+                && iExtension->iDownOnMenuArea )
                 {
                 iExtension->iButtonDownItem = KErrNotFound;
                 iExtension->ResetPressedHighlight();
@@ -4387,7 +4419,8 @@
        
             // act in Menu Sct or Option Menu repectively
             if (( iExtension->iSct && menuSctRect.Contains(aPointerEvent.iPosition)) ||
-                ( !iExtension->iSct && innerRect.Contains(aPointerEvent.iPosition)))
+                ( !iExtension->iSct && innerRect.Contains(aPointerEvent.iPosition)) &&
+                iExtension->iDownOnMenuArea ) 
                {
                 iExtension->iDraggedOutside = EFalse;
                 // Scroll only through visible items
--- a/uifw/EikStd/coctlsrc/aknedwinphysicshandler.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/aknedwinphysicshandler.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -124,6 +124,11 @@
         }
     else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
         {
+        if ( iFlags.IsClear( EFlagDraggingAllowed ) )
+            {
+            return;
+            }
+        
         iFlags.Clear( EFlagDraggingAllowed );
         TPoint drag( 0, iStartPosition.iY - aPointerEvent.iPosition.iY );
         iPhysics->StartPhysics( drag, iStartTime );
@@ -148,6 +153,18 @@
     TSize totalSize( iViewRect.Width(), iViewRect.Height() + KMaxWorldSize );
     TSize viewSize( iViewRect.Width(), iViewRect.Height() );
 
+    
+    CTextLayout* layout = iEdwin.TextLayout();
+    
+    if ( layout )
+        {
+        TInt pixelsAbove = layout->PixelsAboveBand();
+        if ( pixelsAbove > 0 )
+            {
+            MoveScrollIndex( -pixelsAbove );
+            }
+        } 
+    
     iPhysics->InitPhysicsL( totalSize, viewSize, EFalse );
     }
 
@@ -648,3 +665,13 @@
         }
     return EFalse;
     }
+
+// ---------------------------------------------------------------------------
+// CAknEdwinPhysicsHandler::DisableDragging
+// ---------------------------------------------------------------------------
+//
+void CAknEdwinPhysicsHandler::DisableDragging()
+    {
+    iFlags.Clear( EFlagDraggingAllowed );
+    }
+    
--- a/uifw/EikStd/coctlsrc/aknitemactionmenu.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/aknitemactionmenu.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -39,9 +39,10 @@
 // ---------------------------------------------------------------------------
 //
 CAknItemActionMenu* CAknItemActionMenu::NewL(
-        MAknCollection& aCollection )
+        MAknCollection& aCollection, MObjectProvider* aOwner )
     {
-    CAknItemActionMenu* self = CAknItemActionMenu::NewLC( aCollection );
+    CAknItemActionMenu* self = CAknItemActionMenu::NewLC( 
+            aCollection, aOwner );
     CleanupStack::Pop( self );
     return self;
     }
@@ -51,9 +52,10 @@
 // CAknItemActionMenu::NewLC
 // ---------------------------------------------------------------------------
 //
-CAknItemActionMenu* CAknItemActionMenu::NewLC( MAknCollection& aCollection )
+CAknItemActionMenu* CAknItemActionMenu::NewLC(
+        MAknCollection& aCollection, MObjectProvider* aOwner )
     {
-    CAknItemActionMenu* self = new ( ELeave ) CAknItemActionMenu();
+    CAknItemActionMenu* self = new ( ELeave ) CAknItemActionMenu( aOwner );
     CleanupStack::PushL( self );
     self->ConstructL( aCollection );
     return self;
@@ -71,6 +73,12 @@
     delete iMenuPane;
     delete iMenuData;
     iStates.Close();
+    
+    for ( TInt i = 0; i < iObservers.Count(); ++i )
+        {
+        iObservers[i]->SetItemActionMenu( NULL );
+        }
+
     iObservers.Close();
     }
 
@@ -310,15 +318,26 @@
 
 
 // ---------------------------------------------------------------------------
+// CAknItemActionMenu::Owner
+// ---------------------------------------------------------------------------
+//
+ MObjectProvider* CAknItemActionMenu::Owner() const
+     {
+     return iOwner;
+     }
+
+
+// ---------------------------------------------------------------------------
 // CAknItemActionMenu::CAknItemActionMenu
 // ---------------------------------------------------------------------------
 //
-CAknItemActionMenu::CAknItemActionMenu()
+CAknItemActionMenu::CAknItemActionMenu( MObjectProvider* aOwner )
     : iPopupMenu( NULL ),
     iMenuBarObserver( NULL ),
     iMenuBar( NULL ),
     iMenuPane( NULL ),
-    iMenuData( NULL )
+    iMenuData( NULL ),
+    iOwner( aOwner )
     {
     AKNTASHOOK_ADD( this, "CAknItemActionMenu" );
     }
--- a/uifw/EikStd/coctlsrc/aknitemactionmenuregister.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/aknitemactionmenuregister.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -20,6 +20,7 @@
 #include <aknitemactionmenu.h>
 #include <eikdialg.h>
 #include <eikmenub.h>
+#include <akntrace.h>
 
 #include "aknitemactionmenuregister.h"
 #include "aknitemactionmenuregisterarray.h"
@@ -34,14 +35,16 @@
 EXPORT_C void AknItemActionMenuRegister::SetConstructingMenuBarOwnerL(
         MObjectProvider* aMenuBarOwner )
     {
-    if ( AppUiSingleClickCompatible() )
+    _AKNTRACE_FUNC_ENTER;
+
+    AknItemActionMenuRegister* instance( Instance() );
+
+    if ( instance )
         {
-        AknItemActionMenuRegister* instance( Instance() );
-        if ( instance )
-            {
-            instance->iMenuBarOwner = aMenuBarOwner;
-            }
+        instance->iMenuBarOwner = aMenuBarOwner;
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -52,6 +55,8 @@
 EXPORT_C void AknItemActionMenuRegister::SetOverridingMenuBarOwnerL(
         MObjectProvider* aMenuBarOwner, TUint /*aFlags*/ )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     if ( AppUiSingleClickCompatible() )
         {
         AknItemActionMenuRegister* instance( Instance() );
@@ -60,6 +65,8 @@
             instance->iOverridingMenuBarOwner = aMenuBarOwner;
             }
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -70,6 +77,8 @@
 CAknItemActionMenu* AknItemActionMenuRegister::RegisterCollectionL(
         MAknCollection& aCollectionState )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     CAknItemActionMenu* menu( NULL );
     if ( AppUiSingleClickCompatible() )
         {
@@ -79,6 +88,8 @@
             menu = instance->DoRegisterCollectionL( aCollectionState );
             }
         }
+
+    _AKNTRACE_FUNC_EXIT;
     return menu;
     }
 
@@ -90,6 +101,8 @@
 void AknItemActionMenuRegister::RegisterMenuBarL(
         CEikMenuBar& aMenuBar )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     if ( AppUiSingleClickCompatible() )
         {
         AknItemActionMenuRegister* instance( Instance() );
@@ -98,6 +111,8 @@
             instance->DoRegisterMenuBarL( aMenuBar );
             }
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -108,6 +123,8 @@
 void AknItemActionMenuRegister::UnregisterMenuBar(
         CEikMenuBar& aMenuBar )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     if ( AppUiSingleClickCompatible() )
         {
         AknItemActionMenuRegister* instance( Instance() );
@@ -116,7 +133,9 @@
             instance->DoUnregisterMenuBar( aMenuBar );
             }
         }
-    }
+
+    _AKNTRACE_FUNC_EXIT;
+   }
 
 
 // ---------------------------------------------------------------------------
@@ -126,11 +145,15 @@
 void AknItemActionMenuRegister::RegisterItemActionMenuL(
         CAknItemActionMenu& aItemActionMenu )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     AknItemActionMenuRegister* instance( Instance() );
     if ( instance )
         {
         instance->DoRegisterItemActionMenuL( aItemActionMenu );
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -141,6 +164,8 @@
 void AknItemActionMenuRegister::UnregisterItemActionMenu(
         CAknItemActionMenu& aItemActionMenu )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     if ( AppUiSingleClickCompatible() )
         {
         AknItemActionMenuRegister* instance( Instance() );
@@ -149,6 +174,8 @@
             instance->DoUnregisterItemActionMenu( aItemActionMenu );
             }
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -159,6 +186,8 @@
 void AknItemActionMenuRegister::RegisterCollectionObserverL(
         MAknCollectionObserver& aObserver )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     if ( AppUiSingleClickCompatible() )
         {
         AknItemActionMenuRegister* instance( Instance() );
@@ -167,6 +196,8 @@
             instance->DoRegisterCollectionObserverL( aObserver );
             }
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -177,6 +208,8 @@
 void AknItemActionMenuRegister::UnregisterCollectionObserver(
         MAknCollectionObserver& aObserver )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     if ( AppUiSingleClickCompatible() )
         {
         AknItemActionMenuRegister* instance( Instance() );
@@ -185,6 +218,8 @@
             instance->DoUnregisterCollectionObserver( aObserver );
             }
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -194,6 +229,8 @@
 //
 AknItemActionMenuRegister::~AknItemActionMenuRegister()
     {
+    _AKNTRACE_FUNC_ENTER;
+
     for ( TInt i = 0; i < iUnregisteredMenus.Count(); i++ )
         {
         TAknUnregisteredMenuData& data( iUnregisteredMenus[ i ] );
@@ -203,6 +240,8 @@
     iUnregisteredMenus.Close();
     iUnregisteredObservers.Close();
     delete iRegisterArray;
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -214,6 +253,8 @@
     : CCoeStatic( KAknItemActionMenuRegister, KRegisterDestructionPriority ),
     iMenuBarOwner( NULL )
     {
+    _AKNTRACE_FUNC_ENTER;
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -223,7 +264,11 @@
 //
 void AknItemActionMenuRegister::ConstructL()
     {
+    _AKNTRACE_FUNC_ENTER;
+
     iRegisterArray = CAknItemActionMenuRegisterArray::NewL();
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -233,9 +278,19 @@
 //
 TBool AknItemActionMenuRegister::AppUiSingleClickCompatible()
     {
-    CAknAppUi* appUi =
-        static_cast<CAknAppUi*>( CEikonEnv::Static()->AppUi() );
-    return appUi->IsSingleClickCompatible();
+    _AKNTRACE_FUNC_ENTER;
+
+    TBool isCompatible = EFalse;
+    CAknAppUi* appUi = AppUI();
+    
+    if ( appUi )
+        {
+        isCompatible = appUi->IsSingleClickCompatible();
+        }
+    
+    _AKNTRACE_FUNC_EXIT;
+
+    return isCompatible;
     }
 
 // ---------------------------------------------------------------------------
@@ -244,6 +299,8 @@
 //
 AknItemActionMenuRegister* AknItemActionMenuRegister::Instance()
     {
+    _AKNTRACE_FUNC_ENTER;
+
     AknItemActionMenuRegister* instance =
         static_cast<AknItemActionMenuRegister*>(
                 CCoeEnv::Static( KAknItemActionMenuRegister ) );
@@ -251,6 +308,9 @@
         {
         TRAP_IGNORE( instance = CreateInstanceL() ); 
         }
+
+    _AKNTRACE_FUNC_EXIT;
+
     return instance;
     }
 
@@ -262,9 +322,14 @@
 CAknItemActionMenu* AknItemActionMenuRegister::DoRegisterCollectionL(
         MAknCollection& aCollectionState )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     CAknItemActionMenu* menu( NULL );
     CEikMenuBar* menuBar = FindCurrentMenuBarL();
     menu = RegisterStateToItemActionMenuL( menuBar, aCollectionState );
+
+    _AKNTRACE_FUNC_EXIT;
+
     return menu;
     }
 
@@ -275,6 +340,8 @@
 //
 void AknItemActionMenuRegister::DoRegisterMenuBarL( CEikMenuBar& aMenuBar )
     {
+    _AKNTRACE_FUNC_ENTER;
+    
     CAknItemActionMenu* menu( NULL );
     for ( TInt i = 0; i < iUnregisteredMenus.Count(); i++ )
         {
@@ -287,11 +354,13 @@
             if ( menu )
                 {
                 AddRegisterEntryL( aMenuBar, *menu );
+                iUnregisteredMenus.Remove( i );
                 }
-            iUnregisteredMenus.Remove( i );
             break;
             }
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -301,7 +370,11 @@
 //
 void AknItemActionMenuRegister::DoUnregisterMenuBar( CEikMenuBar& aMenuBar )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     iRegisterArray->UnregisterMenuBar( aMenuBar );
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -312,6 +385,8 @@
 void AknItemActionMenuRegister::DoRegisterItemActionMenuL(
         CAknItemActionMenu& aItemActionMenu )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     CEikMenuBar* menuBar( NULL );
     for ( TInt i = 0; i < iUnregisteredMenus.Count(); i++ )
         {
@@ -322,11 +397,13 @@
             if ( menuBar )
                 {
                 AddRegisterEntryL( *menuBar, aItemActionMenu );
+                iUnregisteredMenus.Remove( i );
                 }
-            iUnregisteredMenus.Remove( i );
             break;
             }
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -337,6 +414,8 @@
 void AknItemActionMenuRegister::DoUnregisterItemActionMenu(
         CAknItemActionMenu& aItemActionMenu )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     iRegisterArray->UnregisterItemActionMenu( aItemActionMenu );
 
     for ( TInt i = 0; i < iUnregisteredMenus.Count(); i++ )
@@ -349,6 +428,8 @@
             break; 
             }
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -359,13 +440,21 @@
 void AknItemActionMenuRegister::DoRegisterCollectionObserverL(
         MAknCollectionObserver& aObserver )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     CEikMenuBar* menuBar = FindCurrentMenuBarL();
     if ( !menuBar || !iRegisterArray->RegisterCollectionObserverL(
             *menuBar, aObserver ) )
         {
-        TAknUnregisteredObserverData newData( menuBar, aObserver );
+        TAknUnregisteredObserverData newData( menuBar, 
+                aObserver, Owner() );
+        
+        
+        _AKNTRACE( "    Added observer %d", &aObserver );
         iUnregisteredObservers.AppendL( newData );
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -376,6 +465,8 @@
 void AknItemActionMenuRegister::DoUnregisterCollectionObserver(
         MAknCollectionObserver& aObserver )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     iRegisterArray->UnregisterCollectionObserver( aObserver );
 
     for ( TInt i = 0; i < iUnregisteredObservers.Count(); i++ )
@@ -384,6 +475,8 @@
         if ( &data.iObserver == &aObserver )
             {
             iUnregisteredObservers.Remove( i );
+            _AKNTRACE_FUNC_EXIT;
+
             return;
             }
         }
@@ -393,6 +486,8 @@
         TAknUnregisteredMenuData& data( iUnregisteredMenus[ i ] );
         data.iMenu->RemoveCollectionObserver( aObserver ); 
         }
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -402,9 +497,11 @@
 //
 CEikMenuBar* AknItemActionMenuRegister::DialogMenuBar( CAknAppUi* aAppUi )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     CEikMenuBar* menuBar( NULL );
     // Check if there is an active dialog and fetch its menubar
-    if ( aAppUi->IsDisplayingMenuOrDialog() )
+    if ( aAppUi && aAppUi->IsDisplayingMenuOrDialog() )
         {
         CCoeControl* ctrl = aAppUi->TopFocusedControl();
         if ( ctrl )
@@ -416,6 +513,9 @@
                 }
             }
         }
+
+    _AKNTRACE_FUNC_EXIT;
+
     return menuBar;
     }
 
@@ -426,22 +526,18 @@
 //
 CEikMenuBar* AknItemActionMenuRegister::ViewMenuBar( CAknAppUi* aAppUi )
     {
-    CEikMenuBar* menuBar( NULL );
-    CAknViewAppUi* appUi( static_cast<CAknViewAppUi*>( aAppUi ) );
+    _AKNTRACE_FUNC_ENTER;
 
-    // Check if there is an active view
-    TVwsViewId uid;
-    if ( appUi->GetActiveViewId( uid ) == KErrNone )
+    CEikMenuBar* menuBar( NULL );
+    CAknView* view = View( aAppUi );
+        
+    if ( view )
         {
-        if ( uid.iAppUid != uid.iViewUid )
-            {
-            CAknView* view = appUi->View( uid.iViewUid );
-            if ( view )
-                {
-                menuBar = view->MenuBar();
-                }
-            }
+        menuBar = view->MenuBar();
         }
+
+    _AKNTRACE_FUNC_EXIT;
+
     return menuBar;
     }
 
@@ -452,11 +548,16 @@
 //
 CEikMenuBar* AknItemActionMenuRegister::ConstructingObjectMenuBar()
     {
+    _AKNTRACE_FUNC_ENTER;
+
     CEikMenuBar* menuBar( NULL );
     if ( iMenuBarOwner )
         {
         iMenuBarOwner->MopGetObjectNoChaining( menuBar );
         }
+
+    _AKNTRACE_FUNC_EXIT;
+
     return menuBar;
     }
 
@@ -467,16 +568,112 @@
 //
 CEikMenuBar* AknItemActionMenuRegister::OverridingObjectMenuBar()
     {
+    _AKNTRACE_FUNC_ENTER;
+
     CEikMenuBar* menuBar( NULL );
     if ( iOverridingMenuBarOwner )
         {
         iOverridingMenuBarOwner->MopGetObjectNoChaining( menuBar );
         }
+
+    _AKNTRACE_FUNC_EXIT;
+
     return menuBar;
     }
 
 
 // ---------------------------------------------------------------------------
+// AknItemActionMenuRegister::Owner
+// ---------------------------------------------------------------------------
+//
+MObjectProvider* AknItemActionMenuRegister::Owner() const
+    {
+    _AKNTRACE_FUNC_ENTER;
+
+    MObjectProvider* owner = NULL;
+    CAknAppUi* appUi = AppUI();
+    
+    if ( iOverridingMenuBarOwner )
+        {
+        owner = iOverridingMenuBarOwner;
+        }
+    else
+        {
+        owner = View( appUi );
+
+        if ( !owner )
+            {
+            owner = iMenuBarOwner;
+            }
+        }
+    
+    if ( !owner )
+        {
+        owner = appUi;
+        }
+
+    __ASSERT_DEBUG( owner, User::Invariant() );
+    _AKNTRACE_FUNC_EXIT;
+
+    return owner;
+    }
+
+
+// ---------------------------------------------------------------------------
+// AknItemActionMenuRegister::View
+// ---------------------------------------------------------------------------
+//
+CAknView* AknItemActionMenuRegister::View( CAknAppUi* aAppUi ) const
+    {
+    _AKNTRACE_FUNC_ENTER;
+
+    CAknView* view = NULL;
+
+    if ( aAppUi )
+        {
+        // Check if there is an active view
+        TVwsViewId uid;
+    
+        if ( aAppUi->GetActiveViewId( uid ) == KErrNone )
+            {
+            if ( uid.iAppUid != uid.iViewUid )
+                {
+                view = static_cast<CAknViewAppUi*>(
+                        aAppUi )->View( uid.iViewUid );
+                }
+            }
+        }
+
+    _AKNTRACE_FUNC_EXIT;
+
+    return view;
+    }
+
+
+// ---------------------------------------------------------------------------
+// AknItemActionMenuRegister::AppUI
+// ---------------------------------------------------------------------------
+//
+CAknAppUi* AknItemActionMenuRegister::AppUI()
+    {
+    _AKNTRACE_FUNC_ENTER;
+
+   CAknAppUi* appUi = NULL;
+    CCoeEnv* env = CCoeEnv::Static();
+    
+    if ( env )
+        {
+        appUi = static_cast<CAknAppUi*>( env->AppUi() );
+        }
+    
+
+    _AKNTRACE_FUNC_EXIT;
+
+    return appUi;
+    }
+
+
+// ---------------------------------------------------------------------------
 // AknItemActionMenuRegister::RegisterStateToItemActionMenuL
 // ---------------------------------------------------------------------------
 //
@@ -484,6 +681,8 @@
         CEikMenuBar* aMenuBar,
         MAknCollection& aCollectionState )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     CAknItemActionMenu* menu( NULL );
 
     // View / dialog / appUi menubar was found
@@ -493,7 +692,7 @@
         // menubar does not have item action menu -> create one
         if ( !menu )
             {
-            menu = CAknItemActionMenu::NewLC( aCollectionState );
+            menu = CAknItemActionMenu::NewLC( aCollectionState, Owner() );
             AddRegisterEntryL( *aMenuBar, *menu );
             CleanupStack::Pop( menu );
             }
@@ -525,18 +724,22 @@
         // No unregistered menu found -> create one and add to list
         if ( !viewRegistered )
             {
-            menu = CAknItemActionMenu::NewL( aCollectionState );
+            menu = CAknItemActionMenu::NewLC( aCollectionState, Owner() );
             TAknUnregisteredMenuData newData;
             newData.iOwner = iMenuBarOwner;
             newData.iMenu = menu;
             iUnregisteredMenus.AppendL( newData );
+            CleanupStack::Pop( menu );
             }
         }
     if ( menu )
         {
         // Set observers with menubar to menu
-        AddObserversToItemActionMenuL( aMenuBar, *menu );
+        AddObserversToItemActionMenuL( *menu );
         }
+
+    _AKNTRACE_FUNC_EXIT;
+
     return menu;
     }
 
@@ -547,8 +750,10 @@
 //
 CEikMenuBar* AknItemActionMenuRegister::FindCurrentMenuBarL()
     {
+    _AKNTRACE_FUNC_ENTER;
+
+    CAknAppUi* appUi = AppUI();
     CEikonEnv* eikonEnv( CEikonEnv::Static() );
-    CAknAppUi* appUi( static_cast<CAknAppUi*>( eikonEnv->AppUi() ) );
     TBool isConstructingDialog( EFalse );
     CEikMenuBar* menuBar( NULL );
     
@@ -557,6 +762,7 @@
     // isn't proper one available.
     if ( iOverridingMenuBarOwner )
         {
+        _AKNTRACE_FUNC_EXIT;
         return OverridingObjectMenuBar();
         }
     
@@ -589,10 +795,13 @@
         }
 
     // Finally, if no luck with others, fetch pointer to appUi menu bar.
-    if ( !menuBar )
+    if ( !menuBar && eikonEnv )
         {
         menuBar = eikonEnv->AppUiFactory()->MenuBar();
         }
+
+    _AKNTRACE_FUNC_EXIT;
+
     return menuBar;
     }
 
@@ -604,9 +813,13 @@
 void AknItemActionMenuRegister::AddRegisterEntryL(
         CEikMenuBar& aMenuBar, CAknItemActionMenu& aItemActionMenu )
     {
+    _AKNTRACE_FUNC_ENTER;
+
     aMenuBar.SetItemActionMenu( &aItemActionMenu );
     iRegisterArray->AddEntryL( aMenuBar, aItemActionMenu );
-    AddObserversToItemActionMenuL( &aMenuBar, aItemActionMenu );
+    AddObserversToItemActionMenuL( aItemActionMenu );
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
 
@@ -615,35 +828,56 @@
 // ---------------------------------------------------------------------------
 //
 void AknItemActionMenuRegister::AddObserversToItemActionMenuL(
-        CEikMenuBar* aMenuBar, CAknItemActionMenu& aItemActionMenu )
+        CAknItemActionMenu& aItemActionMenu )
     {
-    for ( TInt i = 0; i < iUnregisteredObservers.Count(); i++ )
+    _AKNTRACE_FUNC_ENTER;
+
+    TInt i = 0;
+    
+    while ( i  < iUnregisteredObservers.Count() )
         {
-        TAknUnregisteredObserverData& data( iUnregisteredObservers[ i ] );
-        // Add if matching menubar or observer with no menubar
-        if ( data.iMenuBar == aMenuBar || !data.iMenuBar )
+        TAknUnregisteredObserverData& data( iUnregisteredObservers[i] );
+        
+        // Register to item action menu if observer's owner matches item action
+        // menu's owner.
+        if ( data.iOwner == aItemActionMenu.Owner() )
             {
+            _AKNTRACE( "    Observer %d added to item action menu", &data.iObserver );
+
             aItemActionMenu.RegisterCollectionObserverL(
                     data.iObserver );
+            
+            iUnregisteredObservers.Remove( i );
+            }
+        else
+            {
+            ++i;
             }
         }
-    iUnregisteredObservers.Reset();
+
+    _AKNTRACE_FUNC_EXIT;
     }
 
+
 // ---------------------------------------------------------------------------
 // AknItemActionMenuRegister::CreateInstanceL
 // ---------------------------------------------------------------------------
 //
 AknItemActionMenuRegister* AknItemActionMenuRegister::CreateInstanceL()
     {
+    _AKNTRACE_FUNC_ENTER;
+
     AknItemActionMenuRegister* instance = NULL; 
     instance = new ( ELeave ) AknItemActionMenuRegister();
     CleanupStack::PushL( instance );
     instance->ConstructL();
     CleanupStack::Pop( instance );
+
+    _AKNTRACE_FUNC_EXIT;
     return instance;
     }
 
+
 // ---------------------------------------------------------------------------
 // AknItemActionMenuRegister::TAknUnregisteredObserverData
 // ::TAknUnregisteredObserverData
@@ -651,12 +885,13 @@
 //
 AknItemActionMenuRegister::TAknUnregisteredObserverData::\
     TAknUnregisteredObserverData(
-        CEikMenuBar* aMenuBar, MAknCollectionObserver& aObserver )
+        CEikMenuBar* aMenuBar, MAknCollectionObserver& aObserver,
+        MObjectProvider* aOwner )
     : iMenuBar( aMenuBar ),
-    iObserver( aObserver )
+    iObserver( aObserver ),
+    iOwner( aOwner )
     {
     }
 
-
 // End of File
 
--- a/uifw/EikStd/coctlsrc/aknstyluspopupmenucontent.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/aknstyluspopupmenucontent.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -791,8 +791,7 @@
         {
         // Implementation when graphics are ready.
         }
-    else if ( aType == KEikMessageFadeAllWindows 
-              || aType == KEikDynamicLayoutVariantSwitch ) 
+    else if ( aType == KEikMessageFadeAllWindows )
         {
         if ( Observer() ) 
             {
@@ -801,6 +800,15 @@
                 MCoeControlObserver::EEventRequestExit ) );
             }    
         }            
+    else if ( aType == KEikDynamicLayoutVariantSwitch ) 
+        {
+        if ( Observer() ) 
+            {
+            // this will close the stylus popup menu
+            TRAP_IGNORE( Observer()->HandleControlEventL( this,
+                MCoeControlObserver::EEventRequestCancel ) );
+            }    
+        }            
     }
 
 // -----------------------------------------------------------------------------
@@ -1515,10 +1523,10 @@
     }
 
 // ---------------------------------------------------------------------------
-// CAknStylusPopUpMenuContent::SelectItem
+// CAknStylusPopUpMenuContent::SelectItemL
 // ---------------------------------------------------------------------------
 //     
-void CAknStylusPopUpMenuContent::SelectItem( TInt aItem )
+void CAknStylusPopUpMenuContent::SelectItemL( TInt aItem )
     {
     iCurrentItem = aItem;
     if ( Observer() )
@@ -1528,8 +1536,8 @@
             iExtension->iInformObserver = EFalse; 
             iExtension->iObserverInformed = ETrue; 
             }
-        TRAP_IGNORE(Observer()->HandleControlEventL( this,
-            MCoeControlObserver::EEventStateChanged ));
+        Observer()->HandleControlEventL( this,
+            MCoeControlObserver::EEventStateChanged );
         }
     }
     
--- a/uifw/EikStd/coctlsrc/aknstyluspopupmenuphysicshandler.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/aknstyluspopupmenuphysicshandler.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -170,7 +170,7 @@
             {
             if ( iViewRect.Contains( aPointerEvent.iPosition ) )
                 {
-                iPopUpMenuContent->SelectItem( 
+                iPopUpMenuContent->SelectItemL( 
                         iPopUpMenuContent->CurrentItem() );
                 }
             else 
--- a/uifw/EikStd/coctlsrc/akntoolbarextension.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/akntoolbarextension.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -201,7 +201,23 @@
     // construct view from resource, items are standard TBAR_CTRL structures
     iView = CAknToolbarExtensionView::NewL( aReader, this );
 
-    aReader.ReadInt32();    // extension
+    // Update the extension with given resource.
+    TInt extensionLink = aReader.ReadInt32();    // extension
+    if ( extensionLink != 0 )
+    	{
+    	CAknButtonState* state = State( 0 );
+    	if ( state )
+    		{
+    		state->UpdateExtensionInfoL( extensionLink );    		
+    		}
+    	state = State( 1 );
+    	if ( state )
+    		{
+    		state->UpdateExtensionInfoL( extensionLink );
+    		}
+    
+    	}
+    
     }
     
 // ---------------------------------------------------------------------------
--- a/uifw/EikStd/coctlsrc/akntoolbarextensionview.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/akntoolbarextensionview.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -32,6 +32,10 @@
 
 #include "aknresourceprovider.h"
 
+#ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
+#include <gfxtranseffect/gfxtranseffect.h>
+#include <akntransitionutils.h>
+#endif
 const TInt KNoItemSelected = -1; 
 const TUint32 KToolbarExtensionBgColor = 0x00000000;
 const TInt KToolBarExtensionBgAlpha = 0x7F;
@@ -70,6 +74,16 @@
 //
 CAknToolbarExtensionView::~CAknToolbarExtensionView()
     {
+#ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
+    if ( IsVisible() )
+        {
+        CAknControl::MakeVisible( EFalse );
+        }
+    if ( GfxTransEffect::IsRegistered( this ) )
+        {
+        GfxTransEffect::Deregister( this );
+        }
+#endif
     SetFocus( EFalse );
     CEikonEnv::Static()->EikAppUi()->RemoveFromStack( this );
     if ( iSelectedItem >= 0 && iSelectedItem < iItems.Count() ) 
@@ -184,9 +198,23 @@
         
         // Calling this here, so that iVisibleItems array has been updated and
         // all items visible in extension get call makevisible
+#ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
+        if ( !GfxTransEffect::IsRegistered( this ) )
+            {
+            CAknControl::MakeVisible( aVisible );
+            }            
+#else
         CAknControl::MakeVisible( aVisible );
+#endif 
         SetRect( rect );     
         DrawableWindow()->SetOrdinalPosition( 0, ECoeWinPriorityNormal );    
+#ifdef RD_UI_TRANSITION_EFFECTS_POPUPS       
+        if ( GfxTransEffect::IsRegistered( this ) )
+            {
+            CAknTransitionUtils::MakeVisibleSubComponents( this,
+                                    CAknTransitionUtils::EAppearInvisible );
+            }
+#endif
         TBool floating = !IsNonFocusing(); 
         for ( TInt i = 0; i < iItems.Count(); i++ )
             {
@@ -227,16 +255,61 @@
                 }
             iPreviousItem = KNoItemSelected;
             }
+#ifdef RD_UI_TRANSITION_EFFECTS_POPUPS        
+        if ( GfxTransEffect::IsRegistered( this ) )
+            {
+            CAknTransitionUtils::SetAllParents( this );
+            GfxTransEffect::NotifyExternalState( EInternalHandleSequence, 
+                    ( const TDesC8* )this );
+            GfxTransEffect::Begin( this, KGfxControlAppearAction );
+            GfxTransEffect::NotifyExternalState( ECaptureComponentsBegin, 
+                    ( const TDesC8* )this );
+            GfxTransEffect::SetDemarcation( this, rect );
+            CAknControl::MakeVisible( ETrue );
+            CAknTransitionUtils::MakeVisibleSubComponents( this,
+                                    CAknTransitionUtils::EAppearVisible );
+            GfxTransEffect::NotifyExternalState( ECaptureComponentsEnd, 
+                    ( const TDesC8* )this );
+            GfxTransEffect::End( this );
+            }
+        else
+            {
         DrawNow(); 
+            }
+#else
+        DrawNow();
+#endif 
         }
     else if ( !aVisible && isVisible )
         {
         CEikonEnv::Static()->EikAppUi()->UpdateStackedControlFlags( this, 
             ~0, ECoeStackFlagRefusesFocus | ECoeStackFlagRefusesAllKeys );
         CEikonEnv::Static()->EikAppUi()->HandleStackChanged();
-        CAknControl::MakeVisible( aVisible );
         TRAP_IGNORE( SelectItemL( iSelectedItem, EFalse ) ); 
-        DrawableWindow()->SetOrdinalPosition( 0, ECoeWinPriorityNeverAtFront );
+        DrawableWindow()->SetOrdinalPosition( 0, 
+                ECoeWinPriorityNeverAtFront );
+#ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
+        if ( GfxTransEffect::IsRegistered( this ) )
+            {
+            CAknTransitionUtils::SetAllParents( this );
+            GfxTransEffect::Begin( this, KGfxControlDisappearAction );
+            GfxTransEffect::NotifyExternalState( ECaptureComponentsBegin, 
+                    ( const TDesC8* )this );
+            GfxTransEffect::SetDemarcation( this, Rect() );
+            CAknControl::MakeVisible( EFalse );
+            CAknTransitionUtils::MakeVisibleSubComponents( this,
+                                    CAknTransitionUtils::EForceInvisible );
+            GfxTransEffect::NotifyExternalState( ECaptureComponentsEnd, 
+                    ( const TDesC8* )this );
+            GfxTransEffect::End( this );
+            }
+        else
+            {
+            CAknControl::MakeVisible( EFalse );
+            }
+#else
+        CAknControl::MakeVisible( EFalse );
+#endif 
         }
     else 
         {
@@ -814,6 +887,9 @@
     iSelectedItem( KNoItemSelected ), iNumberOfColumns( 1 ),
     iIsDownOutside( EFalse )
     {
+#ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
+    GfxTransEffect::Register( this, KGfxTransEffectToolbarExtensionControlUid);
+#endif
     }
 
 
@@ -956,11 +1032,8 @@
          
     if( landscape && !floating )
         {
-
-        TRect extButtonRect( iExtension->Rect() );
-
         // Calculate new y coordinate according to button middle point
-        TInt newY = extButtonRect.iTl.iY + mainPaneRect.iTl.iY;             
+        TInt newY = ( mainPaneRect.Height() - viewSize.iHeight ) / 2 + mainPaneRect.iTl.iY;            
         // Check that rect with new y fits to extension view area
         if( newY < extensionRect.iTl.iY ) // Top
             {
--- a/uifw/EikStd/coctlsrc/eikcba.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/eikcba.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -7432,7 +7432,8 @@
         else
             {
             iFlags.Clear( ECbaItemSoftkeyDisabledByClient );
-            if ( iFlags.IsSet( ECbaItemSoftkeyDisabled ) )
+            if ( iFlags.IsSet( ECbaItemSoftkeyDisabled ) &&
+                     iFlags.IsSet( ECbaItemSpecificSoftkeyInUse ) )
                 {
                 allowChange = EFalse;
                 }
--- a/uifw/EikStd/coctlsrc/eikspane.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/coctlsrc/eikspane.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -3929,9 +3929,31 @@
 	{
 	MakeVisible( aFlags & KEikStatusPaneBaseVisibleBit );
 	SetDimmed( aFlags & KEikStatusPaneBaseDimmedBit );
+	EnableTransparent( aFlags & KStatusPaneTransparentBit );
 	}
 
-
+EXPORT_C void CEikStatusPaneBase::EnableTransparent( TBool aTransparent )
+    {
+    if ( COMPARE_BOOLS( aTransparent, IsTransparent() ) )
+            {
+            return;
+            }
+    if( aTransparent )
+        {
+        iFlags |= KStatusPaneTransparentBit;
+        }
+    else
+        {
+        iFlags &= ~KStatusPaneTransparentBit;
+        }
+    DoDrawNow( EDrawDeferred );
+    
+    }
+
+EXPORT_C TBool CEikStatusPaneBase::IsTransparent() const
+    {
+    return iFlags & KStatusPaneTransparentBit;
+    }
 // ---------------------------------------------------------------------------
 // CEikStatusPaneBase::Flags
 // Returns the status pane flags.
--- a/uifw/EikStd/dlgsrc/EIKDPAGE.CPP	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/EikStd/dlgsrc/EIKDPAGE.CPP	Fri Mar 12 15:43:43 2010 +0200
@@ -2104,6 +2104,19 @@
             TRAP_IGNORE( field->CloseSelectionListL() );
             }
         }
+    // If new line is edwin, move cursor to the end of the string.
+    CEikCaptionedControl* theNewLine =  (*iLines)[aLineIndex];
+    if ( iExtension->iSetInitialFocusDone 
+    		&& IsForm()
+    		&& theNewLine->ControlIsAnEdwin( theNewLine->iControlType ) 
+    		&& theNewLine->iIsEditable )
+    	{
+        CEikEdwin* edwinPtr = STATIC_CAST( CEikEdwin*, theNewLine->iControl );
+        if( edwinPtr->Text() )
+        	{
+            edwinPtr->SetCursorPosL( edwinPtr->TextLength(), EFalse );       
+        	}
+    	}
 
     ShowFocus( EFalse, EFalse );
     iCurrentLine=aLineIndex;
--- a/uifw/ganes/inc/HgConstants.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/inc/HgConstants.h	Fri Mar 12 15:43:43 2010 +0200
@@ -27,7 +27,7 @@
 const TInt KKeyScrollingTurboModeMove(40);
 const TInt KMaxSearchLenght(128);
 const TInt KSearchEndTimeOut(1500000); // 0,5 sec
-const TInt KFocusTextFontSize(50); // biggest font available
+const TInt KFocusTextFontSize(300); // focus text font size in TWIPS
 const TInt KMaxPopupTextLength(32);
 const TInt KScrollAreaOffset(15);
 const TInt KListHighlightInnerRectShrink(10);
--- a/uifw/ganes/inc/HgVgLabel.h	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/inc/HgVgLabel.h	Fri Mar 12 15:43:43 2010 +0200
@@ -42,7 +42,7 @@
      * @param aRect Rectangle of the drawing area.
      * @return HgVgLabel-object.
      */
-    static CHgVgLabel* NewL (const TRect& aRect, const CFont* aFont, const TDesC& aText=KNullDesC); 
+    static CHgVgLabel* NewL (const TRect& aRect, const TDesC& aText=KNullDesC); 
         
     // Destructor.
     virtual ~CHgVgLabel();
@@ -51,12 +51,6 @@
     
     void SetTextL(const TDesC& aText);
     
-    void SetFont(const CFont* aFont);
-    
-    void SetColor(const TRgb& aColor);
-    
-    void SetShadowColor(const TRgb& aColor);
-        
     void Draw(const TRect& aWindowRect, TReal aAlpha=1.0);
     
     void SetLayout(const TAknTextComponentLayout& aLayout, const TRect& aParentRect);
@@ -65,7 +59,7 @@
 
 protected: // Constructors
 
-    CHgVgLabel(const TRect& aRect, const CFont* aFont);
+    CHgVgLabel(const TRect& aRect);
 
     void ConstructL (const TDesC& aText);
     
@@ -75,8 +69,6 @@
 
     TRect iRect;
     
-    const CFont* iFont;
-    
     HBufC* iText; // Item title. Own
 
     CHgVgDrawBuffer* iTextRenderer; // used to renrer text to bit gc, owns
--- a/uifw/ganes/src/HgGrid.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/src/HgGrid.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -363,13 +363,16 @@
     iLayoutData->SetItemLayout(grid_gallery2_pane(variety));
     iLayoutData->SetIconLayout(cell_gallery2_pane_g2(variety));        
     
-    for(TInt i = 0; i < iCols; ++i)
+    if( iLandscapeScrolling )
         {
-        if( iLandscapeScrolling )
+        for(TInt i = 0; i < iRows; ++i)
             {
             iLayoutData->SetColumnLayout(i, cell_gallery2_pane(variety, 0, i));            
             }
-        else
+        }
+    else
+        {
+        for(TInt i = 0; i < iCols; ++i)
             {
             iLayoutData->SetColumnLayout(i, cell_gallery2_pane(variety, i, 0));            
             }
--- a/uifw/ganes/src/HgList.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/src/HgList.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -22,6 +22,7 @@
 
 #include "HgLayoutData.h"
 #include "HgDrawUtils.h"
+#include "HgScrollbar.h"
 
 #include <aknphysics.h>
 
@@ -383,9 +384,13 @@
 TRect CHgList::ListRect() const
     {
     TRect rect(iListOffset, TSize(iWidth,iHeight));
-    TAknLayoutRect areaaftersb;
-    areaaftersb.LayoutRect(rect, iLayoutData->BaseLayout());
-    return areaaftersb.Rect();
+    if(!iScrollbar->IsStatic())
+        {
+        TAknLayoutRect areaaftersb;
+        areaaftersb.LayoutRect(rect, iLayoutData->BaseLayout());
+        rect = areaaftersb.Rect();
+        }
+    return rect;
     }
 
 // -----------------------------------------------------------------------------
--- a/uifw/ganes/src/HgPopupDrawer.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/src/HgPopupDrawer.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -30,6 +30,9 @@
 
 
 THgPopupDrawer::THgPopupDrawer()
+  : iRect(),
+    iFont (NULL),
+    iLongestMonth(0)
     {
     }
 
@@ -42,6 +45,9 @@
 
 void THgPopupDrawer::InitLongestMonth()
     {
+    // font needs to be set
+    if(!iFont) return;
+
     TTime time;
     time.HomeTime();
     TDateTime date = time.DateTime();
@@ -65,6 +71,9 @@
 
 void THgPopupDrawer::Draw( CWindowGc& aGc, const TDesC& aDesc )
     {
+    // font needs to be set
+    if(!iFont) return;
+    
     // Resolve rect for the popup "window"
     const TInt textLength = iFont->TextWidthInPixels( aDesc );
     TInt width = iRect.Width()/KPopupWidthDiv > textLength + KPopupTextExtraPadding ? 
@@ -125,6 +134,9 @@
         const TDesC& aDesc2
         )
     {
+    // font needs to be set
+    if(!iFont) return;
+
     // init longest month value.
     if(!iLongestMonth)
         InitLongestMonth();
@@ -201,6 +213,9 @@
 
 void THgPopupDrawer::InitFont(CWindowGc& aGc)
     {
+    // font needs to be set
+    if(!iFont) return;
+
     // Get color for the text from the skin.
     TRgb normal;
     AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), 
--- a/uifw/ganes/src/HgScrollbar.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/src/HgScrollbar.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -103,6 +103,8 @@
     layout.LayoutRect(aRect, AknLayoutScalable_Avkon::scroll_pane( variety ));
     iScrollbarRect = layout.Rect();
     
+    TBool prevStatic = iStatic;
+
     if((aTotalSize.iHeight <= aViewSize.iHeight && !aLandscapeScrolling)
             || (aTotalSize.iWidth <= aViewSize.iWidth && aLandscapeScrolling) )
         {
@@ -114,9 +116,12 @@
         iTotalSize = aTotalSize;
         iStatic = EFalse;
         }
+    
+    // Do we need to init the bg graphics
+    TBool initBg = (iViewSize != aViewSize) // view size has been changed 
+                    || (prevStatic != iStatic) // static value changed
+                    || (iLandscapeScrolling != aLandscapeScrolling); // different scrolling direction
 
-    TBool viewChanged = iViewSize != aViewSize;
-    
     iViewSize = aViewSize;
     iLandscapeScrolling = aLandscapeScrolling;
     iHandlePosition.SetXY(0,0);
@@ -130,7 +135,9 @@
         iTotalLength = iTotalSize.iHeight - iViewSize.iHeight;
         }
 
-    InitIconsL( viewChanged );    
+    // Don't init icons in static mode since they are not drawn
+    if(!iStatic)
+        InitIconsL( initBg );    
     }
 
 // -----------------------------------------------------------------------------
@@ -238,7 +245,8 @@
 //
 void CHgScrollbar::Draw( CWindowGc& aGc )
     {
-    DrawScrollbar( aGc );
+    if(!iStatic)
+        DrawScrollbar( aGc );
     }
 
 // -----------------------------------------------------------------------------
@@ -249,7 +257,7 @@
     {
     if(iScrollbarBg && iScrollbarHandle && iScrollbarHandleBg)
         {
-        if(iHandler && !iStatic)
+        if(iHandler)
             {
             aGc.BitBltMasked(iScrollbarRect.iTl, 
                     iScrollbarHandleBg->Bitmap(),
@@ -271,14 +279,11 @@
                     iScrollbarBg->Mask(),
                     EFalse);
 
-            if(!iStatic)
-                {
-                aGc.BitBltMasked(iScrollbarRect.iTl + iHandlePosition, 
-                        iScrollbarHandle->Bitmap(),
-                        iScrollbarHandle->Bitmap()->SizeInPixels(),
-                        iScrollbarHandle->Mask(),
-                        EFalse);
-                }
+            aGc.BitBltMasked(iScrollbarRect.iTl + iHandlePosition, 
+                    iScrollbarHandle->Bitmap(),
+                    iScrollbarHandle->Bitmap()->SizeInPixels(),
+                    iScrollbarHandle->Mask(),
+                    EFalse);
             }
         }
     }
--- a/uifw/ganes/src/HgScroller.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/src/HgScroller.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -80,8 +80,6 @@
     iIndicatorManager = CHgIndicatorManager::NewL();
 
     /*
-     * TODO: Vasco says it supports qwerty, so the variation cannot be done.
-     *          Commented out for the time being to fix a crash.
     // Enable key search only in non-touch or hybrid (touch + qwerty) devices
     if( !AknLayoutUtils::PenEnabled() ||
         CFeatureDiscovery::IsFeatureSupportedL(TUid::Uid(KFeatureIdQwertyInput)) )
@@ -372,7 +370,8 @@
 EXPORT_C CHgScroller::~CHgScroller ( )
     {
     iCoeEnv->RemoveForegroundObserver( *this );
-    
+    ReleasePopupFont();
+
     iItems.ResetAndDestroy();
 
     delete iManager;
@@ -492,8 +491,13 @@
     
     if( iPopupDrawer )
         {
-        iPopupDrawer->Init( Rect(), 
-                &ScreenFont( TCoeFont( KFocusTextFontSize, TCoeFont::EPlain ) ) );
+        ReleasePopupFont();
+
+        TFontSpec fontSpecTitle = AknLayoutUtils::FontFromId(EAknLogicalFontPrimaryFont)->FontSpecInTwips();
+        fontSpecTitle.iHeight = KFocusTextFontSize; // set height
+        iCoeEnv->ScreenDevice()->GetNearestFontInTwips(iPopupFont, fontSpecTitle);
+    
+        iPopupDrawer->Init( Rect(), iPopupFont );
         }
     
     if(iFirstTime)
@@ -771,25 +775,29 @@
             SetHighlightL();
             }
         
-        if( iFlags & EHgScrollerSelectionMode || iSelectionMode != ENoSelection ) 
-            // Marking mode or shift key pressed ( or hash )
+        // selection needs to be valid.
+        if( iSelectedIndex >= 0 && iSelectedIndex < iItems.Count() )
             {
-            if( iItems[iSelectedIndex]->Flags() & CHgItem::EHgItemFlagMarked )
-                {
-                UnMark( iSelectedIndex );
-                }
-            else
+            if( iFlags & EHgScrollerSelectionMode || iSelectionMode != ENoSelection ) 
+                // Marking mode or shift key pressed ( or hash )
                 {
-                Mark( iSelectedIndex );                    
+                if( iItems[iSelectedIndex]->Flags() & CHgItem::EHgItemFlagMarked )
+                    {
+                    UnMark( iSelectedIndex );
+                    }
+                else
+                    {
+                    Mark( iSelectedIndex );                    
+                    }
+                DrawDeferred();
                 }
-            DrawDeferred();
-            }
-        else // Selection
-            {
-            if( iSelectionToFocusedItem || !HasHighlight() )
+            else // Selection
                 {
-                if(iSelectionObserver)
-                    iSelectionObserver->HandleOpenL(iSelectedIndex);
+                if( iSelectionToFocusedItem || !HasHighlight() )
+                    {
+                    if(iSelectionObserver)
+                        iSelectionObserver->HandleOpenL(iSelectedIndex);
+                    }
                 }
             }
         }
@@ -1734,4 +1742,18 @@
     return (iActionMenu == NULL) || iShowHighlight || (iFlags & EHgScrollerForceDoubleClick);
     }
 
+// ---------------------------------------------------------------------------
+// CHgScroller::ReleasePopupFont()
+// ---------------------------------------------------------------------------
+//     
+void CHgScroller::ReleasePopupFont()
+    {
+    if (iPopupFont)
+        {
+        iCoeEnv->ScreenDevice()->ReleaseFont(iPopupFont);
+        iPopupFont = NULL;
+        }
+    }
+
+
 // End of File
--- a/uifw/ganes/src/HgVgEGL.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/src/HgVgEGL.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -74,7 +74,7 @@
 //     
 void CHgVgEGL::InitWindowSurfaceL(RWindow& aWindow)
     {
-    RDebug::Print(_L("CHgVgEGL::InitWindowSurface"));
+    //RDebug::Print(_L("CHgVgEGL::InitWindowSurface"));
 
     InitEGL(aWindow);
     }
@@ -85,7 +85,7 @@
 //     
 void CHgVgEGL::FreeWindowSurface()
     {
-    RDebug::Print(_L("CHgVgEGL::FreeWindowSurface"));
+    //RDebug::Print(_L("CHgVgEGL::FreeWindowSurface"));
 
     // make sure there is nothing pending.
     vgFinish();
@@ -239,7 +239,7 @@
     {
 
 
-    // Create surface with premodulated alpha, on IVE3 this gives better performance.
+    // Create surface with premodulated alpha.
     const EGLint KAttriblist[] = 
             {
             EGL_VG_ALPHA_FORMAT, EGL_VG_ALPHA_FORMAT_PRE,
@@ -249,12 +249,12 @@
     EGLint error = eglGetError();
     if (error == EGL_BAD_ALLOC)
         {
-        RDebug::Print(_L("CHgVgEGL:: Can't create surface! (out of memory)"));
+        //RDebug::Print(_L("CHgVgEGL:: Can't create surface! (out of memory)"));
         User::Leave(KErrNoMemory);
         }
     else if (error == EGL_BAD_SURFACE || iSurface == EGL_NO_SURFACE)
         {
-        RDebug::Print(_L("CHgVgEGL:: Can't create surface! (general)"));
+        //RDebug::Print(_L("CHgVgEGL:: Can't create surface! (general)"));
         User::Leave(KErrGeneral);
         }
     
@@ -293,7 +293,7 @@
         {
         // create temporary buffer for data
         RBuf8 buf;
-        buf.Create(aRect.Width() * dataStride);
+        buf.Create(aRect.Height() * dataStride);
         buf.Fill(0xFF);
 
         // read data from vg (this is sloooww)
--- a/uifw/ganes/src/HgVgLabel.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/src/HgVgLabel.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -43,9 +43,9 @@
 // Two-phased constructor.
 // -----------------------------------------------------------------------------
 //
-CHgVgLabel* CHgVgLabel::NewL(const TRect& aRect, const CFont* aFont, const TDesC& aText)
+CHgVgLabel* CHgVgLabel::NewL(const TRect& aRect, const TDesC& aText)
     {
-    CHgVgLabel* self = new ( ELeave ) CHgVgLabel(aRect, aFont);
+    CHgVgLabel* self = new ( ELeave ) CHgVgLabel(aRect);
     CleanupStack::PushL (self );
     self->ConstructL(aText);
     CleanupStack::Pop ( self );
@@ -100,9 +100,8 @@
 // C++ default constructor can NOT contain any code, that might leave.
 // -----------------------------------------------------------------------------
 //
-CHgVgLabel::CHgVgLabel(const TRect& aRect, const CFont* aFont) : 
+CHgVgLabel::CHgVgLabel(const TRect& aRect) : 
 iRect(aRect),
-iFont(aFont),
 iTextColor(KRgbDarkGray),
 iShadowColor(KRgbBlack),
 iDirty(ETrue)
@@ -139,37 +138,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// CHgVgLabel::SetFont()
-// -----------------------------------------------------------------------------
-//
-void CHgVgLabel::SetFont(const CFont* aFont)
-    {
-    if (aFont != iFont)
-        {
-        iFont = aFont;
-        iDirty = ETrue;
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CHgVgLabel::SetColor()
-// -----------------------------------------------------------------------------
-//
-void CHgVgLabel::SetColor(const TRgb& aColor)
-    {
-    iTextColor = aColor;
-    }
-
-// -----------------------------------------------------------------------------
-// CHgVgLabel::SetColor()
-// -----------------------------------------------------------------------------
-//
-void CHgVgLabel::SetShadowColor(const TRgb& aColor)
-    {
-    iShadowColor = aColor;
-    }
-
-// -----------------------------------------------------------------------------
 // CHgVgLabel::Draw()
 // -----------------------------------------------------------------------------
 //
--- a/uifw/ganes/src/HgVgMediaWall.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/src/HgVgMediaWall.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -108,7 +108,7 @@
     iSpring->Reset(0,0);
                 
     iAnimationTimer = CHgVgTimer::NewL();
-        
+    iDelayedInit = CPeriodic::NewL( CActive::EPriorityStandard );
     iKeyScrollingTimer = CPeriodic::NewL( CActive::EPriorityStandard );
 
     SetEmptyTextL(KNullDesC);
@@ -117,8 +117,8 @@
     CreateWindowL ( );
        
     EnableDragEvents();
-    
     ClaimPointerGrab();
+    IgnoreEventsUntilNextPointerUp();
 
     InitScreenL( aRect );
 
@@ -137,10 +137,7 @@
     ActivateL ( );
 
     SetMopParent( aParent );
-                        
-    // skin needs to be updated after parent is set.
-    iSkinRenderer->UpdateSkinL(this, this);
-    
+    SetFlags( EHgVgMediaWallDrawToWindowGC | EHgVgMediaWallUninitialized );
     }
 
 // -----------------------------------------------------------------------------
@@ -277,7 +274,7 @@
     iAnimationState(EHgVgMediaWallAnimationStateIdle),
     iScrollBarEnabled(aEnableScrollBar),
     iMediaWallStyle(aStyle),
-    iOpeningAnimationType(CHgVgMediaWall::EHgVgOpeningAnimationFlipToFront),
+    iOpeningAnimationType(CHgVgMediaWall::EHgVgOpeningAnimationNone),
     iIsForeground(ETrue),
     iUsingDefaultIcon(ETrue),
     iRowCount(1),
@@ -318,6 +315,7 @@
     delete iManager;
     delete iKeyScrollingTimer;
     delete iAnimationTimer;
+    delete iDelayedInit;
     //delete iCompositionSource;
     delete iEGL;
     delete iSpring;
@@ -357,6 +355,15 @@
     {
     //RDebug::Print(_L("CHgVgMediaWall::Draw begin"));
 
+    if(iFlags & EHgVgMediaWallUninitialized)
+        {
+        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+        MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
+        AknsDrawUtils::DrawBackground( skin, cc, this, SystemGc(), TPoint(0,0), 
+                Rect(), KAknsDrawParamDefault );
+        return;
+        }
+    
     CHgVgMediaWall* self = const_cast<CHgVgMediaWall*>(this);           
 
     if (iIsForeground)
@@ -417,34 +424,11 @@
 //
 void CHgVgMediaWall::SizeChanged ( )
     {
+    iRect = Rect();
     
-    iRect = Rect();    
-    TRAPD(error, InitRenderingL(ETrue));
-    if( error != KErrNone )
-        {
-        // if out of memory
-        if (error == KErrNoMemory)
-            {
-            // free all resources
-            FreeItemsImages();
-            // try again
-            TRAPD(error, InitRenderingL(ETrue));
-            // if still fails, need to give up
-            if (error != KErrNone)
-                {
-                User::Panic(_L("USER"), error);
-                }
-            // reload all images we can
-            ReloadItemsImages();
-            }
-        else
-            {
-            // some other error occured during initialization
-            // TODO: should we try again?
-            User::Panic(_L("USER"), error);            
-            }
-        }
-    
+    if(iDelayedInit && !iDelayedInit->IsActive())
+        iDelayedInit->Start(0, 1000000, TCallBack(DelayedInit, this));
+
     if(MTouchFeedback::Instance())
         {
         MTouchFeedback::Instance()->SetFeedbackArea(this, 
@@ -453,7 +437,6 @@
                 ETouchFeedbackBasic, 
                 ETouchEventStylusDown);        
         }
-    
     }
 
 // -----------------------------------------------------------------------------
@@ -488,7 +471,8 @@
     if( iSelectedIndex >= MaxViewPosition() )
         {
         iSpring->Reset((TReal)(MaxViewPosition()-1), 0);
-        HandleViewPositionChanged();         
+        HandleViewPositionChanged();
+        iSelectedIndex = MaxViewPosition() - 1;
         }
         
     }
@@ -499,7 +483,16 @@
 //
 void CHgVgMediaWall::HandlePointerEventL( const TPointerEvent& aEvent )
     {
-    
+    // Not faded and initialized and the drawing is set to be done to WinGc
+    if( !( iFlags & EHgVgMediaWallFaded )
+            && !( iFlags & EHgVgMediaWallUninitialized )
+            && iFlags & EHgVgMediaWallDrawToWindowGC )
+        {
+        // Draw with OpenVg to our surface.
+        ClearFlags( EHgVgMediaWallDrawToWindowGC );
+        DrawNow();
+        }
+		
     if (iAnimationState != EHgVgMediaWallAnimationStateItemOpened)
         {
             
@@ -520,10 +513,7 @@
                 DrawOpenVG();
                 }
             }
-                    
         }
-    
-    
     }
 
 // -----------------------------------------------------------------------------
@@ -1158,7 +1148,38 @@
                 if (iSkinRenderer)    
                     iSkinRenderer->UpdateSkinL(this, this);
                 )
-        }    
+        }
+    
+    if( aType == KEikMessageFadeAllWindows )
+        {
+        // make sure we are not animating
+        HandleTransitionAnimationStop();
+        
+        if (iAnimationTimer->IsActive())
+            {
+            if (iAnimationState == EHgVgMediaWallAnimationStateOpening)
+                iAnimationState = EHgVgMediaWallAnimationStateItemOpened;
+            else
+                iAnimationState = EHgVgMediaWallAnimationStateIdle;
+    
+            iAnimationTimer->Cancel();
+            }
+    
+        SetFlags( EHgVgMediaWallDrawToWindowGC | EHgVgMediaWallFaded );
+        DrawNow();
+        }
+    
+    if( aType == KEikMessageUnfadeWindows )
+        {
+        ClearFlags( EHgVgMediaWallDrawToWindowGC | EHgVgMediaWallFaded );
+        DrawNow();
+        }
+
+    if( aType == KEikDynamicLayoutVariantSwitch && !(iFlags & EHgVgMediaWallDrawToWindowGC) )
+        {
+        SetFlags( EHgVgMediaWallDrawToWindowGC );
+        DrawNow();
+        }
     }
 
 
@@ -1213,9 +1234,7 @@
     
     if (iAnimationTimer->IsActive())
         {
-        if (iAnimationState == EHgVgMediaWallAnimationStateClosing)
-            iAnimationState = EHgVgMediaWallAnimationStateIdle;
-        else if (iAnimationState == EHgVgMediaWallAnimationStateOpening)
+        if (iAnimationState == EHgVgMediaWallAnimationStateOpening)
             iAnimationState = EHgVgMediaWallAnimationStateItemOpened;
         else
             iAnimationState = EHgVgMediaWallAnimationStateIdle;
@@ -1568,10 +1587,7 @@
     iSkinRenderer->UpdateSkinL(this, this);
 
     delete iEmptyLabel; iEmptyLabel = NULL;
-    iEmptyLabel = CHgVgLabel::NewL(
-            /*TRect(TPoint(iRect.Center().iX - 100, iRect.Center().iY - 50),
-            TSize(200, 100))*/iRect, &ScreenFont( TCoeFont( KMediaWallGridPopupFontSize, TCoeFont::EPlain )), 
-            *iEmptyText);
+    iEmptyLabel = CHgVgLabel::NewL( iRect );
     
     switch (iMediaWallStyle)
         {
@@ -2358,11 +2374,10 @@
     iSpringVelocityToAnimationFactor = KMediaWallTBoneSpringVelocityToAnimationFactor;
     iItemsToMoveOnFullScreenDrag = KMediaWallTBoneItemsToMoveOnFullScreenDrag;
     iRowCount = KMediaWallTBoneRowCount;
-    iOpeningAnimationType = EHgVgOpeningAnimationZoomToFront;
     
     // get front rectange from layout
     TAknLayoutRect frontRect;
-    frontRect.LayoutRect( iRect, AknLayoutScalable_Apps::cf0_flow_pane_g1(1) );
+    frontRect.LayoutRect( iRect, AknLayoutScalable_Apps::cf0_flow_pane_g1(0) );
 
     iRenderer = CHgVgMediaWallRenderer::NewL(KMaxCoversVisible, iRect, frontRect.Rect(), 
             KMediaWallTBoneZOffset);
@@ -2438,11 +2453,9 @@
     t0.LayoutText(iRect, l0);
     t1.LayoutText(iRect, l1);            
     
-    iAlbumLabel = CHgVgLabel::NewL(t0.TextRect(), 
-                    &ScreenFont( TCoeFont( KMediaWallTBoneLabelFontSize, TCoeFont::EBold )) );
+    iAlbumLabel = CHgVgLabel::NewL( t0.TextRect() );
 
-    iArtistLabel = CHgVgLabel::NewL(t1.TextRect(), 
-            &ScreenFont( TCoeFont( KMediaWallTBoneLabelFontSize, TCoeFont::EBold )) );
+    iArtistLabel = CHgVgLabel::NewL( t1.TextRect() );
 
     iAlbumLabel->SetLayout(l0, iRect);
     iArtistLabel->SetLayout(l1, iRect);    
@@ -2459,6 +2472,26 @@
             AknLayoutScalable_Apps::cf0_flow_pane_t1(aLayoutVariant), iRect);    
     }
 
+// -----------------------------------------------------------------------------
+// CHgVgMediaWall::DelayedInit()
+// -----------------------------------------------------------------------------
+//
+TInt CHgVgMediaWall::DelayedInit( TAny* aSelf)
+    {
+    CHgVgMediaWall* self = (CHgVgMediaWall*) aSelf;
+    if(self)
+        {
+        TRAPD( error, self->InitRenderingL(ETrue); )
+        if( error == KErrNone )
+            {
+            self->iDelayedInit->Cancel();
+            self->ReloadItemsImages();
+            self->ClearFlags(EHgVgMediaWallUninitialized);
+            self->DrawDeferred();
+            }
+        }
+    return KErrNone;
+    }
 
 
 // End of File
--- a/uifw/ganes/src/HgVgScrollBar.cpp	Fri Feb 19 23:04:46 2010 +0200
+++ b/uifw/ganes/src/HgVgScrollBar.cpp	Fri Mar 12 15:43:43 2010 +0200
@@ -70,11 +70,14 @@
 //
 void CHgVgScrollBar::CreateImagesL()
     {
-    iScrollbarBg = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarBg());
-    iScrollbarBgSelected = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarBgSelected());
-    iScrollbarHandle = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarHandle());
-    iScrollbarHandleSelected = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarHandleSelected());
-    //iScrollbarHandleBg = HgVgHelper::CreateVgImageFromIconL(iScrollbar->ScrollbarHandleBg());
+    if(!iScrollbar->IsStatic())
+        {
+        iScrollbarBg = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarBg());
+        iScrollbarBgSelected = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarBgSelected());
+        iScrollbarHandle = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarHandle());
+        iScrollbarHandleSelected = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarHandleSelected());
+        //iScrollbarHandleBg = HgVgHelper::CreateVgImageFromIconL(iScrollbar->ScrollbarHandleBg());
+        }
     }
 
 
@@ -122,7 +125,7 @@
 
 void CHgVgScrollBar::Draw(const TRect& aWindowRect, TReal aAlpha) const
     {
-    if (!iEnabled)
+    if (!iEnabled || iScrollbar->IsStatic())
         return;
     
     TRect scrollbarRect = iScrollbar->ScrollbarRect();