multimediacommsengine/tsrc/MCETestUI/src/CMCEPoCSessionSettingsItemList.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004 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 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 
       
    23 // Class include
       
    24 #include "CMCEPoCSessionSettingsItemList.h"
       
    25 
       
    26 
       
    27 // ================= MEMBER FUNCTIONS =======================
       
    28 
       
    29 /**
       
    30 * Constructor.	Takes a copy of the reference to aDifficultyLevel
       
    31 * @param aDifficultyLevel the level of difficulty which will be set
       
    32 */	
       
    33 CMCEPoCSessionSettingsItemList::CMCEPoCSessionSettingsItemList (TMCEPoCSessionParams& aSettings)
       
    34 : iSettings (aSettings)
       
    35 	{
       
    36 	}
       
    37 
       
    38 /**
       
    39 *	
       
    40 * Called by framework when the view size is changed.  Resizes the
       
    41 * setting list accordingly.
       
    42 *
       
    43 */
       
    44 void CMCEPoCSessionSettingsItemList::SizeChanged()
       
    45 	{
       
    46 	if (ListBox()) 
       
    47 		{
       
    48 		ListBox()->SetRect(Rect());
       
    49 		}
       
    50 
       
    51 	}
       
    52 
       
    53 
       
    54 /**
       
    55 *	
       
    56 * Creates the actual setting items for the list, passing
       
    57 * ownership of them to the calling class.  Each setting
       
    58 * item has a piece of member data which it sets values in.
       
    59 */
       
    60 CAknSettingItem* CMCEPoCSessionSettingsItemList::CreateSettingItemL(TInt aIdentifier)
       
    61 	{
       
    62 	CAknSettingItem* settingItem = NULL;
       
    63 	
       
    64 	switch (aIdentifier)
       
    65 		{
       
    66 		case EPoCRecipentAddress:
       
    67 		  	settingItem = new (ELeave) CAknEnumeratedTextPopupSettingItem( aIdentifier,static_cast<TInt>( iSettings.iPocRecipentAddress );
       
    68 			break;
       
    69 	/*	case EDownLinkMaximumBurstSize:
       
    70 			settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iDownLinkMaximumBurstSize );
       
    71 			break;
       
    72 		case EUpLinkMaximumBurstSize:
       
    73 			settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iUpLinkMaximumBurstSize );
       
    74 			break;
       
    75 	    case EDownLinkAveragePacketSize:
       
    76         	settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iDownLinkAveragePacketSize );
       
    77 			break;
       
    78 	    case EUpLinkAveragePacketSize:
       
    79         	settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iUpLinkAveragePacketSize );
       
    80 			break;
       
    81 	    case EDownLinkMaximumPacketSize:
       
    82         	settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iDownLinkMaximumPacketSize );
       
    83 			break;
       
    84 	    case EUpLinkMaximumPacketSize:
       
    85         	settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iUpLinkMaximumPacketSize );
       
    86 			break;
       
    87 		case EDownLinkDelay:
       
    88         	settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iDownLinkDelay );
       
    89 			break;
       
    90 	   	case EUpLinkDelay:
       
    91         	settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iUpLinkDelay );
       
    92 			break;
       
    93 	    case EDownLinkDelayVariation:
       
    94 	       	settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iDownLinkDelayVariation );
       
    95 			break;
       
    96 	    case EUpLinkDelayVariation:
       
    97 	       	settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iUpLinkDelayVariation );
       
    98 			break;
       
    99 		case EDownLinkPriority:
       
   100 		    settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iDownLinkPriority );
       
   101 			break;
       
   102 		case EUpLinkPriority:
       
   103 	        settingItem = new (ELeave) CAknIntegerEdwinSettingItem( aIdentifier, iSettings.iUpLinkPriority );
       
   104 			break;
       
   105 	*/	}
       
   106 	
       
   107 	return settingItem; // passing ownership
       
   108 	}
       
   109 
       
   110 /**
       
   111 * Causes the edit page for the currently selected setting
       
   112 * item to be displayed
       
   113 */
       
   114 void CMCEPoCSessionSettingsItemList::ChangeSelectedItemL()
       
   115 	{
       
   116 	EditItemL(ListBox()->CurrentItemIndex(), ETrue);
       
   117 	}
       
   118 
       
   119 /**
       
   120 * Called by the framework whenever an item is selected. 
       
   121 * Causes the edit page for the currently selected setting item to be displayed and stores
       
   122 * any changes made.
       
   123 */
       
   124 void CMCEPoCSessionSettingsItemList::EditItemL (TInt aIndex, TBool aCalledFromMenu)
       
   125 	{
       
   126 	CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu);
       
   127 	(*SettingItemArray())[aIndex]->StoreL();
       
   128 
       
   129 	}