|
57
|
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 Streaming list view.*
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
// Version : %version: 8 %
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
// INCLUDE FILES
|
|
|
23 |
#include <aknViewAppUi.h>
|
|
|
24 |
#include <MediaSettings.rsg>
|
|
|
25 |
#include <calslbs.h>
|
|
|
26 |
#include <featmgr.h>
|
|
|
27 |
#include <hlplch.h> // For HlpLauncher
|
|
|
28 |
#include "mediasettings.hrh"
|
|
|
29 |
#include "MPSettingsAppUi.h"
|
|
|
30 |
#include "MPSettingsNaviPaneController.h"
|
|
|
31 |
#include "MPSettingsStreamingView.h"
|
|
|
32 |
#include "MPSettingsStreamingContainer.h"
|
|
|
33 |
#include "MPSettingsConstants.h"
|
|
|
34 |
#include "mpxlog.h"
|
|
|
35 |
|
|
|
36 |
class CMPSettingsModelForROP;
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
// ================= MEMBER FUNCTIONS =======================
|
|
|
40 |
|
|
|
41 |
// -----------------------------------------------------------------------------
|
|
|
42 |
// CMPSettingsStreamingView::CMPSettingsStreamingView
|
|
|
43 |
// C++ default constructor can NOT contain any code, that
|
|
|
44 |
// might leave.
|
|
|
45 |
// -----------------------------------------------------------------------------
|
|
|
46 |
//
|
|
|
47 |
CMPSettingsStreamingView::CMPSettingsStreamingView(CMPSettingsModelForROP* aModel)
|
|
|
48 |
: iModel( aModel)
|
|
|
49 |
{
|
|
|
50 |
MPX_FUNC("#MS# CMPSettingsStreamingView::CMPSettingsStreamingView()");
|
|
|
51 |
iNaviPaneContext = iNaviCntrl->MPTabGroup();
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
// ---------------------------------------------------------
|
|
|
55 |
// CMPSettingsStreamingView::ConstructL(const TRect& aRect)
|
|
|
56 |
// Symbian OS two-phased constructor
|
|
|
57 |
// ---------------------------------------------------------
|
|
|
58 |
//
|
|
|
59 |
void CMPSettingsStreamingView::ConstructL()
|
|
|
60 |
{
|
|
|
61 |
MPX_FUNC("#MS# CMPSettingsStreamingView::ConstructL()");
|
|
|
62 |
BaseConstructL(R_MPSETT_STREAMING_VIEW);
|
|
|
63 |
}
|
|
|
64 |
|
|
|
65 |
// -----------------------------------------------------------------------------
|
|
|
66 |
// CMPSettingsStreamingView::NewLC
|
|
|
67 |
// Two-phased constructor.
|
|
|
68 |
// -----------------------------------------------------------------------------
|
|
|
69 |
//
|
|
|
70 |
CMPSettingsStreamingView* CMPSettingsStreamingView::NewLC(CMPSettingsModelForROP* aModel)
|
|
|
71 |
{
|
|
|
72 |
MPX_FUNC("#MS# CMPSettingsStreamingView::NewLC()");
|
|
|
73 |
CMPSettingsStreamingView* self = new(ELeave) CMPSettingsStreamingView(aModel);
|
|
|
74 |
|
|
|
75 |
CleanupStack::PushL(self);
|
|
|
76 |
self->ConstructL();
|
|
|
77 |
|
|
|
78 |
return self;
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
// ---------------------------------------------------------
|
|
|
82 |
// CMPSettingsStreamingView::~CMPSettingsStreamingView
|
|
|
83 |
// Destructor
|
|
|
84 |
// ---------------------------------------------------------
|
|
|
85 |
//
|
|
|
86 |
CMPSettingsStreamingView::~CMPSettingsStreamingView()
|
|
|
87 |
{
|
|
|
88 |
MPX_FUNC("#MS# CMPSettingsStreamingView::~CMPSettingsStreamingView()");
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
// ---------------------------------------------------------
|
|
|
92 |
// TUid CMPSettingsStreamingView::Id
|
|
|
93 |
// ---------------------------------------------------------
|
|
|
94 |
//
|
|
|
95 |
TUid CMPSettingsStreamingView::Id() const
|
|
|
96 |
{
|
|
|
97 |
MPX_FUNC("#MS# CMPSettingsStreamingView::Id()");
|
|
|
98 |
return KMPSettStreamingViewId;
|
|
|
99 |
}
|
|
|
100 |
|
|
|
101 |
// ---------------------------------------------------------
|
|
|
102 |
// CMPSettingsStreamingView::HandleCommandL
|
|
|
103 |
// ---------------------------------------------------------
|
|
|
104 |
//
|
|
|
105 |
void CMPSettingsStreamingView::HandleCommandL(TInt aCommand)
|
|
|
106 |
{
|
|
|
107 |
MPX_DEBUG2(_L("#MS# CMPSettingsStreamingView::HandleCommandL(%d)"),aCommand);
|
|
|
108 |
switch (aCommand)
|
|
|
109 |
{
|
|
|
110 |
case EMPSettCmdChange:
|
|
|
111 |
static_cast<CMPSettingsStreamingContainer*>(iContainer)->EditCurrentItemFromMenuL(ETrue);
|
|
|
112 |
break;
|
|
|
113 |
case EMPMiddleSoftKeyChange:
|
|
|
114 |
static_cast<CMPSettingsStreamingContainer*>(iContainer)->EditCurrentItemFromMenuL(EFalse);
|
|
|
115 |
break;
|
|
|
116 |
case EMPSettCmdAdvancedSett:
|
|
|
117 |
AppUi()->ActivateLocalViewL( KMPSettAdvancedBwViewId );
|
|
|
118 |
break;
|
|
|
119 |
case EMPSettCmdOpen:
|
|
|
120 |
break;
|
|
|
121 |
case EAknSoftkeyBack:
|
|
|
122 |
{
|
|
|
123 |
// If video view is empty, then exit Settings
|
|
|
124 |
CMPSettingsAppUi* appUi = static_cast<CMPSettingsAppUi*>(AppUi());
|
|
|
125 |
appUi->ActivateLocalViewL( KMPSettMainViewId );
|
|
|
126 |
}
|
|
|
127 |
break;
|
|
|
128 |
case EMPSettCmdHelp:
|
|
|
129 |
if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
|
|
|
130 |
{
|
|
|
131 |
HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), AppUi()->AppHelpContextL() );
|
|
|
132 |
}
|
|
|
133 |
break;
|
|
|
134 |
default:
|
|
|
135 |
AppUi()->HandleCommandL(aCommand);
|
|
|
136 |
break;
|
|
|
137 |
}
|
|
|
138 |
}
|
|
|
139 |
|
|
|
140 |
// ---------------------------------------------------------------------------
|
|
|
141 |
// CMPSettingsStreamingView::NewContainerL
|
|
|
142 |
// ---------------------------------------------------------------------------
|
|
|
143 |
//
|
|
|
144 |
CMPSettingsBaseContainer* CMPSettingsStreamingView::NewContainerL()
|
|
|
145 |
{
|
|
|
146 |
MPX_FUNC("#MS# CMPSettingsStreamingView::NewContainerL()");
|
|
|
147 |
return new(ELeave) CMPSettingsStreamingContainer(iModel);
|
|
|
148 |
}
|
|
|
149 |
|
|
|
150 |
|
|
|
151 |
// ---------------------------------------------------------------------------
|
|
|
152 |
// CMPSettingsStreamingView::DynInitContainerL
|
|
|
153 |
// ---------------------------------------------------------------------------
|
|
|
154 |
//
|
|
|
155 |
void CMPSettingsStreamingView::DynInitContainerL()
|
|
|
156 |
{
|
|
|
157 |
MPX_FUNC("#MS# CMPSettingsStreamingView::DynInitContainerL()");
|
|
|
158 |
CEikTextListBox* listbox = iContainer->ListBox();
|
|
|
159 |
|
|
|
160 |
listbox->SetTopItemIndex(iTopItemIndex);
|
|
|
161 |
|
|
|
162 |
if (iCurrentItem >= 0 && iCurrentItem < listbox->Model()->NumberOfItems()) // magic
|
|
|
163 |
{
|
|
|
164 |
listbox->SetCurrentItemIndexAndDraw(iCurrentItem);
|
|
|
165 |
}
|
|
|
166 |
CMPSettingsBaseView::SetMiddleSoftKeyLabelL(R_MEDIASETTING_MSK_OPEN,EMPSettCmdOpen);
|
|
|
167 |
}
|
|
|
168 |
|
|
|
169 |
|
|
|
170 |
// End of File
|
|
|
171 |
|