Revision: 201025 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 15 Jul 2010 18:56:19 +0300
branchRCL_3
changeset 17 a1caeb42b3a3
parent 15 c52421ed5f07
child 18 fcdfafb36fe7
Revision: 201025 Kit: 2010127
classicui_plat/find_item_ui_api/inc/finditemdialog.h
classicui_pub/editors_api/inc/EIKEDWIN.H
classicui_pub/misc_controls_api/inc/EIKCAPC.H
classicui_pub/misc_controls_api/inc/eikcapca.h
classicui_pub/private_ui_framework_api/inc/EIKDPAGE.H
classicui_pub/ui_framework_definitions_api/inc/EIKON.HRH
commonuis/CommonUi/src/FindItemDialog.cpp
uifw/AvKon/aknhlist/src/akntreelistphysicshandler.cpp
uifw/AvKon/src/AknPopupField.cpp
uifw/AvKon/src/AknPreviewPopUp.cpp
uifw/AvKon/src/Aknslider.cpp
uifw/AvKon/src/akngrid.cpp
uifw/AvKon/srcdata/AvkonSystemSounds.ra
uifw/AvKon/srcdata/AvkonSystemSounds/default_beep.wav
uifw/AvKon/tsrc/bc/S60_SDK3.0/bctestdocandinit/src/bctestDocAndInitcase.cpp
uifw/AvKon/tsrc/bc/S60_SDK5.0/bctestdocandinit/src/bctestDocAndInitcase.cpp
uifw/EikStd/coctlinc/smileymanager.h
uifw/EikStd/coctlsrc/AknButton.cpp
uifw/EikStd/coctlsrc/AknToolbar.cpp
uifw/EikStd/coctlsrc/EIKEDWIN.CPP
uifw/EikStd/coctlsrc/EIKLBX.CPP
uifw/EikStd/coctlsrc/EIKMENUB.CPP
uifw/EikStd/coctlsrc/EIKMENUP.CPP
uifw/EikStd/coctlsrc/aknstyluspopupmenu.cpp
uifw/EikStd/coctlsrc/aknstyluspopupmenuphysicshandler.cpp
uifw/EikStd/dlginc/aknformphysics.h
uifw/EikStd/dlgsrc/EIKCAPC.CPP
uifw/EikStd/dlgsrc/EIKCAPCA.CPP
uifw/EikStd/dlgsrc/EIKDIALG.CPP
uifw/EikStd/dlgsrc/EIKDLGUT.CPP
uifw/EikStd/dlgsrc/EIKDPAGE.CPP
uifw/EikStd/dlgsrc/aknformphysics.cpp
uifw/EikStd/dlgsrc/aknrecordinggc.cpp
uifw/EikStd/srvuisrc/eikkeysoundserver.cpp
uifw/ganes/src/HgItem.cpp
uifw/ganes/src/HgScroller.cpp
uifw/ganes/src/HgVgMediaWall.cpp
--- a/classicui_plat/find_item_ui_api/inc/finditemdialog.h	Mon Jun 21 15:57:43 2010 +0300
+++ b/classicui_plat/find_item_ui_api/inc/finditemdialog.h	Thu Jul 15 18:56:19 2010 +0300
@@ -447,18 +447,6 @@
          */
         void DoHandlePointerEventL ( const TPointerEvent& aPointerEvent );
 
-        /**
-         * Returns ETrue if current item has visible highlight
-         *
-         * @return ETrue if current item has visible highlight
-         */
-        TBool CurrentItemHasHighlight();
-        
-        /**
-         * Highlights current item.
-         */
-        void HighlightCurrentItem();
-
 
     private: //data
         // Pointer to controller which controls engine and dialog
--- a/classicui_pub/editors_api/inc/EIKEDWIN.H	Mon Jun 21 15:57:43 2010 +0300
+++ b/classicui_pub/editors_api/inc/EIKEDWIN.H	Thu Jul 15 18:56:19 2010 +0300
@@ -2438,6 +2438,19 @@
 		ESuppressNotifyDraw  = 0x00000040,
 		ESuppressFormatting  = 0x00000080, // Suppresses calls to formatting
 		ESkipBackgroundDrawer = 0x00000100
+		/* NOTE : If you want to add new flags here please be carefull. There are other 
+		flags are defined as
+	    enum
+	        { // internal flags
+	        EWysiwygOn                   = 0x00000200,
+	        EUnderOneScreenFormattedText = 0x00000400,
+	        EPictureDelimits             = 0x00000800,
+	        EPunctuationDelimits         = 0x00001000,
+	        EPasteFromIrStore            = 0x00002000,
+	        ELockScrollBarState          = 0x00004000,
+	        EOnReformatting              = 0x00008000
+	        };
+	    */
         };
 
 protected: // from MEditObserver
@@ -2682,19 +2695,20 @@
      * @return Pointer to Edwin's extension. 
      */
     IMPORT_C CEikEdwinExtension* EdwinExtension();
-
 private:
-
-	enum
-		{ // internal flags
-		EWysiwygOn						=0x00000010,
-		EUnderOneScreenFormattedText	=0x00000020,
-		EPictureDelimits				=0x00000040,
-		EPunctuationDelimits			=0x00000080,
-		EPasteFromIrStore				=0x00000100,
-		ELockScrollBarState				=0x00000200,
-		EOnReformatting					=0x00000400
-		};
+    // NOTE : the follow enume and the enum TEikEdwinFlags are both used for iEdwinInternalFlags
+    // it is very easy to conflict !!! So if you want add new flag please check if it has been
+    // declared in enum TEikEdwinFlags
+    enum
+        { // internal flags
+        EWysiwygOn                   = 0x00000200,
+        EUnderOneScreenFormattedText = 0x00000400,
+        EPictureDelimits             = 0x00000800,
+        EPunctuationDelimits         = 0x00001000,
+        EPasteFromIrStore            = 0x00002000,
+        ELockScrollBarState          = 0x00004000,
+        EOnReformatting              = 0x00008000
+        };
 
 private: // from CCoeControl
 
--- a/classicui_pub/misc_controls_api/inc/EIKCAPC.H	Mon Jun 21 15:57:43 2010 +0300
+++ b/classicui_pub/misc_controls_api/inc/EIKCAPC.H	Thu Jul 15 18:56:19 2010 +0300
@@ -168,7 +168,6 @@
 public:
     TInt MaximumNumberOfControlLinesOnVisiblePage() const;
 	TInt NumberOfLines() const;
-	TInt NumberOfLinesForScrollBar() const;
 public:
     TBool ControlIsAnEdwin(TInt aControlType) const;
     TBool ControlIsAMfne(TInt aControlType) const;
@@ -212,18 +211,6 @@
 public:
     void RegisterPageWithCaptionControl(CEikDialogPage* aPage);
 
-public: // internal layout properties
-	//void SetProperties(const TRegion &aRegion, const RArray<TCapCProperty> &aProperties);
-	//TRect Line(TInt aLineIndex); // text line rectangles
-	//TInt LineIndex(TPoint aPoint);
-	//TPoint LineControlPoint(TInt aLineIndex);
-	//RArray<TInt> LineIndexesIntersecting(TRect aRect);
-	//void SetProperty(TInt aLine, TCapCProperty &aProperty);
-	//void ClearProperty(TInt aLine, TCapCProperty &aProperty);
-	//TCapCProperty Properties(TInt aLine);
-	//void LineRegions(TRegion &aRegion);
-	//void SetVisibleArea(TRect aRect);
-	//void RemoveVisibleArea();
 private: // from CCoeControl
     IMPORT_C TInt CountComponentControls() const;
     IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
@@ -264,7 +251,6 @@
     IMPORT_C void SetEditableL( TBool aEditable, TBool aShowEmptyFields = ETrue ) ;
     
     IMPORT_C void SetFormFlags( TInt aFlags ) ;
-    void GetAknLayoutValuesL() ;  // Visible within DLL only.
     TBool HasSeparator() const;
     /** GetFullCaptionText() gets caption descriptor
      *
@@ -316,33 +302,10 @@
      */    
     void SetCurrent(TBool aSelected, TBool aRedraw );
     
-protected:
-    TRect ViewRect() const;
-    TRect EditRect() const;
-
-private:
-    enum TWhichEars
-        {
-        ENoEar=0x00,
-        ELeftEar=0x01,
-        ERightEar=0x02,
-        EBothEars=0x03
-        };
 private: // new functions
-    TInt WidthForEars(TInt aWidthRemaining) const;
-    void DrawEarsNow(TWhichEars aEar) const;
-    void DrawEars(TWhichEars aEar) const;
-    void DrawSingleEar(TWhichEars aEar,TBool aPressed) const;
-    TRect EarRect(TWhichEars aEar) const;
-    void FireEarL(TWhichEars aEar,TInt aEarRepeat);
-    TInt SquashComponentWidth(TInt& aTotalWidth,const TInt aComponentWidthHint);
     void StretchComponents();
-    void SetVertEdgeSpacing( TInt aVertEdgeSpacing );
-    void SetHorzEdgeSpacing( TInt aHorzEdgeSpacing );
     void SquashComponents();
     void CalculateNumberOfLinesForControl( TInt aLines ) ;
-    void SizeDialogComponents() ;
-    void PositionDialogComponents() ;
     static TInt PictographAnimationCallBack( TAny* aPtr );
     /**
     * Sets a size for a bitmap that has already been loaded.
@@ -372,17 +335,15 @@
 public:
     void DrawClosingLine() const;
 	const CEikDialogPage* DialogPage() const { return iDialogPage; }
-	void SetPartiallyVisible( TBool aPVisible );
     TBool PressedDownState() const;
 	void SetPressedDownState( TBool aPressed );
 private:
-    TSize EditorControlSize() const ;
     void SetElementBrushColorsL( TRgb aColor ) ;
     void SetElementTextColorsL( TRgb aColor ) ;
 
     TBool ShowBitmap() const;
-    void  LayoutBitmap(const TRect& aRect);
-    void  LayoutCaption(const TRect& aRect);
+    void LayoutBitmap(const TRect& aRect);
+    void LayoutCaption(const TRect& aRect);
     void DoFormCaptionSettingsL(const TDesC& aText);
 private:
     static void FormLayoutControlBitmap(CEikImage* aBitmap, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines);
@@ -392,8 +353,6 @@
     void FormLayoutControlPopfield(CAknPopupField* aPopfield, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines, TBool aBitmapPresent, TBool aIsFocused);
     void FormLayoutControlSecretEditor(CEikSecretEditor* aSecretEd, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines, TBool aBitmapPresent, TBool aIsFocused );
     static void FormLayoutControlSlider(CAknSlider* aSlider, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines, TBool aBitmapPresent);
-    static void ConvertViewRectToEditRect(TRect& aRect);
-    static void ConvertEditRectToViewRect(TRect& aRect);
 
     /*	
     *
@@ -439,7 +398,6 @@
     CCoeControl* iControl;
     CEikCapCLabel* iCaption;
     HBufC* iCaptionText;
-
     CEikLabel* iTrailer;
     TInt iId;
     TInt iControlType;
@@ -449,42 +407,24 @@
     TBool iIsEditable ;
 
 private:
-    TBool iHasAppendedEditIndicator;
-    TSize iMinSize;
-    TInt  iCapCFlags;
-    TInt  iCaptionWidth;
-    TInt  iFullWidth;
-    TSize iNormalSize ;
-    HBufC*iToolTipText ;
-    TBool iDoNotDisplay ;
-
-    TInt iVertEdgeSpacing ;
-    TInt iHorzEdgeSpacing ;
-    TInt iOriginalHeight ;
-
-    TSize iEditorControlSize ;
-    TInt iNumberOfLines ;
-
+    TInt iSpare1[3];
+    TInt iCapCFlags;
+    TInt iCaptionWidth;
+    TInt iFullWidth;
+    TInt iSpare2[9];
+    TInt iNumberOfLines;
     friend class CEikCapCArray;
-
-    enum { ENotSupplied = -1 } ;
-    TInt iFlags ;
-
-    TBool iRefresh ;
-
-    TInt iCaptionFontId ;
-    TInt iEditorFontId ;
-    TInt iVerticalLineXPosition; //iAknTopSpacing ;         
+    enum { ENotSupplied = -1 };
+    TInt iFlags;
+    TInt iSpare3;
+    TInt iCaptionFontId;
+    TInt iEditorFontId;
+    TInt iVerticalLineXPosition;
     CCoeControl* iHighlightControl;
-    CEikCapCExtension* iExtension ;  // BC extension for additional Data members.
-    TInt iAknFormControlHeight ;
-    TInt iAknFormControlWidth ;
-    TInt iPenColor ;
-    TInt iShadowColor ;
+    CEikCapCExtension* iExtension;  // BC extension for additional Data members.
+    TInt iSpare4[4];
     TBool iIsCurrentLine;
     CEikDialogPage* iDialogPage;
-
-
     };
 
 
--- a/classicui_pub/misc_controls_api/inc/eikcapca.h	Mon Jun 21 15:57:43 2010 +0300
+++ b/classicui_pub/misc_controls_api/inc/eikcapca.h	Thu Jul 15 18:56:19 2010 +0300
@@ -112,21 +112,12 @@
   	 */
 	IMPORT_C void SetDensePacking(TBool aDensePacking);
 	TBool CalcItemIndexes(TInt &aTopItemIndex, TInt &aMiddleItems, TInt &aBottomItemIndex, TSize aAreaSize);
-	TInt NumberOfTextLines() const; // for scrollbar
-	TInt NumberOfTextLinesBeforeLine(TInt aLine) const;
-	TInt FindItemFromTextLine(TInt aTextLine) const;
 	TRect Rect() const;
 	void SetRect(const TRect& aRect, TInt aTop, TInt aMiddle, TInt aBottom);
-	TInt YPosToLine(const TRect &aRect, TInt aTop, TInt aMiddle, TInt aBottom, TInt aYCoord);
 	void CreateExtensionL();
 	CEikCapCArrayExtension *ExtensionOrNull() const;
 	
 	/**
-     * Scrolls each item by aDelta pixels in y direction.
-     */
-	TInt ScrollByPixels( TInt aDelta );
-	
-	/**
      * Return the index of the line at aYPos.
      */
 	TInt YPositionToLineIndex( TInt aYPos ) const;
@@ -159,10 +150,8 @@
     void SetRealRect( const TRect& aRect, TInt aTop, TInt aBottom );
 	
 private:
-	//TInt iCaptionWidth;
 	CEikCapCArrayExtension *iExtension;
 	TBool iDensePacking;
-	//TRect iRect;
 	};
 
 #endif
--- a/classicui_pub/private_ui_framework_api/inc/EIKDPAGE.H	Mon Jun 21 15:57:43 2010 +0300
+++ b/classicui_pub/private_ui_framework_api/inc/EIKDPAGE.H	Thu Jul 15 18:56:19 2010 +0300
@@ -184,11 +184,9 @@
      * Scrolls cached drawing commands by @c aDelta pixels in y direction.
      * 
      * @param  aDelta     A y-asix base on the sliding control's coordinate.
-     * @param  aDebugMsg  Not used.
      * @param  aDrawNow   Whether or not the view should be drawn.  
      */
     void ScrollCacheByPixels( TInt aDelta,
-                              const TDesC& aDebugMsg,
                               TBool aDrawNow = ETrue );
     
     /**
@@ -229,8 +227,6 @@
     TInt BottomFocusableLine() const;
     TBool LineIsFocusable(TInt aLine) const;
     TBool ResizeEdwinToFitTextL(CEikEdwin* aEdwin, TDrawNow aDrawNow, TSize aDesirableEdwinSize);
-    TInt YPosToLine2(TInt aYPos) const;
-    TInt LineToYPos(TInt& aLine) const;
     void ExposeLine(TInt aLine, TBool aForceResize, TBool aShowWholeLine = EFalse );
     void PassOnEventL(CCoeControl* aControl,MCoeControlObserver::TCoeEvent aEvent);
     CEikCaptionedControl* ConstructLineL(TInt aResourceId);
@@ -279,11 +275,6 @@
     void RecordLineL( TInt aLine );
     
     /**
-    * Scrolls all lines by aPixels in y direction.
-    */
-    void ScrollByPixels( TInt aDelta );
-    
-    /**
     * Removes pressed down highlight.
     */
     void RemovePressedDownHighlight();
@@ -307,9 +298,7 @@
 
 public: 
     TBool AnythingToDisplay() const;
-    void DrawVerticalLine() const;
     CEikCaptionedControl* LineOnPageOrNull(TInt aLine) const;
-    TSize RealDataSize() const;
     TInt NumberOfLines() const;
     CEikCaptionedControl* LineByIndex(TInt aIndex) const;
 
--- a/classicui_pub/ui_framework_definitions_api/inc/EIKON.HRH	Mon Jun 21 15:57:43 2010 +0300
+++ b/classicui_pub/ui_framework_definitions_api/inc/EIKON.HRH	Thu Jul 15 18:56:19 2010 +0300
@@ -220,6 +220,8 @@
 #define EAknEditorFlagEnablePartialScreen             0x200000
 #define EAknEditorFlagLaunchPenInputAutomatic         0x400000
 #define EAknEditorFlagHideTextView                    0x800000
+#define EAknEditorFlagCursorLedingEdge                0x1000000
+#define EAknEditorFlagNeedWholeTextData               0x2000000
 // NOTICE! Flag value 0x80000000 is reserved for internal use by FEP.
 
 // EIKLABEL.HRH
--- a/commonuis/CommonUi/src/FindItemDialog.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/commonuis/CommonUi/src/FindItemDialog.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -476,11 +476,6 @@
     else
         {
         DoHandlePointerEventL( aPointerEvent );
-        if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
-            {
-            iEdwin->ClearSelectionL();
-            iEdwin->DrawDeferred();
-            }
         }
     }
 
@@ -958,24 +953,6 @@
 //
 EXPORT_C void CFindItemDialog::ProcessCommandL( TInt aCommandId )
     {
-    TBool selectionVisibility ( ETrue );
-    if ( iSingleClick && iEdwin && iEdwin->TextView() )
-        {
-        selectionVisibility = iEdwin->TextView()->SelectionVisible();
-        iEdwin->TextView()->SetSelectionVisibilityL( EFalse );
-
-        CFindItemEngine::SFoundItem item;
-        TBool founditem = iController->Item( item );
-        if ( founditem )
-            {
-            iEdwin->SetSelectionL( item.iStartPos, item.iStartPos + item.iLength );
-            }
-        else
-            {
-            iEdwin->SetSelectionL( iLastTappedItem.iX, iLastTappedItem.iY );
-            }
-        }
-
     CAknDialog::ProcessCommandL( aCommandId );
     switch (aCommandId)
         {
@@ -1087,12 +1064,6 @@
             {
             if ( LaunchGenericUriL() )
                 {
-                if ( iSingleClick && iEdwin && iEdwin->TextView() )
-                    {
-                    iEdwin->TextView()->SetSelectionVisibilityL( selectionVisibility );
-                    iEdwin->ClearSelectionL();
-                    iEdwin->DrawDeferred();
-                    }
                 return;
                 }
             break;
@@ -1164,15 +1135,6 @@
             break;
             }
         }
-    if ( iSingleClick && iEdwin && iEdwin->TextView() )
-        {
-        iEdwin->TextView()->SetSelectionVisibilityL( selectionVisibility );
-        if ( aCommandId != EFindItemCmdNextItem && aCommandId != EFindItemCmdPrevItem )
-            {
-            iEdwin->ClearSelectionL();
-            }
-        iEdwin->DrawDeferred();
-        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1290,43 +1252,6 @@
 
         aMenuPane->AddMenuItemsL( resource, EAknFormMaxDefault - 1, ETrue );
 
-        if ( iSingleClick && !foundItem )
-            {
-            switch ( resource )
-                {
-                case (R_FINDITEM_MAIL_ADDRESS_MENU):
-                    {
-                    aMenuPane->SetItemDimmed ( EFindItemCmdCopy, ETrue );
-                    aMenuPane->SetItemDimmed ( EFindItemSubMenuSend, ETrue );
-                    aMenuPane->SetItemDimmed ( EFindItemCmdCreateContactCard, ETrue );
-                    break;
-                    }
-
-                case (R_FINDITEM_URL_ADDRESS_MENU):
-                    {
-                    aMenuPane->SetItemDimmed ( EFindItemCmdGoToUrl, ETrue );
-                    aMenuPane->SetItemDimmed ( EFindItemCmdAddToBookmark, ETrue );
-                    aMenuPane->SetItemDimmed ( EFindItemCmdCreateContactCard, ETrue );
-                    aMenuPane->SetItemDimmed ( EFindItemCmdCopy, ETrue );
-                    break;
-                    }
-
-                case (R_FINDITEM_PHONENUMBER_MENU): // fall through
-                case (R_FINDITEM_TELINTERNETNUMBER_MENU):
-                    {
-                    aMenuPane->SetItemDimmed ( EFindItemCmdCall, ETrue );
-                    aMenuPane->SetItemDimmed ( EFindItemCmdCopy, ETrue );
-                    aMenuPane->SetItemDimmed ( EFindItemSubMenuSend, ETrue );
-                    aMenuPane->SetItemDimmed ( EFindItemCmdCreateContactCard, ETrue );
-                    break;
-                    }
-
-                default:
-                    {
-                    break;
-                    }
-                }
-            }
 
         if ( iSearchCase == KSearchTelInternetNumber &&
             iFindItemVoIPExtension->VoIPProfilesExistL() ||
@@ -1354,13 +1279,10 @@
             iSearchCase & CFindItemEngine::EFindItemSearchPhoneNumberBin &&
             !iHideCallMenu )
             {
-            if ( !iSingleClick || foundItem )
-                {
-                aMenuPane->SetItemDimmed( EFindItemCmdCall, ETrue );
-                aMenuPane->AddMenuItemsL(
-                    R_FINDITEM_CALLUI_AIW_ITEM,
-                    EFindItemCmdCall );
-                }
+            aMenuPane->SetItemDimmed( EFindItemCmdCall, ETrue );
+            aMenuPane->AddMenuItemsL(
+                R_FINDITEM_CALLUI_AIW_ITEM,
+                EFindItemCmdCall );
             }
 
         aMenuPane->DeleteMenuItem( EAknFormCmdEdit );
@@ -1370,20 +1292,14 @@
         aMenuPane->DeleteMenuItem( EAknFormCmdDelete );
 
 #ifndef RD_VIRTUAL_PHONEBOOK
-        if ( !iSingleClick || foundItem )
-            {
-            iPbkDataSave->AddMenuItemsL(
-                aMenuPane,
-                EFindItemCmdCreateContactCard );
-            }
+        iPbkDataSave->AddMenuItemsL(
+            aMenuPane,
+            EFindItemCmdCreateContactCard );
 #else
-        if ( !iSingleClick || foundItem )
-            {
-            aMenuPane->SetItemDimmed( EFindItemCmdCreateContactCard, ETrue );
-            aMenuPane->AddMenuItemsL(
-                R_FINDITEM_CONTACTS_AIW_ITEM,
-                EFindItemCmdCreateContactCard );
-            }
+        aMenuPane->SetItemDimmed( EFindItemCmdCreateContactCard, ETrue );
+        aMenuPane->AddMenuItemsL(
+            R_FINDITEM_CONTACTS_AIW_ITEM,
+            EFindItemCmdCreateContactCard );
 #endif // !RD_VIRTUAL_PHONEBOOK
 
         // Delete next/prev item items from menu if a last/next
@@ -1452,54 +1368,24 @@
     switch ( code )
         {
         case EKeyRightArrow:
-            if ( iSingleClick && !CurrentItemHasHighlight() )
-                {
-                HighlightCurrentItem();
-                break;
-                }
             iController->NextItemL();
             break;
         case EKeyDownArrow:
-            if ( iSingleClick && !CurrentItemHasHighlight() )
-                {
-                HighlightCurrentItem();
-                break;
-                }
             iController->MoveDownL();   
             break;
         case EKeyLeftArrow:
-            if ( iSingleClick && !CurrentItemHasHighlight() )
-                {
-                HighlightCurrentItem();
-                break;
-                }
             iController->PrevItemL();	
             break;
         case EKeyUpArrow:
-            if ( iSingleClick && !CurrentItemHasHighlight() )
-                {
-                HighlightCurrentItem();
-                break;
-                }
             iController->MoveUpL();
             break;
         case EKeyOK:
         case EKeyEnter:
-            if ( iSingleClick && !CurrentItemHasHighlight() )
-                {
-                HighlightCurrentItem();
-                break;
-                }
             iIsSensitiveMenu = ETrue;
             iMenuBar->SetMenuType(CEikMenuBar::EMenuContext);
             CAknDialog::DisplayMenuL();
             break;
         case EKeyPhoneSend:
-            if ( iSingleClick && !CurrentItemHasHighlight() )
-                {
-                HighlightCurrentItem();
-                break;
-                }
 
             if ( !iDialData )
                 {
@@ -1926,10 +1812,7 @@
         UpdateScrollIndicatorL();
 
         iEdwin->TextView()->SetSelectionVisibilityL( ETrue );
-        if ( !iSingleClick )
-            {
-            iEdwin->SetSelectionL( item.iStartPos, item.iLength + item.iStartPos );
-            }
+        iEdwin->SetSelectionL( item.iStartPos, item.iLength + item.iStartPos );
         }
     else
         {// Let's show a information note if no items were found
@@ -2406,49 +2289,6 @@
         }    
     }
 
-// ----------------------------------------------------------------------------
-// CFindItemDialog::CurrentItemHasHighlight
-// ----------------------------------------------------------------------------
-//
-TBool CFindItemDialog::CurrentItemHasHighlight()
-    {
-    CFindItemEngine::SFoundItem item;
-    TBool foundItem = iController->Item( item );
-
-    // foundItem remains as ETrue, if item found by controller is exactly
-    // same as highlighted selection
-    
-    TCursorSelection selection( iEdwin->Selection() );
-    TInt selectionLength = iEdwin->SelectionLength();
-
-    foundItem = foundItem && ( ( item.iLength == selectionLength ) && ( item.iStartPos == Min( selection.iCursorPos, selection.iAnchorPos ) ) );
-
-    foundItem = foundItem && ( iEdwin && iEdwin->TextView()
-        && iEdwin->TextView()->SelectionVisible() );
-
-    return foundItem;
-    }
-
-// ----------------------------------------------------------------------------
-// CFindItemDialog::HighlightCurrentItem
-// ----------------------------------------------------------------------------
-//
-void CFindItemDialog::HighlightCurrentItem()
-    {
-    CFindItemEngine::SFoundItem item;
-    TBool found = iController->Item( item );
-
-    if ( found && iEdwin && iEdwin->TextView() )
-        {
-        TRAPD( err, iEdwin->TextView()->SetSelectionVisibilityL( ETrue ) );
-        if ( KErrNone == err )
-            {
-            //When set selection leaves, we can't highlight the item, so just ignore this leave.
-            TRAP_IGNORE( iEdwin->SetSelectionL( item.iStartPos, item.iStartPos + item.iLength ) );
-            }
-        }
-    }
-
 
 //
 // CONTAINER CLASS
--- a/uifw/AvKon/aknhlist/src/akntreelistphysicshandler.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/AvKon/aknhlist/src/akntreelistphysicshandler.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -261,7 +261,7 @@
     if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
         {
         iTreeListView->SetPressedDownState( EFalse );
-        if ( iTreeListView->SingleClickEnabled() && !aMarking )
+        if ( iTreeListView->SingleClickEnabled() )
             {
             iHighlightTimer->Cancel();
             iTreeListView->EnableHighlight( EFalse );
@@ -337,7 +337,7 @@
                  }
             }
 
-        if ( iItemToBeSelected != NULL && !aMarking)
+        if ( iItemToBeSelected != NULL && !aMarking )
             {
             iTreeListView->SelectItem( iItemToBeSelected );
             iItemToBeSelected = NULL;
@@ -355,7 +355,7 @@
     
         if ( item && (*iItems)[ii].Rect().Contains( adjustedPosition ) )
             {        
-            if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
+            if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
                 {            
                 // Marking mode 
                 if ( aMarking )
@@ -363,16 +363,26 @@
                     TBool drawNow = ( item == iTreeListView->FocusedItem() );    
                     if ( aShiftPressed )
                         {
-                        iTreeListView->MarkItems( iTreeListView->FocusedItem(), item,
-                            !item->IsMarked(), drawNow );
+                        if ( iTreeListView->HighlightEnabled() )
+                            {
+                            iTreeListView->MarkItems( iTreeListView->FocusedItem(), item,
+                                    !item->IsMarked(), drawNow );
+                            }
+                        else
+                            {
+                            iTreeListView->MarkItem( item, !item->IsMarked(), drawNow );
+                            }
                         }
                     else if ( aCtrlPressed )
                         {
                         iTreeListView->MarkItem( item, !item->IsMarked(), drawNow );
                         }
-                    }  
-                else if ( iTreeListView->SingleClickEnabled() 
-                          && !wasFlicking  )                    
+                    } 
+                }
+            else if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
+                {     
+                if ( iTreeListView->SingleClickEnabled() 
+                        && !wasFlicking  && !aMarking )                    
                     {
                     iItemToBeSelected = item;             
                     iTreeListView->SetFocusedItem( item, ii, EFalse );
@@ -430,21 +440,12 @@
                         iPlayFeedbackOnUp = ETrue;
                         }
                     }
-                if ( !aMarking )
+                // timer will be launched everytime, but not
+                // if flicking was ongoing AND it was stopped by tapping 
+                // to highlighted item or to folder (=node)   
+                if ( !( wasFlicking && iItemToBeSelected != NULL ) )
                     {
-                    // timer will be launched everytime, but not
-                    // if flicking was ongoing AND it was stopped by tapping 
-                    // to highlighted item or to folder (=node)   
-                    if ( !( wasFlicking && iItemToBeSelected != NULL ) )
-                        {
-                        LaunchHighlightTimer( wasScrolling );
-                        }
-                    }
-                else
-                    {
-                    // Pressed down highlight or highlight timer 
-                    // are not used in marking mode.
-                    SetHighlight();   
+                    LaunchHighlightTimer( wasScrolling );
                     }
                 }                      
             else if ( aPointerEvent.iType == TPointerEvent::EDrag )
@@ -824,12 +825,6 @@
     TUint /*aFlags*/ )
     {
     iScrollIndex = aNewPosition.iY - iViewRect.Height() / 2;
-    TTouchFeedbackType feedbackType = ETouchFeedbackVibra;
-    if ( iPhysics->OngoingPhysicsAction() 
-        == CAknPhysics::EAknPhysicsActionDragging )
-        {
-        feedbackType = static_cast<TTouchFeedbackType>(ETouchFeedbackAudio | ETouchFeedbackVibra);
-        }
     if ( iPhysics->OngoingPhysicsAction() 
             == CAknPhysics::EAknPhysicsActionBouncing )
         {
@@ -905,7 +900,7 @@
                 if ( bottomItem != iTree->VisibleItemCount() - 1 )
                     iFeedback->InstantFeedback( iTreeListView,
                                                 ETouchFeedbackSensitiveList,
-                                                feedbackType,
+                                                ETouchFeedbackVibra,
                                                 TPointerEvent() );
                 }
             }
@@ -915,7 +910,7 @@
                 {
                 iFeedback->InstantFeedback( iTreeListView,
                                             ETouchFeedbackSensitiveList,
-                                            feedbackType,
+                                            ETouchFeedbackVibra,
                                             TPointerEvent() );
                 }
             }
@@ -925,7 +920,7 @@
                 {
                 iFeedback->InstantFeedback( iTreeListView,
                                             ETouchFeedbackSensitiveList,
-                                            feedbackType,
+                                            ETouchFeedbackVibra,
                                             TPointerEvent() );
                 }
             }
--- a/uifw/AvKon/src/AknPopupField.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/AvKon/src/AknPopupField.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -219,15 +219,15 @@
 void CAknPopupField::SetScrollBarSelectionL()
     {
     TInt selection = iValue->CurrentValueIndex();
+    //iOldItemIndex should be saved as original value.
+    if ( iExtension )
+        {
+        iExtension->iOldItemIndex = selection;
+        }
     if (IsInvalid()) selection = 0;
     __ASSERT_DEBUG(iSelectionList != NULL, Panic(EAknPanicPopupFieldSelectionListDoesntExist));
     iSelectionList->SetCurrentItemIndex(selection);
     iSelectionList->View()->SelectItemL(selection);
-
-    if ( iExtension )
-        {
-        iExtension->iOldItemIndex = iSelectionList->CurrentItemIndex();
-        }
     }
 
 
--- a/uifw/AvKon/src/AknPreviewPopUp.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/AvKon/src/AknPreviewPopUp.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -30,10 +30,11 @@
 #include <aknview.h>
 #include <apgwgnam.h>
 #include <aknlayoutscalable_avkon.cdl.h>
-
+#include <akntransitionutils.h>
 #include <AknTasHook.h> // for testability hooks
 #include <touchfeedback.h>
 #include <gfxtranseffect/gfxtranseffect.h>
+#include <akntranseffect.h>
 #include <akntransitionutils.h>
 const TInt KWindowPosition = 1000;             // window's position
 
@@ -573,10 +574,16 @@
                     
                     if ( aPointerEvent.iType != TPointerEvent::EButton1Up )
                         {
+                        // popup will be hiden when EButton1Down comes.
                         MTouchFeedback* feedback = MTouchFeedback::Instance();
                         if ( feedback )
                             {
-                            feedback->InstantFeedback( ETouchFeedbackPopUp );
+                            TTouchLogicalFeedback feedbackType = ETouchFeedbackPopUp;
+                            if ( CAknTransitionUtils::TransitionsEnabled( AknTransEffect::EComponentTransitionsOff ) )
+                                {
+                                feedbackType = ETouchFeedbackOptionsMenuClosed;
+                                }
+                            feedback->InstantFeedback( feedbackType );
                             }        
                         iCloseMenu = ETrue; 
                         iController.HidePopUp(); 
@@ -600,13 +607,19 @@
                             }
                         else
                             {
+                            // popup will be hiden when EButton1Down comes.
+                            TTouchLogicalFeedback feedbackType = ETouchFeedbackPopUp;
+                            if ( CAknTransitionUtils::TransitionsEnabled( AknTransEffect::EComponentTransitionsOff ) )
+                                {
+                                feedbackType = ETouchFeedbackOptionsMenuClosed;
+                                }
                             feedback->InstantFeedback( this,
-                                                       ETouchFeedbackPopUp,
+                                                       feedbackType,
                                                        aPointerEvent );
                             }
                         }
                     iCloseMenu = ETrue;
-                    iController.HidePopUp();    
+                    iController.HidePopUp();
                     }          
                 }
                 
--- a/uifw/AvKon/src/Aknslider.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/AvKon/src/Aknslider.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -4190,7 +4190,8 @@
     if ( Layout() != EAknSettingsItemSliderLayout &&
          Layout() != EAknSettingsItemSliderLayoutWithGraphics  &&
          Layout() != EAknSliderLayoutVertical &&
-         Layout() != EAknSliderLayoutHorizontal ) 
+         Layout() != EAknSliderLayoutHorizontal &&
+         Layout() != EAknMIDPFormSliderLayout ) 
         {
         error = AknsUtils::GetCachedColor( skin, color,
                     KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG8 );
--- a/uifw/AvKon/src/akngrid.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/AvKon/src/akngrid.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -1346,8 +1346,16 @@
 EXPORT_C void CAknGrid::HandleResourceChange(TInt aType)
     {
     _AKNTRACE_FUNC_ENTER;
-    // Need to do this to set up the scroll bar model
-    TRAP_IGNORE( UpdateScrollBarsL() );
+    if ( aType != KEikMessageWindowsFadeChange && 
+    	 aType != KEikMessageUnfadeWindows && 
+    	 aType != KEikMessageFadeAllWindows && 
+    	 aType != KEikMessageColorSchemeChange && 
+    	 aType != KAknsMessageSkinChange )
+    	{
+        // Need to do this to set up the scroll bar model
+        TRAP_IGNORE( UpdateScrollBarsL() );
+    	}
+    
     
     if (aType==KEikDynamicLayoutVariantSwitch)
         {
@@ -1401,9 +1409,17 @@
     TRAP_IGNORE( ItemDrawer()->FormattedCellData()->SetupSkinContextL());
     // Data extension has animations which will change when skin changes.
     ItemDrawer()->FormattedCellData()->HandleResourceChange( aType );
-
-    // Need to do this to set up the scroll bar model
-    TRAP_IGNORE( UpdateScrollBarsL() );
+    
+    if ( aType != KEikMessageWindowsFadeChange && 
+    	 aType != KEikMessageUnfadeWindows && 
+    	 aType != KEikMessageFadeAllWindows && 
+    	 aType != KEikMessageColorSchemeChange && 
+    	 aType != KAknsMessageSkinChange )
+        {
+        // Need to do this to set up the scroll bar model
+        TRAP_IGNORE( UpdateScrollBarsL() );
+        }
+    
     _AKNTRACE_FUNC_EXIT;
     }
 
--- a/uifw/AvKon/srcdata/AvkonSystemSounds.ra	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/AvKon/srcdata/AvkonSystemSounds.ra	Thu Jul 15 18:56:19 2010 +0300
@@ -109,7 +109,7 @@
 			// 0x06 = 6 = tone_tick = 60ms
 			// 0x0B = 11 = OPCODE_END
 			file = KVolumeMinSoundFile;
-			volume = 9;
+			volume = 5;
 			},
 		AVKON_SOUND_INFO 
 			{
@@ -171,14 +171,15 @@
 			sid=EAvkonSIDChargingBatteryTone; 
 			priority=EAvkonLowLevelNotesPriority; 
 			preference=EAknAudioPrefCharging;
-			sequencelength=6;
-			sequence={0,17,10,118,17,11};
+			// sequencelength=6;
+			// sequence={0,17,10,118,17,11};
 		   	// 0x00 = 0  = OPCODE_SEQUENCE_START
 			// 0x11 = 17 = OPCODE_DURATION_UNIT
 			// 0x0A = 10 = duration unit => tone duration is 10ms * tone_tick
 			// 0x76 = 118 => 118-64=54=AUD_TONE_RING_FREQ_F2	 = 1397Hz
 			// 0x11 = 17 = tone_tick = 170ms
 			// 0x0B = 11 = OPCODE_END
+			file = KDefaultBeepSoundFile;
 			volume = 5;
 			},
 		AVKON_SOUND_INFO 
Binary file uifw/AvKon/srcdata/AvkonSystemSounds/default_beep.wav has changed
--- a/uifw/AvKon/tsrc/bc/S60_SDK3.0/bctestdocandinit/src/bctestDocAndInitcase.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/AvKon/tsrc/bc/S60_SDK3.0/bctestdocandinit/src/bctestDocAndInitcase.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -83,15 +83,21 @@
         {
         DELAY( 1 ), // delay between commands is 1*0.1 seconds = 0.1 seconds
         LeftCBA, 
+        LeftCBA,
+        WAIT( 10 ),
         LeftCBA, 
-        LeftCBA, KeyOK,
-        LeftCBA, KeyOK,
-        LeftCBA, KeyOK,
-        LeftCBA, LeftCBA, KeyOK,
+        WAIT( 5 ),
+        LeftCBA, 
+        WAIT( 5 ),
+        LeftCBA, 
+        WAIT( 5 ),
+        LeftCBA,
+        WAIT( 5 ),
+        LeftCBA, 
         DELAY( 15 ),         
         LeftCBA,
         DELAY( 1 ), 
-        REP(Down, 1 ), 
+        Down, 
         LeftCBA
         };
     AddTestScriptL( scripts, sizeof( scripts )/sizeof( TInt ) );
--- a/uifw/AvKon/tsrc/bc/S60_SDK5.0/bctestdocandinit/src/bctestDocAndInitcase.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/AvKon/tsrc/bc/S60_SDK5.0/bctestdocandinit/src/bctestDocAndInitcase.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -80,28 +80,26 @@
 void CBCTestDocAndInitCase::BuildScriptL()
     { 
     
-    TCFDDriveStatus status = DriveStatus( EDriveE );
-	
-	if (status != EDriveNotReady)
+       const TInt scripts[] =
         {
-		// Have E drive
-        AddTestL( DELAY( 10 ), 
-		LeftCBA, Down, LeftCBA, DELAY( 10 ), 
-		LeftCBA, LeftCBA, DELAY( 10 ), 
-		LeftCBA, DELAY( 10 ),
-		LeftCBA, DELAY( 10 ),
-		LeftCBA, DELAY( 10 ),
-		
-		LeftCBA, TEND );
-        }
-	else
-	    {
-		// Not have E drive
-		AddTestL( DELAY( 10 ), 
-		LeftCBA, Down, LeftCBA, DELAY( 10 ), 
-		LeftCBA, LeftCBA, DELAY( 20 ), 
-		LeftCBA, TEND );
-	    }
+        DELAY( 1 ), // delay between commands is 1*0.1 seconds = 0.1 seconds
+        LeftCBA, 
+        LeftCBA,
+        WAIT( 10 ),
+        LeftCBA, 
+        WAIT( 5 ),
+        LeftCBA, 
+        WAIT( 5 ),
+        LeftCBA,
+        WAIT( 5 ),
+        LeftCBA, 
+        DELAY( 15 ),         
+        LeftCBA,
+        DELAY( 1 ), 
+        Down, 
+        LeftCBA
+        };
+    AddTestScriptL( scripts, sizeof( scripts )/sizeof( TInt ) );
     }
 // ---------------------------------------------------------------------------
 // CBCTestDocAndInitCase::DriveStatus
--- a/uifw/EikStd/coctlinc/smileymanager.h	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/coctlinc/smileymanager.h	Thu Jul 15 18:56:19 2010 +0300
@@ -42,7 +42,7 @@
     {
 public:
     static const TText KPlaceHolder = 0xfff0;
-    static const TInt KMaxLength = 5;
+    static const TInt KMaxLength = 100;
     static const TInt KMinLength = 2;
     static const TText KZeroCode = 0;
     static const TText KCompensateChar = 'i'; 
--- a/uifw/EikStd/coctlsrc/AknButton.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/coctlsrc/AknButton.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -2739,6 +2739,7 @@
         }
 
     TRAP_IGNORE( SetStateIndexL( newIndex ) );
+    SetFrameIDs(); 
     if ( aDrawNow )
         {
         DrawNow();
--- a/uifw/EikStd/coctlsrc/AknToolbar.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/coctlsrc/AknToolbar.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -1210,8 +1210,12 @@
         for(TInt i = 0; i < iVisibleItems.Count(); i++)
             {
             CAknToolbarItem* item = iVisibleItems[ i ];
-            CAknButton* button = static_cast<CAknButton*>( item->Control() ); 
-            button->ResetState();
+            if( item->ControlType() == EAknCtButton 
+                || item->ControlType() == EAknCtToolbarExtension )
+                {
+                CAknButton* button = static_cast<CAknButton*>( item->Control() ); 
+                button->ResetState();
+                }
             }
 
         if ( iFlags & KAknToolbarFixed )
--- a/uifw/EikStd/coctlsrc/EIKEDWIN.CPP	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/coctlsrc/EIKEDWIN.CPP	Thu Jul 15 18:56:19 2010 +0300
@@ -228,6 +228,11 @@
     {
     friend class CEikEdwin;
 public:
+    // The length of text window
+    const static TInt KMaxSegmentLength = 10000;
+    // The threshold for text window position change
+    const static TInt KSegmentUpdateTrigger = 100;
+    
     static CEikEdwinFepSupport* New(CEikEdwin& aEdwin);
     virtual ~CEikEdwinFepSupport();
     TBool IsHandledByFepL(TPointerEvent::TType aType, TUint aModifiers, TInt aDocumentPosition);
@@ -243,7 +248,21 @@
     // from MCoeFepAwareTextEditor_Extension1
     void SetStateTransferingOwnershipL(CState* aState, TUid aTypeSafetyUid);
     CState* State(TUid aTypeSafetyUid); // this function does *not* transfer ownership
-
+    
+    // New functions for Touch Input sync performance improvement. A sliding window method is used 
+    // here to show only part of text of editor to Touch Input, so the text sync between Touch input and 
+    // editor can be faster.
+    /**
+     * To update start position of text window according to cursor position. The cursor position has to
+     * be in the visible text window.
+     */
+    void UpdateDocPosOffsetL( TInt aCursorPos );
+
+    /**
+     * To check if FEP wants to get information of whole text, not the text window.
+     */
+    TBool FepRequireWholeTextData() const;
+    
 private:
     enum TPointerState
         {
@@ -303,6 +322,8 @@
     MTouchFeedback* iFeedback;
     TBool iSelectionIsCancel;
     TInt iMoveThumbFeedbackNeeded;
+    // record start position of text window
+	TInt iDocPosOffset;
 private:    
     MFepPointerEventHandlerDuringInlineEdit* iPointerEventHandlerDuringInlineEdit; // does not own anything
     SPointerEventInInlineText iLastPointerEventInInlineText;
@@ -590,8 +611,6 @@
 
 void CEikEdwinFepSupport::SetInlineEditingCursorVisibilityL(TBool aCursorVisibility)
     {
-    __ASSERT_ALWAYS(iPositionOfInlineTextInDocument>=0,Panic(EEikPanicBadInlineEditingState7)); // assert that we're currently inline editing
-    __ASSERT_DEBUG((iOriginalSelection.iCursorPos>=0) && (iOriginalSelection.iAnchorPos>=0) && (iPositionOfInsertionPointInDocument>=0) && (iPositionOfInlineTextInDocument>=0) && (iLengthOfInlineText>=0) && (iPointerEventHandlerDuringInlineEdit!=NULL),Panic(EEikPanicBadInlineEditingState8));
     iEdwin.SetCursorVisibilityL(aCursorVisibility);
     iShowCursor = aCursorVisibility;
     }
@@ -637,32 +656,128 @@
 
 TInt CEikEdwinFepSupport::DocumentLengthForFep() const
     {
+    // If the length between text window start position and text end is shorter
+    // than length of text window, return the short length, otherwise return
+    // text window length.
+    if ( !FepRequireWholeTextData() && iEdwin.TextLength() > KMaxSegmentLength )
+        {
+        TInt lengthToEnd( iEdwin.TextLength() - iDocPosOffset );
+        if ( lengthToEnd < KMaxSegmentLength )
+            {
+            return lengthToEnd;
+            }
+        return KMaxSegmentLength;
+        }
     return iEdwin.TextLength();
     }
 
 TInt CEikEdwinFepSupport::DocumentMaximumLengthForFep() const
     {
+    // return the length between textlimit and text window start position
+    if ( !FepRequireWholeTextData() && KMaxSegmentLength < iEdwin.iTextLimit )
+        {
+        return iEdwin.iTextLimit - iDocPosOffset;
+        }
     return iEdwin.iTextLimit;
     }
 
 void CEikEdwinFepSupport::SetCursorSelectionForFepL(const TCursorSelection& aCursorSelection)
     {
-    TCursorSelection select( aCursorSelection.iCursorPos, aCursorSelection.iAnchorPos );
-    iEdwin.HandleSelectionForSmiley( select );
-    iEdwin.iTextView->SetSelectionL( select );
-    iEdwin.UpdateVertScrollBarThumbL();
-    iEdwin.UpdateHorizScrollBarThumb();
-    iEdwin.ReportEdwinEventL( MEikEdwinObserver::EEventNavigation );
+    // if text window is enabled, the pos of parameter selection are relative to
+    // text window start position, so convert them back to actual doc pos.
+    TInt cursorPos( aCursorSelection.iCursorPos );
+    TInt anchorPos( aCursorSelection.iAnchorPos );
+    TInt textLength( iEdwin.TextLength() );
+    if ( !FepRequireWholeTextData() )
+        {
+        cursorPos += iDocPosOffset;
+        anchorPos += iDocPosOffset;
+        cursorPos = cursorPos > textLength ? textLength : cursorPos;
+        anchorPos = anchorPos > textLength ? textLength : anchorPos;
+        if ( cursorPos != anchorPos )
+            {
+            TCursorSelection select( iEdwin.Selection() );
+            if ( ( anchorPos == iDocPosOffset || anchorPos == iDocPosOffset + 
+                KMaxSegmentLength ) && anchorPos >= select.LowerPos() && 
+                anchorPos <= select.HigherPos() )
+                {
+                anchorPos = cursorPos > anchorPos ? select.LowerPos() : 
+                    select.HigherPos();
+                }
+            }
+        }
+    // Selection position can not be in smiley code string, so check if
+    // the position needs to be changed.
+    if ( iEdwin.IsSmileyEnabled() )
+        {  
+        CSmileyManager* smiley( iEdwin.iEdwinExtension->iSmiley );
+        TInt oldPos = ( cursorPos == anchorPos ) ? iEdwin.CursorPos() : anchorPos; 
+        smiley->HandleSetCursor( oldPos, cursorPos );       
+        if ( aCursorSelection.iCursorPos == aCursorSelection.iAnchorPos )
+            {
+            anchorPos = cursorPos;
+            }
+        else
+            {
+            smiley->HandleSetCursor( cursorPos, anchorPos );
+            }
+        }
+    iEdwin.SetSelectionL( cursorPos, anchorPos );
+    // Cursor pos is changed, so update text window position.
+	UpdateDocPosOffsetL( cursorPos );
+    iEdwin.ReportEdwinEventL(MEikEdwinObserver::EEventNavigation);
     }
 
 void CEikEdwinFepSupport::GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const
     {
     aCursorSelection=iEdwin.Selection();
+    // To use text window, FEP can not access text view of editor directly but 
+    // FEP needs to know some information which can not be provided by current 
+    // interface. So use below method to transfer the information to FEP.
+    CAknEdwinState* state( iEdwin.EditorState() );
+    if ( state )
+        {
+        TInt flag( state->Flags() );
+        TTmDocPos docPos;
+        iEdwin.TextView()->GetCursorPos( docPos );
+        if ( docPos.iLeadingEdge )
+            {
+            flag |= EAknEditorFlagCursorLedingEdge;
+            }
+        else
+            {
+            flag &= ~EAknEditorFlagCursorLedingEdge;
+            }
+        state->SetFlags( flag );
+        }
+    // If text window is enabled, convert the actual doc pos to relative doc pos.
+    if ( !FepRequireWholeTextData() )
+        {
+        if ( aCursorSelection.iAnchorPos < iDocPosOffset )
+            {
+            aCursorSelection.iAnchorPos = iDocPosOffset;
+            }
+        else if ( aCursorSelection.iAnchorPos > iDocPosOffset + KMaxSegmentLength )
+            {
+            aCursorSelection.iAnchorPos = iDocPosOffset + KMaxSegmentLength;
+            }
+        aCursorSelection.iCursorPos -= iDocPosOffset;
+        aCursorSelection.iAnchorPos -= iDocPosOffset;
+        }
     }
 
 void CEikEdwinFepSupport::GetEditorContentForFep(TDes& aEditorContent,TInt aDocumentPosition,TInt aLengthToRetrieve) const
     {
+    // If text window is enabled, convert relative doc pos to actual doc pos.
+    if ( !FepRequireWholeTextData() )
+        {
+        aDocumentPosition += iDocPosOffset;
+        }
     TInt length( Min( aLengthToRetrieve, iEdwin.TextLength() - aDocumentPosition ) );
+    if ( !FepRequireWholeTextData() )
+        {
+        length = Min( length, KMaxSegmentLength );
+        }    
     iEdwin.iText->Extract( aEditorContent, aDocumentPosition, length );
     CSmileyManager* smiley( iEdwin.iEdwinExtension->iSmiley );
     if ( smiley && smiley->HasSmileyIconsInText() )
@@ -710,6 +825,8 @@
 
 void CEikEdwinFepSupport::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLine,TInt& aHeight,TInt& aAscent,TInt aDocumentPosition) const
     {
+    // If text window is enabled, convert relative doc pos to actual doc pos.
+    aDocumentPosition += iDocPosOffset;
     aDocumentPosition %= ( iEdwin.iText->DocumentLength() + 1 );    
     iEdwin.iTextView->DocPosToXyPosL(aDocumentPosition,aLeftSideOfBaseLine);
     aLeftSideOfBaseLine+=iEdwin.DrawableWindow()->InquireOffset(iEdwin.iCoeEnv->RootWin()); // make position "absolute" (i.e. not relative to the window that iEdwin is using) - note that *any* group window can be passed into InquireOffset to return the desired result, it doesn't have to be an ancestor of the window being used by iEdwin (i.e. this line of code does *not* make the assumption that iEdwin is (even indirectly) attached to iCoeEnv->RootWin())
@@ -878,6 +995,50 @@
     {
     }
 
+// Update start position of text window, when cursor pos is out of current 
+// text window or it is in trigger range, the text window position needs to 
+// be changed and notify FEP the text change.
+void CEikEdwinFepSupport::UpdateDocPosOffsetL( TInt aCursorPos )
+    {
+    if ( FepRequireWholeTextData() )
+        {
+        return;
+        }
+    if ( iEdwin.TextLength() > KMaxSegmentLength )
+        {
+        TInt halfSegment( KMaxSegmentLength / 2 );
+        TBool validDocPosOffset( iDocPosOffset >= 0 && aCursorPos > iDocPosOffset &&
+            aCursorPos - iDocPosOffset < KMaxSegmentLength );
+        TBool cursorInHead( validDocPosOffset && 
+            aCursorPos - iDocPosOffset < KSegmentUpdateTrigger );
+        TBool cursorInTail( validDocPosOffset && 
+            iDocPosOffset + KMaxSegmentLength - aCursorPos < KSegmentUpdateTrigger &&
+            iDocPosOffset + KMaxSegmentLength < iEdwin.TextLength() );
+        if  ( !validDocPosOffset || cursorInHead || cursorInTail )
+            {
+            if ( iEdwin.TextLength() - aCursorPos < halfSegment )
+                {
+                iDocPosOffset = iEdwin.TextLength() - KMaxSegmentLength;
+                }
+            else
+                {
+                iDocPosOffset = aCursorPos - halfSegment;
+                iDocPosOffset = iDocPosOffset >= 0 ? iDocPosOffset : 0;
+                }            
+            static_cast<CAknEdwinState*>( State( KNullUid ) )->ReportAknEdStateEventL( 
+                MAknEdStateObserver::EAknCursorPositionChanged );
+            }
+        }
+    }
+
+// Check if FEP set the flag to indicate it wants to get information of whole
+// text, not the text window.
+TBool CEikEdwinFepSupport::FepRequireWholeTextData() const
+    {
+    CAknEdwinState* state( static_cast<CAknEdwinState*>( 
+        const_cast<CEikEdwinFepSupport*>( this )->State(KNullUid) ) );
+    return ( state->Flags() & EAknEditorFlagNeedWholeTextData );
+    }
 
 //
 //  CEikEdwinExtension
@@ -3509,6 +3670,8 @@
     if ( iEdwinFepSupport && 
         ( aDocPos != oldPos || ( select.Length() > 0 && !aSelect ) ) )
         {
+        // Update text window position for cursor change.
+        iEdwinFepSupport->UpdateDocPosOffsetL( docPos );
         CAknEdwinState* edwinState = static_cast<CAknEdwinState*>( iEdwinFepSupport->State(KNullUid) );
         if ( edwinState )
             {
@@ -3558,6 +3721,8 @@
 
     if ( iEdwinFepSupport )
         {
+        // Update text window position for cursor change.
+        iEdwinFepSupport->UpdateDocPosOffsetL( aCursorPos );
         CAknEdwinState* edwinState = static_cast<CAknEdwinState*>( iEdwinFepSupport->State(KNullUid) );
         if ( edwinState )
             {
@@ -4054,6 +4219,8 @@
 
     if ( iEdwinFepSupport )
         {
+        // Update text window position for cursor change.
+        iEdwinFepSupport->UpdateDocPosOffsetL( CursorPos() );
         CAknEdwinState* edwinState = static_cast<CAknEdwinState*>( 
             iEdwinFepSupport->State( KNullUid ) );
         if ( edwinState )
--- a/uifw/EikStd/coctlsrc/EIKLBX.CPP	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/coctlsrc/EIKLBX.CPP	Thu Jul 15 18:56:19 2010 +0300
@@ -1872,7 +1872,8 @@
         TInt topItemIndex = iListBox.iView->TopItemIndex();
         TInt itemHeight = iListBox.iView->ItemHeight();
         TInt numberOfItems = iListBox.iModel->NumberOfItems();
-
+        TInt emptySpaceOffset ( 0 );
+        
         TSize viewSize( iListBox.iView->ViewRect().Size() );
         TSize worldSize( viewSize.iWidth, itemHeight * numberOfItems );
         
@@ -1887,6 +1888,15 @@
                 {
                 worldSize.iHeight += itemHeight;
                 }
+            
+            // Check empty space below the grid
+            if ( topItemIndex != 0 )
+                {
+                TInt lastItemBottomY = 
+                        iListBox.iView->ItemPos( 
+                                numberOfItems - 1 ).iY + itemHeight +1;
+                emptySpaceOffset = Min( 0, lastItemBottomY - viewSize.iHeight );
+                }
             }
             
         // Reset offset if view's size has changed - this is needed if e.g.
@@ -1897,6 +1907,7 @@
             }
 
         TPoint viewCenter( viewSize.iWidth / 2, ( topItemIndex / iItemsInSingleLine ) * itemHeight - iListBox.iView->ItemOffsetInPixels() + ( viewSize.iHeight / 2 ) );
+        viewCenter.iY += emptySpaceOffset;
 
         // Make sure that world's size is always at least view size.
         worldSize.iHeight = Max( worldSize.iHeight, viewSize.iHeight );
@@ -6787,18 +6798,18 @@
                     ( newListBottomPos >= iListBoxExt->ListBottomLimit() ) ||
                     ( newListTopPos <= 0 && newListTopPos + viewHeight >= 0 && newListLastItemPos > viewHeight ) )
                     {
-                    if ( CAknPhysics::EAknPhysicsActionFlicking == iListBoxExt->iPhysics->OngoingPhysicsAction() || 
-                         CAknPhysics::EAknPhysicsActionBouncing == iListBoxExt->iPhysics->OngoingPhysicsAction() )
+                    switch(iListBoxExt->iPhysics->OngoingPhysicsAction())
                         {
-                        iListBoxExt->ImmediateFeedback( ETouchFeedbackSensitiveList,
-                                                        TTouchFeedbackType( ETouchFeedbackVibra ),
-                                                        TPointerEvent() );
-                        }
-                    else if ( CAknPhysics::EAknPhysicsActionDragging == iListBoxExt->iPhysics->OngoingPhysicsAction() )
-                        {
-                        iListBoxExt->ImmediateFeedback( ETouchFeedbackSensitiveList,
-                                                        TTouchFeedbackType( ETouchFeedbackVibra | ETouchFeedbackAudio ),
-                                                        TPointerEvent() );
+                        case CAknPhysics::EAknPhysicsActionBouncing:
+                        case CAknPhysics::EAknPhysicsActionDragging:
+                        case CAknPhysics::EAknPhysicsActionFlicking:
+                            iListBoxExt->ImmediateFeedback( 
+                                    ETouchFeedbackSensitiveList,
+                                    TTouchFeedbackType( ETouchFeedbackVibra ),
+                                    TPointerEvent() );
+                            break;
+                        default:
+                            break;
                         }
                     }
                 }
--- a/uifw/EikStd/coctlsrc/EIKMENUB.CPP	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/coctlsrc/EIKMENUB.CPP	Thu Jul 15 18:56:19 2010 +0300
@@ -1172,14 +1172,7 @@
             TTouchLogicalFeedback fbLogicalType = ETouchFeedbackPopUp;
             if ( CAknTransitionUtils::TransitionsEnabled( AknTransEffect::EComponentTransitionsOff ) )
                 {
-                if( iExt->iMenuType == EMenuContext || iExt->iMenuType == EMenuEdit )
-                    {
-                    fbLogicalType = ETouchFeedbackIncreasingPopUp;
-                    }
-                else
-                    {
-                    fbLogicalType = ETouchFeedbackOptionsMenuOpened;
-                    }
+                fbLogicalType = ETouchFeedbackOptionsMenuOpened;
                 }
             feedback->InstantFeedback(
                                    this,
@@ -1370,15 +1363,7 @@
                     if ( CAknTransitionUtils::TransitionsEnabled(
                             AknTransEffect::EComponentTransitionsOff ) )
                         {
-                        if ( iExt->iMenuType == EMenuContext ||
-                             iExt->iMenuType == EMenuEdit )
-                            {
-                            fbLogicalType = ETouchFeedbackDecreasingPopUp;
-                            }
-                        else
-                            {
-                            fbLogicalType = ETouchFeedbackOptionsMenuClosed;
-                            }
+                        fbLogicalType = ETouchFeedbackOptionsMenuClosed;
                         }
                     feedback->InstantFeedback(
                                            this,
--- a/uifw/EikStd/coctlsrc/EIKMENUP.CPP	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/coctlsrc/EIKMENUP.CPP	Thu Jul 15 18:56:19 2010 +0300
@@ -573,24 +573,18 @@
         if ( iFlickActive || iPanningActive )
             {
             if ( ( aOffset>0 && iListTopIndex <= listBottomLimit && iListTopIndex >= -iViewHeight ) ||
-            	  ( aOffset<0 && iListBottomIndex >= 0 && iListBottomIndex <= listBottomLimit+iViewHeight ) ) 
-            	{
-            	if ( iPhysics )
+                  ( aOffset<0 && iListBottomIndex >= 0 && iListBottomIndex <= listBottomLimit+iViewHeight ) ) 
+                {
+                if ( iPhysics )
                     {
-                    TTouchFeedbackType feedbackType = ETouchFeedbackVibra;
-                    switch( iPhysics->OngoingPhysicsAction() )
+                    switch(iPhysics->OngoingPhysicsAction())
                         {
+                        case CAknPhysics::EAknPhysicsActionBouncing:
                         case CAknPhysics::EAknPhysicsActionDragging:
-                            {
-                            feedbackType = static_cast<TTouchFeedbackType> ( ETouchFeedbackVibra | ETouchFeedbackAudio );
-                            }
                         case CAknPhysics::EAknPhysicsActionFlicking:
-                        case CAknPhysics::EAknPhysicsActionBouncing:
-                            {
                             ImmediateFeedback( ETouchFeedbackSensitiveList,
-                                               feedbackType );
+                                    ETouchFeedbackVibra );
                             break;
-                            }
                         default:
                             break;
                         }
--- a/uifw/EikStd/coctlsrc/aknstyluspopupmenu.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/coctlsrc/aknstyluspopupmenu.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -25,7 +25,8 @@
 #include <aknappui.h>
 #include <AknDef.h>
 #include <touchfeedback.h>
-
+#include <akntranseffect.h>
+#include <akntransitionutils.h>
 #include "aknstyluspopupmenu.h"
 #include "aknstyluspopupmenucontent.h"
 
@@ -201,9 +202,14 @@
         MTouchFeedback* feedback = MTouchFeedback::Instance();
         if ( feedback )
             {
+            TTouchLogicalFeedback feedbackType = ETouchFeedbackPopUp;
+            if ( CAknTransitionUtils::TransitionsEnabled( AknTransEffect::EComponentTransitionsOff ) )
+                {
+                feedbackType = ETouchFeedbackOptionsMenuOpened;
+                }
             feedback->InstantFeedback(
                     iContent,
-                    ETouchFeedbackPopUp,
+                    feedbackType,
                     ETouchFeedbackVibra,
                     TPointerEvent() );
             }
--- a/uifw/EikStd/coctlsrc/aknstyluspopupmenuphysicshandler.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/coctlsrc/aknstyluspopupmenuphysicshandler.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -388,24 +388,19 @@
             {
             if ( iPhysics )
                 {
-                TTouchFeedbackType feedbackType = ETouchFeedbackVibra;
-                switch( iPhysics->OngoingPhysicsAction() )
+                switch(iPhysics->OngoingPhysicsAction())
                     {
+                    case CAknPhysics::EAknPhysicsActionBouncing:
                     case CAknPhysics::EAknPhysicsActionDragging:
-                        {
-                        feedbackType = static_cast<TTouchFeedbackType>
-                                  ( ETouchFeedbackVibra | ETouchFeedbackAudio );
-                        }
                     case CAknPhysics::EAknPhysicsActionFlicking:
-                    case CAknPhysics::EAknPhysicsActionBouncing:
                         {
                         MTouchFeedback* feedback = MTouchFeedback::Instance();
                         if ( feedback )
                             {
                             feedback->InstantFeedback( iPopUpMenuContent,
-                                                    ETouchFeedbackSensitiveList,
-                                                    feedbackType,
-                                                    TPointerEvent() );
+                                                ETouchFeedbackSensitiveList,
+                                                ETouchFeedbackVibra,
+                                                TPointerEvent() );
                             }
                         break;
                         }
--- a/uifw/EikStd/dlginc/aknformphysics.h	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/dlginc/aknformphysics.h	Thu Jul 15 18:56:19 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -31,15 +31,8 @@
 class CAknRecordingGc;
 
 /**
- *  ?one_line_short_description
- *  ?more_complete_description
- *
- *  @code
- *   ?good_class_usage_example(s)
- *  @endcode
- *
- *  @lib ?library
- *  @since S60 ?S60_version *** for example, S60 v3.0
+ *  @lib eikdlg.lib
+ *  @since S60 v5.0
  */
 NONSHARABLE_CLASS( CAknFormPhysics ) : public CBase, public MAknPhysicsObserver
     {
@@ -209,15 +202,6 @@
     */
     void ConstructL();
 
-    /**
-    * Checks whether panning and flicking are allowed with current world and
-    * view sizes.
-    *
-    * @since S60 v5.0
-    * @return ETrue if allowed.
-    */
-    TBool PhysicsAllowed() const;
-
 private: // data
     /**
     * Center of the "view" (the visible window to the whole form i.e. form's
@@ -250,16 +234,6 @@
     * View size.
     */
     TSize iViewSize;
-    
-    /**
-    * Benchmark timestamp.
-    */
-    TTime iStartTime;
-    
-    /**
-    * Benchmark frame counter.
-    */
-    TInt iFrameCount;
     };
 
 #endif // C_CAKNFORMPHYSICS_H
--- a/uifw/EikStd/dlgsrc/EIKCAPC.CPP	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/dlgsrc/EIKCAPC.CPP	Thu Jul 15 18:56:19 2010 +0300
@@ -85,13 +85,6 @@
 GLREF_C void Panic(TEikDialogPanic aPanic);
 
 const TInt KViewHighlightColor = 244 ;
-// const TInt KViewHighlightShadowColor = 222 ; 
-// const TInt KNormalBackgroundColor = 0 ;
-
-
-// Do not reference these directly... Use MaximumNumberOfControlLinesOnVisiblePage() 
-// const TInt KMaxControlLinesOnPageSingleLineFormat =6;
-// const TInt KMaxControlLinesOnPageDoubleLineFormat =5;
 
 enum
     {// must carry on from TSpaceSharingFlags
@@ -111,15 +104,8 @@
     ENoBorder       = 0x20000
     };
 
-const TInt KDynamicEarMask=(ELeftEarDown|ERightEarDown|ELeftEarGrab|ERightEarGrab);
-
-const TInt KCapCDefaultHorzEdgeSpacing=0;
-const TInt KCapCDefaultVertEdgeSpacing=0; 
 const TInt KCapCCenterSpacing=0;
 const TInt KControlTrailerSpacing=0;
-// const TInt KCapCEarHeightTopHalf=0;
-// const TInt KCapCEarHeightBottomHalf=0;
-// const TInt KCapCEarHeight=KCapCEarHeightTopHalf+KCapCEarHeightBottomHalf;
 const TInt KCapCEarWidth=0;
 const TInt KCapCEarSpacing=0;
 const TInt KCapCVertCaptionOffset=0;
@@ -127,9 +113,6 @@
 const TInt KTrailCVertCaptionOffset=0;
 const TInt KCapCSeparatorAfterSpace=0;
 
-const TInt KCapCInitialEarRepeat=600000;    // 6 tenths of a second
-const TInt KCapCEarRepeat=100000; // one tenth of a second
-
 /*
  *  The following set of static functions return value which have been hard coded from the Series 60 Skins LAF v2.0
  *  If a layout DLL becomes available the hard-coded values may be replaced with equivalent Macros.
@@ -350,12 +333,7 @@
 public: // needs to be public because idle callback uses these members.
 	CIdle *iIdle;
 	CIdleCallbackData *iIdleData;
-    /** iPartiallyVisible is used as a protection from changing subcontrol positions of 
-      * partially-visible controls in PositionFormComponents(). This is needed only for
-      * dynamic screen size change.
-      */
-    TBool iPartiallyVisible;
-    
+
     /**
      * Boolean used to check if application is single touch compatible.
      */
@@ -393,8 +371,7 @@
 	iSimulatedDownEvent( EFalse ),
     iFeedback( MTouchFeedback::Instance() ),
 	iIdle(NULL),
-	iIdleData(NULL),
-    iPartiallyVisible( EFalse )
+	iIdleData(NULL)
     {
     _AKNTRACE_FUNC_ENTER;
     if ( iAvkonAppUi )
@@ -478,7 +455,7 @@
     MAknsControlContext* cc = AknsDrawUtils::ControlContext( iSelf->iDialogPage );
 
     return AknsDrawUtils::DrawBackground( skin, cc, iSelf->iDialogPage, aGc, TPoint(0,0),
-                                          iSelf->ViewRect(), KAknsDrawParamRGBOnly );
+                                          iSelf->Rect(), KAknsDrawParamRGBOnly );
     }
 
 
@@ -737,7 +714,7 @@
     return drawingSkins;
     }
 
-EXPORT_C CEikCaptionedControl::CEikCaptionedControl() : iHasAppendedEditIndicator(EFalse)
+EXPORT_C CEikCaptionedControl::CEikCaptionedControl()
     {
     _AKNTRACE_FUNC_ENTER;
     iNumberOfLines = 1 ;  // default starting value
@@ -765,7 +742,6 @@
     delete iCaptionText;
     delete iCaption;
     delete iTrailer;
-    delete iToolTipText ;
     delete iBitmap ;
     delete iHighlightControl ;
     if ( iExtension )
@@ -974,15 +950,10 @@
             size.iWidth+=KCapCEarWidth+KCapCEarSpacing;
             iCaptionWidth+=KCapCEarWidth+KCapCEarSpacing;
             }
-        size.iHeight+=2*iVertEdgeSpacing;
-        size.iWidth+=iCaptionWidth+2*iHorzEdgeSpacing;
+        size.iWidth+=iCaptionWidth;
         if (iCapCFlags&ESeparatorAfter)
             size.iHeight+=KCapCSeparatorAfterSpace;
-        iMinSize=size;
-
-        if ( iDoNotDisplay )
-            // This flag is set if the control is not to be shown - so set it's height to zero
-            iMinSize.iHeight = 0 ;
+
         _AKNTRACE_FUNC_EXIT;
        return(size);
         }
@@ -1171,14 +1142,13 @@
     if (iCapCFlags&EIfTooSmallDontStrech)
     	return;
     
-    TRect rect=Rect();
-    rect.Shrink(iHorzEdgeSpacing,iVertEdgeSpacing);
+    TRect rect(Rect());
     if (iCapCFlags&ESeparatorAfter)
         rect.iBr.iY-=KCapCSeparatorAfterSpace;
 
     const CFont* editorFont = AknLayoutUtils::FontFromId( iEditorFontId ) ;
 
-    TInt normalEditorHeight = editorFont->HeightInPixels() + editorFont->DescentInPixels() + ( 2 * iVertEdgeSpacing ) ;
+    TInt normalEditorHeight = editorFont->HeightInPixels() + editorFont->DescentInPixels();
     if ( normalEditorHeight > rect.Height() )
         normalEditorHeight = rect.Height() ;
 
@@ -1186,8 +1156,8 @@
     // Note, if position of caption & bitmap is to be configurable this routine will have to be re structured
     if ( iBitmap )
         {       
-        TPoint bitmapTl = rect.iTl ;
-        TSize bitmapSize = iBitmap->MinimumSize() ;
+        TPoint bitmapTl( rect.iTl );
+        TSize bitmapSize( iBitmap->MinimumSize() );
         if ( bitmapSize.iHeight > normalEditorHeight )
             {
             // reduce the size of the bitmap whilst retaining proportion. (will clip the bitmap methinks)
@@ -1216,9 +1186,6 @@
         }
     rect.iTl.iX+=iCaptionWidth;
 
-    if ((iCapCFlags&EUsesEars) && !(iCapCFlags&ETrailerAfterEar))
-        rect.iBr.iX-=(KCapCEarWidth+KCapCEarSpacing);
-
     if (iTrailer)
         {
         TSize trailSize=iTrailer->MinimumSize();
@@ -1229,8 +1196,6 @@
         iTrailer->SetExtent(TPoint(trailPosX,trailPosY),trailSize);
         rect.iBr.iX=trailPosX-KControlTrailerSpacing;
         }
-    if ((iCapCFlags&EUsesEars) && (iCapCFlags&ETrailerAfterEar))
-        rect.iBr.iX-=(KCapCEarWidth+KCapCEarSpacing);
 
     if(iCapCFlags&EIfTooBigCtlStaysMinHeight && rect.Height()>iControl->MinimumSize().iHeight)
         rect.iBr.iY=rect.iTl.iY+iControl->MinimumSize().iHeight;
@@ -1241,26 +1206,6 @@
     }
 
 
-TInt CEikCaptionedControl::WidthForEars(TInt aWidthRemaining) const
-    {
-    TInt earWidth=0;
-    if(iCapCFlags&EUsesEars)
-        {
-        const TInt earAndMarginWidth=KCapCEarWidth+KCapCEarSpacing;
-        if(iTrailer || iCaption)
-            {
-            if(aWidthRemaining>(2+(iTrailer?1:0)+(iCaption?1:0))*earAndMarginWidth)
-                earWidth=earAndMarginWidth;
-            else if(aWidthRemaining>(2+(iTrailer?1:0)+(iCaption?1:0))*KCapCEarWidth)
-                earWidth=KCapCEarWidth;
-            }
-        else
-            earWidth=Min(aWidthRemaining/2,earAndMarginWidth);
-        }
-    return earWidth;
-    }
-
-
 void CEikCaptionedControl::SquashComponents()
     {
     TRect rect=Rect();
@@ -1269,14 +1214,14 @@
         rect.iBr.iY-=KCapCSeparatorAfterSpace;
 
     // Space required before the left of the control rect
-    TInt desiredLeft=iHorzEdgeSpacing;
+    TInt desiredLeft=0;
     if(iCaption)
         desiredLeft+=iCaption->MinimumSize().iWidth+KCapCCenterSpacing;
     if ( iBitmap )
         desiredLeft += iBitmap->MinimumSize().iWidth ; // + additional separation?
 
     // Space required after the right of the control rect
-    TInt desiredRight=iHorzEdgeSpacing;
+    TInt desiredRight=0;
     if(iTrailer)
         desiredRight+=iTrailer->MinimumSize().iWidth+KControlTrailerSpacing;
     
@@ -1296,10 +1241,6 @@
         widthRemaining-=controlWidth;
         }
     
-    // Decide if there is space for ears with margins, ears only, or no ears.
-    TInt earWidth=WidthForEars(widthRemaining);
-    widthRemaining-=2*earWidth;
-    
     // Space assigned for before the left of the control rect
     TInt actualLeft=0;
     actualLeft=ScaledSubLength(widthRemaining,desiredLeft,desiredLeft+desiredRight);
@@ -1334,9 +1275,8 @@
         if (iCapCFlags&EExtraAscent)
             rect.iTl.iY+=KCapCExtraAscent;
         
-        if(actualLeft>2*(KCapCCenterSpacing+iHorzEdgeSpacing))
+        if(actualLeft>2*(KCapCCenterSpacing))
                 {
-                captionRect.iTl.iX+=iHorzEdgeSpacing;
                 captionRect.iBr.iX-=KCapCCenterSpacing;
                 }
         const TSize capMin=iCaption->MinimumSize();
@@ -1349,30 +1289,15 @@
         {
         TInt leftAdjust=0;
         TInt rightAdjust=0;
-        TRect trailerRect=rect;
-        trailerRect.iTl.iX+=actualLeft+controlWidth+(iCapCFlags&EUsesEars ? earWidth : 0);
+        TRect trailerRect(rect);
+        trailerRect.iTl.iX+=actualLeft+controlWidth;
         trailerRect.iTl.iY+=KTrailCVertCaptionOffset;
 
-        if(actualRight>2*(iHorzEdgeSpacing+KControlTrailerSpacing))
+        if(actualRight>2*(KControlTrailerSpacing))
             {
-            if(iCapCFlags&ETrailerAfterEar)
-                {
-                leftAdjust=KControlTrailerSpacing+earWidth;
-                rightAdjust=iHorzEdgeSpacing;
-                }
-            else
-                {
-                rightAdjust=earWidth+iHorzEdgeSpacing;
-                leftAdjust=KControlTrailerSpacing;
-                }
+            leftAdjust=KControlTrailerSpacing;
             }
-        else
-            {
-            if(iCapCFlags&ETrailerAfterEar)
-                leftAdjust=earWidth;
-            else
-                rightAdjust=earWidth;
-            }
+
         trailerRect.iTl.iX+=leftAdjust;
         trailerRect.iBr.iX-=rightAdjust;
         iTrailer->SetExtent(trailerRect.iTl,TSize(trailerRect.Width(),
@@ -1380,16 +1305,14 @@
         }
     // Position and set the controls space
     TRect controlRect=rect;
-    controlRect.iTl.iX+=actualLeft+earWidth;
-    controlRect.iBr.iX-=(actualRight+earWidth);
+    controlRect.iTl.iX+=actualLeft;
+    controlRect.iBr.iX-=actualRight;
     if(iCapCFlags&EIfTooBigCtlStaysMinHeight && controlRect.Height()>iControl->MinimumSize().iHeight)
         controlRect.iBr.iY=controlRect.iTl.iY+iControl->MinimumSize().iHeight;
     iControl->SetRect(controlRect);
-    
     }
 
 
-
 /**
  * Sets the flags, aFlags, (see TSpaceSharingFlags), which determine
  * the way space is distributed if the captioned control is given too
@@ -1523,41 +1446,10 @@
             iCaption->SetEmphasis(emphasis);
             }
         }
-    
-
-    if (aDrawNow && iCapCFlags&EUsesEars && IsReadyToDraw())
-        DrawEarsNow(EBothEars);
-    _AKNTRACE_FUNC_EXIT;
-    }
-
-
-
-void CEikCaptionedControl::DrawEarsNow(TWhichEars aEar) const
-    {
-    _AKNTRACE_FUNC_ENTER;
-    ActivateGc();
-    DrawEars(aEar);
-    DeactivateGc();
+
     _AKNTRACE_FUNC_EXIT;
     }
 
-void CEikCaptionedControl::DrawEars(TWhichEars aEar) const
-    {
-    if (aEar&ELeftEar)
-        DrawSingleEar(ELeftEar,iCapCFlags&ELeftEarDown);
-    if (aEar&ERightEar)
-        DrawSingleEar(ERightEar,iCapCFlags&ERightEarDown);
-    }
-
-void CEikCaptionedControl::DrawSingleEar(TWhichEars /*aEar*/,TBool /*aPressed*/) const
-    {
-    // not needed in S60
-    }
-
-TRect CEikCaptionedControl::EarRect(TWhichEars /*aEar*/) const
-    {
-    return(TRect(0,0,0,0)); // not needed in S60
-    }
 
 EXPORT_C TInt CEikCaptionedControl::CountComponentControls() const
     {
@@ -1620,11 +1512,6 @@
     CWindowGc& gc=SystemGc();
 
     gc.SetPenStyle(CGraphicsContext::ENullPen);
-    if ( iRefresh )
-        {
-        gc.SetBrushStyle( CGraphicsContext::ESolidBrush ) ;
-        gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ) ;
-        }
 
     if ( iCaption )
         {
@@ -1670,12 +1557,6 @@
 
     gc.SetPenStyle(CGraphicsContext::ENullPen);
 
-    if ( iRefresh )
-        {
-        gc.SetBrushStyle( CGraphicsContext::ESolidBrush ) ;
-        gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ) ;
-        }
-
     if (iDialogPage&& iHighlightControl)
         {
         TInt height(Rect().Height());
@@ -1748,14 +1629,8 @@
 
     gc.SetPenStyle(CGraphicsContext::ENullPen);
 
-    if ( iRefresh )
-        {
-        gc.SetBrushStyle( CGraphicsContext::ESolidBrush ) ;
-        gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ) ;
-        }
-
     // This gives the correct Rect for using the Layout functions
-    TRect viewRect=ViewRect(); 
+    TRect viewRect( Rect() ); 
 
     TAknLayoutRect line1Rect;
     line1Rect.LayoutRect( viewRect, AKN_LAYOUT_WINDOW_List_pane_highlight_graphics__various__Line_1 (viewRect) );
@@ -1813,14 +1688,6 @@
     CWindowGc& gc=SystemGc();
 
     gc.SetPenStyle(CGraphicsContext::ENullPen);
-
-    if ( iRefresh )
-        {
-        gc.SetBrushStyle( CGraphicsContext::ESolidBrush ) ;
-        gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ) ;
-        }
-
-    gc.SetPenStyle(CGraphicsContext::ENullPen);
     gc.SetBrushStyle( CGraphicsContext::ESolidBrush ) ;
     gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ) ;  
 
@@ -1837,7 +1704,6 @@
     gc.SetBrushStyle( CGraphicsContext::ENullBrush ) ;
     gc.DrawLine(TPoint(iVerticalLineXPosition,Rect().iTl.iY),
         TPoint(iVerticalLineXPosition,Rect().iBr.iY+1));
-    // CEikCaptionedControl* visibleBelow=0; (NOT USED)
 
     if (iDialogPage) 
         {
@@ -1873,7 +1739,7 @@
     }
 
 
-void CEikCaptionedControl::DrawAsEikonDialog( const TRect& aRect ) const
+void CEikCaptionedControl::DrawAsEikonDialog( const TRect& /*aRect*/ ) const
     {
     _AKNTRACE_FUNC_ENTER;
     CWindowGc& gc=SystemGc();
@@ -1882,16 +1748,6 @@
     if (iHighlightControl)
         STATIC_CAST(CEikCaptionedControlFormHighlightLine*,iHighlightControl)->SetTopOrBottom(CEikCaptionedControlFormHighlightLine::EUnset);
 
-    if ( iRefresh )
-        {
-        gc.SetBrushStyle( CGraphicsContext::ESolidBrush ) ;
-        gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ) ;
-        }
-
-
-    TRect redrawRect=Rect();
-    redrawRect.Intersection(aRect);
-
     /*
     *
     * FIX TSW JTON-6HGAND - see also eikdpage.cpp
@@ -1902,19 +1758,16 @@
     * Most likely other places using gc.Clear() ( or gc.DrawRect() as 'clear'
     * should be fixed also.
     */
-    
     if (iCapCFlags&ESeparatorAfter)
         {
         TRect rect(Rect());
-        TPoint separatorStartPt(rect.iTl.iX+iHorzEdgeSpacing/2,rect.iBr.iY-1);
-        TPoint separatorEndPt(separatorStartPt.iX+(iFullWidth-iHorzEdgeSpacing), separatorStartPt.iY);
+        TPoint separatorStartPt(rect.iTl.iX,rect.iBr.iY-1);
+        TPoint separatorEndPt(separatorStartPt.iX, separatorStartPt.iY);
         gc.SetPenStyle(CGraphicsContext::ESolidPen);
         gc.SetPenColor(iEikonEnv->ControlColor(EColorWindowText, *this));
         gc.DrawLine(separatorStartPt, separatorEndPt);
-        };
-
-    if (iCapCFlags&EUsesEars)
-        DrawEars(EBothEars); 
+        }
+
     _AKNTRACE_FUNC_EXIT;
     }
 
@@ -1976,52 +1829,6 @@
 EXPORT_C void CEikCaptionedControl::HandlePointerEventL(const TPointerEvent& aPointerEvent)
     {
     _AKNTRACE_FUNC_ENTER;
-    if (!IsNonFocusing())
-        {
-        TWhichEars ear=ENoEar;
-        if (aPointerEvent.iType!=TPointerEvent::EButton1Down)
-            {
-            _AKNTRACE("TPointerEvent::EButton1Down");
-            if (iCapCFlags&ELeftEarGrab)
-                ear=ELeftEar;
-            else if (iCapCFlags&ERightEarGrab)
-                ear=ERightEar;
-            if (ear)
-                {
-                TInt oldDrawFlags=iCapCFlags&(ELeftEarDown|ERightEarDown);
-                if (aPointerEvent.iType==TPointerEvent::EButton1Up)
-                    iCapCFlags&=(~KDynamicEarMask);
-                else
-                    {
-                    iCapCFlags&=(~(ELeftEarDown|ERightEarDown));
-                    if (EarRect(ear).Contains(aPointerEvent.iPosition))
-                        {
-                        FireEarL(ear, KCapCEarRepeat);
-                        return;
-                        }
-                    }
-                if (oldDrawFlags!=(iCapCFlags&(ELeftEarDown|ERightEarDown)))
-                    DrawEarsNow(ear);
-                _AKNTRACE_FUNC_EXIT;
-                return;
-                }
-            }
-        else if (iCapCFlags&EUsesEars)
-            {
-            iCapCFlags&=(~KDynamicEarMask);
-            if (EarRect(ELeftEar).Contains(aPointerEvent.iPosition))
-                ear=ELeftEar;
-            else if (EarRect(ERightEar).Contains(aPointerEvent.iPosition))
-                ear=ERightEar;
-            if (ear)
-                {
-                FireEarL(ear, KCapCInitialEarRepeat);
-                _AKNTRACE_FUNC_EXIT;
-                return;
-                }
-            }
-        }
-
     TBool edwinControl( ControlIsAnEdwin( iControlType ) );
     
      if ( iIsFormControl )
@@ -2085,24 +1892,6 @@
         }
     }
 
-void CEikCaptionedControl::FireEarL(TWhichEars aEar, TInt aEarRepeat)
-    {
-    Window().RequestPointerRepeatEvent(aEarRepeat, EarRect(aEar));
-    TKeyEvent key;
-    key.iModifiers=0;
-    if (aEar==ELeftEar)
-        {
-        key.iCode=EKeyLeftArrow;
-        iCapCFlags|=ELeftEarDown|ELeftEarGrab;
-        }
-    else
-        {
-        key.iCode=EKeyRightArrow;
-        iCapCFlags|=ERightEarDown|ERightEarGrab;
-        }
-    DrawEarsNow(aEar);
-    iControl->OfferKeyEventL(key,EEventKey);
-    }
 
 EXPORT_C void CEikCaptionedControl::SetCaptionL(const TDesC& aText)
     {
@@ -2120,7 +1909,7 @@
         iCaptionText = aText.AllocL();
         }
         
-    if (iCaption->DrawableWindow() == NULL)    
+    if (!iCaption->DrawableWindow())    
         {
         iCaption->SetContainerWindowL(*this);
         iCaption->CopyControlContextFrom(this);
@@ -2235,10 +2024,6 @@
     TPtrC16 toolTip = aReader.ReadTPtrC() ;
     SetToolTipTextL( toolTip ) ; 
     
-    // Set the border spacing to the default value
-    SetVertEdgeSpacing( KCapCDefaultVertEdgeSpacing ) ;
-    SetHorzEdgeSpacing( KCapCDefaultHorzEdgeSpacing ) ;
-
     //Added to create new form box closer for edwins in forms.
     if (!iHighlightControl)
         {
@@ -2290,9 +2075,7 @@
 EXPORT_C void CEikCaptionedControl::ResetMinimumSizes()
     {
 	_AKNTRACE_FUNC_ENTER;
-    iMinSize.iWidth=0;
     iCaptionWidth=0;
-    iFullWidth=0;
     _AKNTRACE_FUNC_EXIT;
     }
 
@@ -2438,10 +2221,7 @@
 
 EXPORT_C const TDesC* CEikCaptionedControl::ToolTipText() const 
     {
-    if ( iToolTipText )
-        return  iToolTipText ;
-    else
-        return NULL ;
+    return NULL ;
     }
 
 /**
@@ -2580,16 +2360,6 @@
     _AKNTRACE_FUNC_EXIT;
     }
 
-void CEikCaptionedControl::SetVertEdgeSpacing( TInt aVertEdgeSpacing ) 
-    {
-    iVertEdgeSpacing = aVertEdgeSpacing ;
-    }
-
-void CEikCaptionedControl::SetHorzEdgeSpacing( TInt aHorzEdgeSpacing ) 
-    {
-    iHorzEdgeSpacing = aHorzEdgeSpacing ;
-    }
-
 /**
  * Avkon component positioning for Forms
  */
@@ -2597,19 +2367,15 @@
 void CEikCaptionedControl::PositionFormComponents()
     {
     _AKNTRACE_FUNC_ENTER;
-    if( iExtension->iPartiallyVisible )
+    MinimumSize() ;
+
+    // if control has no height, return now (no point laying out)
+    if (!Rect().Height())  
         return;
+
     TBool isFocused = iIsCurrentLine;
     TBool isSingleLineLayout = ( FormLayout() == CEikDialogPage::ESingle);
-    MinimumSize() ;
     TBool hasBitmaps = ShowBitmap();
-    
-/* 
-if control has no height, return now (no point laying out)
-*/
-    if (!Rect().Height())  
-        return;
-
     TAknWindowLineLayout verticalLine = AKN_LAYOUT_WINDOW_List_pane_elements__single_heading__Line_1 ; 
 
     // If double line layout update verticalLine
@@ -2638,11 +2404,10 @@
                 }
             }    
         }
-        TRect parentRect = Rect();
-        TAknLayoutRect layoutRect;
-        layoutRect.LayoutRect( parentRect, verticalLine );
-        TRect rectVerticalLine( layoutRect.Rect() );
-
+
+    TAknLayoutRect layoutRect;
+    layoutRect.LayoutRect( Rect(), verticalLine );
+    TRect rectVerticalLine( layoutRect.Rect() );
 
     // set vertical line position.  
     if ( AknLayoutUtils::LayoutMirrored() )
@@ -2673,12 +2438,10 @@
 "none of the above".
 */
         Panic(EEikFormPanicUnknownControlType);
-        };
-
-    //TRect layoutRectOfDataPane =(iIsEditable)? EditRect() : ViewRect();
+        }
 
    //view and edit data pane rect should be the same
-    TRect layoutRectOfDataPane = ViewRect();    
+    TRect layoutRectOfDataPane( Rect() );    
 
     if ( hasBitmaps )
         {
@@ -2853,22 +2616,11 @@
         }
     }
 
-TSize CEikCaptionedControl::EditorControlSize() const 
-    {
-    return iEditorControlSize ;
-    }
-
 TInt CEikCaptionedControl::NumberOfLines() const
 	{
 	return iNumberOfLines;
 	}
 
-TInt CEikCaptionedControl::NumberOfLinesForScrollBar() const
-	{
-	if ( FormLayout() == CEikDialogPage::ESingle ) return NumberOfLines();
-	return NumberOfLines()+1;
-	}
-
 /**
  * Recalculates the number of required lines for a control.
  */
@@ -2970,26 +2722,8 @@
         {
         AknLayoutUtils::OverrideControlColorL(*this, EColorControlText, textColor );
         }
-    
     }
 
-/**
- * Retrieves the Series 60 European LAF layout values from avkon.rh
- *
- */
-void CEikCaptionedControl::GetAknLayoutValuesL()
-    {
-    TAknWindowLineLayout l = AknLayoutScalable_Avkon::form_field_data_pane(0).LayoutLine();
-    TRect parentRect = iAvkonAppUi->ClientRect();
-    TAknLayoutRect layoutRect;
-    layoutRect.LayoutRect( parentRect, l );
-    TRect rectDataPane( layoutRect.Rect() );
-
-    iAknFormControlWidth = rectDataPane.Width();
-    iAknFormControlHeight = rectDataPane.Height();
-   }
-
-    
 
 TBool   CEikCaptionedControl::IsDisplayable() const
     {
@@ -3158,12 +2892,12 @@
 EXPORT_C const TPtrC CEikCaptionedControl::GetFullCaptionText() const
     {
     return *iCaptionText;
-    };
+    }
 
 void CEikCaptionedControl::RegisterPageWithCaptionControl(CEikDialogPage* aPage)
     {
     iDialogPage=aPage;
-    };
+    }
 
 TInt CEikCaptionedControl::MaximumNumberOfControlLinesOnVisiblePage() const
     {
@@ -3213,37 +2947,8 @@
     _AKNTRACE( "maxItems: [%d]", maxItems );
     _AKNTRACE_FUNC_EXIT;
     return maxItems;
-    };
-
-
-TRect CEikCaptionedControl::ViewRect() const
-
-    {
-/* 
-The Rect that the view mode is expecting is:
-176 across 
-21 high
-set from 0,0
-
-We are
-174 across
-23 high
-set from (1,1) relative to viewwin.
-
-To convert we must:
-* Shrink(-1,1) to make Y cord and size equal, and X coord equal.
-* add 1 to the BR X coord. to make X size equal.
-*/
-    TRect viewRectConversion(EditRect());
-    viewRectConversion.Shrink(0,1);
-    return viewRectConversion;
     }
 
-TRect CEikCaptionedControl::EditRect() const
-    {
-    //The Rect provided by Rect() is fine  
-    return Rect();
-    } 
 
 void CEikCaptionedControl::FormLayoutControlBitmap(CEikImage* aBitmap, const TRect& aParent, TBool aIsEditable, TBool aSingleLayout, TInt aNumberOfLines)
     {   
@@ -3393,8 +3098,7 @@
     	SetScrollRect(aEdwin, layoutRect, textLayout, aNumberOfLines);
 	    }
 
-	TBool isviewmode = !aIsEditable;
-	aEdwin->SetSuppressBackgroundDrawing(isviewmode);
+	aEdwin->SetSuppressBackgroundDrawing(!aIsEditable);
     }
 
 
@@ -3417,11 +3121,7 @@
     // Layout the label for the single line format
     if (aSingleLayout) 
         {
-        if (aIsEditable)
-            {
-            // Do nothing; this is the default used
-            }
-        else
+        if (!aIsEditable)
             {
             // This layout is dy
             if (aBitmapPresent)
@@ -3564,7 +3264,7 @@
         TBool aSingleLayout, TInt aNumberOfLines, TBool aBitmapPresent,
         TBool /*aIsFocused*/)
     {
-    TRect layoutRect = aParent;
+    TRect layoutRect( aParent );
     TAknWindowLineLayout layoutData(AKN_LAYOUT_WINDOW_list_form_pane(aNumberOfLines-1));
 	TAknTextLineLayout labelLayout(AknLayout::Form_data_field_texts_Line_2(0));
     if (!aNumberOfLines)
@@ -3587,59 +3287,26 @@
 		{
 		isText = ETrue;
 		}
- 
+	
     if (aSingleLayout)
         {
-        if (aIsEditable)
-            {
-            layoutData=AKN_LAYOUT_WINDOW_list_form_pane(aNumberOfLines-1);
-            }
-        else
-            {
-/* 
-popupfields not specified in lists.  
-Have to convert aParent to form equivalent and use that layout.
-*/
-            ConvertViewRectToEditRect(layoutRect);
-            layoutData=AKN_LAYOUT_WINDOW_list_form_pane(aNumberOfLines-1);
-            }
+        layoutData=AKN_LAYOUT_WINDOW_list_form_pane(aNumberOfLines-1);
         }
     else  // double layout
         {
         TInt newpar = ( aBitmapPresent ? 1 : 0 ) ;
-        if (!aBitmapPresent)
-            {
-            if (aIsEditable)
-                {
-                layoutData=AKN_LAYOUT_WINDOW_list_form_wide_pane(newpar, aNumberOfLines-1);
-                }
-            else
-                {
-                // have to convert Rect before doing this.
-                ConvertViewRectToEditRect(layoutRect);
-                layoutData=AKN_LAYOUT_WINDOW_list_form_wide_pane(newpar, aNumberOfLines-1);
-                }
-            }
-        else //AKN_LAYOUT_WINDOW_list_form_graphic_wide_pane
+        layoutData=AKN_LAYOUT_WINDOW_list_form_wide_pane(newpar, aNumberOfLines-1);
+
+        if ( aBitmapPresent && !aIsEditable )
             {
-            if (aIsEditable)
-                {
-                layoutData=AKN_LAYOUT_WINDOW_list_form_wide_pane(newpar, aNumberOfLines-1);
-                }
-            else
-                {
-                // have to convert Rect before doing this.
-                ConvertViewRectToEditRect(layoutRect);
-                layoutData=AKN_LAYOUT_WINDOW_list_form_wide_pane(newpar, aNumberOfLines-1);
-				//move bitmap's width for display second line text
-		        TAknWindowLineLayout l = AknLayout::List_pane_elements__single_graphic_heading__Line_1();
-		        TAknLayoutRect bmpRect;
-		        TRect tempRect;
-		        bmpRect.LayoutRect( tempRect, l );
-				layoutRect.iTl.iX += bmpRect.Rect().Width();
-                }
+            //move bitmap's width for display second line text
+            TAknWindowLineLayout l = AknLayout::List_pane_elements__single_graphic_heading__Line_1();
+            TAknLayoutRect bmpRect;
+            TRect tempRect;
+            bmpRect.LayoutRect( tempRect, l );
+            layoutRect.iTl.iX += bmpRect.Rect().Width();
             }
-        };
+        }
 	aPopfield->SetFormFieldRect(layoutRect);
 	if (isText)
 		{ // popup field will be same size as text element
@@ -3670,7 +3337,6 @@
             TRAP_IGNORE( AknLayoutUtils::OverrideControlColorL( *aPopfield, EColorLabelText, textColor ) ); 
             }          
         }
-        
     }
 
 // Password editor
@@ -3742,61 +3408,26 @@
     {   
     if (!aNumberOfLines)
         return;
-    if (aSingleLayout)
-        {
-        if (aIsEditable)
-            {
-            aSlider->SetRect(aParent);
-            }
-        else
-            {
-/* 
-sliders not specified in lists.  
-Have to convert aParent to form equivalent and use that layout.
-*/
-            TRect conversionRect(aParent);
-            ConvertViewRectToEditRect(conversionRect);
-            aSlider->SetRect(conversionRect);
-            }
-        }
-    else 
+    
+    TRect parentRect( aParent );
+    
+    if ( !aSingleLayout )
         {
         // Not currently specified, so making temporary alterations here.
-        TInt baselineSkip= AKN_LAYOUT_MULTILINE_TEXT_Form_data_field_texts_Line_2(1).BaselineSkip();
-        TRect newParentRect(aParent);
-        //Only move the rect will cover a part or next dialogline, so decrease height of rect form iTl.
+        TInt baselineSkip = AKN_LAYOUT_MULTILINE_TEXT_Form_data_field_texts_Line_2(1).BaselineSkip();
+
+        // Only move the rect will cover a part or next dialogline, so decrease height of rect form iTl.
         if( !aIsEditable )
 	        {
-	        newParentRect.iTl.iX += baselineSkip;          	
+            parentRect.iTl.iX += baselineSkip;          	
 	        }
-        newParentRect.iTl.iY += baselineSkip;
-            
-        if (aIsEditable)
-            {
-            aSlider->SetRect(newParentRect);
-            }
-        else 
-            {
-            TRect conversionRect(newParentRect);
-            ConvertViewRectToEditRect(conversionRect);
-            aSlider->SetRect(conversionRect);
-            }
-        }   
-
-        // Exteded skin support for sliders coded in slider file: \s60\AvKon\src\Aknslider.cpp
+        
+        parentRect.iTl.iY += baselineSkip;
+        }
+    
+    aSlider->SetRect( parentRect );
     }
 
-void CEikCaptionedControl::ConvertViewRectToEditRect(TRect& aRect)
-    {
-    aRect.Grow(-1,1);
-    aRect.iBr.iX--;
-    }
-
-void CEikCaptionedControl::ConvertEditRectToViewRect(TRect& aRect)
-    {
-    aRect.Shrink(-1,1);
-    aRect.iBr.iX++;
-    }
 
 // Standard access method for the form layout from within captioned control
 CEikDialogPage::TFormLayoutSelection CEikCaptionedControl::FormLayout() const
@@ -3804,12 +3435,12 @@
     // There is no undefined style, but initialize to single...
     CEikDialogPage::TFormLayoutSelection ret = CEikDialogPage::ESingle;
     if ( iDialogPage )
+        {
         ret = iDialogPage->FormLayout();
-    
-    if (!iDialogPage)
+        }
+    else if (iFlags & EEikFormUseDoubleSpacedFormat) // similar to CEikDialogPage::ConstructFormFromResourceL()
         {
-        if (iFlags & EEikFormUseDoubleSpacedFormat) // similar to CEikDialogPage::ConstructFormFromResourceL()
-            ret = CEikDialogPage::EDouble;
+        ret = CEikDialogPage::EDouble;
         }
     return ret;
     }
@@ -3821,23 +3452,11 @@
         {
         sepLineRect.LayoutRect
             (
-            ViewRect(), 
+            Rect(), 
             AKN_LAYOUT_WINDOW_List_pane_elements__single_heading__Line_2
             );
         sepLineRect.DrawRect(gc);
-
         }
-//  else
-//      {
-// Currently no LAF specification for separator in double mode
-//      sepLineRect.LayoutRect
-//          (
-//          ViewRect(), 
-//          AKN_LAYOUT_WINDOW_List_pane_elements__double_graphic__Line_??
-//          );
-//      sepLineRect.DrawRect(gc);
-//
-//      }
     }
 
 void CEikCaptionedControl::DrawClosingLine() const
@@ -3923,8 +3542,6 @@
         }
     else
         {
-        outerRect = ViewRect() ;
-        innerRect = outerRect ;
         innerRect.iTl = ViewFrameTopLeftRect( outerRect ).iBr ;
         innerRect.iBr = ViewFrameBottomRightRect( outerRect ).iTl ;
         iExtension->iViewModeHighlightControlContext->SetFrameRects( outerRect, innerRect );
@@ -3963,58 +3580,56 @@
         }
     else // Highlight Skinning.  Requires Frame
         {
+        TRect outerRect( Rect() );
+        TRect innerRect( outerRect );
+        
         if ( iIsEditable )
             {
-            TRect innerRect( EditRect() ) ;
-            innerRect.iTl = EditFrameTopLeftRect( Rect() ).iBr ;
-            innerRect.iBr = EditFrameBottomRightRect( Rect() ).iTl ;
+            innerRect.iTl = EditFrameTopLeftRect( outerRect ).iBr ;
+            innerRect.iBr = EditFrameBottomRightRect( outerRect ).iTl ;
 
             MAknsControlContext* parentCc = GetDialogControlContext( iDialogPage ) ; 
-            AknsDrawUtils::Background( skin, parentCc, this, aGc, Rect() ) ;
-
-            AknListUtils::DrawSeparator( aGc, Rect(), textColor, skin );
+            AknsDrawUtils::Background( skin, parentCc, this, aGc, outerRect ) ;
+
+            AknListUtils::DrawSeparator( aGc, outerRect, textColor, skin );
             
             // Set the rectangle(s) for the Frame context
-            iExtension->iEditModeHighlightControlContext->SetFrameRects( EditRect(), innerRect ) ;
-            iExtension->iEditModeHighlightControlContextPressed->SetFrameRects( EditRect(), innerRect ) ;
+            iExtension->iEditModeHighlightControlContext->SetFrameRects( outerRect, innerRect ) ;
+            iExtension->iEditModeHighlightControlContextPressed->SetFrameRects( outerRect, innerRect ) ;
             
-            AknsDrawUtils::DrawFrame( skin, aGc, EditRect(), innerRect,
+            AknsDrawUtils::DrawFrame( skin, aGc, outerRect, innerRect,
                                       PressedDownState() ?
                                       KAknsIIDQsnFrListPressed : KAknsIIDQsnFrInput, KAknsIIDDefault );
             }
         else // View Mode highlight
             {
             TBool drawOk = EFalse;
-            TRect viewRect( ViewRect() );
-            TRect innerRect( viewRect );
-            innerRect.iTl = ViewFrameTopLeftRect( viewRect ).iBr;
-            innerRect.iTl.iX-- ; innerRect.iTl.iY--;
-            innerRect.iBr = ViewFrameBottomRightRect( viewRect ).iTl ;
+            innerRect.iTl = ViewFrameTopLeftRect( outerRect ).iBr;
+            innerRect.iBr = ViewFrameBottomRightRect( outerRect ).iTl ;
     
             // The bit around the outside must use the parent's control context
             MAknsControlContext* parentCc = GetDialogControlContext( iDialogPage );
-            AknsDrawUtils::BackgroundBetweenRects( skin, parentCc, this, aGc, 
-                    Rect(), innerRect );
+            AknsDrawUtils::Background( skin, parentCc, this, aGc, outerRect ) ;
     
-            AknListUtils::DrawSeparator( aGc, Rect(), textColor, skin );
+            AknListUtils::DrawSeparator( aGc, outerRect, textColor, skin );
 
             // Draw the animation itself
             if ( iExtension->IsHighlightAnimated() 
                     && iExtension->iAnimation->Animation() )
                 {
                 drawOk = iExtension->iAnimation->Animation()->Render( aGc, 
-                        viewRect );
+                        outerRect );
                 }
     
             if ( !drawOk )
                 {
                 // Set the rectangle(s) for the Frame context
                 iExtension->iViewModeHighlightControlContext->SetFrameRects( 
-                        viewRect, innerRect ) ;
+                        outerRect, innerRect ) ;
                 iExtension->iViewModeHighlightControlContextPressed->
-                    SetFrameRects( viewRect, innerRect ) ;
+                    SetFrameRects( outerRect, innerRect ) ;
                 
-                AknsDrawUtils::DrawFrame( skin, aGc, viewRect, innerRect,
+                AknsDrawUtils::DrawFrame( skin, aGc, outerRect, innerRect,
                         PressedDownState() ? KAknsIIDQsnFrListPressed : 
                         KAknsIIDQsnFrList, KAknsIIDDefault );
                 }
@@ -4154,40 +3769,7 @@
         User::LeaveIfError(AknIconUtils::SetSize(aBitmap, 
                               rectElements.Size() ));
         }
-/*        
-    
-    if (iIsFormControl)
-        {
-        if (iIsEditable)
-            {
-            if (iBitmap && iBitmap->Bitmap())
-                {
-                AknIconUtils::SetSize(CONST_CAST(CFbsBitmap*, iBitmap->Bitmap()), 
-                                        TSize(AKN_LAYOUT_WINDOW_Form_data_field_elements_Line_4.iW, 
-                                        AKN_LAYOUT_WINDOW_Form_data_field_elements_Line_4.iH));
-                }
-            }
-        else
-            {
-            if (iBitmap && iBitmap->Bitmap())
-                {
-                AknIconUtils::SetSize(CONST_CAST(CFbsBitmap*, iBitmap->Bitmap()), 
-                                        TSize(AKN_LAYOUT_WINDOW_List_pane_elements__single_graphic_heading__Line_1.iW, 
-                                        AKN_LAYOUT_WINDOW_List_pane_elements__single_graphic_heading__Line_1.iH));
-                }
-            }
-        }
-    else
-        {
-        if (iBitmap && iBitmap->Bitmap())
-            {
-            AknIconUtils::SetSize(CONST_CAST(CFbsBitmap*, iBitmap->Bitmap()), 
-                        TSize(AKN_LAYOUT_WINDOW_List_pane_elements__single_graphic_heading__Line_1.iW, 
-                        AKN_LAYOUT_WINDOW_List_pane_elements__single_graphic_heading__Line_1.iH));
-            }
-        }                       */
     }
-    
 
 
 // -----------------------------------------------------------------------------
@@ -4281,11 +3863,6 @@
     }
 
 
-void CEikCaptionedControl::SetPartiallyVisible( TBool aPVisible )
-    {
-    iExtension->iPartiallyVisible = aPVisible;
-    }
-    
 /*  
  * Special Label Class which appends colon to label text
  */
--- a/uifw/EikStd/dlgsrc/EIKCAPCA.CPP	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/dlgsrc/EIKCAPCA.CPP	Thu Jul 15 18:56:19 2010 +0300
@@ -97,105 +97,7 @@
 	return iExtension;
 }
 
-TInt CEikCapCArray::NumberOfTextLines() const
-{
-	_AKNTRACE_FUNC_ENTER;
-	CEikCaptionedControl *firstCapCC = Count() > 0 ? (*this)[0] : NULL;
-	const CEikDialogPage *dialogPage = firstCapCC ? firstCapCC->DialogPage() : NULL;
-    CEikDialogPage::TFormLayoutSelection ret = CEikDialogPage::ESingle;
-	if ( dialogPage )
-		ret = dialogPage->FormLayout();
 
-	TInt lines = 0;
-	for(TInt i = 0; i<Count(); i++)
-		{
-			TInt num_of_lines = 0;
-			CEikCaptionedControl *line = (*this)[i];
-			if (ret == CEikDialogPage::ESingle)
-					{
-					//line->MinimumSize(); // ensures NumberOfLines() is valid.
-					TInt h = line->NumberOfLinesForScrollBar();
-					num_of_lines = h;
-					}
-			else if (ret == CEikDialogPage::EDouble)
-					{
-					//line->MinimumSize(); // ensures NumberOfLines() is valid.
-					TInt h = line->NumberOfLinesForScrollBar();
-					num_of_lines = h; // one for title
-					}	
-		lines += num_of_lines;
-	}
-	_AKNTRACE( "lines: [%d]", lines );
-	_AKNTRACE_FUNC_EXIT;
-	return lines;
-}
-
-TInt CEikCapCArray::NumberOfTextLinesBeforeLine(TInt aLine) const
-{
-	_AKNTRACE_FUNC_ENTER;
-	CEikCaptionedControl *firstCapCC = Count() > 0 ? (*this)[0] : NULL;
-	const CEikDialogPage *dialogPage = firstCapCC ? firstCapCC->DialogPage() : NULL;
-    CEikDialogPage::TFormLayoutSelection ret = CEikDialogPage::ESingle;
-	if ( dialogPage )
-		ret = dialogPage->FormLayout();
-
-	TInt lines = 0;
-	for(TInt i = 0; i<aLine; i++)
-		{
-			TInt num_of_lines = 0;
-			CEikCaptionedControl *line = (*this)[i];
-			if (ret == CEikDialogPage::ESingle)
-					{
-					//line->MinimumSize(); // ensures NumberOfLines() is valid.
-					TInt h = line->NumberOfLinesForScrollBar();
-					num_of_lines = h;
-					}
-			else if (ret == CEikDialogPage::EDouble)
-					{
-					//line->MinimumSize(); // ensures NumberOfLines() is valid.
-					TInt h = line->NumberOfLinesForScrollBar();
-					num_of_lines = h; // one for title
-					}	
-		lines += num_of_lines;
-	}
-	_AKNTRACE( "lines: [%d]", lines );
-	_AKNTRACE_FUNC_EXIT;
-	return lines;
-
-}
-
-TInt CEikCapCArray::FindItemFromTextLine(TInt aTextLine) const
-	{
-	CEikCaptionedControl *firstCapCC = Count() > 0 ? (*this)[0] : NULL;
-	const CEikDialogPage *dialogPage = firstCapCC ? firstCapCC->DialogPage() : NULL;
-    CEikDialogPage::TFormLayoutSelection ret = CEikDialogPage::ESingle;
-	if ( dialogPage )
-		ret = dialogPage->FormLayout();
-
-	TInt lines = 0;
-	TInt i = 0;
-	for(i = 0; i<Count(); i++)
-		{
-			TInt num_of_lines = 0;
-			CEikCaptionedControl *line = (*this)[i];
-			if (ret == CEikDialogPage::ESingle)
-					{
-					//line->MinimumSize(); // ensures NumberOfLines() is valid.
-					TInt h = line->NumberOfLinesForScrollBar();
-					num_of_lines = h;
-					}
-			else if (ret == CEikDialogPage::EDouble)
-					{
-					//line->MinimumSize(); // ensures NumberOfLines() is valid.
-					TInt h = line->NumberOfLinesForScrollBar();
-					num_of_lines = h; // one for title
-					}	
-		lines += num_of_lines;
-		if (lines > aTextLine)
-			break;
-	}
-	return i;
-	}
 /**
  *  Calculate the size of all the component controls stacked vertically.
  *  For Avkon Forms the controls overlap by 2 pixels (hard coded)
@@ -212,78 +114,63 @@
 		// TP HACK START (made because MinimumSize() is not good name for situations where content dimensions are desired)
 		TInt height = 0;
 		TInt width = 0;
-		TRect parentRect = Rect();
 		TSize lineSize; // absolute size, minimumSize = maximumSize = LAF size
 		for(TInt i=0;i<Count();i++)
 			{
-			TInt gap = 0; // not possible to get this from LAF. (should be 0.5u or something)
 			CEikCaptionedControl *line = (*this)[i];
-				TAknWindowLineLayout layout;
-			const CEikDialogPage *dialogPage = firstCapCC->DialogPage();
-		    CEikDialogPage::TFormLayoutSelection ret = CEikDialogPage::ESingle;
-			if ( dialogPage )
-				ret = dialogPage->FormLayout();
-			if (ret == CEikDialogPage::ESingle)
-					{
-					lineSize = line->MinimumSize(); // ensures NumberOfLines() is valid.
-					}
-			else if (ret == CEikDialogPage::EDouble)
-					{
-					lineSize = line->MinimumSize(); // ensures NumberOfLines() is valid.
-					}	
-			height += lineSize.iHeight + gap;
+            lineSize = line->MinimumSize(); // ensures NumberOfLines() is valid.
+			height += lineSize.iHeight;
 			width = lineSize.iWidth;
 			}
-		size = TSize(width,height);
+		size.SetSize(width,height);
 		}
 	else
 		{
-
-	TInt wholeWidth=0;
-	const TInt count=Count();
-	const TInt topMargin=iDensePacking ? KAknNoTopMargin : KAknTopMargin;
-	const TInt bottomMargin = iDensePacking ? KAknNoTopMargin : KAknTopMargin ;
-	const TInt verticalSpacing=iDensePacking ? KVerticalSpacingSquash : KVerticalSpacing;
-	TInt deltaHeight=0;
-	CEikCapCArrayExtension *extension = ExtensionOrNull();
-	if (!extension) return TSize(30,30); // OOM
-	for (TInt ii=0;ii<count;++ii)
-		{
-		CEikCaptionedControl* line=(*this)[ii];
-		TSize thisSize=line->MinimumSize();
-		TInt thisDeltaHeight=thisSize.iHeight+verticalSpacing;
-		if (deltaHeight<thisDeltaHeight)
-			deltaHeight=thisDeltaHeight;
-		const TInt thisCaptionWidth=line->iCaptionWidth;
-		if (!(line->LatentGroupLineFollows()))
-			{
-			size.iHeight+=deltaHeight;
-			deltaHeight=0;
-			}
-		if (!thisCaptionWidth)
-			{
-			if (wholeWidth<thisSize.iWidth)
-				wholeWidth=thisSize.iWidth;
-			}
-		else
-			{
-			thisSize.iWidth-=thisCaptionWidth;
-			if (extension->iCaptionWidth<thisCaptionWidth)
-				extension->iCaptionWidth=thisCaptionWidth;
-			if (size.iWidth<thisSize.iWidth)
-				size.iWidth=thisSize.iWidth;
-			}
-		}
-	size.iWidth+=extension->iCaptionWidth;
-	if (size.iWidth<wholeWidth)
-		size.iWidth=wholeWidth;
-	// If the total height is zero don't bother adding a top margin
-	if ( size.iHeight > 0 )
-		{
-		size.iHeight+=( topMargin + bottomMargin ) ;
-		size.iHeight+=2 ;  // (we have included one too many '-2's)
-		}
-	}
+        TInt wholeWidth=0;
+        const TInt count=Count();
+        const TInt topMargin=iDensePacking ? KAknNoTopMargin : KAknTopMargin;
+        const TInt bottomMargin = iDensePacking ? KAknNoTopMargin : KAknTopMargin ;
+        const TInt verticalSpacing=iDensePacking ? KVerticalSpacingSquash : KVerticalSpacing;
+        TInt deltaHeight=0;
+        CEikCapCArrayExtension *extension = ExtensionOrNull();
+        if (!extension) return TSize(30,30); // OOM
+        for (TInt ii=0;ii<count;++ii)
+            {
+            CEikCaptionedControl* line=(*this)[ii];
+            TSize thisSize=line->MinimumSize();
+            TInt thisDeltaHeight=thisSize.iHeight+verticalSpacing;
+            if (deltaHeight<thisDeltaHeight)
+                deltaHeight=thisDeltaHeight;
+            const TInt thisCaptionWidth=line->iCaptionWidth;
+            if (!(line->LatentGroupLineFollows()))
+                {
+                size.iHeight+=deltaHeight;
+                deltaHeight=0;
+                }
+            if (!thisCaptionWidth)
+                {
+                if (wholeWidth<thisSize.iWidth)
+                    wholeWidth=thisSize.iWidth;
+                }
+            else
+                {
+                thisSize.iWidth-=thisCaptionWidth;
+                if (extension->iCaptionWidth<thisCaptionWidth)
+                    extension->iCaptionWidth=thisCaptionWidth;
+                if (size.iWidth<thisSize.iWidth)
+                    size.iWidth=thisSize.iWidth;
+                }
+            }
+        size.iWidth+=extension->iCaptionWidth;
+        if (size.iWidth<wholeWidth)
+            size.iWidth=wholeWidth;
+        // If the total height is zero don't bother adding a top margin
+        if ( size.iHeight > 0 )
+            {
+            size.iHeight+=( topMargin + bottomMargin ) ;
+            size.iHeight+=2 ;  // (we have included one too many '-2's)
+            }
+        }
     _AKNTRACE( "The Size : ( %d, %d ) ", size.iHeight, size.iWidth );
 	_AKNTRACE_FUNC_EXIT;
 	return size;
@@ -373,7 +260,7 @@
 			{
 			// should Panic() here 
 			}
-		TRect rect = TRect(TPoint(0,0), aAreaSize);
+		TRect rect(aAreaSize);
 		TAknLayoutRect layoutRect;
 		layoutRect.LayoutRect(rect, layout);
 		TInt height2 = layoutRect.Rect().Height();
@@ -384,7 +271,6 @@
 			break;
 			}
 
-
 		newMiddle = i + 1;
 		if (aTopItemIndex == -1)
 			{
@@ -476,149 +362,6 @@
 	SetRect(aRect, 0, -1, -1);
 }
 
-/**
- * If aControl is an edwin, set its clipping rect to empty. This
- * will disable the text hiding.
- */
-static void ResetHides(CEikCaptionedControl *aControl)
-	{
-	aControl->SetPartiallyVisible( EFalse );
-	if (aControl->ControlIsAnEdwin(aControl->iControlType))
-		{
-		CEikEdwin *edwin = (CEikEdwin*)aControl->iControl;
-		edwin->SetTextLinesRect(TRect());
-		}
-	}
-
-/**
- * Sets a clipping rectangle for hiding the whole or a part of edwin's text.
- *
- * The reason for using this function is the multiline edwins. The text inside
- * an edwin can be broken to two or more lines, which must be hidden or shown 
- * independently from each other. That is why it is not enough just to move
- * the whole edwin out of the screen.
- *
- * @param aClipRect The clipping rect for edwin's text. An empty rect disables 
- *   hiding.
- *
- * @return How many subcontrols were hidden
- */
-static TInt HideLines_Edwin(CEikEdwin *aEdwin, TRect aClipRect)
-	{
-	aEdwin->SetTextLinesRect(aClipRect);
-    
-    // Create rects of the first and last edwin lines
-    TPoint edwinTl( aEdwin->Rect().iTl );
-    TPoint edwinBr( aEdwin->Rect().iBr );
-    TRect textFirstLine;
-    aEdwin->TextLayout()->GetLineRect(edwinTl.iY, textFirstLine);
-    textFirstLine.Move( edwinTl.iX, edwinTl.iY + aEdwin->Margins().iTop );
-    TRect textLastLine;
-    aEdwin->TextLayout()->GetLineRect(edwinBr.iY, textLastLine);
-    textLastLine.Move( edwinBr.iX, edwinBr.iY - aEdwin->Margins().iTop - textLastLine.Height() );
-
-    // Check if at least one line fits to the clipping rect
-	if( aClipRect.Contains(textFirstLine.iTl) &&
-	    aClipRect.iBr.iY >= textFirstLine.iBr.iY )   // The first line fits
-	    return 0;
-	if( aClipRect.Contains(textLastLine.iTl) &&
-	    aClipRect.iBr.iY >= textLastLine.iBr.iY )   // The last line fits
-	    return 0;
-	return 1;
-	}
-
-/**
- * Tries to hide the specified control. The control will be hidden, if it doesn't
- * fit to the specified clipping rectangle. Checks if the control exists.
- *
- * @return How many subcontrols were hidden
- */
-static TInt HideLines_Ctrl(CCoeControl *aControl, TRect aClipRect)
-	{
-	if ( !aControl )
-	    return 1;   // It doesn't exist and hence not visible
-	TRect rect( aControl->Rect() );
-	if ( !aClipRect.Contains(rect.iTl) || aClipRect.iBr.iY <= rect.iBr.iY )
-	    // Never use TRect::Contains() for checking the bottom right corner, see documentation
-		{
-		// hide it
-		aControl->SetPosition( TPoint(-666,-666) );
-		return 1;
-		}
-    else
-        return 0;
-	}
-
-/**
- * Get vertically minimal rectangle of the two given.
- *
- * Vertically reduces aRect1 by aRect2's dangling part, if aRect2
- * doesn't fit to aRect1.
- *
- * Sets aRect1 to the resulting minimal rectangle.
- */	
-static void GetVertMinRect( TRect& aRect1, const TRect aRect2 )
-    {
-    // If aRect2's top doesn't fit, lower aRect1's top
-    if( aRect2.iTl.iY < aRect1.iTl.iY )
-        aRect1.iTl.iY = Max( aRect1.iTl.iY, aRect2.iBr.iY );
-    // If aRect2's bottom doesn't fit, raise aRect1's bottom
-    if( aRect2.iBr.iY > aRect1.iBr.iY )
-        aRect1.iBr.iY = Min( aRect1.iBr.iY, aRect2.iTl.iY );
-    }
-
-/**
- * Hides the specified form line, if it does not fit to the specified clipping rectangle.
- * The function never hides focused editable lines. If the form layout is single, the whole
- * captioned control is hidden.
- * 
- * @param aControl The form line to be hidden
- * @param aClipRect The clipping rectangle
- *
- * @return How many subcontrols remained visible
- */	
-static TInt HideLines(CEikCaptionedControl *aControl, TRect aClipRect)
-	{
-	TInt visibleCtrls = 3; // Visible subcontrols after hiding
-	CEikCaptionedControl *currentdLine = aControl->DialogPage()->CurrentLine();
-	if( ( aControl == currentdLine ) && aControl->iIsEditable )
-	    {
-	    return visibleCtrls;
-	    }
-	
-	TBool isEdwin = aControl->ControlIsAnEdwin(aControl->iControlType);    
-	CEikEdwin* edwin( NULL );
-	if( isEdwin )
-	    edwin = (CEikEdwin*)aControl->iControl;
-	TRect ctrlRect( aControl->iControl->Rect() );
-		
-	if( isEdwin )
-	    {
-	    // Adjust rectangle only to the first line (with edwin's top margin)
-	    TRect textFirstLine;
-	    edwin->TextLayout()->GetLineRect(ctrlRect.iTl.iY, textFirstLine);
-	    ctrlRect.iBr.iY = ctrlRect.iTl.iY + edwin->Margins().iTop + textFirstLine.Height();
-	    }	    
-	
-	// Find the minimal clipping rectangle
-	if( aControl->iBitmap )
-	    GetVertMinRect( aClipRect, aControl->iBitmap->Rect() );
-	if( aControl->iCaption )
-	    GetVertMinRect( aClipRect, aControl->iCaption->Rect() );
-	GetVertMinRect( aClipRect, ctrlRect );
-	
-	
-	
-	// Try to hide all controls on the current line
-	aControl->SetPartiallyVisible( ETrue );
-	visibleCtrls -= HideLines_Ctrl( aControl->iBitmap, aClipRect );
-	visibleCtrls -= HideLines_Ctrl( aControl->iCaption, aClipRect );
-	if( isEdwin )
-		visibleCtrls -= HideLines_Edwin( edwin, aClipRect );
-	else
-		visibleCtrls -= HideLines_Ctrl( aControl->iControl, aClipRect );
-    return visibleCtrls;
-	}
 
 /**
 * Places the dialog items according to the current visible window position.
@@ -650,7 +393,7 @@
     TAknLayoutRect formtLayoutRect;
     formtLayoutRect.LayoutRect(aRect, AknLayoutScalable_Avkon::listscroll_form_pane().LayoutLine());
     formtLayoutRect.LayoutRect(formtLayoutRect.Rect(), AknLayoutScalable_Avkon::list_form_gen_pane().LayoutLine());
-    TRect formRect = formtLayoutRect.Rect();
+    TRect formRect( formtLayoutRect.Rect() );
 	
 	CEikCapCArrayExtension *extension_or_null = ExtensionOrNull();
 	
@@ -679,271 +422,46 @@
             }
         }
         
-	TBool topDefined = EFalse;   // top or bottom number defined?
-	if( aTop > -1 )
-	    {
-	    topDefined = ETrue;
-	    }
-	else if( aBottom > -1 )
-	    {
-	    topDefined = EFalse;
-	    }
-	else    // aBottom == aTop == -1
-	    {
-	    User::Panic( _L("CEikCapCArray::SetRect(): Neither top nor bottom items number defined"), EAknPanicInvalidValue );
-	    }
-	const TInt count = Count();
-	const TInt rectHeight = aRect.Height();
-	/**
-	* Special invisible points are used for placing the items that are
-	* outside the window. CCoeControl's invisible flag cannot be used,
-	* as it is controlled by third-party applications.
-	*/
-	const TPoint topInvisPoint( -10000, -10000 );
-	const TPoint bottomInvisPoint( 10000, 10000 );
-	
-	CEikCaptionedControl *firstCapCC = count > 0 ? (*this)[0] : NULL;
-	if( firstCapCC && firstCapCC->iIsFormControl )  // Forms
-		{
-		CEikCaptionedControl *selectedLine( NULL );
-		if( firstCapCC->DialogPage())
-	        selectedLine = firstCapCC->DialogPage()->CurrentLine();
-		
-		// Check height of items and the input parameters aTop and aBottom.
-		TInt rest = 0;  // number of the rest items without aTop or aBottom
-		TInt index = 0;
-    	if( topDefined )
-    	    {
-    	    rest = count - aTop;
-    	    index = aTop;
-    	    }
-    	else
-    	    {
-    	    rest = count - aBottom;
-    	    index = rest - 1;
-    	    }
-		TInt height = 0;
-		for( TInt ii = 0; ii < rest; ii++ )
-			{
-    		CEikCaptionedControl* line = (*this)[index];
-		    height += line->MinimumSize().iHeight;  // Use MinimumSize() here as a protection from dynamic layout change
-		    if( height >= rectHeight )
-                break;  // Input params are OK
-		    topDefined? index++ : index--;
-		    }
-		/** 
-		* If the window contains too few items inside and there are still items outside,
-		* correct the input parameters @a aTop and @a aBottom to fill up the window.
-		*/
-		if( height < rectHeight )
-		    {
-		    if( topDefined && aTop > 0 )    // For top-down placement and there are items above the window
-    		    {
-    		    // Calculate height of controls above the window also
-		        for( TInt ii = 0; ii < aTop; ii++ )
-		            {
-    		        CEikCaptionedControl* line = (*this)[ii];
-		            height += line->MinimumSize().iHeight;
-        		    if( height >= rectHeight )  // All items don't fit to the window anyway
-    		            {
-        		        topDefined = EFalse;   // Reverse direction to bottom-up
-        		        aBottom = 0;
-                        break;
-        		        }
-		            }
-		        if( height < rectHeight )  // All items fit to the window
-    		        {
-    		        aTop = 0; // Just place them from the first item
-    		        }
-    		    }
-    	    else if( !topDefined )  // For bottom-up placement
-    	        {
-    		    topDefined = ETrue;   // Reverse direction to top-down
-    		    aTop = 0;
-    	        }
-    	    }
-		
-		// Hiding items that are explicitly defined to be outside the window
-		TInt start;
-		TInt end;
-	    TPoint invisPoint;    // current invisible point, depends on placement direction
-    	if( topDefined )
-    	    {
-    	    start = 0;
-    	    end = aTop;
-    	    invisPoint = topInvisPoint;
-    	    }
-    	else
-    	    {
-    	    start = count - aBottom;
-    	    end = count;
-    	    invisPoint = bottomInvisPoint;
-    	    }
-		for( TInt ii = start; ii < end; ii++ )
-			{
-			CEikCaptionedControl* line = (*this)[ii];
-			line->SetPosition( invisPoint );
-			}
-		
-		// Setting rects for the rest of the items
-    	if( topDefined )
-    	    {
-    	    rest = count - aTop;
-    	    invisPoint = bottomInvisPoint;
-    	    index = aTop;
-    	    }
-    	else
-    	    {
-    	    rest = count - aBottom;
-    	    invisPoint = topInvisPoint;
-    	    index = rest - 1;
-    	    }
-		TInt reservedHeight = 0; // in pixels
-		TBool insideWindow = ETrue; // The current item is still inside the window
-        TInt topY = 0;
-        
-		
-		for( TInt ii = 0; ii < rest; ii++ )
-			{
-    		CEikCaptionedControl* line = (*this)[index];
-    		TSize lineSize( line->Size() );
-		    if( insideWindow )
-		        {
-			    ResetHides( line );
-    		    if( topDefined )
-    		        {   // Top-down placement
-    		        topY = aRect.iTl.iY + reservedHeight;   
-    		        }
-    		    else
-    		        {   // Bottom-up placement
-    		        topY = aRect.iBr.iY - reservedHeight - lineSize.iHeight;
-    		        }
-    		    line->SetExtent( TPoint( formRect.iTl.iX, topY ), lineSize );
-    			AknsUtils::RegisterControlPosition( line );
-    			AknsUtils::RegisterControlPosition( line->iCaption );
-    			AknsUtils::RegisterControlPosition( line->iControl );
-    			AknsUtils::RegisterControlPosition( line->iTrailer );
-    			AknsUtils::RegisterControlPosition( line->iBitmap );
-    			reservedHeight += lineSize.iHeight;
-    			/** 
-    			* The control at a window edge is considered as partially-visible.
-    			* Its subcontrols must be checked for visibility individually.
-    			*/
-    			if( reservedHeight > rectHeight )
-    			    {
-    			    TInt visibleSubctrls = HideLines( line, aRect );    // Check how many subcontrols stayed visible
-    			    insideWindow = EFalse;
-    			    /**
-    			    * For the bottom-up placement:
-    			    * if the window contains only an empty "partially-visible" control and a
-    			    * a selected popup field, make the popup to hang at the top alone.
-    			    */
-    			    if( !topDefined && index < count - 1 ) // bottom-up and not last
-    			        {
-        			    CEikCaptionedControl* lineBelow = (*this)[index+1];
-        			    if( visibleSubctrls == 0 && ii == 1 &&
-        			        IsPopupField( lineBelow ) && lineBelow == selectedLine )
-        			        {
-            		        TRect popupRect( lineBelow->Rect() );
-            		        TInt diff = aRect.iTl.iY - popupRect.iTl.iY; // negative
-            		        popupRect.Move( 0, diff );
-            		        lineBelow->SetRect( popupRect );
-        			        }
-    			        }
-    			    }
-		        }
-		    else
-		        {
-	            line->SetPosition( invisPoint );
-		        }
-		    topDefined? index++ : index--;
-			}
-		}
-	else    // Dialogs other than forms:
-		{
-    	TRect rect=aRect;
-    	const TInt fullWidth=rect.iBr.iX-rect.iTl.iX;
-    	const TInt count=Count();
-    	const TInt topMargin=iDensePacking ? KAknNoTopMargin : KAknTopMargin;
-    	const TInt verticalSpacing=iDensePacking ? KVerticalSpacingSquash : KVerticalSpacing;
-    	rect.iTl.iY+=topMargin;
-    	TInt deltaHeight=0;
-    	for (TInt ii=0;ii<count;++ii)
-    		{
-    		CEikCaptionedControl* line=(*this)[ii];
-    	    TSize thisSize=line->MinimumSize();
-    		TInt thisDeltaHeight=thisSize.iHeight+verticalSpacing;
-    		if (deltaHeight<thisDeltaHeight)
-    			deltaHeight=thisDeltaHeight;
-    		if (!(line->iCaptionWidth))
-    			thisSize.iWidth=fullWidth;
-    		else
-    			{
-    			CEikCapCArrayExtension *ext = ExtensionOrNull();
-    			TInt deltaWidth = 0;
-    			if (ext) 
-    				deltaWidth = ext->iCaptionWidth-line->iCaptionWidth;
-    			thisSize.iWidth+=deltaWidth;
-    			if (ext)
-    				line->iCaptionWidth=ext->iCaptionWidth;
-    			else
-    				line->iCaptionWidth = 0;
-    			line->iMinSize.iWidth+=deltaWidth;
-    			}
-    		line->iFullWidth=fullWidth;
-    	    line->SetExtent(rect.iTl,thisSize);
-    		if (!(line->LatentGroupLineFollows()))
-    			{
-    			rect.iTl.iY+=deltaHeight;
-    			deltaHeight=0;
-    			}
-    		}
-		}
-	_AKNTRACE_FUNC_EXIT;
-	}
+	// rest of the function is executed for dialogs and empty forms only
+    TRect rect(aRect);
+    const TInt fullWidth=rect.iBr.iX-rect.iTl.iX;
+    const TInt count=Count();
+    const TInt topMargin=iDensePacking ? KAknNoTopMargin : KAknTopMargin;
+    const TInt verticalSpacing=iDensePacking ? KVerticalSpacingSquash : KVerticalSpacing;
+    rect.iTl.iY+=topMargin;
+    TInt deltaHeight=0;
+    for (TInt ii=0;ii<count;++ii)
+        {
+        CEikCaptionedControl* line=(*this)[ii];
+        TSize thisSize=line->MinimumSize();
+        TInt thisDeltaHeight=thisSize.iHeight+verticalSpacing;
+        if (deltaHeight<thisDeltaHeight)
+            deltaHeight=thisDeltaHeight;
+        if (!(line->iCaptionWidth))
+            thisSize.iWidth=fullWidth;
+        else
+            {
+            CEikCapCArrayExtension *ext = ExtensionOrNull();
+            TInt deltaWidth = 0;
 
-TInt CEikCapCArray::YPosToLine(const TRect &aRect, 
-							   TInt aTop, TInt aMiddle, TInt aBottom, 
-							   TInt aYCoord)
-	{
-	TInt top = aTop;
-	TInt middle = aMiddle;
-	TInt bottom = aBottom;
-	CalcItemIndexes(top, middle, bottom, aRect.Size());
-	
-	for(int i = top ; i < top+middle; i++)
-		{
-		CEikCaptionedControl *fst = (*this)[i];
-		if (aYCoord < fst->Rect().iTl.iY)
-			{
-			if (i > 0)
-				return i-1;
-			else
-				return KErrNotFound;
-			}
-		}
-	if (Count() == 0) return -1;
-	TInt ii = top+middle-1;
-	CEikCaptionedControl *last = (*this)[ii];
-	if ( aYCoord < last->Rect().iBr.iY )
-		{
-		return ii;
-		}
-	else
-		{
-		if ( ii+1 < Count() )
-		    {
-		    return ii+1;
-		    }
-		else if ( aYCoord > last->Rect().iBr.iY )
-		    {
-		    return KErrNotFound;
-		    }
-		else
-		    {
-		    return ii;
-		    }
-		}
+            if (ext) 
+                deltaWidth = ext->iCaptionWidth-line->iCaptionWidth;
+            thisSize.iWidth+=deltaWidth;
+            if (ext)
+                line->iCaptionWidth=ext->iCaptionWidth;
+            else
+                line->iCaptionWidth = 0;
+            }
+        line->iFullWidth=fullWidth;
+        line->SetExtent(rect.iTl,thisSize);
+        if (!(line->LatentGroupLineFollows()))
+            {
+            rect.iTl.iY+=deltaHeight;
+            deltaHeight=0;
+            }
+        }
+
+    _AKNTRACE_FUNC_EXIT;
 	}
 	
 EXPORT_C void CEikCapCArray::ResetMinimumSizes()
@@ -989,61 +507,6 @@
 	return(KErrNotFound);
 	}
 
-// ---------------------------------------------------------------------------
-// CEikCapCArray::ScrollByPixels
-// ---------------------------------------------------------------------------
-//
-TInt CEikCapCArray::ScrollByPixels( TInt aDelta )
-    {
-	_AKNTRACE_FUNC_ENTER;
-    TInt count = Count();
-    
-    // Top and bottom of lines
-    TInt topY = (*this)[0]->Rect().iTl.iY;
-    TInt bottomY = (*this)[count - 1]->Rect().iBr.iY;
-
-    TRect formRect( Rect() );
-
-    if ( aDelta )
-        {
-        for( TInt i = 0; i < count; ++i )
-            {
-            CEikCaptionedControl* line = (*this)[i];
-            TBool onDisplay = line->Rect().Intersects( formRect );
-            TPoint position( line->Position() );
-            position.iY += aDelta;
-            
-            line->SetPosition( position );
-            
-            onDisplay = onDisplay || line->Rect().Intersects( formRect );
-            
-            // Line is or was on display
-            if ( ETrue /*onDisplay*/ )
-                // Some controls, eg. slider and edwin don't handle
-                // SetPosition properly. Workaround is to use SetRect,
-                // which is slow as it does a whole layout for the control.
-                // If form panning is ever speed optimized, captioned
-                // control should me made to support SetPosition() correctly.
-                {
-                if ( line->ControlIsAPopfield( line->iControlType ) )
-                    {
-                    // Have to layout whole captioned control, otherwise
-                    // text doesn't move. Fix later popup field to move
-                    // properly.
-                    line->SetRect( line->Rect() );
-                    }
-                else
-                    {
-                    line->iControl->SetRect( line->iControl->Rect() );
-                    }
-                line->DrawDeferred();
-                //line->DrawNow();
-                }
-            }
-        }
-    _AKNTRACE_FUNC_EXIT;
-    return aDelta;
-    }
 
 // ---------------------------------------------------------------------------
 // CEikCapCArray::SetRealRect
@@ -1170,7 +633,7 @@
         {
         TInt y = LineIndexToYPosition( aCurrentLine, aTopY );
 
-        // if current line is visible on the screen the focus that
+        // if current line is visible on the screen then focus that
         if ( y >= 0 && y <= Rect().Height() )
             {
             focusableLine = aCurrentLine;
--- a/uifw/EikStd/dlgsrc/EIKDIALG.CPP	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/dlgsrc/EIKDIALG.CPP	Thu Jul 15 18:56:19 2010 +0300
@@ -1364,7 +1364,7 @@
 	if (line)
 		{
 		line->SetCaptionL(aText);
-		line->DrawNow();
+		line->DrawDeferred();
 		}
 	}
 
@@ -2450,10 +2450,6 @@
     	CCoeControl::HandleResourceChange(aType);
         }
     
-    if( !CAknEnv::Static()->TransparencyEnabled() && aType==KEikColorResourceChange)
-        {
-        Window().SetBackgroundColor(iEikonEnv->ControlColor(EColorDialogBackground,*this));
-        }
     _AKNTRACE_FUNC_EXIT;
     }
 
--- a/uifw/EikStd/dlgsrc/EIKDLGUT.CPP	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/dlgsrc/EIKDLGUT.CPP	Thu Jul 15 18:56:19 2010 +0300
@@ -360,7 +360,7 @@
 	{
 	CEikEdwin* edwin=(CEikEdwin*)Control(aControlId);
 	edwin->SetTextL(aDes);
-	edwin->DrawNow();
+	edwin->DrawDeferred();
 	}
 
 /**
--- a/uifw/EikStd/dlgsrc/EIKDPAGE.CPP	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/dlgsrc/EIKDPAGE.CPP	Thu Jul 15 18:56:19 2010 +0300
@@ -94,7 +94,8 @@
 public:
     enum TFlags
         {
-        ELineHandlerCalled
+        ELineHandlerCalled,
+        EDragEventsAllowed  // turned on when dragging is allowed
         };
     static CDialogPageExtension* NewL();
     ~CDialogPageExtension();
@@ -131,7 +132,6 @@
     TBool iExternalScrollbar;
     TBool iIsDoubleQuery;
     TBool iFocusedClicked;
-    TInt iPreviousThumbPosition;
     TBool iPreviousThumbDirection;
     MTouchFeedback* iFeedback;
     TBitFlags iFlags;
@@ -495,7 +495,6 @@
         thisLine->iIsFormControl = aFormControl ;
         if ( aFormControl )
             {
-            thisLine->GetAknLayoutValuesL() ;   // should cause the control to have size.
             if ( iFormFlags )
             thisLine->SetFormFlags( iFormFlags ) ;
             }       
@@ -1329,27 +1328,6 @@
     return KErrNotFound;
     }
 
-TInt CEikDialogPage::YPosToLine2(TInt aYPos) const
-    {
-    return iLines->YPosToLine( Rect(), iScroll->Top(), iScroll->Middle(), iScroll->Bottom(), aYPos );
-    }
-
-TInt CEikDialogPage::LineToYPos(TInt& aLine) const
-//
-// Calcs YPos of line relative to the ViewWin and adjusts aLine if its out of bounds
-    {
-	_AKNTRACE_FUNC_ENTER;
-    ASSERT(iLines);
-    const TInt numLines=iLines->Count();
-    ASSERT(numLines>0);
-    if (aLine<0)
-        aLine=0;
-    else if (aLine>=numLines)
-        aLine=numLines-1;
-    _AKNTRACE( "[%s][%s][%d]", "CEikDialogPage", __FUNCTION__, (*iLines)[aLine]->Position().iY );
-    _AKNTRACE_FUNC_EXIT;
-    return (*iLines)[aLine]->Position().iY; // TPREMOVAL +iDataWinPos.iY;
-    }
 
 void CEikDialogPage::ExposeLine(TInt aLine, TBool aForceResize, TBool aShowWholeLine) 
 //
@@ -1523,13 +1501,31 @@
             }
 
         iLines->SetRect( Rect(), iScroll->Top(), iScroll->Middle(), iScroll->Bottom() );
-
         iExtension->iInitialLayoutDone = ETrue;
         UpdatePhysics();
 
-        if ( ( count > 0 ) && ( iCurrentLine >= 0 ) )
+        if ( iExtension->iScrolling
+                || iExtension->iFlags.IsSet( 
+                        CDialogPageExtension::EDragEventsAllowed ) )
+            {
+            iPhysics->Stop();
+            Synchronize();
+            }
+
+        if ( count > 0 && iCurrentLine != KErrNotFound )
             {
+            if ( iLastExposedLine != -1 )
+                {
+                iLastExposedLineViewWinYPosition = 
+                        iLines->LineIndexToYPosition( iLastExposedLine, 0 );
+                }
+
             ExposeLine( iCurrentLine, ETrue );
+            
+            if ( Size() != TSize::EUninitialized )
+                {
+                (*iLines)[iCurrentLine]->DrawDeferred();
+                }
             }
         
         TRAP_IGNORE( UpdateScrollBarL() ); // ignore any errors.
@@ -1633,7 +1629,7 @@
                     
                     if ( i != iCurrentLine )
                         {
-                        DrawNow();
+                        DrawDeferred();
                         }
                         
                     break;
@@ -1678,7 +1674,7 @@
                     {
                     RecordLineL( i );
                     }
-                DrawNow();
+                DrawDeferred();
                 break;
                 }
             }
@@ -1737,16 +1733,10 @@
                                              KAknsIIDQsnFrInput,
                                              KAknsIIDDefault ) ;
                 }
-
             }       
-        
         }
-    
     }
 
-void CEikDialogPage::DrawVerticalLine() const
-    {       
-    }
 
 void CEikDialogPage::HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType)
     {
@@ -1823,7 +1813,7 @@
     if (height > maxHeight)
         height = maxHeight;
 
-    TSize size = aEdwin->Size();
+    TSize size( aEdwin->Size() );
     TInt maximumEdwinHeight = aEdwin->MaximumHeight();
 // ensure maxheight as dynamic construction may be done whilst form is of zero height.
     if ((maximumEdwinHeight > maxHeight) && maxHeight) 
@@ -1878,54 +1868,6 @@
     }
 
 
-static TInt CountNumberOfLines_Edwin(CEikEdwin *aEdwin, TRect aRect, TInt numOfLines)
-    {
-    TInt edwinLines = numOfLines;
-    TInt count = 0;
-    for(TInt i=0;i<edwinLines;i++)
-        {
-        TInt scrolledLines = aEdwin->TextLayout()->FirstLineInBand();
-        TInt docPos = aEdwin->TextLayout()->FirstCharOnLine(scrolledLines + i+1);
-        TPoint point;
-        aEdwin->TextLayout()->PosInBand(docPos, point);
-        TInt yPos = point.iY;
-        TRect lineRect;
-        aEdwin->TextLayout()->GetLineRect(yPos, lineRect);
-        lineRect.iTl += aEdwin->Position();
-        lineRect.iBr += aEdwin->Position();
-        if (aRect.Contains(lineRect.iTl) && aRect.Contains(lineRect.iBr))
-            count++;
-        }   
-    return count;
-    }
-static TInt CountNumberOfLines_Ctrl(CCoeControl *aControl, TRect aRect)
-    {
-    TRect rect = TRect(aControl->Position(), aControl->Size());
-    TInt count = 0;
-    if (aRect.Contains(rect.iTl) && aRect.Contains(rect.iBr))
-        count ++;
-    return count;
-    }
-
-static TInt CountNumberOfVisibleLines(CEikCaptionedControl *aControl, TRect aClipRect)
-    {
-    TInt count = 0;
-    if (aControl->ControlIsAnEdwin(aControl->iControlType))
-        count += CountNumberOfLines_Edwin((CEikEdwin*)aControl->iControl, aClipRect, aControl->NumberOfLines());
-    else
-        count += CountNumberOfLines_Ctrl(aControl->iControl, aClipRect);
-    count += CountNumberOfLines_Ctrl(aControl->iCaption, aClipRect);
-    return count;
-    }
-
-static TInt NumberOfTextLinesVisible(CEikCapCArray *aLines, TInt aItem, TRect aClipRect)
-    {
-    if (aItem < 0) return 0;
-    CEikCaptionedControl *control = (*aLines)[aItem];
-    return CountNumberOfVisibleLines(control, aClipRect);   
-    }
-
-
 void CEikDialogPage::HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType)
     {
 	_AKNTRACE_FUNC_ENTER;
@@ -1990,21 +1932,12 @@
 
     if (scrollBar)
         {
-        TInt top = iScroll->Top();
-        TInt middle = iScroll->Middle();
-        TInt bottom = iScroll->Bottom();
-        TRect parent( Rect() );
-        TBool topmostPartial = top == -1;
-        iLines->CalcItemIndexes(top, middle, bottom, parent.Size());
-        TInt extraLines = topmostPartial ? NumberOfTextLinesVisible(iLines, top-1, parent) : 0;
-        iExtension->iPreviousThumbPosition = iLines->NumberOfTextLinesBeforeLine( top - extraLines );
-
         // Using form layout, since this is used by AknForm only
         TAknWindowComponentLayout layout = TAknWindowComponentLayout::Compose( 
             AknLayoutScalable_Avkon::listscroll_form_pane(),  
             AknLayoutScalable_Avkon::scroll_pane_cp8());
             
-        TRect scrollBarParent( MainPane().Size()/*mainPaneRect.Size()*/ );
+        TRect scrollBarParent( MainPane().Size() );
     
         AknLayoutUtils::LayoutVerticalScrollBar(iPageContainer->ScrollBar(), scrollBarParent, layout.LayoutLine());
         if(!ScbState() &&  iCurrentLine!=-1 && iCurrentLine < iLines->Count() )
@@ -2047,7 +1980,6 @@
         vertModel.iThumbSpan = iSize.iHeight - iSize.iHeight % 2;
         vertModel.iThumbPosition = Max( iPhysics->ViewTopY(), 0 );
 
-        iExtension->iPreviousThumbPosition = vertModel.iThumbPosition;
         TRAP_IGNORE(scrollBar->SetModelL(&vertModel)); // won't leave now, but can't guarantee forever        
         iPageContainer->ScrollBar()->Tile(&vertModel);
         iPageContainer->ScrollBar()->SetVFocusPosToThumbPos(vertModel.iThumbPosition);
@@ -2423,7 +2355,7 @@
     
     if ( iExtension->iUsesSingleClick && iExtension->iSetInitialFocusDone )
         {
-        ShowFocus( EFalse );
+        ShowFocus( EFalse, EFalse );
         }
     
     const TInt numLines=iLines->Count() ;
@@ -2545,9 +2477,6 @@
             // Have to call non const leaving function...  Ignore the TRAP as result is cosmetic only.
             TRAP_IGNORE( const_cast<CEikDialogPage*>(this)->DrawEmptyListL( windowGcRef ) ) ;
             }
-        else
-            DrawVerticalLine();
-        
         
         if ( IsForm() )
             {
@@ -2707,8 +2636,6 @@
         aLine->iIsFormControl = iFormControl ;
         if ( iFormFlags )
             aLine->SetFormFlags( iFormFlags ) ;
-
-        aLine->GetAknLayoutValuesL() ;  // should cause the control to have size.
         }
     };
 
@@ -2822,14 +2749,6 @@
     return EFalse;
     }
 
-TSize CEikDialogPage::RealDataSize() const
-    {
-    if (iLines)
-        if (iLines->Count()>0)
-            return TRect((*iLines)[0]->Rect().iTl,(*iLines)[iLines->Count()-1]->Rect().iBr).Size();
-    return iSize;
-    }
-
 TInt CEikDialogPage::NumberOfLines() const
     {
     if (iLines)
@@ -3001,6 +2920,8 @@
                     }
                 }
             }
+        
+        iExtension->iFlags.Set( CDialogPageExtension::EDragEventsAllowed );
         }
 
     if ( aPointerEvent.iType == TPointerEvent::EDrag )
@@ -3008,7 +2929,9 @@
         _AKNTRACE( "TPointerEvent::EDrag" );
         TPoint drag( iExtension->iDragStartPosition - aPointerEvent.iPosition );
         
-        if ( Abs( drag.iY ) > iPhysics->DragThreshold() )
+        if ( Abs( drag.iY ) > iPhysics->DragThreshold()
+                && iExtension->iFlags.IsSet( 
+                        CDialogPageExtension::EDragEventsAllowed ) )
             {
             iExtension->iHighlightTimer->Cancel();
 
@@ -3074,7 +2997,8 @@
         
         if ( !textSelected )
             {
-            if ( !iPhysics->StartFlick( drag, iExtension->iStartTime ) )
+            if ( !iExtension->iFlags.IsSet( CDialogPageExtension::EDragEventsAllowed ) 
+                    || !iPhysics->StartFlick( drag, iExtension->iStartTime ) )
                 {
                 iExtension->iScrolling = EFalse;
                 
@@ -3106,6 +3030,8 @@
                     }
                 }
             }
+        
+        iExtension->iFlags.Clear( CDialogPageExtension::EDragEventsAllowed );
         }
 
     // forward pointer event to line's observer
@@ -3186,13 +3112,13 @@
             viewCenter.iY = Abs( (*iLines)[0]->Rect().iTl.iY - iPosition.iY );
             }
             
-        viewCenter.iY += iPhysics->ViewCenterDistance();
+        TInt viewCenterDistance = iPhysics->ViewCenterDistance();
+        viewCenter.iY += viewCenterDistance;
         
         if ( iExtension->iInitialLayoutDone )
             {
             TInt oldScreenHeight = iPhysics->ViewSize().iHeight;
-            TInt delta = ( iPhysics->ViewCenterDistance() ) - 
-                ( oldScreenHeight / 2 );
+            TInt delta = ( viewCenterDistance ) - ( oldScreenHeight / 2 );
 
             viewCenter = iPhysics->ViewCenter();
             viewCenter.iY += delta;
@@ -3201,6 +3127,16 @@
         TSize worldSize( iLines->MinimumSize() );
         worldSize.iHeight = Max( worldSize.iHeight, iSize.iHeight );
 
+        // align to borders if those are crossed
+        if ( viewCenter.iY < viewCenterDistance )
+            {
+            viewCenter.iY = viewCenterDistance;
+            }
+        else if ( viewCenter.iY > ( worldSize.iHeight - viewCenterDistance ) )
+            {
+            viewCenter.iY = worldSize.iHeight - viewCenterDistance;
+            }
+        
         TRAP_IGNORE( iPhysics->InitPhysicsL( worldSize, iSize, viewCenter ) );
         TRAP_IGNORE( UpdateScrollBarL() );
         }
@@ -3267,7 +3203,7 @@
 // ---------------------------------------------------------------------------
 //
 void CEikDialogPage::ScrollCacheByPixels( 
-		TInt /*aDelta*/, const TDesC& /*aDebugMsg*/, TBool aDrawNow )
+		TInt /*aDelta*/, TBool aDrawNow )
     {
     if ( iLines->Count() <= 0 )
         return;
@@ -3302,17 +3238,16 @@
         {
         if ( upperItem != iExtension->iTopItem || bottomItem != iExtension->iBottomItem )
             {
-            if( iPhysics->OngoingPhysicsAction() == CAknPhysics::EAknPhysicsActionDragging )
-                {
-                iExtension->Feedback( *this, ETouchFeedbackSensitiveList );
-                }
-            else if( iPhysics->OngoingPhysicsAction() == CAknPhysics::EAknPhysicsActionFlicking )
+            switch(iPhysics->OngoingPhysicsAction())
                 {
-                iExtension->SilentFeedback( *this, ETouchFeedbackSensitiveList, TPointerEvent() );
-                }
-            else if( iPhysics->OngoingPhysicsAction() == CAknPhysics::EAknPhysicsActionBouncing )
-                {
-                iExtension->SilentFeedback( *this, ETouchFeedbackSensitiveList, TPointerEvent() );
+                case CAknPhysics::EAknPhysicsActionBouncing:
+                case CAknPhysics::EAknPhysicsActionDragging:
+                case CAknPhysics::EAknPhysicsActionFlicking:
+                    iExtension->SilentFeedback( *this,
+                            ETouchFeedbackSensitiveList, TPointerEvent() );
+                    break;
+                default:
+                    break;
                 }
             }
         }
@@ -3320,17 +3255,16 @@
         {
         if ( upperItem < iExtension->iTopItem || bottomItem > iExtension->iBottomItem )
             {
-            if( iPhysics->OngoingPhysicsAction() == CAknPhysics::EAknPhysicsActionDragging )
-                {
-                iExtension->Feedback( *this, ETouchFeedbackSensitiveList );
-                }
-            else if( iPhysics->OngoingPhysicsAction() == CAknPhysics::EAknPhysicsActionFlicking )
+            switch(iPhysics->OngoingPhysicsAction())
                 {
-                iExtension->SilentFeedback( *this, ETouchFeedbackSensitiveList, TPointerEvent() );
-                }
-            else if( iPhysics->OngoingPhysicsAction() == CAknPhysics::EAknPhysicsActionBouncing )
-                {
-                iExtension->SilentFeedback( *this, ETouchFeedbackSensitiveList, TPointerEvent() );
+                case CAknPhysics::EAknPhysicsActionBouncing:
+                case CAknPhysics::EAknPhysicsActionDragging:
+                case CAknPhysics::EAknPhysicsActionFlicking:
+                    iExtension->SilentFeedback( *this,
+                            ETouchFeedbackSensitiveList, TPointerEvent() );
+                    break;
+                default:
+                    break;
                 }
             }
         }
@@ -3395,6 +3329,7 @@
 void CEikDialogPage::Synchronize()
     {
     iExtension->iScrolling = EFalse;
+    iExtension->iFlags.Clear( CDialogPageExtension::EDragEventsAllowed );
     iLines->MoveLineToScreen( iCurrentLine, iPhysics->ViewTopY(), ETrue );
     }
 
@@ -3477,22 +3412,6 @@
 
 
 // ---------------------------------------------------------------------------
-// CEikDialogPage::ScrollByPixels
-// ---------------------------------------------------------------------------
-//
-void CEikDialogPage::ScrollByPixels( TInt aDelta )
-    {
-    if ( aDelta != 0 )
-        {
-        iLines->ScrollByPixels( aDelta );
-        TRAP_IGNORE( UpdateScrollBarL() );
-        DrawNow();
-        TRAP_IGNORE( RecordLinesL() );
-        }
-    }
-
-
-// ---------------------------------------------------------------------------
 // CEikDialogPage::RemovePressedDownHighlight
 // ---------------------------------------------------------------------------
 //
@@ -3592,12 +3511,10 @@
     CCoeControl* grabbingComponent = GrabbingComponent(); 
     TBool callDefaultImplementation = ETrue;
     TBool focusItem = EFalse;
-    // YPosToLine is scaled to iDataWinPos, so add it to pointer Y position
-    TInt yPosition = aPointerEvent.iPosition.iY; // + iDataWinPos.iY;
-    TInt touchedLineIndex = YPosToLine2( yPosition );
+    TInt touchedLineIndex = iLines->YPositionToLineIndex( aPointerEvent.iPosition.iY );
+
     // If the stylus is down and the touched line is already the current one,
     // mark this fact in iExtension->iFocusedClicked to be used later when the stylus is up.
-    
     if ( touchedLineIndex != KErrNotFound && 
          iExtension->iCapturingItem != KErrNotFound &&
          touchedLineIndex != iExtension->iCapturingItem )
--- a/uifw/EikStd/dlgsrc/aknformphysics.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/dlgsrc/aknformphysics.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -115,16 +115,11 @@
                                    const TTime& aStartTime )
     {
     _AKNTRACE_FUNC_ENTER;
-    if (  PhysicsAllowed() )
+    TPoint drag( aLength );
+
+    if ( iPhysics->StartPhysics( drag, aStartTime ) )
         {
-        TPoint drag( aLength );
-        if ( iPhysics->StartPhysics( drag, aStartTime ) )
-            {
-            // reset benchmark variables
-            iStartTime.HomeTime();
-            iFrameCount = 0;
-            return ETrue;
-            }
+        return ETrue;
         }
 
     PhysicEmulationEnded();
@@ -170,7 +165,7 @@
 void CAknFormPhysics::SetPanningPosition( const TPoint& aDelta )
     {
     _AKNTRACE_FUNC_ENTER;
-    if (  PhysicsAllowed() && iPhysics )
+    if ( iPhysics )
         {
         iPhysics->RegisterPanningPosition( aDelta );
         }
@@ -189,32 +184,9 @@
     _AKNTRACE_FUNC_ENTER;
     _AKNTRACE( "The Position of aNewPosition are: ( %d, %d ) ", 
     		aNewPosition.iX, aNewPosition.iY );
-    if ( !PhysicsAllowed() )
-        {
-        return;
-        }
-    TInt fps = 0;
+
     iViewCenter = aNewPosition;
-
-    // benchmark / debug part
-    if ( iFrameCount != -1 )
-        {
-        ++iFrameCount;
-        TTime now;
-        now.HomeTime();
-        
-        TInt64 duration = now.MicroSecondsFrom( iStartTime ).Int64();
-        
-        if ( duration > 0 )
-            {
-            fps = iFrameCount * 1000000 / duration;
-            }
-        }
-
-    TBuf<128> msg;
-    msg.Format( _L( "%dfps" ), fps );
-
-    iParent.ScrollCacheByPixels( iViewCenter.iY, msg, aDrawNow );
+    iParent.ScrollCacheByPixels( iViewCenter.iY, aDrawNow );
     _AKNTRACE_FUNC_EXIT;
     }
 
@@ -227,7 +199,6 @@
     {
     _AKNTRACE_FUNC_ENTER;
     iParent.Synchronize();
-    iFrameCount = -1;
     _AKNTRACE_FUNC_EXIT;
     }
 
@@ -300,13 +271,4 @@
     {
     return iViewCenter;
     }
-
-
-// ---------------------------------------------------------------------------
-// CAknFormPhysics::PhysicsAllowed
-// ---------------------------------------------------------------------------
-//
-TBool CAknFormPhysics::PhysicsAllowed() const
-    {
-    return ETrue;
-    }
+	
--- a/uifw/EikStd/dlgsrc/aknrecordinggc.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/dlgsrc/aknrecordinggc.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -183,8 +183,7 @@
                     case CBufferItem::EDrawLine:
                         // EDrawLine is used for separator line only and it
                         // should be skipped for the last visible item.
-                        if ( i < iLines.Count() - 1 
-                                && realRect.iBr.iY < aRect.iBr.iY )
+                        if ( i < iLines.Count() - 1 )
                             {
                             gc->DrawLine( item->iRect.iTl, item->iRect.iBr );
                             }
--- a/uifw/EikStd/srvuisrc/eikkeysoundserver.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/EikStd/srvuisrc/eikkeysoundserver.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -1229,7 +1229,8 @@
 
     if ( Preference() != KKeyClickPreference ) // Other sounds than key click
         {
-        aAudioPlayer->SetVolume( ((TInt)iVolume * max )/(TInt)ESoundVolume9);
+		//change (TInt)ESoundVolume9 to ((TInt)ESoundVolume9 + 1)) to keep consistent with audiotheme
+        aAudioPlayer->SetVolume( ((TInt)iVolume * max )/((TInt)ESoundVolume9 + 1));
         return;
         }
 
--- a/uifw/ganes/src/HgItem.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/ganes/src/HgItem.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -67,8 +67,8 @@
 //
 CHgItem::CHgItem( TInt aFlags, CGulIcon* aIcon ) :
     iIcon( aIcon ),
-    iFlags( aFlags ),
-    iTime(0)
+    iTime(0),
+    iFlags( aFlags )
     {
     }
 
--- a/uifw/ganes/src/HgScroller.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/ganes/src/HgScroller.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -1131,17 +1131,10 @@
         TInt action = iPhysics->OngoingPhysicsAction();
         if( action !=  CAknPhysics::EAknPhysicsActionNone && needsFeedback )
             {
-            TTouchFeedbackType type( ETouchFeedbackVibra );
-            if ( CAknPhysics::EAknPhysicsActionDragging == action )
-                {
-                type = TTouchFeedbackType(ETouchFeedbackVibra | ETouchFeedbackAudio);
-                }
-
             MTouchFeedback* feedback = MTouchFeedback::Instance();
             if(feedback)
                 feedback->InstantFeedback( this, ETouchFeedbackSensitiveList,
-                                            type,
-                                            TPointerEvent() );
+                                           ETouchFeedbackVibra, TPointerEvent() );
             }
 
         if(iManager)
--- a/uifw/ganes/src/HgVgMediaWall.cpp	Mon Jun 21 15:57:43 2010 +0300
+++ b/uifw/ganes/src/HgVgMediaWall.cpp	Thu Jul 15 18:56:19 2010 +0300
@@ -145,7 +145,7 @@
     
     
     SetMopParent( aParent );
-    SetFlags( EHgVgMediaWallUninitialized );
+    SetFlags( EHgVgMediaWallDrawToWindowGC | EHgVgMediaWallUninitialized );
     
     }
 
@@ -176,7 +176,7 @@
 //
 EXPORT_C void CHgVgMediaWall::RefreshScreen( TInt aIndex )
     {
-    ClearFlags(EHgVgMediaWallDrawToWindowGC);
+    
     if( !iIsForeground  )
         {
         return;
@@ -189,7 +189,15 @@
                         && aIndex <= FirstIndexOnScreen() + ItemsOnScreen()) )
             {
             UpdateLabelsAndPopup();
-            DrawNow();
+            if(iFlags & EHgVgMediaWallDrawToWindowGC)
+                {
+                DrawNow();
+                }
+            else
+                {
+                DrawOpenVG();
+                }
+        
             }
         }
     }
@@ -367,19 +375,34 @@
         return;
         }
     
-    if(iFlags & EHgVgMediaWallDrawToWindowGC)
+    CHgVgMediaWall* self = const_cast<CHgVgMediaWall*>(this);           
+
+    if( iFlags & EHgVgMediaWallDrawToWindowGC )
         {
-        CHgVgMediaWall* self = const_cast<CHgVgMediaWall*>(this);
-        self->ClearFlags(EHgVgMediaWallDrawToWindowGC);
-        FillSystemGcWithSkin( );
-        return;
+        CFbsBitmap* screenshot = NULL;
+        screenshot = self->DrawToBitmap();
+        if (screenshot)
+            {
+            SystemGc().BitBlt( Rect().iTl,screenshot );
+            delete screenshot;
+            }
+        else
+            {
+            // draw with alpha to make a hole to composition layer
+            SystemGc().SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+            SystemGc().SetBrushColor(TRgb(0,0,0,0));
+            SystemGc().Clear();
+            DrawOpenVG();
+            }
         }
-    
-    // draw with alpha to make a hole to composition layer
-    SystemGc().SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
-    SystemGc().SetBrushColor(TRgb(0,0,0,0));
-    SystemGc().Clear();
-    DrawOpenVG();
+    else
+        {
+        // draw with alpha to make a hole to composition layer
+        SystemGc().SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+        SystemGc().SetBrushColor(TRgb(0,0,0,0));
+        SystemGc().Clear();
+        DrawOpenVG();
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1164,6 +1187,9 @@
     
             iAnimationTimer->Cancel();
             }
+    
+        SetFlags( EHgVgMediaWallDrawToWindowGC  );
+        DrawNow();
         }
     
     if( aType == KEikMessageUnfadeWindows )
@@ -1171,8 +1197,15 @@
         ClearFlags( EHgVgMediaWallDrawToWindowGC );
         DrawNow();
         }
+
+    if( aType == KEikDynamicLayoutVariantSwitch && !(iFlags & EHgVgMediaWallDrawToWindowGC) )
+        {
+        SetFlags( EHgVgMediaWallDrawToWindowGC );
+        DrawNow();
+        }
     }
 
+
 // ---------------------------------------------------------------------------
 // CHgVgMediaWall::InitItemsL()
 // ---------------------------------------------------------------------------
@@ -1226,13 +1259,16 @@
 
     iIsForeground = EFalse;
     
+    // draw screenshot using window gc, this is needed
+    // for nga effects to work
+    DrawNow();
+    
     // free textures    
     FreeItemsImages();
     // free other resources
     DestroyRendering();
 
-    SetFlags( EHgVgMediaWallUninitialized );
-    DrawNow();
+    SetFlags( EHgVgMediaWallUninitialized | EHgVgMediaWallDrawToWindowGC );
     
     iCoeEnv->WsSession().Flush();
     }