mediasettings/mediasettingsapp/src/MPSettingsProxyView.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:   View class for Proxy setting list view.*
       
    15 */
       
    16 
       
    17 
       
    18 // Version : %version: 4 %
       
    19 
       
    20 
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include    <aknViewAppUi.h>
       
    24 #include    <hlplch.h>             // For HlpLauncher
       
    25 #include    <featmgr.h>
       
    26 #include    <MediaSettings.rsg>
       
    27 #include    "mediasettings.hrh"
       
    28 #include    "MPSettingsNaviPaneController.h"
       
    29 #include    "MPSettingsProxyView.h"
       
    30 #include    "MPSettingsProxyContainer.h"
       
    31 #include    "MPSettingsConstants.h" 
       
    32 #include    "mpxlog.h"
       
    33 
       
    34 class CMPSettingsModelForROP;
       
    35 // ================= MEMBER FUNCTIONS =======================
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CMPSettingsProxyView::CMPSettingsProxyView
       
    39 // C++ default constructor can NOT contain any code, that
       
    40 // might leave.
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CMPSettingsProxyView::CMPSettingsProxyView(CMPSettingsModelForROP* aModel, TBool iConstructAsGsPlugin) 
       
    44     : iModel( aModel), iGsPlugin(iConstructAsGsPlugin)
       
    45     {
       
    46         MPX_FUNC("#MS# CMPSettingsProxyView::CMPSettingsProxyView()");
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------
       
    50 // CMPSettingsProxyView::ConstructL(const TRect& aRect)
       
    51 // Symbian OS two-phased constructor
       
    52 // ---------------------------------------------------------
       
    53 //
       
    54 void CMPSettingsProxyView::ConstructL()
       
    55     {
       
    56     MPX_FUNC("#MS# CMPSettingsProxyView::ConstructL()");
       
    57     BaseConstructL(R_MPSETT_PROXY_VIEW);
       
    58     }
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // CMPSettingsProxyView::NewLC
       
    62 // Two-phased constructor.
       
    63 // -----------------------------------------------------------------------------
       
    64 //
       
    65 CMPSettingsProxyView* CMPSettingsProxyView::NewLC(CMPSettingsModelForROP* aModel, TBool iConstructAsGsPlugin)
       
    66     {
       
    67     MPX_FUNC("#MS# CMPSettingsProxyView::NewLC()");
       
    68     CMPSettingsProxyView* self = new(ELeave) CMPSettingsProxyView(aModel,iConstructAsGsPlugin);
       
    69     
       
    70     CleanupStack::PushL(self);
       
    71     self->ConstructL();
       
    72 
       
    73     return self;
       
    74     }
       
    75 
       
    76 // ---------------------------------------------------------
       
    77 // CMPSettingsProxyView::~CMPSettingsProxyView()
       
    78 // Destructor
       
    79 // ---------------------------------------------------------
       
    80 //
       
    81 CMPSettingsProxyView::~CMPSettingsProxyView()
       
    82     {
       
    83     MPX_FUNC("#MS# CMPSettingsProxyView::~CMPSettingsProxyView()");
       
    84     }
       
    85 
       
    86 // ---------------------------------------------------------
       
    87 // TUid CMPSettingsProxyView::Id
       
    88 // ---------------------------------------------------------
       
    89 //
       
    90 TUid CMPSettingsProxyView::Id() const
       
    91     {
       
    92     MPX_FUNC("#MS# CMPSettingsProxyView::Id()");
       
    93     return KMPSettProxyViewId;
       
    94     }
       
    95 
       
    96 // ---------------------------------------------------------
       
    97 // CMPSettingsProxyView::HandleCommandL
       
    98 // ---------------------------------------------------------
       
    99 //
       
   100 void CMPSettingsProxyView::HandleCommandL(TInt aCommand)
       
   101     {   
       
   102     MPX_DEBUG2(_L("#MS# CMPSettingsProxyView::HandleCommandL(%d)"),aCommand);
       
   103     switch (aCommand)
       
   104         {
       
   105         case EMPSettCmdChange:
       
   106             static_cast<CMPSettingsProxyContainer*>(iContainer)->EditCurrentItemFromMenuL(ETrue);
       
   107             break;
       
   108         case EMPMiddleSoftKeyChange:
       
   109             static_cast<CMPSettingsProxyContainer*>(iContainer)->EditCurrentItemFromMenuL(EFalse);
       
   110             break;
       
   111         case EAknSoftkeyBack:
       
   112             AppUi()->ActivateLocalViewL(KMPSettStreamingViewId);
       
   113             break;
       
   114         case EMPSettCmdHelp:
       
   115             if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
       
   116             {
       
   117                 HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), AppUi()->AppHelpContextL() );
       
   118             }
       
   119             break;
       
   120         default:
       
   121             AppUi()->HandleCommandL(aCommand);
       
   122             break;
       
   123         }
       
   124     }
       
   125 
       
   126 // ---------------------------------------------------------------------------
       
   127 // CMPSettingsProxyView::NewContainerL
       
   128 // ---------------------------------------------------------------------------
       
   129 //
       
   130 CMPSettingsBaseContainer* CMPSettingsProxyView::NewContainerL()
       
   131     {
       
   132     MPX_FUNC("#MS# CMPSettingsProxyView::NewContainerL()");
       
   133     return new(ELeave) CMPSettingsProxyContainer(iModel);
       
   134     }  
       
   135 
       
   136 // ---------------------------------------------------------------------------
       
   137 // CMPSettingsProxyView::SetNaviPaneL
       
   138 // Sets Navipane texts.
       
   139 // ---------------------------------------------------------------------------
       
   140 //
       
   141 void CMPSettingsProxyView::SetNaviPaneL()
       
   142     {
       
   143     MPX_DEBUG2(_L("#MS# CMPSettingsProxyView::SetNaviPaneL() iGsPlugin(%d)"),iGsPlugin);
       
   144     if (!iGsPlugin)
       
   145         {
       
   146         iNaviPaneContext = NULL;
       
   147         CMPSettingsBaseView::SetNaviPaneL();
       
   148         }
       
   149     CMPSettingsBaseView::SetMiddleSoftKeyLabelL(R_MEDIASETTING_MSK_CHANGE,EMPMiddleSoftKeyChange);
       
   150     }
       
   151 // End of File
       
   152