uifw/AvKon/src/AknPopupSettingPage.cpp
branchRCL_3
changeset 56 d48ab3b357f1
parent 55 aecbbf00d063
equal deleted inserted replaced
55:aecbbf00d063 56:d48ab3b357f1
     1 /*
     1 /*
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    42 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
    42 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
    43 #include <aknlistloadertfx.h>
    43 #include <aknlistloadertfx.h>
    44 #include <aknlistboxtfxinternal.h>
    44 #include <aknlistboxtfxinternal.h>
    45 #endif //RD_UI_TRANSITION_EFFECTS_LIST
    45 #endif //RD_UI_TRANSITION_EFFECTS_LIST
    46 
    46 
    47 
    47 #include <AknPriv.hrh>
    48 
    48 
    49 // ----------------------------------------------------------------------------
    49 // ----------------------------------------------------------------------------
    50 // Extension class definition
    50 // Extension class definition
    51 // ----------------------------------------------------------------------------
    51 // ----------------------------------------------------------------------------
    52 //
    52 //
   315         case MEikListBoxObserver::EEventFlickStopped:
   315         case MEikListBoxObserver::EEventFlickStopped:
   316             // Change list's current item index to the selected item. This
   316             // Change list's current item index to the selected item. This
   317             // ensures that correct item gets selected if setting page is
   317             // ensures that correct item gets selected if setting page is
   318             // accepted by clicking the left softkey.
   318             // accepted by clicking the left softkey.
   319             if ( iExtension && iExtension->iFlags.IsSet( 
   319             if ( iExtension && iExtension->iFlags.IsSet( 
   320                     CAknPopupSettingListExtension::ESingleClickEnabled ) )
   320                      CAknPopupSettingListExtension::ESingleClickEnabled ) &&
       
   321                  ItemExists( iCurrentSelection ) )
   321                 {
   322                 {
   322                 View()->SetCurrentItemIndex( iCurrentSelection );
   323                 View()->SetCurrentItemIndex( iCurrentSelection );
   323                 }
   324                 }
   324             break;
   325             break;
   325             
   326             
   674     // Construct an appropriate control context for the contained editor areas.
   675     // Construct an appropriate control context for the contained editor areas.
   675     // Context produced is owned by CAknSettingPage.
   676     // Context produced is owned by CAknSettingPage.
   676     SetEditedItemFrameIID( KAknsIIDQsnFrSetOpt, KAknsIIDQsnFrSetOptCenter );
   677     SetEditedItemFrameIID( KAknsIIDQsnFrSetOpt, KAknsIIDQsnFrSetOptCenter );
   677 
   678 
   678 	iQueryValue.SetQueryMode( MAknQueryValue::ESettingPageMode );
   679 	iQueryValue.SetQueryMode( MAknQueryValue::ESettingPageMode );
       
   680 	//
       
   681 	// SetQueryValue make the view item drawn by default, SetDisableRedraw can remove flick
       
   682 	//
       
   683 	TBool bRedrawDisabled = PopupSettingListBox()->View()->RedrawDisabled();
       
   684 	PopupSettingListBox()->View()->SetDisableRedraw( ETrue );
   679 	PopupSettingListBox()->SetQueryValueL( &iQueryValue );
   685 	PopupSettingListBox()->SetQueryValueL( &iQueryValue );
       
   686 	PopupSettingListBox()->View()->SetDisableRedraw( bRedrawDisabled);
       
   687 
   680 	CheckAndSetDataValidity();
   688 	CheckAndSetDataValidity();
   681 	UpdateCbaL();
   689 	UpdateCbaL();
   682 
   690 
   683 	PopupSettingListBox()->SetPopupSettingListObserver( this );
   691 	PopupSettingListBox()->SetPopupSettingListObserver( this );
   684 	// Set the scroller indication to appear when needed
   692 	// Set the scroller indication to appear when needed
   733 	return &iQueryValue;
   741 	return &iQueryValue;
   734 	}
   742 	}
   735 
   743 
   736 EXPORT_C void CAknPopupSettingPage::SelectCurrentItemL()
   744 EXPORT_C void CAknPopupSettingPage::SelectCurrentItemL()
   737 	{
   745 	{
   738 #ifdef RD_TOUCH2
       
   739     CAknPopupSettingList* list = PopupSettingListBox();
   746     CAknPopupSettingList* list = PopupSettingListBox();
   740     
   747     
   741     if ( ( list->ItemDrawer()->Flags() & 
   748     if ( ( list->ItemDrawer()->Flags() & 
   742             CListItemDrawer::ESingleClickDisabledHighlight ) 
   749             CListItemDrawer::ESingleClickDisabledHighlight ) 
   743             && list->CurrentItemIndex() != list->CurrentSelection() )
   750             && list->CurrentItemIndex() != list->CurrentSelection() )
   744         {
   751         {
   745         list->View()->SetCurrentItemIndex( list->CurrentSelection() );
   752         list->View()->SetCurrentItemIndex( list->CurrentSelection() );
   746         }
   753         }
   747 #endif // RD_TOUCH2
       
   748     
   754     
   749     PopupSettingListBox()->SelectCurrentItemL();
   755     PopupSettingListBox()->SelectCurrentItemL();
   750 	} 
   756 	} 
   751 
   757 
   752 EXPORT_C void CAknPopupSettingPage::UpdateQueryValueL( MAknQueryValue* aQueryValue )
   758 EXPORT_C void CAknPopupSettingPage::UpdateQueryValueL( MAknQueryValue* aQueryValue )
   781 #endif
   787 #endif
   782 
   788 
   783 EXPORT_C void CAknPopupSettingPage::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
   789 EXPORT_C void CAknPopupSettingPage::HandlePointerEventL(const TPointerEvent& aPointerEvent) 
   784     { 
   790     { 
   785     CAknListBoxSettingPage::HandlePointerEventL(aPointerEvent); 
   791     CAknListBoxSettingPage::HandlePointerEventL(aPointerEvent); 
       
   792     if ( TPointerEvent::EDrag == aPointerEvent.iType )
       
   793         {
       
   794         if ( !( Rect().Contains( aPointerEvent.iPosition ) ) )
       
   795             {
       
   796             // Clear focus if dragged outside popup
       
   797             PopupSettingListBox()->HandleResourceChange( KAknMessageFocusLost );
       
   798             }
       
   799         }
   786     }
   800     }
   787 
   801 
   788 EXPORT_C void* CAknPopupSettingPage::ExtensionInterface( TUid /*aInterface*/ ) 
   802 EXPORT_C void* CAknPopupSettingPage::ExtensionInterface( TUid /*aInterface*/ ) 
   789     { 
   803     { 
   790     return NULL;
   804     return NULL;
   811 */
   825 */
   812 EXPORT_C void CAknPopupSettingPage::CAknListBoxSettingPage_Reserved_1()
   826 EXPORT_C void CAknPopupSettingPage::CAknListBoxSettingPage_Reserved_1()
   813 	{
   827 	{
   814 	}
   828 	}
   815 
   829 
       
   830 //---------------------------------------------------------------------------------------
       
   831 // CAknPopupSettingPage::ProcessCommandL()
       
   832 // Processes events from the softkeys. (Or translated from key events)
       
   833 //---------------------------------------------------------------------------------------
       
   834 //
       
   835 EXPORT_C void CAknPopupSettingPage::ProcessCommandL( TInt aCommandId )
       
   836     {
       
   837     if ( !EnableSingleClickHighlight( aCommandId ) )
       
   838         {
       
   839         // no single click mode was enabled, just call the base class method
       
   840         CAknSettingPage::ProcessCommandL( aCommandId );
       
   841         }
       
   842     }
       
   843 
   816 // End of File
   844 // End of File