multimediacommsengine/tsrc/MCETestUI/src/CMCEPoCSessionSettingsListContainer.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 "CMCEPoCSessionSettingsListContainer.h"
       
    25 
       
    26 // ================= MEMBER FUNCTIONS =======================
       
    27 
       
    28 /**
       
    29 * Symbian OS 2nd phase constructor.  Creates a Window for the controls, which it contains.
       
    30 * Constructs a label and adds it to the window, which it then activates.
       
    31 * @param aRect The rectangle for this window
       
    32 */		
       
    33 void CMCEPoCSessionSettingsListContainer::ConstructL(const TRect& aRect)
       
    34 	{
       
    35 	CreateWindowL();
       
    36 	iSettingItemList = new CMCEPoCSessionSettingsItemList (iSettings);
       
    37     iSettingItemList->ConstructFromResourceL( R_POC_SESSION_SETTING_ITEM_LIST );
       
    38 	SetRect(aRect);
       
    39 	ActivateL();
       
    40 	}
       
    41 /**
       
    42 * Symbian OS 2 phase constructor.
       
    43 * Constructs the CSettingsListContainer using the NewLC method, popping
       
    44 * the constructed object from the CleanupStack before returning it.
       
    45 * 
       
    46 * @param aRect The rectangle for this window
       
    47 * @return The newly constructed CSettingsListContainer
       
    48 */
       
    49 CMCEPoCSessionSettingsListContainer* CMCEPoCSessionSettingsListContainer::NewL(const TRect& aRect, TMCEPoCSessionParams& aSettings )
       
    50 	{
       
    51 	CMCEPoCSessionSettingsListContainer* self = CMCEPoCSessionSettingsListContainer::NewLC( aRect, aSettings );
       
    52 	CleanupStack::Pop(self);
       
    53 	return self;
       
    54 	}
       
    55 
       
    56 /**
       
    57 * Symbian OS 2 phase constructor.
       
    58 * Constructs the CSettingsListContainer using the constructor and ConstructL 
       
    59 * method, leaving the constructed object on the CleanupStack before returning it.
       
    60 * 
       
    61 * @param aRect The rectangle for this window
       
    62 * @return The newly constructed CSettingsListContainer
       
    63 */
       
    64 CMCEPoCSessionSettingsListContainer* CMCEPoCSessionSettingsListContainer::NewLC(const TRect& aRect, TMCEPoCSessionParams& aSettings )
       
    65 	{
       
    66 	CMCEPoCSessionSettingsListContainer* self = new (ELeave) CMCEPoCSessionSettingsListContainer( aSettings );
       
    67 	CleanupStack::PushL(self);
       
    68 	self->ConstructL(aRect);
       
    69 	return self;
       
    70 	}
       
    71 
       
    72 CMCEPoCSessionSettingsListContainer::CMCEPoCSessionSettingsListContainer(TMCEPoCSessionParams& aSettings):
       
    73                                         iSettings( aSettings )
       
    74                                     
       
    75 	{
       
    76 	
       
    77 	}
       
    78 /** 
       
    79 * Destructor.  Frees up memory for the settings list.
       
    80 */
       
    81 CMCEPoCSessionSettingsListContainer::~CMCEPoCSessionSettingsListContainer()
       
    82 	{
       
    83 	delete iSettingItemList;
       
    84 	}
       
    85 
       
    86 /**
       
    87 * Called by the framework in compound controls	
       
    88 * @return The number of controls in this CSettingsListContainer
       
    89 */
       
    90 TInt CMCEPoCSessionSettingsListContainer::CountComponentControls() const
       
    91 	{
       
    92 	return 1; // return number of controls inside this container
       
    93 	}
       
    94 
       
    95 /**
       
    96 * Called by the framework in compound controls	
       
    97 * @param The index of the control to return
       
    98 * @return The control for aIndex
       
    99 */
       
   100 CCoeControl* CMCEPoCSessionSettingsListContainer::ComponentControl(TInt aIndex) const
       
   101 	{
       
   102 	switch (aIndex)
       
   103 		{
       
   104 		case 0:
       
   105 			return iSettingItemList;
       
   106 		default:
       
   107 			return NULL;
       
   108 		}
       
   109 	}
       
   110 
       
   111 
       
   112 /**
       
   113 * Called by the framework whenever a key event occurs.	
       
   114 * @param aKeyEvent the Key event which occured, e.g. select key pressed
       
   115 * @param aType the type of Key event which occurred, e.g. key up, key down
       
   116 * @return TKeyResponse EKeyWasNotConsumed if the key was not processed, EKeyWasConsumed if it was
       
   117 */
       
   118 TKeyResponse CMCEPoCSessionSettingsListContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
       
   119 	{
       
   120 	if (iSettingItemList && IsVisible())
       
   121 	    {
       
   122 	        iSettingItemList->OfferKeyEventL (aKeyEvent, aType);    
       
   123 	    }
       
   124 	
       
   125 	//In case the tabs has to be changed
       
   126 	return EKeyWasNotConsumed;
       
   127 	}
       
   128 
       
   129 /**
       
   130 * Asks the setting list to change the currently selected item
       
   131 */
       
   132 void CMCEPoCSessionSettingsListContainer::ChangeSelectedItemL()
       
   133 	{
       
   134 	if (iSettingItemList)
       
   135 		iSettingItemList->ChangeSelectedItemL();
       
   136 	}
       
   137 
       
   138 
       
   139 // End of File