35
|
1 |
/*
|
|
2 |
* Copyright (c) 2006 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: Primary policy class.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <featmgr.h>
|
|
20 |
#include <avkon.hrh>
|
|
21 |
#include <cvtlogger.h>
|
|
22 |
#include <videotelui.rsg>
|
|
23 |
#include <avkon.rsg>
|
|
24 |
|
|
25 |
#include "cvtuiprimarycmdpolicy.h"
|
|
26 |
#include "cvtuicmdvalidationactionbase.h"
|
|
27 |
#include "cvtuicmdcustomvalidationactionbase.h"
|
|
28 |
#include "tvtuicmdvalidatorcallback.h"
|
|
29 |
#include "tvtuistates.h"
|
|
30 |
#include "videotelui.hrh"
|
|
31 |
#include "tVtuifeaturevariation.h"
|
|
32 |
#include "CVtUiAppUi.h"
|
|
33 |
|
|
34 |
// ======== MEMBER FUNCTIONS ========
|
|
35 |
|
|
36 |
// ---------------------------------------------------------------------------
|
|
37 |
// CVtUiPrimaryCmdPolicy::NewL
|
|
38 |
// ---------------------------------------------------------------------------
|
|
39 |
//
|
|
40 |
CVtUiPrimaryCmdPolicy* CVtUiPrimaryCmdPolicy::NewL(
|
|
41 |
const TVtUiStates& aUiStates, const CVtUiAppUi& aAppUi )
|
|
42 |
{
|
|
43 |
__VTPRINTENTER( "PrimaryCmdPolicy.NewL" )
|
|
44 |
CVtUiPrimaryCmdPolicy* self =
|
|
45 |
new ( ELeave ) CVtUiPrimaryCmdPolicy( aUiStates, aAppUi );
|
|
46 |
CleanupStack::PushL( self );
|
|
47 |
self->ConstructL();
|
|
48 |
CleanupStack::Pop(); // self
|
|
49 |
__VTPRINTEXIT( "PrimaryCmdPolicy.NewL" )
|
|
50 |
return self;
|
|
51 |
}
|
|
52 |
|
|
53 |
// ---------------------------------------------------------------------------
|
|
54 |
// CVtUiPrimaryCmdPolicy::~CVtUiPrimaryCmdPolicy
|
|
55 |
// ---------------------------------------------------------------------------
|
|
56 |
//
|
|
57 |
CVtUiPrimaryCmdPolicy::~CVtUiPrimaryCmdPolicy()
|
|
58 |
{
|
|
59 |
__VTPRINTENTER( "PrimaryCmdPolicy.~" )
|
|
60 |
__VTPRINTEXIT( "PrimaryCmdPolicy.~" )
|
|
61 |
}
|
|
62 |
|
|
63 |
// ---------------------------------------------------------------------------
|
|
64 |
// CVtUiPrimaryCmdPolicy::ValidateMenuItemsL
|
|
65 |
// ---------------------------------------------------------------------------
|
|
66 |
//
|
|
67 |
void CVtUiPrimaryCmdPolicy::ValidateMenuItemsL(
|
|
68 |
CVtUiCmdValidationActionBase& aAction, TInt )
|
|
69 |
{
|
|
70 |
__VTPRINTENTER( "PrimaryCmdPolicy.ValidateMenuItemsL" )
|
|
71 |
aAction.ProcessL(
|
|
72 |
TVtUiCmdValidatorCallBack< CVtUiPrimaryCmdPolicy >( *this,
|
|
73 |
ValidateMenuCommand ) );
|
|
74 |
__VTPRINTEXIT( "PrimaryCmdPolicy.ValidateMenuItemsL" )
|
|
75 |
}
|
|
76 |
|
|
77 |
// ---------------------------------------------------------------------------
|
|
78 |
// CVtUiPrimaryCmdPolicy::ValidateSoftkeyItemsL
|
|
79 |
// ---------------------------------------------------------------------------
|
|
80 |
//
|
|
81 |
void CVtUiPrimaryCmdPolicy::ValidateSoftkeyItemsL(
|
|
82 |
CVtUiCmdValidationActionBase& aAction, TInt )
|
|
83 |
{
|
|
84 |
__VTPRINTENTER( "PrimaryCmdPolicy.ValidateSoftkeyItemsL" )
|
|
85 |
aAction.ProcessL(
|
|
86 |
TVtUiCmdValidatorCallBack< CVtUiPrimaryCmdPolicy >( *this,
|
|
87 |
ValidateSoftkey ) );
|
|
88 |
__VTPRINTEXIT( "PrimaryCmdPolicy.ValidateSoftkeyItemsL" )
|
|
89 |
}
|
|
90 |
|
|
91 |
// ---------------------------------------------------------------------------
|
|
92 |
// CVtUiPrimaryCmdPolicy::ValidateSoftkeyItemsL
|
|
93 |
// ---------------------------------------------------------------------------
|
|
94 |
//
|
|
95 |
void CVtUiPrimaryCmdPolicy::ValidateToolbarItemsL(
|
|
96 |
CVtUiCmdValidationActionBase& aAction, TInt )
|
|
97 |
{
|
|
98 |
__VTPRINTENTER( "PrimaryCmdPolicy.ValidateToolbarItemsL" )
|
|
99 |
aAction.ProcessL(
|
|
100 |
TVtUiCmdValidatorCallBack< CVtUiPrimaryCmdPolicy >( *this,
|
|
101 |
ValidateToolbarCommand ) );
|
|
102 |
__VTPRINTEXIT( "PrimaryCmdPolicy.ValidateToolbarItemsL" )
|
|
103 |
}
|
|
104 |
|
|
105 |
// ---------------------------------------------------------------------------
|
|
106 |
// CVtUiPrimaryCmdPolicy::CustomValidationL
|
|
107 |
// ---------------------------------------------------------------------------
|
|
108 |
//
|
|
109 |
void CVtUiPrimaryCmdPolicy::CustomValidationL(
|
|
110 |
CVtUiCmdCustomValidationActionBase& aAction, TInt )
|
|
111 |
{
|
|
112 |
__VTPRINTENTER( "PrimaryCmdPolicy.CustomValidationL" )
|
|
113 |
switch ( aAction.CustomTypeId() )
|
|
114 |
{
|
|
115 |
// Command state validation
|
|
116 |
case EVtUiCmdContextTypeExecution:
|
|
117 |
aAction.ProcessL( TVtUiCmdValidatorCallBack< CVtUiPrimaryCmdPolicy >(
|
|
118 |
*this, ValidateCommandState ) );
|
|
119 |
break;
|
|
120 |
|
|
121 |
default:
|
|
122 |
__VTPRINT2( DEBUG_GEN,
|
|
123 |
"PrimaryCmdPolicy.CustomValidationL unknown typeId = %d",
|
|
124 |
aAction.CustomTypeId() );
|
|
125 |
break;
|
|
126 |
}
|
|
127 |
__VTPRINTEXIT( "PrimaryCmdPolicy.CustomValidationL" )
|
|
128 |
}
|
|
129 |
|
|
130 |
// ---------------------------------------------------------------------------
|
|
131 |
// CVtUiPrimaryCmdPolicy::ValidatesContext
|
|
132 |
// ---------------------------------------------------------------------------
|
|
133 |
//
|
|
134 |
TBool CVtUiPrimaryCmdPolicy::ValidatesContext(
|
|
135 |
const TVtUiCmdContextType& aCtxType ) const
|
|
136 |
{
|
|
137 |
__VTPRINTENTER( "PrimaryCmdPolicy.ValidatesContext" )
|
|
138 |
|
|
139 |
TBool result( EFalse );
|
|
140 |
|
|
141 |
switch ( aCtxType )
|
|
142 |
{
|
|
143 |
case EVtUiCmdContextTypeMenu:
|
|
144 |
case EVtUiCmdContextTypeSoftkey:
|
|
145 |
case EVtUiCmdContextTypeToolbar:
|
|
146 |
case EVtUiCmdContextTypeExecution:
|
|
147 |
result = ETrue;
|
|
148 |
break;
|
|
149 |
|
|
150 |
default:
|
|
151 |
break;
|
|
152 |
}
|
|
153 |
|
|
154 |
__VTPRINTEXITR( "PrimaryCmdPolicy.ValidatesContext %d", result )
|
|
155 |
|
|
156 |
return result;
|
|
157 |
}
|
|
158 |
|
|
159 |
// ---------------------------------------------------------------------------
|
|
160 |
// CVtUiPrimaryCmdPolicy::CVtUiPrimaryCmdPolicy
|
|
161 |
// ---------------------------------------------------------------------------
|
|
162 |
//
|
|
163 |
CVtUiPrimaryCmdPolicy::CVtUiPrimaryCmdPolicy( const TVtUiStates& aUiStates,
|
|
164 |
const CVtUiAppUi& aAppUi )
|
|
165 |
: CVtUiCmdValidatorBase( EVtUiCmdPolicyPriorityPrimary ),
|
|
166 |
iUiStates( aUiStates ), iAppUi( aAppUi )
|
|
167 |
{
|
|
168 |
}
|
|
169 |
|
|
170 |
// ---------------------------------------------------------------------------
|
|
171 |
// CVtUiPrimaryCmdPolicy::ConstructL
|
|
172 |
// ---------------------------------------------------------------------------
|
|
173 |
//
|
|
174 |
void CVtUiPrimaryCmdPolicy::ConstructL()
|
|
175 |
{
|
|
176 |
TVtUiActiveIdleVariation activeIdleVariation;
|
|
177 |
iAIEnabled = activeIdleVariation.IsActiveIdleEnabled();
|
|
178 |
}
|
|
179 |
|
|
180 |
// ---------------------------------------------------------------------------
|
|
181 |
// CVtUiPrimaryCmdPolicy::ValidateMenuCommand
|
|
182 |
// ---------------------------------------------------------------------------
|
|
183 |
//
|
|
184 |
TBool CVtUiPrimaryCmdPolicy::ValidateMenuCommand( TInt aCommandId ) const
|
|
185 |
{
|
|
186 |
TBool handled;
|
|
187 |
return ValidateCommand( aCommandId, handled );
|
|
188 |
}
|
|
189 |
|
|
190 |
// ---------------------------------------------------------------------------
|
|
191 |
// CVtUiPrimaryCmdPolicy::ValidateSoftkey
|
|
192 |
// ---------------------------------------------------------------------------
|
|
193 |
//
|
|
194 |
TBool CVtUiPrimaryCmdPolicy::ValidateSoftkey( TInt aResourceId ) const
|
|
195 |
{
|
|
196 |
__VTPRINTENTER( "PrimaryCmdPolicy.ValidateSoftkey" )
|
|
197 |
TBool result( EFalse );
|
|
198 |
switch ( aResourceId )
|
|
199 |
{
|
|
200 |
case R_VIDEOTELUI_SOFTKEYS_EMPTY_ACTIVE_COMMAND:
|
|
201 |
result = iUiStates.IsCommandActivating();
|
|
202 |
break;
|
|
203 |
|
|
204 |
case R_VIDEOTELUI_SOFTKEYS_EMPTY_DIALEREXIT:
|
|
205 |
result = iUiStates.IsDialerActivating();
|
|
206 |
break;
|
|
207 |
|
|
208 |
case R_VIDEOTELUI_SOFTKEYS_SHARE_OBJECT_IMAGE:
|
|
209 |
result = iUiStates.MediaState().IsSharing();
|
|
210 |
break;
|
|
211 |
|
|
212 |
case R_VIDEOTELUI_SOFTKEYS_CAPTURE_VIDEO:
|
|
213 |
result = iUiStates.IsCaptureModeOn();
|
|
214 |
break;
|
|
215 |
|
|
216 |
case R_VIDEOTELUI_SOFTKEYS_ENABLE_AUDIO:
|
|
217 |
result = !iUiStates.AudioState().IsAudio();
|
|
218 |
break;
|
|
219 |
|
|
220 |
case R_VIDEOTELUI_SOFTKEYS_ENABLE_VIDEO:
|
|
221 |
result = !iUiStates.MediaState().IsVideo() &&
|
|
222 |
iUiStates.MediaState().HasCamera() &&
|
|
223 |
( iUiStates.ExecState() == TVtUiStates::EExecStateRunning );
|
|
224 |
break;
|
|
225 |
|
|
226 |
case R_VIDEOTELUI_SOFTKEYS_DIALER:
|
|
227 |
case R_VIDEOTELUI_SOFTKEYS_BT_HANDSFREE:
|
|
228 |
case R_VIDEOTELUI_SOFTKEYS_LOUDSPEAKER:
|
|
229 |
case R_VIDEOTELUI_SOFTKEYS_HANDSET_B:
|
|
230 |
{
|
|
231 |
if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) &&
|
|
232 |
( iUiStates.ExecState() == TVtUiStates::EExecStateRunning ) )
|
|
233 |
{
|
|
234 |
switch ( aResourceId )
|
|
235 |
{
|
|
236 |
case R_VIDEOTELUI_SOFTKEYS_DIALER:
|
|
237 |
result = ETrue;
|
|
238 |
break;
|
|
239 |
}
|
|
240 |
}
|
|
241 |
else
|
|
242 |
{
|
|
243 |
switch ( aResourceId )
|
|
244 |
{
|
|
245 |
case R_VIDEOTELUI_SOFTKEYS_BT_HANDSFREE:
|
|
246 |
result = iUiStates.AudioState().CanActivateBtHf();
|
|
247 |
break;
|
|
248 |
|
|
249 |
case R_VIDEOTELUI_SOFTKEYS_LOUDSPEAKER:
|
|
250 |
result = iUiStates.AudioState().CanActivateLoudspeaker();
|
|
251 |
break;
|
|
252 |
|
|
253 |
case R_VIDEOTELUI_SOFTKEYS_HANDSET_B:
|
|
254 |
result = iUiStates.AudioState().CanDeactivateLoudspeaker();
|
|
255 |
break;
|
|
256 |
}
|
|
257 |
}
|
|
258 |
}
|
|
259 |
break;
|
|
260 |
|
|
261 |
case R_VIDEOTELUI_SOFTKEYS_END_CALL:
|
|
262 |
result = ETrue;
|
|
263 |
break;
|
|
264 |
}
|
|
265 |
__VTPRINTEXITR( "PrimaryCmdPolicy.ValidateSoftkey %d", result )
|
|
266 |
return result;
|
|
267 |
}
|
|
268 |
|
|
269 |
// ---------------------------------------------------------------------------
|
|
270 |
// CVtUiPrimaryCmdPolicy::ValidateToolbarCommand
|
|
271 |
// ---------------------------------------------------------------------------
|
|
272 |
//
|
|
273 |
TBool CVtUiPrimaryCmdPolicy::ValidateToolbarCommand( TInt aCommandId ) const
|
|
274 |
{
|
|
275 |
__VTPRINTENTER( "PrimaryCmdPolicy.ValidateToolbarCommand" )
|
|
276 |
__VTPRINT2( DEBUG_GEN, "cmdId = %d", aCommandId )
|
|
277 |
TBool result( ETrue );
|
|
278 |
switch( aCommandId )
|
|
279 |
{
|
|
280 |
case EVtUiCmdZoom:
|
|
281 |
case EVtUiCmdShareObjectImage:
|
|
282 |
case EVtUiCmdSwapImagesPlaces:
|
|
283 |
//case EVtUiCmdSnapshot:
|
|
284 |
|
|
285 |
result = EFalse;
|
|
286 |
break;
|
|
287 |
|
|
288 |
default:
|
|
289 |
result = ValidateMenuCommand( aCommandId );
|
|
290 |
break;
|
|
291 |
}
|
|
292 |
__VTPRINTEXITR( "PrimaryCmdPolicy.ValidateToolbarCommand %d", result )
|
|
293 |
return result;
|
|
294 |
}
|
|
295 |
|
|
296 |
// ---------------------------------------------------------------------------
|
|
297 |
// CVtUiPrimaryCmdPolicy::ValidateCommandState
|
|
298 |
// ---------------------------------------------------------------------------
|
|
299 |
//
|
|
300 |
TBool CVtUiPrimaryCmdPolicy::ValidateCommandState( TInt aCommandId ) const
|
|
301 |
{
|
|
302 |
__VTPRINTENTER( "PrimaryCmdPolicy.ValidateCommandState" )
|
|
303 |
TBool handled;
|
|
304 |
TBool allowed( !ValidateCommand( aCommandId, handled ) );
|
|
305 |
if ( !handled )
|
|
306 |
{
|
|
307 |
switch ( aCommandId )
|
|
308 |
{
|
|
309 |
case EVtUiCmdCapture:
|
|
310 |
case EVtUiCmdCancelCapture:
|
|
311 |
allowed = iUiStates.IsCaptureModeOn();
|
|
312 |
break;
|
|
313 |
|
|
314 |
case EVtUiCmdStopSharingObjectImage:
|
|
315 |
allowed = iUiStates.MediaState().IsSharing() &&
|
|
316 |
!iUiStates.MediaState().IsVideoPermanentlyStopped();
|
|
317 |
break;
|
|
318 |
|
|
319 |
default:
|
|
320 |
allowed = ETrue;
|
|
321 |
break;
|
|
322 |
}
|
|
323 |
}
|
|
324 |
__VTPRINTEXITR( "PrimaryCmdPolicy.ValidateCommandState %d", allowed )
|
|
325 |
return allowed;
|
|
326 |
}
|
|
327 |
|
|
328 |
// ---------------------------------------------------------------------------
|
|
329 |
// CVtUiPrimaryCmdPolicy::ValidateCommand
|
|
330 |
// ---------------------------------------------------------------------------
|
|
331 |
//
|
|
332 |
TBool CVtUiPrimaryCmdPolicy::ValidateCommand( TInt aCommandId,
|
|
333 |
TBool& aHandled ) const
|
|
334 |
{
|
|
335 |
__VTPRINTENTER( "PrimaryCmdPolicy.ValidateCommand" )
|
|
336 |
|
|
337 |
__VTPRINT2( DEBUG_GEN, " cmdId = %d", aCommandId )
|
|
338 |
|
|
339 |
TBool result( ETrue );
|
|
340 |
|
|
341 |
aHandled = ETrue;
|
|
342 |
|
|
343 |
const TVtUiMediaState& mediaState( iUiStates.MediaState() );
|
|
344 |
const TVtUiAudioState& audioState( iUiStates.AudioState() );
|
|
345 |
const TBool disabledVideo( !mediaState.IsVideo() ||
|
|
346 |
mediaState.IsSharing() );
|
|
347 |
const TBool disabledAudio( !audioState.IsAudio() );
|
|
348 |
const TBool disableVideoOptions( !mediaState.HasCamera() );
|
|
349 |
const TBool freezeSupported( mediaState.IsFreezeSupported() );
|
|
350 |
const TBool frozen( mediaState.IsFrozen() );
|
|
351 |
|
|
352 |
const TBool videoPermStopped( mediaState.IsVideoPermanentlyStopped() );
|
|
353 |
const TBool audioPermStopped( audioState.IsAudioPermanentlyStopped() );
|
|
354 |
|
|
355 |
switch( aCommandId )
|
|
356 |
{
|
|
357 |
case EVtUiCmdSnapshot:
|
|
358 |
result = ( disabledVideo && !frozen ) ||
|
|
359 |
disableVideoOptions ||
|
|
360 |
!freezeSupported;
|
|
361 |
break;
|
|
362 |
|
|
363 |
case EVtUiCmdUsePrimaryCamera:
|
|
364 |
result = mediaState.IsPrimaryCameraInUse() || frozen ||
|
|
365 |
!mediaState.HasPrimaryCamera() || mediaState.IsSharing() ||
|
|
366 |
videoPermStopped;
|
|
367 |
break;
|
|
368 |
|
|
369 |
case EVtUiCmdUseSecondaryCamera:
|
|
370 |
result = mediaState.IsSecondaryCameraInUse() || frozen ||
|
|
371 |
!mediaState.HasSecondaryCamera() || mediaState.IsSharing() ||
|
|
372 |
videoPermStopped;
|
|
373 |
break;
|
|
374 |
|
|
375 |
case EVtUiCmdDeactivateBT:
|
|
376 |
result = !audioState.CanDeactivateBtHf();
|
|
377 |
break;
|
|
378 |
|
|
379 |
case EVtUiCmdSwitchFromBTToIHF:
|
|
380 |
result = !audioState.CanDeactivateBtHf() ||
|
|
381 |
!audioState.CanActivateLoudspeaker();
|
|
382 |
break;
|
|
383 |
|
|
384 |
case EVtUiCmdActivateBT:
|
|
385 |
result = !audioState.CanActivateBtHf();
|
|
386 |
break;
|
|
387 |
|
|
388 |
case EVtUiCmdDeactivateLoudspeaker:
|
|
389 |
result = !audioState.CanDeactivateLoudspeaker();
|
|
390 |
break;
|
|
391 |
|
|
392 |
case EVtUiCmdActivateLoudspeaker:
|
|
393 |
result = !audioState.CanActivateLoudspeaker();
|
|
394 |
break;
|
|
395 |
|
|
396 |
case EVtUiCmdSwapImagesPlaces:
|
|
397 |
// Swap image places is always shown in menu.
|
|
398 |
result = EFalse;
|
|
399 |
break;
|
|
400 |
|
|
401 |
case EVtUiCmdAdjustVideo:
|
|
402 |
// Adjust video is always shown in menu.
|
|
403 |
result = EFalse;
|
|
404 |
break;
|
|
405 |
|
|
406 |
case EVtUiCmdAdjustVideoVideoQuality:
|
|
407 |
result = EFalse;
|
|
408 |
break;
|
|
409 |
|
|
410 |
case EVtUiCmdAdjustVideoWhiteBalance:
|
|
411 |
result = !iUiStates.IsWhiteBalanceSettingAvailable() || frozen;
|
|
412 |
break;
|
|
413 |
|
|
414 |
case EVtUiCmdAdjustVideoBrightness:
|
|
415 |
result =!iUiStates.IsBrightnessSettingAvailable() || frozen;
|
|
416 |
break;
|
|
417 |
|
|
418 |
case EVtUiCmdAdjustVideoContrast:
|
|
419 |
result =!iUiStates.IsContrastSettingAvailable() || frozen;
|
|
420 |
break;
|
|
421 |
|
|
422 |
case EVtUiCmdAdjustVideoColourTone:
|
|
423 |
result = !iUiStates.IsColorToneSettingAvailable() || frozen;
|
|
424 |
|
|
425 |
break;
|
|
426 |
case EVtUiCmdZoom:
|
|
427 |
result = frozen || disableVideoOptions || disabledVideo;
|
|
428 |
break;
|
|
429 |
|
|
430 |
case EVtUiCmdCreateVoice:
|
|
431 |
// Downgrading to voice call is not possible if remote end MSISDN
|
|
432 |
// is unavailable or there is waiting call.
|
|
433 |
result = !iUiStates.IsCLIReceived() || iUiStates.IsWaitingCall();
|
|
434 |
break;
|
|
435 |
|
|
436 |
case EVtUiCmdGoToIdle:
|
|
437 |
#ifndef RD_BOOT_CUSTOMIZABLE_AI
|
|
438 |
result = !iAIEnabled;
|
|
439 |
#else
|
|
440 |
// When RD_BOOT_CUSTOMIZABLE_AI is defined, active idle is always
|
|
441 |
// shown in menu
|
|
442 |
// result = EFalse;
|
|
443 |
// disable the go to idle when autolock is on.
|
|
444 |
result = iUiStates.IsDeviceLockOn();
|
|
445 |
#endif //RD_BOOT_CUSTOMIZABLE_AI
|
|
446 |
break;
|
|
447 |
|
|
448 |
case EAknCmdHelp:
|
|
449 |
{
|
|
450 |
TVtUiHelpVariation hlpvariation;
|
|
451 |
result = !hlpvariation.IsHelpSupported();
|
|
452 |
}
|
|
453 |
break;
|
|
454 |
|
|
455 |
case EAknCmdExit:
|
|
456 |
// Exit option is disabled by default. Change ETrue to EFalse
|
|
457 |
// and it is in the menu.
|
|
458 |
break;
|
|
459 |
|
|
460 |
case EVtUiCmdEndActiveCall:
|
|
461 |
// End active call always shown in menu.
|
|
462 |
result = EFalse;
|
|
463 |
break;
|
|
464 |
|
|
465 |
case EVtUiCmdShareObjectImage:
|
|
466 |
result = frozen || mediaState.IsNotAbleToShare() ||
|
|
467 |
mediaState.IsInitializingShare() || videoPermStopped ||
|
|
468 |
iAppUi.IsActiveCommand( EVtUiCmdShareObjectImage );
|
|
469 |
break;
|
|
470 |
|
|
471 |
case EVtUiCmdEnableMain:
|
|
472 |
result = ( iAppUi.IsActiveCommand( EVtUiCmdEnableVideo ) ||
|
|
473 |
iAppUi.IsActiveCommand( EVtUiCmdDisableVideo ) ||
|
|
474 |
!disabledVideo || disableVideoOptions || videoPermStopped )
|
|
475 |
&& ( iAppUi.IsActiveCommand ( EVtUiCmdEnableAudio ) ||
|
|
476 |
!disabledAudio || audioPermStopped );
|
|
477 |
break;
|
|
478 |
|
|
479 |
case EVtUiCmdEnableVideo:
|
|
480 |
result = !disabledVideo || disableVideoOptions ||
|
|
481 |
videoPermStopped;
|
|
482 |
break;
|
|
483 |
|
|
484 |
case EVtUiCmdEnableAudio:
|
|
485 |
result = !disabledAudio || audioPermStopped;
|
|
486 |
break;
|
|
487 |
|
|
488 |
case EVtUiCmdEnableBoth:
|
|
489 |
result = !disabledVideo || !disabledAudio || disableVideoOptions ||
|
|
490 |
videoPermStopped || audioPermStopped;
|
|
491 |
break;
|
|
492 |
|
|
493 |
case EVtUiCmdDisableMain:
|
|
494 |
result = ( iAppUi.IsActiveCommand( EVtUiCmdDisableVideo ) ||
|
|
495 |
iAppUi.IsActiveCommand( EVtUiCmdEnableVideo ) ||
|
|
496 |
disabledVideo || disableVideoOptions || videoPermStopped ) &&
|
|
497 |
( iAppUi.IsActiveCommand( EVtUiCmdDisableAudio ) ||
|
|
498 |
disabledAudio || audioPermStopped );
|
|
499 |
break;
|
|
500 |
|
|
501 |
case EVtUiCmdDisableVideo:
|
|
502 |
result = disabledVideo || disableVideoOptions || videoPermStopped;
|
|
503 |
break;
|
|
504 |
|
|
505 |
case EVtUiCmdDisableAudio:
|
|
506 |
result = disabledAudio || audioPermStopped;
|
|
507 |
break;
|
|
508 |
|
|
509 |
case EVtUiCmdDisableBoth:
|
|
510 |
result = disableVideoOptions || disabledVideo || disabledAudio ||
|
|
511 |
videoPermStopped || audioPermStopped;
|
|
512 |
break;
|
|
513 |
|
|
514 |
case EVtUiCmdSendDTMF:
|
|
515 |
if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer ) )
|
|
516 |
{
|
|
517 |
result = EFalse;
|
|
518 |
}
|
|
519 |
else
|
|
520 |
{
|
|
521 |
result = ETrue;
|
|
522 |
}
|
|
523 |
break;
|
|
524 |
|
|
525 |
default:
|
|
526 |
aHandled = EFalse;
|
|
527 |
break;
|
|
528 |
}
|
|
529 |
|
|
530 |
__VTPRINTEXITR( "PrimaryCmdPolicy.ValidateCommand %d", result )
|
|
531 |
|
|
532 |
return result;
|
|
533 |
}
|
|
534 |
|