33 #include "mediasettings.hrh" |
33 #include "mediasettings.hrh" |
34 #include "MPSettingsAppUi.h" |
34 #include "MPSettingsAppUi.h" |
35 #include "MPSettingsMainView.h" |
35 #include "MPSettingsMainView.h" |
36 #include "MPSettingsVideoView.h" |
36 #include "MPSettingsVideoView.h" |
37 #include "MPSettingsStreamingView.h" |
37 #include "MPSettingsStreamingView.h" |
38 #include "MPSettingsProxyView.h" |
|
39 #include "MPSettingsNetworkView.h" |
|
40 #include "MPSettingsConstants.h" |
38 #include "MPSettingsConstants.h" |
41 #include "MPSettingsPluginView.h" |
39 #include "MPSettingsPluginView.h" |
42 #include "MPSettingsAdvancedBwView.h" |
40 #include "MPSettingsAdvancedBwView.h" |
43 #include "MPSettingsDocument.h" |
41 #include "MPSettingsDocument.h" |
44 #include "mpsettingsmodel.h" |
42 #include "mpsettingsmodel.h" |
45 #include "MPSettingsModelForROP.h" |
43 #include "MPSettingsModelForROP.h" |
46 #include "mpxlog.h" |
44 #include "mpxlog.h" |
47 #include "feedsettingsview.h" |
45 |
|
46 #include <centralrepository.h> |
|
47 #include "MediaPlayerPrivateCRKeys.h" |
|
48 #include "MediaPlayerVariant.hrh" |
48 |
49 |
49 // CONSTANTS |
50 // CONSTANTS |
50 const TInt KMPSettViewIdArrayGranularity = 3; |
51 const TInt KMPSettViewIdArrayGranularity = 2; |
51 |
52 |
52 // ================= MEMBER FUNCTIONS ======================= |
53 // ================= MEMBER FUNCTIONS ======================= |
53 // |
54 // |
54 |
55 |
55 // ----------------------------------------------------------------------------- |
56 // ----------------------------------------------------------------------------- |
56 // CMPSettingsAppUi::CMPSettingsAppUi |
57 // CMPSettingsAppUi::CMPSettingsAppUi |
57 // C++ default constructor can NOT contain any code, that |
58 // C++ default constructor can NOT contain any code, that |
58 // might leave. |
59 // might leave. |
59 // ----------------------------------------------------------------------------- |
60 // ----------------------------------------------------------------------------- |
60 // |
61 // |
61 CMPSettingsAppUi::CMPSettingsAppUi() : iConstructAsGsPlugin(EFalse) |
62 CMPSettingsAppUi::CMPSettingsAppUi() |
62 { |
63 { |
63 MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::CMPSettingsAppUi()")); |
64 MPX_DEBUG1(_L("#MS# CMPSettingsAppUi::CMPSettingsAppUi()")); |
64 } |
65 } |
65 |
66 |
66 // ---------------------------------------------------------- |
67 // ---------------------------------------------------------- |
75 BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible ); |
76 BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible ); |
76 |
77 |
77 // Sets up TLS, must be done before FeatureManager is used. |
78 // Sets up TLS, must be done before FeatureManager is used. |
78 FeatureManager::InitializeLibL(); |
79 FeatureManager::InitializeLibL(); |
79 |
80 |
80 CMPSettingsDocument* doc = static_cast<CMPSettingsDocument*>(static_cast<CEikAppUi*> |
81 iVideoViewAvailable = VideoContrastIsSupportedL(); |
81 (CEikonEnv::Static()->AppUi())->Document()); |
82 |
|
83 CMPSettingsDocument* doc = static_cast<CMPSettingsDocument*>( Document() ); |
82 iModel = doc->SettingsModel(); |
84 iModel = doc->SettingsModel(); |
83 iRopModel = static_cast<CMPSettingsModelForROP*>(iModel); |
85 iRopModel = static_cast<CMPSettingsModelForROP*>(iModel); |
84 |
86 |
85 // Fetch pointer to the default navi pane control |
87 // Fetch pointer to the default navi pane control |
86 CEikStatusPane* sp = StatusPane(); |
88 CEikStatusPane* sp = StatusPane(); |
88 (sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi))); |
90 (sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi))); |
89 |
91 |
90 // Construct navipane tabs |
92 // Construct navipane tabs |
91 iDecoratedTabGroup = iNaviPane->CreateTabGroupL(this); |
93 iDecoratedTabGroup = iNaviPane->CreateTabGroupL(this); |
92 |
94 |
93 // Construct tabs |
95 // Construct tabs if we have multiple views |
94 AddTabSettingsGroupL(); |
96 if ( iVideoViewAvailable ) |
|
97 { |
|
98 AddTabSettingsGroupL(); |
|
99 } |
95 |
100 |
96 // Create vector which contains view id's for all setting folders. |
101 // Create vector which contains view id's for all setting folders. |
97 iViewIds = new(ELeave) CArrayFixFlat<TUid>(KMPSettViewIdArrayGranularity); |
102 iViewIds = new(ELeave) CArrayFixFlat<TUid>(KMPSettViewIdArrayGranularity); |
98 iViewIds->AppendL(KMPSettVideoViewId); |
103 if ( iVideoViewAvailable ) |
99 iViewIds->AppendL(KMPSettStreamingViewId); |
104 { |
100 iViewIds->AppendL(KMPSettFeedsViewId); |
105 iViewIds->AppendL( KMPSettVideoViewId ); |
101 |
106 } |
102 // * Create application views * |
107 iViewIds->AppendL( KMPSettStreamingViewId ); |
103 |
108 |
|
109 // Create application views |
104 CAknView* view; |
110 CAknView* view; |
105 |
111 view = CMPSettingsMainView::NewLC( iViewIds, iRopModel, EFalse ); |
106 view = CMPSettingsMainView::NewLC(iViewIds,iRopModel,iConstructAsGsPlugin); |
|
107 AddViewL(view); // transfer ownership to CAknViewAppUi |
112 AddViewL(view); // transfer ownership to CAknViewAppUi |
108 CleanupStack::Pop(); // view |
113 CleanupStack::Pop(); // view |
109 |
114 |
110 // iMainView is not owned, i.e. it is not deleted in the destructor -> |
115 // iMainView is not owned, i.e. it is not deleted in the destructor -> |
111 // main view cannot be directly creted to iMainView, as it's against the coding |
116 // main view cannot be directly creted to iMainView, as it's against the coding |
112 // conventions to place class' pointers to cleanup stack => static_cast. |
117 // conventions to place class' pointers to cleanup stack => static_cast. |
113 iMainView = static_cast<CMPSettingsMainView*>(view); |
118 iMainView = static_cast<CMPSettingsMainView*>(view); |
114 |
119 |
115 view = CMPSettingsVideoView::NewLC(iRopModel); |
120 if ( iVideoViewAvailable ) |
|
121 { |
|
122 view = CMPSettingsVideoView::NewLC(iRopModel); |
|
123 AddViewL(view); // transfer ownership to CAknViewAppUi |
|
124 CleanupStack::Pop(); // view |
|
125 } |
|
126 |
|
127 CMPSettingsStreamingView* streamingView = CMPSettingsStreamingView::NewLC(iRopModel); |
|
128 view = streamingView; |
116 AddViewL(view); // transfer ownership to CAknViewAppUi |
129 AddViewL(view); // transfer ownership to CAknViewAppUi |
117 CleanupStack::Pop(); // view |
130 CleanupStack::Pop(); // view |
118 |
131 |
119 view = CMPSettingsStreamingView::NewLC(iRopModel); |
132 view = CMPSettingsAdvancedBwView::NewLC( iRopModel, EFalse ); |
120 AddViewL(view); // transfer ownership to CAknViewAppUi |
133 AddViewL(view); // transfer ownership to CAknViewAppUi |
121 CleanupStack::Pop(); // view |
134 CleanupStack::Pop(); // view |
122 |
|
123 view = CVcxNsSettingsView::NewLC(); |
|
124 AddViewL(view); // transfer ownership to CAknViewAppUi |
|
125 CleanupStack::Pop(); // view |
|
126 |
|
127 view = CMPSettingsProxyView::NewLC(iRopModel,iConstructAsGsPlugin); |
|
128 AddViewL(view); // transfer ownership to CAknViewAppUi |
|
129 CleanupStack::Pop(); // view |
|
130 |
|
131 view = CMPSettingsNetworkView::NewLC(iRopModel,iConstructAsGsPlugin); |
|
132 AddViewL(view); // transfer ownership to CAknViewAppUi |
|
133 CleanupStack::Pop(); // view |
|
134 |
|
135 view = CMPSettingsAdvancedBwView::NewLC(iRopModel,iConstructAsGsPlugin); |
|
136 AddViewL(view); // transfer ownership to CAknViewAppUi |
|
137 CleanupStack::Pop(); // view |
|
138 |
|
139 |
135 |
140 // Construct plug-in views (if any exists) |
136 // Construct plug-in views (if any exists) |
141 CMPSettingsPluginView::ListImplementationsL(iImplInfoArray); |
137 CMPSettingsPluginView::ListImplementationsL(iImplInfoArray); |
142 TInt count = iImplInfoArray.Count(); |
138 TInt count = iImplInfoArray.Count(); |
143 |
139 |
359 AddTabSettingsL(KAknsIIDQgnPropSetMpStreamTab3, |
358 AddTabSettingsL(KAknsIIDQgnPropSetMpStreamTab3, |
360 fileName, |
359 fileName, |
361 EMbmMediasettingsQgn_prop_set_mp_stream_tab2, |
360 EMbmMediasettingsQgn_prop_set_mp_stream_tab2, |
362 EMbmMediasettingsQgn_prop_set_mp_stream_tab2_mask, |
361 EMbmMediasettingsQgn_prop_set_mp_stream_tab2_mask, |
363 EMPViewStreamTab); |
362 EMPViewStreamTab); |
364 |
|
365 AddTabSettingsL(KAknsIIDQgnPropSetMpStreamTab3, |
|
366 fileName, |
|
367 EMbmMediasettingsQgn_prop_set_mp_video_tab3, |
|
368 EMbmMediasettingsQgn_prop_set_mp_video_tab3_mask, |
|
369 EMPViewFeedsTab); |
|
370 |
363 |
371 CleanupStack::PopAndDestroy(); // mbmpath |
364 CleanupStack::PopAndDestroy(); // mbmpath |
372 |
365 |
373 // return to previous view & update correct tab index |
366 // return to previous view & update correct tab index |
374 if (iPushed) |
367 if (iPushed) |
409 iTabGroup->AddTabL(aTabId, bitmap, mask); |
402 iTabGroup->AddTabL(aTabId, bitmap, mask); |
410 |
403 |
411 CleanupStack::Pop(2); // bitmap, mask |
404 CleanupStack::Pop(2); // bitmap, mask |
412 } |
405 } |
413 |
406 |
|
407 // ---------------------------------------------------- |
|
408 // CMPSettingsAppUi::ActivateLocalViewL |
|
409 // ---------------------------------------------------- |
|
410 // |
|
411 void CMPSettingsAppUi::ActivateLocalViewL( TUid aViewId ) |
|
412 { |
|
413 if ( !iVideoViewAvailable && |
|
414 aViewId == KMPSettMainViewId ) |
|
415 { |
|
416 HandleCommandL( EEikCmdExit ); |
|
417 } |
|
418 else |
|
419 { |
|
420 CAknViewAppUi::ActivateLocalViewL( aViewId ); |
|
421 } |
|
422 } |
|
423 |
|
424 // ---------------------------------------------------- |
|
425 // CMPSettingsAppUi::VideoContrastIsSupportedL |
|
426 // ---------------------------------------------------- |
|
427 // |
|
428 TBool CMPSettingsAppUi::VideoContrastIsSupportedL() |
|
429 { |
|
430 TInt flags = 0; |
|
431 |
|
432 CRepository* repository = CRepository::NewL( KCRUidMediaPlayerFeatures ); |
|
433 repository->Get( KMPLocalVariation, flags ); |
|
434 delete repository; |
|
435 |
|
436 return ( flags & KMediaPlayerVideoContrast ); |
|
437 } |
|
438 |
414 // End of File |
439 // End of File |