internetradio2.0/uisrc/irsettingscontainer.cpp
changeset 0 09774dfdd46b
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     1 /*
       
     2 * Copyright (c) 2006-2006 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 #include <stringloader.h>
       
    20 #include <internetradio.rsg>
       
    21 #include <akntitle.h> 
       
    22 
       
    23 #include "irsettingscontainer.h"
       
    24 #include "irsettingsview.h"
       
    25 #include "irdebug.h" //  PC-Lint comments :: SPP
       
    26 
       
    27 
       
    28 // ======== LOCAL FUNCTIONS ========
       
    29 
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // CIRSettingsContainer::NewL()
       
    34 // Two-phased constructor.
       
    35 // -----------------------------------------------------------------------------
       
    36 //
       
    37 CIRSettingsContainer* CIRSettingsContainer::NewL(CIRSettingsView& aSettingsView)
       
    38     {
       
    39  	IRLOG_DEBUG( "CIRSettingsContainer::NewL" );
       
    40  	CIRSettingsContainer* self = CIRSettingsContainer::NewLC(aSettingsView);
       
    41     CleanupStack::Pop( self );
       
    42     IRLOG_DEBUG( "CIRSettingsContainer::NewL - Exiting" );
       
    43     return self;
       
    44     }
       
    45 // ---------------------------------------------------------------------------
       
    46 // Two-phased constructor.
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 CIRSettingsContainer* CIRSettingsContainer::NewLC(CIRSettingsView& aSettingsView )
       
    50     {
       
    51     	IRLOG_DEBUG( "CIRSettingsView::NewLC - Entering" );
       
    52     	CIRSettingsContainer* self = new ( ELeave ) CIRSettingsContainer(aSettingsView);
       
    53 		CleanupStack::PushL( self );
       
    54 		self->ConstructL();
       
    55 		IRLOG_DEBUG( "CIRSettingsContainer::NewLC - Exiting" );
       
    56 		return self;
       
    57 	
       
    58     }
       
    59 
       
    60 // ---------------------------------------------------------------------------
       
    61 // Constructor.
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 CIRSettingsContainer::CIRSettingsContainer( CIRSettingsView& aSettingsView ) 
       
    65     : CIRCommonSettingsContainer(), iSettingsView(aSettingsView)
       
    66     {
       
    67     IRLOG_DEBUG( "CIRSettingsContainer::CIRSettingsContainer" );
       
    68     }
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // Second-phase constructor.
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 void CIRSettingsContainer::ConstructL()
       
    75     {
       
    76     	IRLOG_DEBUG( "CIRSettingsContainer::ConstructL - Entering." );
       
    77     	BaseConstructL();
       
    78     	IRLOG_DEBUG( "CIRSettingsContainer::ConstructL - Exiting." );
       
    79     }
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // Destructor.
       
    83 // ---------------------------------------------------------------------------
       
    84 //
       
    85 CIRSettingsContainer::~CIRSettingsContainer()
       
    86     {
       
    87     IRLOG_DEBUG( "CIRSettingsContainer::~CIRSettingsContainer" );
       
    88     }
       
    89 
       
    90 // ---------------------------------------------------------------------------
       
    91 // From CAknSettingItemList.
       
    92 // ---------------------------------------------------------------------------
       
    93 //
       
    94 CAknSettingItem* CIRSettingsContainer::CreateSettingItemL( TInt aSettingId )
       
    95     {
       
    96     	IRLOG_DEBUG( "CIRSettingsContainer::CreateSettingItemL - Entering." );
       
    97 		CAknSettingItem* item = CIRCommonSettingsContainer::CreateSettingItemL( aSettingId );
       
    98 		IRLOG_DEBUG( "CIRSettingsContainer::CreateSettingItemL - Exiting." );
       
    99 		return item;
       
   100 
       
   101     }
       
   102     
       
   103 // ---------------------------------------------------------
       
   104 // CIRSettingsContainer::OfferKeyEventL
       
   105 // ---------------------------------------------------------
       
   106 //
       
   107 TKeyResponse CIRSettingsContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
       
   108     {
       
   109     	IRLOG_DEBUG( "CIRSettingsContainer::OfferKeyEventL - Entering." );
       
   110 		TKeyResponse keyResp(EKeyWasNotConsumed);
       
   111 		
       
   112 		switch (aKeyEvent.iCode)
       
   113 			{
       
   114 			case EKeyIncVolume:
       
   115 			case EKeyDecVolume:
       
   116 			case EKeyLeftArrow:
       
   117 			case EKeyRightArrow:
       
   118 				{
       
   119 				// Don't consume the volume keys
       
   120 				keyResp = EKeyWasNotConsumed;
       
   121 				break;
       
   122 				}
       
   123 			default:
       
   124 				{
       
   125 				keyResp = CAknSettingItemList::OfferKeyEventL(aKeyEvent, aType);
       
   126 				break;
       
   127 				}
       
   128 		}
       
   129 		IRLOG_DEBUG( "CIRSettingsContainer::OfferKeyEventL - Exiting." );
       
   130 		return keyResp; 
       
   131     }
       
   132     
       
   133 // ---------------------------------------------------------------------------
       
   134 // Called when an item is being edited.
       
   135 // ---------------------------------------------------------------------------
       
   136 //
       
   137 void CIRSettingsContainer::EditItemL( TInt aIndex, TBool aCalledFromMenu )
       
   138     {
       
   139     IRLOG_DEBUG( "CIRSettingsContainer::EditItemL - Entering." );
       
   140 		
       
   141 		CIRCommonSettingsContainer::EditItemL( aIndex, aCalledFromMenu );
       
   142 		IRLOG_DEBUG( "CIRSettingsContainer::EditItemL - Entering." );
       
   143 			
       
   144     }
       
   145 
       
   146 // ---------------------------------------------------------------------------
       
   147 // Sets window faded
       
   148 // ---------------------------------------------------------------------------
       
   149 //
       
   150 void CIRSettingsContainer::SetFaded(TBool aFaded) const
       
   151     {
       
   152     IRLOG_DEBUG( "CIRSettingsContainer::SetFaded - Entering." );
       
   153     Window().SetFaded(aFaded, RWindowTreeNode::EFadeIncludeChildren);
       
   154     IRLOG_DEBUG( "CIRSettingsContainer::SetFaded - Exiting." );
       
   155     }
       
   156 
       
   157 // ======== GLOBAL FUNCTIONS ========
       
   158