author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:28:06 +0300 | |
branch | RCL_3 |
changeset 41 | 755f0370535b |
parent 33 | bc78a40cd63c |
permissions | -rw-r--r-- |
33 | 1 |
/* |
2 |
* Copyright (c) 2005 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 "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: The MUS application's UI class. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include "musuidefinitions.h" |
|
20 |
#include "musuilivesharingviewcontainer.h" |
|
21 |
#include "musuieventcontroller.h" |
|
22 |
#include "musuigeneralview.h" |
|
23 |
#include "musuilivesharingview.h" |
|
24 |
#include "musuiappui.h" |
|
25 |
#include "musuilevelindicator.h" |
|
26 |
#include "musuidialogutil.h" |
|
27 |
#include "musui.hrh" |
|
28 |
#include "muslogger.h" // debug logging |
|
29 |
#include "mussettings.h" |
|
30 |
#include <musui.rsg> |
|
31 |
||
32 |
#include <AknsDrawUtils.h> |
|
33 |
#include <AknDef.h> |
|
34 |
||
35 |
||
36 |
// ----------------------------------------------------------------------------- |
|
37 |
// |
|
38 |
// ----------------------------------------------------------------------------- |
|
39 |
// |
|
40 |
void CMusUiLiveSharingViewContainer::ConstructL( CMusUiGeneralView* aView, |
|
41 |
const TRect& aRect ) |
|
42 |
{ |
|
43 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::ConstructL" ); |
|
44 |
||
45 |
CMusUiSendViewContainer::ConstructL( aView, |
|
46 |
aRect, |
|
47 |
EAknOrientationVertical ); |
|
48 |
// check if operator specific functionality is needed |
|
49 |
iOperatorSpecificFunctionality = |
|
50 |
( MultimediaSharingSettings::OperatorVariantSettingL() == |
|
51 |
MusSettingsKeys::EOperatorSpecific ); |
|
52 |
||
53 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingViewContainer::ConstructL" ); |
|
54 |
} |
|
55 |
||
56 |
||
57 |
// ----------------------------------------------------------------------------- |
|
58 |
// |
|
59 |
// ----------------------------------------------------------------------------- |
|
60 |
// |
|
61 |
CMusUiLiveSharingViewContainer::~CMusUiLiveSharingViewContainer() |
|
62 |
{ |
|
63 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::~CMusUiLiveSharingViewContainer" ); |
|
64 |
// NOP |
|
65 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingViewContainer::~CMusUiLiveSharingViewContainer" ); |
|
66 |
} |
|
67 |
||
68 |
||
69 |
// ----------------------------------------------------------------------------- |
|
70 |
// |
|
71 |
// ----------------------------------------------------------------------------- |
|
72 |
// |
|
73 |
void CMusUiLiveSharingViewContainer::SetZoomValues( TInt aMinZoom, TInt aMaxZoom ) |
|
74 |
{ |
|
75 |
iIndicator->SetRange( aMinZoom, aMaxZoom, ETrue ); |
|
76 |
} |
|
77 |
||
78 |
||
79 |
// ----------------------------------------------------------------------------- |
|
80 |
// |
|
81 |
// ----------------------------------------------------------------------------- |
|
82 |
// |
|
83 |
void CMusUiLiveSharingViewContainer::SetBrightnessValues( TInt aMinBrightness, |
|
84 |
TInt aMaxBrightness ) |
|
85 |
{ |
|
86 |
iIndicator->SetRange( aMinBrightness, aMaxBrightness, ETrue ); |
|
87 |
} |
|
88 |
||
89 |
||
90 |
// ----------------------------------------------------------------------------- |
|
91 |
// |
|
92 |
// ----------------------------------------------------------------------------- |
|
93 |
// |
|
94 |
void CMusUiLiveSharingViewContainer::SetZoomL( TInt aZoomLevel ) |
|
95 |
{ |
|
96 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::SetZoomL" ) |
|
97 |
||
98 |
iIndicator->SetLevelL( EMusUiIndicatorTypeZoom, |
|
99 |
aZoomLevel, |
|
100 |
ETrue /* use timer */ ); |
|
101 |
||
102 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingViewContainer::SetZoomL" ) |
|
103 |
} |
|
104 |
||
105 |
||
106 |
// ----------------------------------------------------------------------------- |
|
107 |
// |
|
108 |
// ----------------------------------------------------------------------------- |
|
109 |
// |
|
110 |
void CMusUiLiveSharingViewContainer::SetBrightnessL( TInt aBrightnessLevel ) |
|
111 |
{ |
|
112 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::SetBrightnessL" ) |
|
113 |
||
114 |
iIndicator->SetLevelL( EMusUiIndicatorTypeBrightness, |
|
115 |
aBrightnessLevel, |
|
116 |
ETrue /* use timer */ ); |
|
117 |
||
118 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingViewContainer::SetBrightnessL" ) |
|
119 |
} |
|
120 |
||
121 |
||
122 |
// ----------------------------------------------------------------------------- |
|
123 |
// |
|
124 |
// ----------------------------------------------------------------------------- |
|
125 |
// |
|
126 |
void CMusUiLiveSharingViewContainer::SetZoomVisible( TBool aVisible ) |
|
127 |
{ |
|
128 |
iIndicator->SetIndicatorType( EMusUiIndicatorTypeZoom ); |
|
129 |
MakeVisible( aVisible ); |
|
130 |
SetGloballyCapturing( aVisible ); |
|
131 |
SetPointerCapture( aVisible ); |
|
132 |
} |
|
133 |
||
134 |
||
135 |
// ----------------------------------------------------------------------------- |
|
136 |
// |
|
137 |
// ----------------------------------------------------------------------------- |
|
138 |
// |
|
139 |
void CMusUiLiveSharingViewContainer::SetBrightnessVisible( TBool aVisible) |
|
140 |
{ |
|
141 |
iIndicator->SetIndicatorType(EMusUiIndicatorTypeBrightness); |
|
142 |
MakeVisible( aVisible ); |
|
143 |
SetGloballyCapturing( aVisible ); |
|
144 |
SetPointerCapture( aVisible ); |
|
145 |
} |
|
146 |
||
147 |
||
148 |
// ----------------------------------------------------------------------------- |
|
149 |
// |
|
150 |
// ----------------------------------------------------------------------------- |
|
151 |
// |
|
152 |
TMusUiIndicatorType CMusUiLiveSharingViewContainer::GetIndicatorType() |
|
153 |
{ |
|
154 |
return iIndicator->GetIndicatorType(); |
|
155 |
} |
|
156 |
||
157 |
||
158 |
// ----------------------------------------------------------------------------- |
|
159 |
// Called by framework when to retrieve the no. of controls. |
|
160 |
// ----------------------------------------------------------------------------- |
|
161 |
// |
|
162 |
TInt CMusUiLiveSharingViewContainer::CountComponentControls() const |
|
163 |
{ |
|
164 |
return 1; // return nbr of controls inside this container |
|
165 |
} |
|
166 |
||
167 |
||
168 |
// ----------------------------------------------------------------------------- |
|
169 |
// Called by framework to retrieve the control specified by index. |
|
170 |
// ----------------------------------------------------------------------------- |
|
171 |
// |
|
172 |
CCoeControl* CMusUiLiveSharingViewContainer::ComponentControl( TInt aIndex ) const |
|
173 |
{ |
|
174 |
CCoeControl* control = NULL; |
|
175 |
switch ( aIndex ) |
|
176 |
{ |
|
177 |
case 0: |
|
178 |
control = iIndicator; |
|
179 |
break; |
|
180 |
default: |
|
181 |
break; |
|
182 |
} |
|
183 |
return control; |
|
184 |
} |
|
185 |
||
186 |
||
187 |
// ----------------------------------------------------------------------------- |
|
188 |
// Called by framework to act on key events if required. |
|
189 |
// ----------------------------------------------------------------------------- |
|
190 |
// |
|
191 |
TKeyResponse CMusUiLiveSharingViewContainer::OfferKeyEventL( |
|
192 |
const TKeyEvent& aKeyEvent, |
|
193 |
TEventCode /*aType*/ ) |
|
194 |
{ |
|
195 |
MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::OfferKeyEventL: %d", |
|
196 |
aKeyEvent.iCode ); |
|
197 |
MUS_LOG1( "mus: [MUSUI ] -> CMusUiLiveSharingViewContainer::OfferKeyEventL: %d", |
|
198 |
aKeyEvent.iScanCode ); |
|
199 |
||
200 |
TKeyResponse ret( EKeyWasNotConsumed ); |
|
41
755f0370535b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
201 |
|
755f0370535b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
202 |
if ( IsVisible() ) |
755f0370535b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
203 |
{ |
755f0370535b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
204 |
return ret; |
755f0370535b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
205 |
} |
33 | 206 |
|
41
755f0370535b
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
207 |
|
33 | 208 |
CMusUiLiveSharingView* view = |
209 |
static_cast< CMusUiLiveSharingView* >( MusUiView() ); |
|
210 |
switch ( aKeyEvent.iCode ) |
|
211 |
{ |
|
212 |
case EKeyLeftArrow: |
|
213 |
{ |
|
214 |
view->HandleCommandL( EMusuiCmdViewVolumeDown ); |
|
215 |
ret = EKeyWasConsumed; |
|
216 |
break; |
|
217 |
} |
|
218 |
case EKeyRightArrow: |
|
219 |
{ |
|
220 |
view->HandleCommandL( EMusuiCmdViewVolumeUp ); |
|
221 |
ret = EKeyWasConsumed; |
|
222 |
break; |
|
223 |
} |
|
224 |
case EKeyUpArrow: |
|
225 |
{ |
|
226 |
view->HandleKeyUpArrowL(); |
|
227 |
ret = EKeyWasConsumed; |
|
228 |
break; |
|
229 |
} |
|
230 |
case EKeyDownArrow: |
|
231 |
{ |
|
232 |
view->HandleKeyDownArrowL(); |
|
233 |
ret = EKeyWasConsumed; |
|
234 |
break; |
|
235 |
} |
|
236 |
default: |
|
237 |
break; |
|
238 |
} |
|
239 |
||
240 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingViewContainer::OfferKeyEventL" ); |
|
241 |
return ret; |
|
242 |
} |
|
243 |
||
244 |
// ----------------------------------------------------------------------------- |
|
245 |
// |
|
246 |
// ----------------------------------------------------------------------------- |
|
247 |
// |
|
248 |
void CMusUiLiveSharingViewContainer::HandlePointerEventL( |
|
249 |
const TPointerEvent& aPointerEvent) |
|
250 |
{ |
|
251 |
// Forward to base class in order to use slider |
|
252 |
CCoeControl::HandlePointerEventL( aPointerEvent ); |
|
253 |
||
254 |
if ( !Rect().Contains( aPointerEvent.iPosition ) ) |
|
255 |
{ |
|
256 |
MakeVisible( EFalse ); |
|
257 |
} |
|
258 |
} |
|
259 |
||
260 |
||
261 |
// end of file |