tsrc/CenrepEditor/Src/cenrepeditorlistbox3.cpp
changeset 15 ccd8e69b5392
parent 2 b31261fd4e04
child 20 e8be2c2e049d
child 22 496ad160a278
equal deleted inserted replaced
2:b31261fd4e04 15:ccd8e69b5392
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 #include "cenrepeditorListbox3.h"
       
    18 
       
    19 
       
    20 CAknSettingItem* CMusApplicationListbox::CreateSettingItemL( TInt aIdentifier )
       
    21     {
       
    22     CAknSettingItem* settingItem = NULL;        
       
    23     switch (aIdentifier)
       
    24         {
       
    25         case EApplicationStartStop:
       
    26         settingItem = new (ELeave) 
       
    27             CAknEnumeratedTextPopupSettingItem(aIdentifier,iMusApplication->iUseCase);
       
    28             break;    
       
    29         default:
       
    30             break;
       
    31         }
       
    32     return settingItem;
       
    33     }
       
    34 
       
    35 
       
    36 void CMusApplicationListbox::SetData(CMusApplication* aMusApplication)
       
    37     {
       
    38     iMusApplication = aMusApplication;
       
    39     }
       
    40 
       
    41 void CMusApplicationListbox::SizeChanged()
       
    42     {
       
    43     if (ListBox()) 
       
    44         {
       
    45         ListBox()->SetRect(Rect());
       
    46         }   
       
    47     }
       
    48 
       
    49 /**
       
    50  *	Handle the "Change" option on the Options menu.  This is an
       
    51  *	alternative to the Selection key that forces the settings page
       
    52  *	to come up rather than changing the value in place (if possible).
       
    53  */
       
    54 void CMusApplicationListbox::ChangeSelectedItemL()
       
    55 	{
       
    56 	if ( ListBox()->CurrentItemIndex() >= 0 )
       
    57 		EditItemL( ListBox()->CurrentItemIndex(), ETrue );
       
    58 	}
       
    59 
       
    60 
       
    61 TKeyResponse CMusApplicationListbox::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType )
       
    62 	{
       
    63 	if ( aKeyEvent.iCode == EKeyLeftArrow || aKeyEvent.iCode == EKeyRightArrow )
       
    64 		{
       
    65 		return EKeyWasNotConsumed;
       
    66 		}
       
    67 	
       
    68 	return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType );
       
    69 	}
       
    70 
       
    71 
       
    72 void CMusApplicationListbox::EditItemL ( TInt aIndex, TBool aCalledFromMenu )
       
    73     {
       
    74     CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );		
       
    75     }
       
    76 
       
    77 //End of File