13 * |
13 * |
14 * Description: GSVideoPlugin.cpp* |
14 * Description: GSVideoPlugin.cpp* |
15 */ |
15 */ |
16 |
16 |
17 |
17 |
18 // Version : %version: 8 % |
18 // Version : %version: 10 % |
19 |
19 |
20 |
20 |
21 |
21 |
22 // INCLUDES |
22 // INCLUDES |
23 #include "MPSettingsModelForROP.h" |
23 #include "MPSettingsModelForROP.h" |
24 #include "GSVideoPlugin.h" |
24 #include "GSVideoPlugin.h" |
25 #include "MPSettingsConstants.h" |
25 #include "MPSettingsConstants.h" |
26 #include "MPSettingsMainView.h" |
26 #include "MPSettingsMainView.h" |
27 #include "MPSettingsProxyView.h" |
|
28 #include "MPSettingsNetworkView.h" |
|
29 #include "MPSettingsPluginView.h" |
27 #include "MPSettingsPluginView.h" |
30 #include "MPSettingsAdvancedBwView.h" |
28 #include "MPSettingsAdvancedBwView.h" |
31 #include "MPSettingsMainContainer.h" |
29 #include "MPSettingsMainContainer.h" |
|
30 #include "MPSettingsStreamingContainer.h" |
32 #include "mediasettings.hrh" |
31 #include "mediasettings.hrh" |
33 #include "gstabhelper.h" |
32 #include "gstabhelper.h" |
34 #include "GSMediaPlayerVideoView.h" |
33 #include "GSMediaPlayerVideoView.h" |
35 #include "GSMediaPlayerStreamingView.h" |
34 #include "GSMediaPlayerStreamingView.h" |
36 #include "feedsettingsview.h" |
|
37 #include "mpxlog.h" |
35 #include "mpxlog.h" |
38 |
36 |
39 #include <coeaui.h> |
37 #include <coeaui.h> |
40 #include <hlplch.h> // For HlpLauncher |
38 #include <hlplch.h> // For HlpLauncher |
41 #include <aknview.h> |
39 #include <aknview.h> |
42 #include <aknViewAppUi.h> |
40 #include <aknViewAppUi.h> |
43 #include <featmgr.h> |
41 #include <featmgr.h> |
44 #include <bautils.h> |
|
45 #include <StringLoader.h> //for StringLoader |
42 #include <StringLoader.h> //for StringLoader |
46 #include <gsprivatepluginproviderids.h> |
43 #include <gsprivatepluginproviderids.h> |
47 #include <gsmainview.h> |
44 #include <gsmainview.h> |
48 #include <mediasettings.mbg> |
45 #include <mediasettings.mbg> |
49 #include <gsfwviewuids.h> //for KGSMainViewUid |
|
50 #include <MediaSettings.rsg> |
46 #include <MediaSettings.rsg> |
51 #include <eiktxlbm.h> |
47 #include <eiktxlbm.h> |
52 #include <eikmenup.h> |
48 #include <eikmenup.h> |
53 |
49 |
|
50 #include <centralrepository.h> |
|
51 #include "MediaPlayerPrivateCRKeys.h" |
|
52 #include "MediaPlayerVariant.hrh" |
|
53 |
54 // CONSTANTS |
54 // CONSTANTS |
55 const TInt KGSRopSettViewIdArrayGranularity = 3; |
55 const TInt KGSRopSettViewIdArrayGranularity = 2; |
56 const TInt KGSRopSettTopItemIndex = 0; |
56 const TInt KGSRopSettTopItemIndex = 0; |
57 |
57 |
58 // ========================= MEMBER FUNCTIONS ================================ |
58 // ========================= MEMBER FUNCTIONS ================================ |
59 |
59 |
60 // --------------------------------------------------------------------------- |
60 // --------------------------------------------------------------------------- |
114 // |
109 // |
115 void CGSVideoPlugin::ConstructL() |
110 void CGSVideoPlugin::ConstructL() |
116 { |
111 { |
117 MPX_FUNC("#MS# CGSVideoPlugin::ConstructL()"); |
112 MPX_FUNC("#MS# CGSVideoPlugin::ConstructL()"); |
118 FeatureManager::InitializeLibL(); |
113 FeatureManager::InitializeLibL(); |
119 iViewArray = new (ELeave) CArrayPtrFlat<MGSTabbedView>( 3 ); |
114 |
120 |
115 iVideoViewAvailable = VideoContrastIsSupportedL(); |
|
116 if ( iVideoViewAvailable ) |
|
117 { |
|
118 iViewArray = new (ELeave) CArrayPtrFlat<MGSTabbedView>( KGSRopSettViewIdArrayGranularity ); |
|
119 } |
121 TFileName fileName; |
120 TFileName fileName; |
122 LocateFilePathL( fileName, EFalse ); |
121 LocateFilePathL( fileName, EFalse ); |
123 OpenLocalizedResourceFileL( fileName, iResources ); |
122 OpenLocalizedResourceFileL( fileName, iResources ); |
124 |
123 |
125 BaseConstructL(R_GS_MEDIASETTING_VIEW); |
124 TInt ctorResource = ( iVideoViewAvailable ? R_GS_MEDIASETTING_VIEW : |
126 |
125 R_GS_MPSETT_STREAMING_VIEW ); |
127 iTabHelper = CGSTabHelper::NewL(); |
126 |
|
127 BaseConstructL( ctorResource ); |
128 } |
128 } |
129 |
129 |
130 // --------------------------------------------------------------------------- |
130 // --------------------------------------------------------------------------- |
131 // CGSVideoPlugin::NewL() |
131 // CGSVideoPlugin::NewL() |
132 // Static constructor |
132 // Static constructor |
227 { |
230 { |
228 MPX_FUNC("#MS# CGSVideoPlugin::HandleCommandL()"); |
231 MPX_FUNC("#MS# CGSVideoPlugin::HandleCommandL()"); |
229 switch ( aCommand ) |
232 switch ( aCommand ) |
230 { |
233 { |
231 case EMPSettCmdOpen: |
234 case EMPSettCmdOpen: |
232 HandleListBoxSelectionL(); |
|
233 break; |
235 break; |
234 case EAknSoftkeyBack: |
236 case EAknSoftkeyBack: |
235 SetCurrentItem(EGSMediaSettingsVideoIndex); |
237 SetCurrentItem(EGSMediaSettingsVideoIndex); |
236 AppUi()->ActivateLocalViewL( KGSAppsPluginUid ); |
238 AppUi()->ActivateLocalViewL( KGSAppsPluginUid ); |
237 break; |
239 break; |
|
240 case EMPSettCmdAdvancedSett: |
|
241 AppUi()->ActivateLocalViewL( KMPSettAdvancedBwViewId ); |
|
242 break; |
238 case EMPSettCmdHelp: |
243 case EMPSettCmdHelp: |
239 { |
244 { |
240 if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) |
245 if( FeatureManager::FeatureSupported( KFeatureIdHelp ) ) |
241 { |
246 { |
242 HlpLauncher::LaunchHelpApplicationL( |
247 HlpLauncher::LaunchHelpApplicationL( |
289 // --------------------------------------------------------------------------- |
294 // --------------------------------------------------------------------------- |
290 // |
295 // |
291 void CGSVideoPlugin::NewContainerL() |
296 void CGSVideoPlugin::NewContainerL() |
292 { |
297 { |
293 MPX_FUNC("#MS# CGSVideoPlugin::NewContainerL()"); |
298 MPX_FUNC("#MS# CGSVideoPlugin::NewContainerL()"); |
294 iContainer = new( ELeave ) CMPSettingsMainContainer; |
299 if ( iVideoViewAvailable ) |
295 } |
300 { |
296 |
301 iContainer = new( ELeave ) CMPSettingsMainContainer; |
|
302 } |
|
303 else |
|
304 { |
|
305 iContainer = new( ELeave ) CMPSettingsStreamingContainer( iModel ); |
|
306 } |
|
307 } |
|
308 |
297 // --------------------------------------------------------------------------- |
309 // --------------------------------------------------------------------------- |
298 // CGSVideoPlugin::HandleListBoxSelectionL |
310 // CGSVideoPlugin::HandleListBoxSelectionL |
299 // |
311 // |
300 // Handle any user actions while in the list view. |
312 // Handle any user actions while in the list view. |
301 // --------------------------------------------------------------------------- |
313 // --------------------------------------------------------------------------- |
375 MPX_FUNC("#MS# CGSVideoPlugin::CreateLocalViewsL()"); |
386 MPX_FUNC("#MS# CGSVideoPlugin::CreateLocalViewsL()"); |
376 // model creation |
387 // model creation |
377 iModel = CMPSettingsModelForROP::NewL(); |
388 iModel = CMPSettingsModelForROP::NewL(); |
378 |
389 |
379 // Create vector which contains view id's for all setting folders. |
390 // Create vector which contains view id's for all setting folders. |
380 iViewIds = new(ELeave) CArrayFixFlat<TUid>(KGSRopSettViewIdArrayGranularity); |
391 iViewIds = new(ELeave) CArrayFixFlat<TUid>( KGSRopSettViewIdArrayGranularity ); |
381 iViewIds->AppendL(KMPSettVideoViewId); |
392 if ( iVideoViewAvailable ) |
382 iViewIds->AppendL(KMPSettStreamingViewId); |
393 { |
383 iViewIds->AppendL(KMPSettFeedsViewId); |
394 iViewIds->AppendL( KMPSettVideoViewId ); |
|
395 } |
|
396 iViewIds->AppendL( KMPSettStreamingViewId ); |
|
397 |
384 CAknView* view; |
398 CAknView* view; |
385 |
399 |
386 view = CMPSettingsMainView::NewLC(iViewIds,iModel,iConstructAsGsPlugin); |
400 if ( iVideoViewAvailable ) |
387 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |
401 { |
388 CleanupStack::Pop(); // view |
402 view = CMPSettingsMainView::NewLC(iViewIds,iModel,iConstructAsGsPlugin); |
389 |
403 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |
390 // iMainView is not owned, i.e. it is not deleted in the destructor -> |
404 CleanupStack::Pop(); // view |
391 // main view cannot be directly creted to iMainView, as it's against the coding |
405 |
392 // conventions to place class' pointers to cleanup stack => static_cast. |
406 // iMainView is not owned, i.e. it is not deleted in the destructor -> |
393 iMainView = static_cast<CMPSettingsMainView*>(view); |
407 // main view cannot be directly creted to iMainView, as it's against the coding |
394 |
408 // conventions to place class' pointers to cleanup stack => static_cast. |
395 view = CGSMediaPlayerVideoView::NewLC(iModel,iViewArray); |
409 iMainView = static_cast<CMPSettingsMainView*>(view); |
396 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |
410 |
397 CleanupStack::Pop(); // view |
411 view = CGSMediaPlayerVideoView::NewLC(iModel,iViewArray); |
398 |
412 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |
|
413 CleanupStack::Pop(); // view |
|
414 } |
|
415 |
399 view = CGSMediaPlayerStreamingView::NewLC(iModel,iViewArray); |
416 view = CGSMediaPlayerStreamingView::NewLC(iModel,iViewArray); |
400 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |
|
401 CleanupStack::Pop(); // view |
|
402 |
|
403 view = CVcxNsSettingsView::NewLC( iViewArray ); |
|
404 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |
|
405 CleanupStack::Pop(); // view |
|
406 |
|
407 view = CMPSettingsProxyView::NewLC(iModel,iConstructAsGsPlugin); |
|
408 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |
|
409 CleanupStack::Pop(); // view |
|
410 |
|
411 view = CMPSettingsNetworkView::NewLC(iModel,iConstructAsGsPlugin); |
|
412 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |
417 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |
413 CleanupStack::Pop(); // view |
418 CleanupStack::Pop(); // view |
414 |
419 |
415 view = CMPSettingsAdvancedBwView::NewLC(iModel,iConstructAsGsPlugin); |
420 view = CMPSettingsAdvancedBwView::NewLC(iModel,iConstructAsGsPlugin); |
416 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |
421 AppUi()->AddViewL(view); // transfer ownership to CAknViewAppUi |