mediasettings/mediasettingsapp/src/MPSettingsProxyContainer.cpp
branchRCL_3
changeset 10 112a725ff2c2
parent 9 5294c000a26d
child 11 8970fbd719ec
equal deleted inserted replaced
9:5294c000a26d 10:112a725ff2c2
     1 /*
       
     2 * Copyright (c) 2002 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 the License "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:   Container class for Proxy settings list view.*
       
    15 */
       
    16 
       
    17 
       
    18 // Version : %version: 7 %
       
    19 
       
    20 
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include    <aknlists.h>
       
    24 #include    <barsread.h>
       
    25 #include    <MediaSettings.rsg>
       
    26 #include    <csxhelp/iptv.hlp.hrh>
       
    27 
       
    28 #include    "MPSettingsApp.h"
       
    29 #include    "MPSettingsProxyContainer.h"
       
    30 #include    "MPSettingsProxySettingItemList.h"
       
    31 #include    "MPSettingsConstants.h"
       
    32 #include	"mpxlog.h"
       
    33 
       
    34 class CMPSettingsModelForROP;
       
    35 // ================= MEMBER FUNCTIONS =======================
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CMPSettingsProxyContainer::CMPSettingsProxyContainer
       
    39 // C++ default constructor can NOT contain any code, that
       
    40 // might leave.
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CMPSettingsProxyContainer::CMPSettingsProxyContainer(CMPSettingsModelForROP* aModel) 
       
    44 	: iModel( aModel)
       
    45     {
       
    46 	MPX_FUNC("#MS# CMPSettingsProxyContainer::CMPSettingsProxyContainer()");
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------
       
    50 // CMPSettingsProxyContainer::~CMPSettingsProxyContainer
       
    51 // Destructor
       
    52 // ---------------------------------------------------------
       
    53 //
       
    54 CMPSettingsProxyContainer::~CMPSettingsProxyContainer()
       
    55     {
       
    56     MPX_FUNC("#MS# CMPSettingsProxyContainer::~CMPSettingsProxyContainer()");
       
    57 	if (iSettingList) 
       
    58 		{
       
    59 		delete iSettingList;
       
    60 		}
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------
       
    64 // CMPSettingsProxyContainer::EditCurrentItemFromMenuL
       
    65 // ---------------------------------------------------------
       
    66 //
       
    67 void CMPSettingsProxyContainer::EditCurrentItemFromMenuL(TBool iMenuOption)
       
    68     {
       
    69 	MPX_DEBUG2(_L("#MS# CMPSettingsProxyContainer::EditCurrentItemFromMenuL(%d)"),iMenuOption);
       
    70     TInt index = iListBox->CurrentItemIndex();
       
    71     iSettingList->EditItemL(index, iMenuOption);
       
    72     }
       
    73 
       
    74 // ---------------------------------------------------------
       
    75 // CMPSettingsProxyContainer::ConstructComponentControlsL
       
    76 // ---------------------------------------------------------
       
    77 //
       
    78 void CMPSettingsProxyContainer::ConstructComponentControlsL()
       
    79     {
       
    80     MPX_FUNC("#MS# CMPSettingsProxyContainer::ConstructComponentControlsL()");
       
    81     iSettingList = new(ELeave) CMPSettingsProxySettingItemList(iModel);
       
    82     iSettingList->SetContainerWindowL(*this);
       
    83     iSettingList->ConstructFromResourceL(R_MPSETT_PROXY_SETTING_ITEM_LIST);
       
    84 
       
    85     iComponentControl = iSettingList;
       
    86     iListBox = iSettingList->ListBox();
       
    87     }
       
    88 
       
    89 // ---------------------------------------------------------
       
    90 // CMPSettingsProxyContainer::TitleResourceId
       
    91 // ---------------------------------------------------------
       
    92 //
       
    93 TInt CMPSettingsProxyContainer::TitleResourceId()
       
    94     {
       
    95     return R_MPSETT_PROXY_VIEW_TITLE;
       
    96     }
       
    97 
       
    98 // ---------------------------------------------------------
       
    99 // CMPSettingsProxyContainer::GetHelpContext
       
   100 // ---------------------------------------------------------
       
   101 //
       
   102 void CMPSettingsProxyContainer::GetHelpContext(TCoeHelpContext& aContext) const
       
   103     {
       
   104     MPX_FUNC("#MS# CMPSettingsProxyContainer::GetHelpContext()");
       
   105     aContext.iMajor = KIptvHelpContextUid;
       
   106     aContext.iContext = KIPTV_HLP_SETTINGS;
       
   107     }
       
   108 
       
   109 // ---------------------------------------------------------
       
   110 // CMPSettingsProxyContainer::FocusChanged
       
   111 // ---------------------------------------------------------
       
   112 //
       
   113 void CMPSettingsProxyContainer::FocusChanged(TDrawNow /*aDrawNow*/)
       
   114 	{
       
   115 		if( iListBox)
       
   116         {
       
   117         iListBox->SetFocus( IsFocused() );
       
   118         }
       
   119 
       
   120 		if( iComponentControl)
       
   121         {
       
   122         iComponentControl->SetFocus( IsFocused() );
       
   123         }
       
   124 	}
       
   125 
       
   126 // ---------------------------------------------------------------------------
       
   127 // CMPSettingsProxyContainer::SizeChanged()
       
   128 // Called by framwork when the view size is changed
       
   129 // ---------------------------------------------------------------------------
       
   130 //
       
   131 void CMPSettingsProxyContainer::SizeChanged()
       
   132     {
       
   133 		if (iListBox)
       
   134         {
       
   135         iListBox->SetRect(Rect());
       
   136         }
       
   137 
       
   138 		if (iComponentControl)
       
   139         {
       
   140         iComponentControl->SetRect(Rect());
       
   141         }
       
   142     }
       
   143     
       
   144 // ---------------------------------------------------------
       
   145 // CMPSettingsProxyContainer::HandleResourceChange
       
   146 // Handles a resource relative event 
       
   147 // ---------------------------------------------------------
       
   148 //
       
   149 void CMPSettingsProxyContainer::HandleResourceChange( TInt aType )
       
   150     {
       
   151 	MPX_DEBUG2(_L("#MS# CMPSettingsProxyContainer::HandleResourceChange(0x%X)"),aType);
       
   152 	if ( aType == KEikDynamicLayoutVariantSwitch ) //Handle change in layout orientation
       
   153 		{
       
   154 		TRect mainPaneRect;
       
   155 		AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
       
   156 		SetRect( mainPaneRect );
       
   157 		DrawNow();
       
   158 		}
       
   159 	CCoeControl::HandleResourceChange( aType );  
       
   160     }
       
   161 // End of File