mediasettings/feedsettingsviews/src/feedsettingsview.cpp
changeset 71 60b4b6493d7b
equal deleted inserted replaced
-1:000000000000 71:60b4b6493d7b
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:    CVcSettingsView view class definitions.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <aknViewAppUi.h>
       
    21 #include <akntitle.h>
       
    22 #include <AknUtils.h>
       
    23 #include <avkon.hrh>
       
    24 #include <AknGlobalNote.h>
       
    25 #include <AknIconUtils.h> 
       
    26 #include <StringLoader.h>
       
    27 #include <akntitle.h>
       
    28 #include <barsread.h>
       
    29 #include <mpxviewutility.h>
       
    30 #include <featmgr.h>
       
    31 #include <hlplch.h>
       
    32 
       
    33 #include <gstabhelper.h>
       
    34 #include <videoplayeractivationmessage.h>
       
    35 
       
    36 #include "IptvDebug.h"
       
    37 #include <vcxnssettingsview.rsg>
       
    38 #include "CIptvResourceLoader.h"
       
    39 #include "vcxnsservicesettings.h"
       
    40 #include "feedsettingsview.h"
       
    41 #include "feedsettingsviewcontainer.h"
       
    42 
       
    43 #include "videoplayersettingsengine.h"
       
    44 
       
    45 #include <mediasettings.mbg>
       
    46 #include "GSVideoPlugin.h"
       
    47 
       
    48 #include "MPSettingsNaviPaneController.h"
       
    49 #include "MPSettingsAppUi.h"
       
    50 #include "MPSettingsConstants.h" 
       
    51 
       
    52 // Consts
       
    53 _LIT( KVcSettingsViewResource, "\\resource\\apps\\vcxnssettingsview." );
       
    54 _LIT( KMSettingsFile, "mediasettings.mif" );
       
    55 
       
    56 // ================= MEMBER FUNCTIONS =======================
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CVcxNsSettingsView::NewL()
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 EXPORT_C CVcxNsSettingsView* CVcxNsSettingsView::NewL( )
       
    63     {
       
    64     CVcxNsSettingsView* self = CVcxNsSettingsView::NewLC( );
       
    65     CleanupStack::Pop( self );
       
    66     return self;
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CVcxNsSettingsView::NewLC()
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 EXPORT_C CVcxNsSettingsView* CVcxNsSettingsView::NewLC( 
       
    74         CArrayPtrFlat<MGSTabbedView>* aTabViewArray )
       
    75     {
       
    76     CVcxNsSettingsView* self = new (ELeave) CVcxNsSettingsView( );
       
    77     CleanupStack::PushL( self );
       
    78 
       
    79     self->ConstructL( aTabViewArray );
       
    80     return self;
       
    81     }
       
    82 
       
    83 // ---------------------------------------------------------
       
    84 // CVcxNsSettingsView::~CVcxNsSettingsView()
       
    85 // ---------------------------------------------------------
       
    86 //
       
    87 EXPORT_C CVcxNsSettingsView::~CVcxNsSettingsView()
       
    88     {
       
    89     iFs.Close();
       
    90 
       
    91     if ( iContainer )
       
    92         {
       
    93         AppUi()->RemoveFromStack( iContainer );
       
    94         delete iContainer;
       
    95         }
       
    96     
       
    97     delete iTabHelper;
       
    98     delete iResourceLoader;
       
    99     delete iSettingsEngine;
       
   100     delete iServiceSettings;
       
   101     
       
   102     if ( iViewUtility )
       
   103         {
       
   104         iViewUtility->Close();
       
   105         }
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------
       
   109 // CVcxNsSettingsView::CVcxNsSettingsView()
       
   110 // ---------------------------------------------------------
       
   111 //
       
   112 EXPORT_C CVcxNsSettingsView::CVcxNsSettingsView( const TUid aViewId )
       
   113   : iViewId( aViewId ),
       
   114     iServiceSubscriptionMode( EFalse ),
       
   115     iVodcastAddFeedMode( EFalse ),
       
   116     iGSVideoPluginMode( EFalse )
       
   117     {
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------
       
   121 // CVcxNsSettingsView::ConstructL()
       
   122 // ---------------------------------------------------------
       
   123 //
       
   124 EXPORT_C void CVcxNsSettingsView::ConstructL( 
       
   125         CArrayPtrFlat<MGSTabbedView>* aTabViewArray )
       
   126     {
       
   127     if ( aTabViewArray )
       
   128         {
       
   129         aTabViewArray->AppendL(this);
       
   130         iGSVideoPluginMode = ETrue;
       
   131         iViewArray = aTabViewArray;
       
   132         }
       
   133     
       
   134     if ( iGSVideoPluginMode )
       
   135         {
       
   136         iTabHelper = CGSTabHelper::NewL();
       
   137         }
       
   138     
       
   139     // Resources must be loaded before base construct.
       
   140     iResourceLoader = CIptvResourceLoader::NewL( *iCoeEnv );
       
   141     iResourceLoader->AddResourceL( KVcSettingsViewResource );
       
   142 
       
   143     BaseConstructL( R_VCSETTINGSVIEW_SETTINGSVIEW );
       
   144 
       
   145     User::LeaveIfError( iFs.Connect() );
       
   146     
       
   147     iSettingsEngine = CVcxNsSettingsEngine::NewL( );
       
   148     iServiceSettings = CVcxNsServiceSettings::NewL();
       
   149     iViewUtility = MMPXViewUtility::UtilityL();
       
   150     }
       
   151 
       
   152 // ---------------------------------------------------------
       
   153 // TUid CVcxNsSettingsView::Id()
       
   154 // Return id of this view instance
       
   155 // ---------------------------------------------------------
       
   156 //
       
   157 TUid CVcxNsSettingsView::Id() const
       
   158     {
       
   159     //return iViewId;
       
   160     return KMPSettFeedsViewId;
       
   161     }
       
   162 
       
   163 // ---------------------------------------------------------
       
   164 // CCVcxNsSettingsView::IsSettingsViewActive()
       
   165 // ---------------------------------------------------------
       
   166 //
       
   167 TBool CVcxNsSettingsView::IsSettingsViewActive()
       
   168     {
       
   169     return iContainer != NULL;
       
   170     }
       
   171 
       
   172 // ---------------------------------------------------------
       
   173 // CCVcxNsSettingsView::HandleCommandL()
       
   174 // Command handler
       
   175 // ---------------------------------------------------------
       
   176 //
       
   177 EXPORT_C void CVcxNsSettingsView::HandleCommandL(TInt aCommand)
       
   178     {
       
   179     IPTVLOGSTRING2_LOW_LEVEL( 
       
   180         "Settings view ## CVcxNsSettingsView::HandleCommandL(%d)", aCommand );
       
   181 
       
   182     switch ( aCommand )
       
   183         {
       
   184         // Settings view
       
   185         case EAknSoftkeyOpen:
       
   186         case EVcSettingsViewCmdOpen:
       
   187             break;
       
   188 
       
   189         case EVcSettingsServiceCmdSelect:
       
   190             if (iContainer)
       
   191                 {
       
   192                 iContainer->SaveServiceSelectionInformationL();
       
   193                 }
       
   194             break;
       
   195 
       
   196         // Video service selection view
       
   197         case EVcSettingsServiceCmdMark:
       
   198         case EVcSettingsServiceCmdUnmark:
       
   199             if ( iContainer )
       
   200                 {
       
   201                 iContainer->HandleMarkCommandL( aCommand );
       
   202                 }
       
   203             break;
       
   204 
       
   205         case EVcSettingsServiceCmdVodDetails:
       
   206         case EVcSettingsServiceCmdVodcastDetails:
       
   207         case EVcSettingsServiceCmdWebLinkDetails:
       
   208             if (iContainer)
       
   209                 {
       
   210                 iContainer->ShowVideoServiceDetailsL();
       
   211                 }        
       
   212             break;
       
   213 
       
   214         case EVcSettingsServiceCmdVodEdit:
       
   215         case EVcSettingsServiceCmdVodcastEdit:
       
   216             HandleVodAddOrEditCommandL( EFalse );
       
   217             break;
       
   218 
       
   219         case EVcSettingsServiceCmdVodRemove:
       
   220         case EVcSettingsServiceCmdVodcastRemove:
       
   221         case EVcSettingsServiceCmdWebLinkRemove:
       
   222             if (iContainer)
       
   223                 {
       
   224                 iContainer->DeleteVideoServiceL();
       
   225                 }
       
   226             break;
       
   227 
       
   228         case EVcSettingsServiceCmdVodAdd:
       
   229         case EVcSettingsServiceCmdVodcastAdd:
       
   230             HandleVodAddOrEditCommandL( ETrue );
       
   231             break;
       
   232 
       
   233         // Add/Edit service view
       
   234         case EVcSettingsViewAddServiceCmdChange:
       
   235         case EAknSoftkeyChange:
       
   236             if (iContainer)
       
   237                 {
       
   238                 iContainer->EditCurrentSettingItemListItemL(ETrue);
       
   239                 }
       
   240             break;
       
   241 
       
   242         // Common
       
   243         case EVcSettingsViewCmdHelp:
       
   244             {
       
   245             if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
       
   246                 {
       
   247                 HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(), 
       
   248                                                      AppUi()->AppHelpContextL() );
       
   249                 }
       
   250             }
       
   251             break;
       
   252 
       
   253         case EVcSettingsViewCmdExit:
       
   254             {
       
   255             if ( iContainer )
       
   256                 {
       
   257                 iContainer->SaveServiceSelectionInformationL();
       
   258                 }
       
   259             AppUi()->HandleCommandL( EEikCmdExit );
       
   260             }
       
   261             break;
       
   262 
       
   263         // Softkeys
       
   264         case EAknSoftkeyExit:
       
   265             {
       
   266             AppUi()->HandleCommandL( EEikCmdExit );
       
   267             }
       
   268             break;
       
   269 
       
   270         case EAknSoftkeyBack:
       
   271             {
       
   272             HandleBackCommandL();
       
   273             }
       
   274             break;   
       
   275                     
       
   276         case EVcSettingsViewSoftkeyBack:
       
   277             break;
       
   278 
       
   279         case EVcSettingsViewSoftkeyMove:
       
   280         case EVcSettingsViewSoftkeyOk:
       
   281         case EVcSettingsViewSoftkeyCancel:
       
   282             break;
       
   283 
       
   284         default:
       
   285             AppUi()->HandleCommandL( aCommand );
       
   286             break;
       
   287         }
       
   288 
       
   289     if ( iContainer )
       
   290         {
       
   291         iContainer->CheckMsk();
       
   292         }
       
   293     }
       
   294     
       
   295  // ---------------------------------------------------------
       
   296 // CVcxNsSettingsView::SetServiceSubscriptionMode()
       
   297 // ---------------------------------------------------------   
       
   298 void CVcxNsSettingsView::SetServiceSubscriptionMode()
       
   299     {
       
   300     iServiceSubscriptionMode = ETrue;
       
   301     }
       
   302     
       
   303 // ---------------------------------------------------------
       
   304 // CVcxNsSettingsView::SetVodcastAddFeedMode()
       
   305 // ---------------------------------------------------------
       
   306 //
       
   307 void CVcxNsSettingsView::SetVodcastAddFeedMode()
       
   308     {
       
   309     iVodcastAddFeedMode = ETrue;
       
   310     }
       
   311 
       
   312 // ---------------------------------------------------------
       
   313 // CVcxNsSettingsView::HandleClientRectChange()
       
   314 // ---------------------------------------------------------
       
   315 //
       
   316 void CVcxNsSettingsView::HandleClientRectChange()
       
   317     {
       
   318     if ( iContainer )
       
   319         {
       
   320         iContainer->SetRect( ClientRect() );
       
   321         }
       
   322     }
       
   323 
       
   324 // ---------------------------------------------------------
       
   325 // CVcxNsSettingsView::GetButtonGroupContainer()
       
   326 // ---------------------------------------------------------
       
   327 //
       
   328 CEikButtonGroupContainer* CVcxNsSettingsView::GetButtonGroupContainer()
       
   329     {
       
   330     return Cba();
       
   331     }
       
   332 
       
   333 // ---------------------------------------------------------
       
   334 // CVcxNsSettingsView::DoActivateL
       
   335 // Activation of this view instance.
       
   336 // ---------------------------------------------------------
       
   337 //
       
   338 EXPORT_C void CVcxNsSettingsView::DoActivateL( 
       
   339         const TVwsViewId& aPrevViewId, 
       
   340         TUid /*aCustomMessageId*/, 
       
   341         const TDesC8& aCustomMessage )
       
   342     {
       
   343     IPTVLOGSTRING_LOW_LEVEL("Settings view ## CVcxNsSettingsView::DoActivateL()");
       
   344 
       
   345     HandleActivationMessageL( aCustomMessage );
       
   346 
       
   347     if ( !iGSVideoPluginMode && !iServiceSubscriptionMode && !iVodcastAddFeedMode  )
       
   348         {
       
   349         iNaviCntrl = static_cast<CMPSettingsAppUi*>(AppUi());
       
   350         iNaviPaneContext = iNaviCntrl->MPTabGroup();
       
   351         }
       
   352     
       
   353     // Set correct navi pane
       
   354     SetNaviPaneL();
       
   355     
       
   356     iPrevViewId = aPrevViewId; // Save the previous view id 
       
   357 
       
   358     if ( !iContainer )
       
   359         {
       
   360         
       
   361         iContainer = new (ELeave) CVcxNsSettingsViewContainer( 
       
   362                                                   *AppUi(), 
       
   363                                                   *iSettingsEngine, 
       
   364                                                   *iServiceSettings,
       
   365                                                   this, 
       
   366                                                   iFs );
       
   367         
       
   368         iContainer->SetMopParent( this );
       
   369         iContainer->ConstructL( ClientRect() );
       
   370 
       
   371         AppUi()->AddToStackL(*this, iContainer);
       
   372         }
       
   373 
       
   374     if ( iServiceSubscriptionMode )
       
   375         {
       
   376         iContainer->SwitchToServiceSelectionListL( CIptvService::EVod );
       
   377         }
       
   378     else if ( iVodcastAddFeedMode )
       
   379         {
       
   380         iContainer->LoadAddVodCastFeedL();
       
   381         iContainer->SwitchToAddOrEditServiceListL();
       
   382         }
       
   383     
       
   384    
       
   385     if ( iServiceSubscriptionMode || iVodcastAddFeedMode )
       
   386         {
       
   387         // If we come directly from Video Feeds, status pane has flat layout
       
   388         iPrevStatusPaneLayout = StatusPane()->CurrentLayoutResId();
       
   389         if ( iPrevStatusPaneLayout != R_AVKON_STATUS_PANE_LAYOUT_USUAL
       
   390                 && iPrevStatusPaneLayout != R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT )
       
   391             {
       
   392             StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL );        
       
   393             }
       
   394         }
       
   395     iContainer->MakeVisible( ETrue );
       
   396 
       
   397     CEikButtonGroupContainer* cba = Cba();
       
   398     if ( cba )
       
   399         {
       
   400         cba->DrawDeferred();
       
   401         }
       
   402     
       
   403     if ( iGSVideoPluginMode )
       
   404         {
       
   405         CGSVideoPlugin* parent = 
       
   406             static_cast<CGSVideoPlugin*> ( AppUi()->View( KGSVideoPluginUid ) );
       
   407 
       
   408         if ( parent )
       
   409             {
       
   410             iTabHelper->CreateTabGroupL( Id(), 
       
   411                         static_cast<CArrayPtrFlat<MGSTabbedView> *> (iViewArray) ); 
       
   412             }
       
   413         }
       
   414     iContainer->CheckMsk();
       
   415     }
       
   416 
       
   417 // ---------------------------------------------------------
       
   418 // CVcxNsSettingsView::DoDeactivate()
       
   419 // Deactivation of this view instance.
       
   420 // ---------------------------------------------------------
       
   421 //
       
   422 EXPORT_C void CVcxNsSettingsView::DoDeactivate()
       
   423     {
       
   424     if ( !iServiceSubscriptionMode )
       
   425         {
       
   426         // Save service selection when switching to another tab.
       
   427         TRAP_IGNORE( SaveServiceSelectionL() );
       
   428         }
       
   429         
       
   430     // Must restore status pane layout if going back to Video Feeds.
       
   431     // statuspane layout switch uses fonts, this makes sure that 
       
   432     // the fonts are still available in environment. This can happen
       
   433     // in cases where environment is already destroyed when this
       
   434     // is entered.
       
   435     if ( ( iServiceSubscriptionMode || iVodcastAddFeedMode ) && iPrevStatusPaneLayout )            
       
   436         {
       
   437         if ( iPrevStatusPaneLayout != StatusPane()->CurrentLayoutResId() &&
       
   438                 iCoeEnv->NormalFont() )
       
   439             {
       
   440             TRAP_IGNORE( StatusPane()->SwitchLayoutL( iPrevStatusPaneLayout ) )
       
   441             }
       
   442         }
       
   443     
       
   444     if ( iContainer )
       
   445         {
       
   446         AppUi()->RemoveFromStack( iContainer );
       
   447 
       
   448         delete iContainer;
       
   449         iContainer = NULL;
       
   450         }
       
   451     
       
   452     if ( iTabHelper )
       
   453         {
       
   454         iTabHelper->RemoveTabGroup();
       
   455         }
       
   456     }
       
   457 
       
   458 // ---------------------------------------------------------
       
   459 // CVcxNsSettingsView::RoutedKeyEventL
       
   460 // ---------------------------------------------------------
       
   461 //
       
   462 TKeyResponse CVcxNsSettingsView::RoutedKeyEventL( const TKeyEvent &aKeyEvent,
       
   463                                                   TEventCode aType )
       
   464     {
       
   465     if (iContainer)
       
   466         {
       
   467         return iContainer->OfferKeyEventL(aKeyEvent, aType);
       
   468         }
       
   469     return EKeyWasConsumed;
       
   470     }
       
   471 
       
   472 // ------------------------------------------------------------------------------
       
   473 // CVcxNsSettingsView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
       
   474 // This function is called by the EIKON framework just before it displays
       
   475 // a menu pane. Menu is adjusted according to Settings UI state.
       
   476 // ------------------------------------------------------------------------------
       
   477 //
       
   478 EXPORT_C void CVcxNsSettingsView::DynInitMenuPaneL( TInt aResourceId,
       
   479                                                     CEikMenuPane* aMenuPane )
       
   480     {
       
   481     if ( !iContainer )
       
   482         {
       
   483         // This cleans up the code layout,
       
   484         // no need to check this later
       
   485         return;
       
   486         }
       
   487     
       
   488     switch ( aResourceId )
       
   489         {
       
   490         case R_VCSETTINGSVIEW_SETTINGSVIEW_MENU:
       
   491             {
       
   492             switch ( iContainer->GetActiveList() )
       
   493                 {
       
   494                 case EServiceSelection:
       
   495                     {
       
   496                     aMenuPane->SetItemDimmed( EVcSettingsViewCmdOpen, ETrue );
       
   497                     aMenuPane->SetItemDimmed( EVcSettingsViewCmdChange, ETrue );
       
   498                                            
       
   499                     aMenuPane->SetItemDimmed(
       
   500                         EVcSettingsServiceCmdMark, 
       
   501                         !iContainer->ShowMarkForCurrentListItemL() );
       
   502                     aMenuPane->SetItemDimmed(
       
   503                         EVcSettingsServiceCmdUnmark, 
       
   504                         !iContainer->ShowUnmarkForCurrentListItemL() );
       
   505                     
       
   506                     switch ( iContainer->GetServiceSelectionServiceType() )
       
   507                         {
       
   508                         case CIptvService::EVod:
       
   509                             {
       
   510                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodDetails, 
       
   511                                 !iContainer->ShowMenuItemForCurrentListItemL(
       
   512                                      CVcxNsSettingsViewContainer::EConstAndInfo ) );
       
   513                             aMenuPane->SetItemDimmed(EVcSettingsServiceCmdVodEdit,
       
   514                                 !iContainer->ShowMenuItemForCurrentListItemL( 
       
   515                                     CVcxNsSettingsViewContainer::EEditable ));
       
   516                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodRemove, 
       
   517                                 !iContainer->ShowMenuItemForCurrentListItemL(
       
   518                                      CVcxNsSettingsViewContainer::EEditable ) );
       
   519                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodAdd, EFalse );
       
   520                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastDetails, ETrue );
       
   521                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastEdit, ETrue );
       
   522                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastRemove, ETrue );
       
   523                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastAdd, ETrue );
       
   524                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkDetails, ETrue );
       
   525                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkRemove, ETrue );
       
   526                             }
       
   527                             break;
       
   528 
       
   529                         case CIptvService::EVodCast:
       
   530                             {
       
   531                             aMenuPane->SetItemDimmed(EVcSettingsServiceCmdVodcastDetails,
       
   532                                 !iContainer->ShowMenuItemForCurrentListItemL( 
       
   533                                      CVcxNsSettingsViewContainer::EConstAndInfo ));
       
   534                             aMenuPane->SetItemDimmed(EVcSettingsServiceCmdVodcastEdit,
       
   535                                 !iContainer->ShowMenuItemForCurrentListItemL( 
       
   536                                      CVcxNsSettingsViewContainer::EEditable ));
       
   537                             aMenuPane->SetItemDimmed(EVcSettingsServiceCmdVodcastRemove,
       
   538                                 !iContainer->ShowMenuItemForCurrentListItemL( 
       
   539                                      CVcxNsSettingsViewContainer::EEditable ));
       
   540                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastAdd, EFalse );
       
   541                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodDetails, ETrue );
       
   542                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodEdit, ETrue );
       
   543                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodRemove, ETrue );
       
   544                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodAdd, ETrue );
       
   545                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkDetails, ETrue );
       
   546                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkRemove, ETrue );
       
   547                             }
       
   548                             break;
       
   549 
       
   550                         case CIptvService::EBrowser:
       
   551                             {
       
   552                             aMenuPane->SetItemDimmed(EVcSettingsServiceCmdWebLinkDetails, 
       
   553                                                      !iContainer->ShowMenuItemForCurrentListItemL(
       
   554                                                          CVcxNsSettingsViewContainer::EConstAndInfo));
       
   555                             aMenuPane->SetItemDimmed(EVcSettingsServiceCmdWebLinkRemove, 
       
   556                                                      !iContainer->ShowMenuItemForCurrentListItemL(
       
   557                                                          CVcxNsSettingsViewContainer::EEditable));
       
   558                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodDetails, ETrue );
       
   559                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodEdit, ETrue );
       
   560                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodRemove, ETrue );
       
   561                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodAdd, ETrue );
       
   562                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastDetails, ETrue );
       
   563                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastEdit, ETrue );
       
   564                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastRemove, ETrue );
       
   565                             aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastAdd, ETrue );
       
   566                             }
       
   567                             break;
       
   568                         
       
   569                         default:
       
   570                             break;
       
   571                         }
       
   572 
       
   573                     aMenuPane->SetItemDimmed(EVcSettingsViewAddServiceCmdChange, ETrue);
       
   574 
       
   575                     aMenuPane->SetItemDimmed(EVcSettingsViewCmdHelp, EFalse);
       
   576                     aMenuPane->SetItemDimmed(EVcSettingsViewCmdExit, EFalse);
       
   577                     }
       
   578                     break;
       
   579                     
       
   580                 case EAddService:
       
   581                     {
       
   582                     aMenuPane->SetItemDimmed( EVcSettingsViewCmdOpen, ETrue );
       
   583                     aMenuPane->SetItemDimmed( EVcSettingsViewCmdChange, ETrue );
       
   584                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdMark, ETrue );
       
   585                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdUnmark, ETrue );
       
   586                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdMark, ETrue );
       
   587                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdUnmark, ETrue );
       
   588                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodDetails, ETrue );
       
   589                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodEdit, ETrue );
       
   590                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodRemove, ETrue );
       
   591                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodAdd, ETrue );
       
   592                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastDetails, ETrue );
       
   593                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastEdit, ETrue );
       
   594                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastRemove, ETrue );
       
   595                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdVodcastAdd, ETrue );
       
   596                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkDetails, ETrue );
       
   597                     aMenuPane->SetItemDimmed( EVcSettingsServiceCmdWebLinkRemove, ETrue );
       
   598                     aMenuPane->SetItemDimmed( EVcSettingsViewAddServiceCmdChange, EFalse );
       
   599                     aMenuPane->SetItemDimmed( EVcSettingsViewCmdHelp, EFalse );
       
   600                     aMenuPane->SetItemDimmed( EVcSettingsViewCmdExit, EFalse );
       
   601                     }
       
   602                     break;
       
   603                 }
       
   604             }
       
   605             break;
       
   606 
       
   607         default:
       
   608             break;
       
   609         }
       
   610     }
       
   611 
       
   612 // -----------------------------------------------------------------------------
       
   613 // CVcxNsSettingsView::HandleStatusPaneSizeChange
       
   614 // -----------------------------------------------------------------------------
       
   615 //
       
   616 EXPORT_C void CVcxNsSettingsView::HandleStatusPaneSizeChange()
       
   617     {
       
   618     if ( iContainer )
       
   619         {
       
   620         iContainer->SetRect( ClientRect() );
       
   621         }
       
   622     }
       
   623 
       
   624 // -----------------------------------------------------------------------------
       
   625 // CVcxNsSettingsView::LaunchedFromGsFw
       
   626 // -----------------------------------------------------------------------------
       
   627 //
       
   628 TBool CVcxNsSettingsView::LaunchedFromGsFw()
       
   629     {
       
   630     //return Id().iUid == KVcxNsGeneralSettingsPluginUid ? ETrue : EFalse;
       
   631     return EFalse;
       
   632     }
       
   633 
       
   634 // -----------------------------------------------------------------------------
       
   635 // CVcxNsSettingsView::Container
       
   636 // -----------------------------------------------------------------------------
       
   637 //
       
   638 CVcxNsSettingsViewContainer* CVcxNsSettingsView::Container()
       
   639     {
       
   640     return iContainer;
       
   641     }
       
   642 
       
   643 // -----------------------------------------------------------------------------
       
   644 // CVcxNsSettingsView::CreateTabIconL
       
   645 // -----------------------------------------------------------------------------
       
   646 //
       
   647 CGulIcon* CVcxNsSettingsView::CreateTabIconL()
       
   648     {
       
   649     CGulIcon* icon = NULL;
       
   650     TFileName fileName;
       
   651     LocateMifFileL( fileName );
       
   652 
       
   653     icon = AknsUtils::CreateGulIconL(
       
   654         AknsUtils::SkinInstance(), 
       
   655         KAknsIIDDefault, 
       
   656         fileName,
       
   657         EMbmMediasettingsQgn_prop_set_mp_video_tab3,
       
   658         EMbmMediasettingsQgn_prop_set_mp_video_tab3_mask );
       
   659 
       
   660     return icon;
       
   661     }       
       
   662 
       
   663 // -----------------------------------------------------------------------------
       
   664 // CVcxNsSettingsView::LocateMifFileL
       
   665 // -----------------------------------------------------------------------------
       
   666 //
       
   667 void CVcxNsSettingsView::LocateMifFileL( TFileName& aFileName )
       
   668     {
       
   669     // Get the path & file name with the drive not specified.
       
   670     TParse parse;
       
   671     parse.Set( KMSettingsFile, &KDC_APP_BITMAP_DIR, NULL );
       
   672     TPtrC mifFile = parse.FullName();
       
   673    
       
   674     // This is done to ensure upgraded file is used first.
       
   675     TFindFile find( iCoeEnv->FsSession() );
       
   676     TInt err = find.FindByDir( mifFile, KNullDesC );
       
   677     
       
   678     if ( err )
       
   679         {
       
   680         User::Leave( KErrNotFound );
       
   681         }
       
   682     else
       
   683         {
       
   684         aFileName.Append( find.File() );
       
   685         }
       
   686     }
       
   687 
       
   688 // ---------------------------------------------------------------------------
       
   689 // CVcxNsSettingsView::SetNaviPaneL
       
   690 // ---------------------------------------------------------------------------
       
   691 //
       
   692 void CVcxNsSettingsView::SetNaviPaneL( TBool aDisableNaviPane )
       
   693     {
       
   694     if ( !iGSVideoPluginMode && !iServiceSubscriptionMode && !iVodcastAddFeedMode )
       
   695         {
       
   696         if ( iNaviPaneContext && !aDisableNaviPane )
       
   697             {
       
   698             iNaviCntrl->NaviContainer()->PushL( *iNaviPaneContext );
       
   699             if ( iNaviPaneContext == iNaviCntrl->MPTabGroup() )
       
   700                 {
       
   701                 iNaviCntrl->UpdateTabIndex();
       
   702                 }
       
   703             }
       
   704         else 
       
   705             {
       
   706             iNaviCntrl->NaviContainer()->PushDefaultL();
       
   707             }
       
   708         }
       
   709     }
       
   710 
       
   711 // ---------------------------------------------------------------------------
       
   712 // CVcxNsSettingsView::HandleActivationMessageL
       
   713 // ---------------------------------------------------------------------------
       
   714 //
       
   715 void CVcxNsSettingsView::HandleActivationMessageL( const TDesC8& aCustomMessage )
       
   716     {
       
   717     if ( aCustomMessage.Length() == sizeof( TVideoPlayerActivationMessage ) )
       
   718         {
       
   719         TVideoPlayerActivationMessage params;
       
   720         TPckg<TVideoPlayerActivationMessage> paramsPckg( params );
       
   721         paramsPckg.Copy( aCustomMessage );
       
   722         
       
   723         if ( params.iMsgType == 
       
   724             TVideoPlayerActivationMessage::EOpenVCSettingsFeedSubscriptions )
       
   725             {
       
   726             SetServiceSubscriptionMode();
       
   727             }
       
   728         else if ( params.iMsgType == 
       
   729             TVideoPlayerActivationMessage::EOpenVCSettingsAddFeed )
       
   730             {
       
   731             SetVodcastAddFeedMode();
       
   732             }
       
   733         }
       
   734     }
       
   735 
       
   736 // ---------------------------------------------------------------------------
       
   737 // CVcxNsSettingsView::HandleBackCommandL
       
   738 // ---------------------------------------------------------------------------
       
   739 //
       
   740 void CVcxNsSettingsView::HandleBackCommandL()
       
   741     {
       
   742     if ( iContainer )
       
   743         {
       
   744         switch ( iContainer->GetActiveList() )
       
   745             {
       
   746             case EServiceSelection:
       
   747                 {
       
   748                 HandleBackCommandForServiceSelectionL();
       
   749                 }
       
   750                 break;
       
   751                 
       
   752             case EAddService:
       
   753                 {
       
   754                 HandleBackCommandForAddServiceL();
       
   755                 }
       
   756                 break;
       
   757 
       
   758             default:
       
   759                 break;
       
   760             }
       
   761         }
       
   762     }
       
   763 
       
   764 // ---------------------------------------------------------------------------
       
   765 // CVcxNsSettingsView::HandleBackCommandForServiceSelectionL
       
   766 // ---------------------------------------------------------------------------
       
   767 //
       
   768 void CVcxNsSettingsView::HandleBackCommandForServiceSelectionL()
       
   769     {
       
   770     if ( iContainer )
       
   771         {
       
   772         if ( !iServiceSubscriptionMode )
       
   773             {
       
   774             // Normal case, Video player settings main view.
       
   775             iContainer->SaveServiceSelectionInformationL();
       
   776             
       
   777             if ( !iGSVideoPluginMode )
       
   778                 {
       
   779                 // Activate settings main view
       
   780                 AppUi()->ActivateLocalViewL( KMPSettMainViewId );
       
   781                 }
       
   782             else 
       
   783                 {
       
   784                 AppUi()->ActivateLocalViewL( KGSVideoPluginUid );
       
   785                 }
       
   786             }
       
   787         else
       
   788             {
       
   789             // In Vodcast "feed subscription" mode we switch
       
   790             // right back to Vodcast when user closes this view.
       
   791     
       
   792             iContainer->SaveServiceSelectionInformationL();
       
   793             iContainer->FinishServiceSelectionList();
       
   794 
       
   795             iViewUtility->ActivatePreviousViewL();
       
   796             iServiceSubscriptionMode = EFalse;
       
   797             }
       
   798         }
       
   799     }
       
   800 
       
   801 // ---------------------------------------------------------------------------
       
   802 // CVcxNsSettingsView::SaveServiceSelectionL()
       
   803 // ---------------------------------------------------------------------------
       
   804 //
       
   805 void CVcxNsSettingsView::SaveServiceSelectionL()
       
   806     {
       
   807     if ( iContainer )
       
   808         {
       
   809         iContainer->SaveServiceSelectionInformationL();
       
   810         }
       
   811     }
       
   812 
       
   813 // ---------------------------------------------------------------------------
       
   814 // CVcxNsSettingsView::HandleBackCommandForAddServiceL
       
   815 // ---------------------------------------------------------------------------
       
   816 //
       
   817 void CVcxNsSettingsView::HandleBackCommandForAddServiceL()
       
   818     {
       
   819     if ( iContainer )
       
   820         {
       
   821         if( !iVodcastAddFeedMode )
       
   822             {
       
   823             //Save new service and switch to service selection view.
       
   824             iContainer->SaveAddServiceInformationL();
       
   825             iContainer->SwitchToServiceSelectionListL();
       
   826             SetNaviPaneL();
       
   827             }
       
   828         else
       
   829             {
       
   830             // Save new service and switch back to VOD.
       
   831             iContainer->SaveAddServiceInformationL();
       
   832             iContainer->FinishServiceSelectionList();
       
   833 
       
   834            iViewUtility->ActivatePreviousViewL();
       
   835             iVodcastAddFeedMode = EFalse;
       
   836             }
       
   837         }
       
   838     }
       
   839 
       
   840 // ---------------------------------------------------------------------------
       
   841 // CVcxNsSettingsView::HandleVodAddOrEditCommand
       
   842 // ---------------------------------------------------------------------------
       
   843 //
       
   844 void CVcxNsSettingsView::HandleVodAddOrEditCommandL( TBool aIsAdding )
       
   845     {
       
   846     if ( iContainer )
       
   847         {
       
   848         iContainer->SaveServiceSelectionInformationL();
       
   849         iContainer->LoadAddServiceInformationL( aIsAdding ); // EFalse=Edit, ETrue=Add
       
   850         SetNaviPaneL( ETrue );
       
   851         iContainer->SwitchToAddOrEditServiceListL();
       
   852         }        
       
   853     }
       
   854