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