Revision: 201011 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 21:35:06 +0300
branchRCL_3
changeset 15 3e521e99f813
parent 13 50bbdc59f9c4
child 17 392fdfb57a78
Revision: 201011 Kit: 201013
package_definition.xml
vtengines/videoteleng/Inc/Commands/CVtEngCommandHandler.h
vtengines/videoteleng/Inc/Commands/MVtEngCommandHandler.h
vtengines/videoteleng/Src/Commands/CVtEngCommandHandler.cpp
vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp
vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp
vtengines/vtmediatorplugin/inc/cvtmediatorplugin.h
vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp
vtprotocolplugins/VideoSource/src/CVSStillImageDataProvider.cpp
vtuis/videotelui/data/videotelui.rss
vtuis/videotelui/inc/CVtUiAppUi.h
vtuis/videotelui/inc/videotelui.hrh
vtuis/videotelui/loc/videotelui.loc
vtuis/videotelui/src/CVtUiAppUi.cpp
vtuis/videotelui/src/features/toolbar/cvtuifixedtoolbar.cpp
--- a/package_definition.xml	Mon Mar 15 12:40:49 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
-  <package id="videotelephony" name="Video Telephony Apps" levels="engine plugin prot ui">
-    <collection id="vtengines" name="Video Telephony Engines" level="engine">
-      <component id="videoteleng" filter="s60" name="Video Telephony Engine">
-        <unit bldFile="vtengines/videoteleng/group"/>
-        	<!-- should these be #included? -->
-        <!-- <unit bldFile="vtengines/videoteleng/logger/group"/> -->
-        <!-- <unit bldFile="vtengines/videoteleng/callctrl/group"/> -->
-      </component>
-      <component id="vtmediatorplugin" filter="s60" name="VT Mediator Plugin" class="plugin">
-        <unit bldFile="vtengines/vtmediatorplugin/group"/>
-      </component>
-    </collection>
-    <collection id="vtuis" name="Video Telephony UIs" level="ui">
-      <component id="videotelui" filter="s60" name="Video Telephony UI">
-        <unit bldFile="vtuis/videotelui/group"/>
-      </component>
-    </collection>
-    <collection id="vtprotocolplugins" name="VT Protocol Plugins" level="plugin">
-      <component id="displaysink" filter="s60" name="Display Sink" introduced="^2">
-        <unit bldFile="vtprotocolplugins/displaysink/group"/>
-      </component>
-      <component id="videosource" filter="s60" name="Video Source" introduced="^2">
-        <unit bldFile="vtprotocolplugins/videosource/group"/>
-      </component>
-    </collection>
-    <collection id="vtprotocolsstub" name="VT Protocols Stub" level="prot">
-      <component id="videotelproto" filter="s60" name="Video Telephony Protocol">
-        <unit bldFile="vtprotocolsstub/group"/>
-      </component>
-    </collection>
-    <collection id="videotelephony_info" name="VT Apps Info" level="ui">
-      <component id="videotelephony_plat" filter="s60" name="VT Apps Platform Interfaces" class="api">
-        <unit bldFile="videotelephony_plat/group"/>
-      </component>
-    </collection>
-  </package>
-</SystemDefinition>
--- a/vtengines/videoteleng/Inc/Commands/CVtEngCommandHandler.h	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtengines/videoteleng/Inc/Commands/CVtEngCommandHandler.h	Wed Mar 31 21:35:06 2010 +0300
@@ -76,6 +76,11 @@
         /**
         * @see MVtEngCommandHandler        
         */
+        virtual TVtEngCommandId InvalidCommand();
+        
+        /**
+        * @see MVtEngCommandHandler        
+        */
         virtual void AddObserverL( MVtEngCommandObserver& aObserver );
 
         /**
@@ -185,6 +190,7 @@
         CVtEngHandlerContainer&              iHandlers;
         CVtEngOperation*                     iActiveOp;
         CVtEngCmdPool*                       iCommandPool;
+        TVtEngCommandId                      iInvalidCommandId;
 
     };
 
--- a/vtengines/videoteleng/Inc/Commands/MVtEngCommandHandler.h	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtengines/videoteleng/Inc/Commands/MVtEngCommandHandler.h	Wed Mar 31 21:35:06 2010 +0300
@@ -97,6 +97,12 @@
         virtual TVtEngCommandId PendingCommand() = 0;
 
         /**
+        * Returns invalid command.
+        * @return invalid command
+        */
+        virtual TVtEngCommandId InvalidCommand() = 0;
+        
+        /**
         * Sets command observer. First call on this is guaranteed
         * to succeed.
         * @param aObserver command observer.
--- a/vtengines/videoteleng/Src/Commands/CVtEngCommandHandler.cpp	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtengines/videoteleng/Src/Commands/CVtEngCommandHandler.cpp	Wed Mar 31 21:35:06 2010 +0300
@@ -53,7 +53,8 @@
 CVtEngCommandHandler::CVtEngCommandHandler(
     CVtEngHandlerContainer& aHandlers ) :
     iObservers( 1 ),
-    iHandlers( aHandlers )
+    iHandlers( aHandlers ),
+    iInvalidCommandId( KVtEngCommandNone )
     {
     }
 
@@ -265,6 +266,16 @@
     }
 
 // -----------------------------------------------------------------------------
+// CVtEngCommandHandler::InvalidCommand
+//
+// -----------------------------------------------------------------------------
+//
+TVtEngCommandId CVtEngCommandHandler::InvalidCommand()
+    {
+    return iInvalidCommandId;
+    }
+
+// -----------------------------------------------------------------------------
 // CVtEngCommandHandler::AddObserverL
 //
 // -----------------------------------------------------------------------------
@@ -483,6 +494,7 @@
     const TVtEngCommandId aCommandId,
     TInt& aCaps )
     {
+    iInvalidCommandId = KVtEngCommandNone;
     aCaps &= (~EAttribEnabled);
     if ( !(iActiveOp && ( aCaps & EAttribAsync ) ) )
         {
@@ -491,12 +503,11 @@
             {
             aCaps |= EAttribEnabled;
             }
-#ifdef VTDEBUG
         else
             {
+            iInvalidCommandId = aCommandId;
             __VTPRINT( DEBUG_GEN, "ComHlr.ChkState INVALID" )
             }
-#endif // VTDEBUG
         }
     __VTPRINT3( DEBUG_GEN | DEBUG_DETAIL, "  capsState cmd=%d,caps=%d", aCommandId, aCaps )
     }
--- a/vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp	Wed Mar 31 21:35:06 2010 +0300
@@ -1279,7 +1279,7 @@
         {
         TVtEngProviderType delayedSelect( iDelayedSelect.DelayedSelectTarget() );
         if ( delayedSelect != KVtEngProviderNone && 
-             delayedSelect != KVtEngProviderDefaultStillImage )
+             delayedSelect != KVtEngProviderImage )
             {
             aSource = delayedSelect;
             }
--- a/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp	Wed Mar 31 21:35:06 2010 +0300
@@ -543,7 +543,9 @@
 
             case KVtEngHandleLayoutChange:
                 if ( iLocalVideo && iLocalVideo->ActiveProvider() !=
-                        CVtEngLocalVideo::KVtEngProviderNone  && !iPendingOp )
+                        CVtEngLocalVideo::KVtEngProviderNone  && 
+                        !iPendingOp && iLocalVideo->ActiveProvider() !=
+                                CVtEngLocalVideo::KVtEngProviderImage )
                     {
                     okToPerform = KErrNone;
                     }
--- a/vtengines/vtmediatorplugin/inc/cvtmediatorplugin.h	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtengines/vtmediatorplugin/inc/cvtmediatorplugin.h	Wed Mar 31 21:35:06 2010 +0300
@@ -286,8 +286,6 @@
     // Application thread id.
     TThreadId iAppThreadId;
     
-    // Owned window server session.
-    RWsSession iWsSession;
     /**
         * Active object for waiting thread death.
         *
--- a/vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp	Wed Mar 31 21:35:06 2010 +0300
@@ -154,8 +154,6 @@
         {
         delete iAppDeathActive;
         iAppThread.Close();
-        iWsSession.Close();
-        
         }
 
     TRACE("CVtMediatorPlugin::~CVtMediatorPlugin>")
@@ -528,7 +526,9 @@
 
     iAppDeathActive = new ( ELeave ) CAppDeathActive( *this, iAppThread );
        
-    User::LeaveIfError( iWsSession.Connect() );
+    RWsSession wsSession;
+    User::LeaveIfError( wsSession.Connect() );
+    CleanupClosePushL( wsSession );
 
     TInt wgId = 0;
     TBool found = EFalse;
@@ -539,10 +539,10 @@
         {
         CApaWindowGroupName::FindByAppUid( 
             KVtCmVideoTelUiUid, 
-            iWsSession, 
+            wsSession, 
             wgId );
 
-        TApaTask task( iWsSession );
+        TApaTask task( wsSession );
         task.SetWgId( wgId );
         if ( task.Exists() )
             {
@@ -563,7 +563,8 @@
             iAppThread.Close();
              }
         }
-
+    CleanupStack::PopAndDestroy(); // CleanupClosePushL
+    
     // If application was not found, then launch new application.
     if ( !found )
         {
@@ -931,7 +932,6 @@
     TRACE("CVtMediatorPlugin.StopDeathActive<")
     delete iAppDeathActive;
     iAppThread.Close();
-    iWsSession.Close();
     //if there is a waiting call, check if we need to launch it
     TRACE2("CVtMediatorPlugin.StopDeathActive WaitintCallID=%d>",
             iWaitingVideoCallInfo.iCallId)
--- a/vtprotocolplugins/VideoSource/src/CVSStillImageDataProvider.cpp	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtprotocolplugins/VideoSource/src/CVSStillImageDataProvider.cpp	Wed Mar 31 21:35:06 2010 +0300
@@ -327,7 +327,7 @@
     iActiveWait = new (ELeave) CVSActiveWait< CVSStillImageDataProvider > ( this );
 
     //Create viewer
-    iViewer = CMultiframeProvider::NewL( this , iDisplayMode );
+    iViewer = CMultiframeProvider::NewL( this , EColor16MU/*iDisplayMode*/ );
     User::LeaveIfError( iFreezeCS.CreateLocal() );
 
     __IF_DEBUG(Print(_L("VideoSource [%d]: CVSStillImageDataProvider::CommonInitializeL() <<"), RThread().Id().operator TUint()));
--- a/vtuis/videotelui/data/videotelui.rss	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtuis/videotelui/data/videotelui.rss	Wed Mar 31 21:35:06 2010 +0300
@@ -1761,8 +1761,8 @@
         {
         CBA_BUTTON
             {
-            id = EAknSoftkeyEmpty;
-            txt = text_softkey_empty;
+            id = EVtUiCmdDialerEmergencyCall;
+            txt = qtn_incal_softk_emergency_call;
             },
         CBA_BUTTON
             {
--- a/vtuis/videotelui/inc/CVtUiAppUi.h	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtuis/videotelui/inc/CVtUiAppUi.h	Wed Mar 31 21:35:06 2010 +0300
@@ -1185,6 +1185,11 @@
         *  This function hides the brightness, contrast, volume slider if their mode is on.
         */
         void StopSliders();
+        
+        /*
+        * This function can get the focus window group id
+        */
+        TInt GetFocusWindowGroupId();
 
         /**
         * Does pre handling to key events, especially for Zoom in and Zoom out
--- a/vtuis/videotelui/inc/videotelui.hrh	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtuis/videotelui/inc/videotelui.hrh	Wed Mar 31 21:35:06 2010 +0300
@@ -110,7 +110,9 @@
     // Adjust video colour tone
     EVtUiCmdAdjustVideoColourTone, //6114
     // Dialer close
-    EVtUiDialerExit //6115
+    EVtUiDialerExit, //6115
+    // Dialer emergency call
+    EVtUiCmdDialerEmergencyCall //6116
     };
 
 // Enumerates bitmap identifiers
--- a/vtuis/videotelui/loc/videotelui.loc	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtuis/videotelui/loc/videotelui.loc	Wed Mar 31 21:35:06 2010 +0300
@@ -398,4 +398,10 @@
 // r: 5.0
 //
 #define qtn_vt_button_end_call "End Call"
+
+// d: It is text in softkey to make emergency call.
+// l: control_pane_t1/opt7
+// r: 5.0
+//
+#define qtn_incal_softk_emergency_call "Emerg. Call"
 // End of File
--- a/vtuis/videotelui/src/CVtUiAppUi.cpp	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtuis/videotelui/src/CVtUiAppUi.cpp	Wed Mar 31 21:35:06 2010 +0300
@@ -1481,8 +1481,7 @@
             {
             // If focus window group is not this application nor window server,
             // then this application can not be in focus.
-            const TInt windowGroupId =
-                iCoeEnv->WsSession().GetFocusWindowGroup();
+            const TInt windowGroupId = GetFocusWindowGroupId();
 
             if ( ( windowGroupId != iThisApplicationWgId ) &&
                  ( windowGroupId != iEikonServerWgId ) &&
@@ -1552,6 +1551,62 @@
     }
 
 // -----------------------------------------------------------------------------
+// CVtUiAppUi::GetFocusWindowGroupId
+// -----------------------------------------------------------------------------
+//
+TInt CVtUiAppUi::GetFocusWindowGroupId()
+    {
+    __VTPRINTENTER( "VtUi.GetFocusWindowGroupId" )
+    RWsSession& ws = iCoeEnv->WsSession();
+    RArray<RWsSession::TWindowGroupChainInfo>* allWgIds = 
+        new (ELeave) RArray<RWsSession::TWindowGroupChainInfo>( 4 );
+
+    CleanupDeletePushL( allWgIds );
+    CleanupClosePushL( *allWgIds );
+
+    User::LeaveIfError( ws.WindowGroupList( 0, allWgIds) );
+
+	const TInt chainCount = allWgIds->Count();
+	
+	RApaLsSession appArcSession;
+	User::LeaveIfError( appArcSession.Connect() );
+
+	appArcSession.GetAllApps();
+
+    CApaWindowGroupName* windowName;
+    TInt firstAppWgId = KErrNone;
+    for ( TInt index=0; index < chainCount; index++ )
+        {
+        RWsSession::TWindowGroupChainInfo& info = (*allWgIds)[index];
+        if ( info.iParentId <= 0 )
+            {
+            TInt wgId=info.iId;
+            windowName = CApaWindowGroupName::NewLC(ws, wgId);
+            TUid applicationUid = windowName->AppUid();                
+
+            // application screen (0 = main screen, 1 = cover ui )          
+            // the possible error value is omitted 
+            TInt appScreen = -1; 
+            TInt errId = appArcSession.GetDefaultScreenNumber( appScreen, applicationUid ); 
+            if (  errId != KErrNone )
+                {
+                CleanupStack::PopAndDestroy( windowName );  //windowName
+                continue;   
+                }
+            if ( firstAppWgId == KErrNone && ( appScreen == 0 || appScreen == -1 ) )
+                {
+                firstAppWgId = wgId; //   firstAppWgId should be the top windows group id.
+                }
+
+            CleanupStack::PopAndDestroy();  //windowName
+            }
+        }
+    __VTPRINTEXIT( "VtUi.GetFocusWindowGroupId" )
+    return firstAppWgId;
+    }
+
+
+// -----------------------------------------------------------------------------
 // CVtUiAppUi::PreHandleKeyEventL
 //
 // -----------------------------------------------------------------------------
@@ -2259,6 +2314,11 @@
             CmdGoToIdleL();
             break;
 
+        // Dial emergency call
+        case EVtUiCmdDialerEmergencyCall:
+        __VTPRINT( DEBUG_GEN, "VtUiHandleCommand.CmdEmergencyCall" );
+            CmdSimulateKeyEvent( EStdKeyYes );
+            break;
         // Object sharing related
 
         case EVtUiCmdShareObjectImage:
@@ -4921,13 +4981,15 @@
         __VTPRINT( DEBUG_GEN,
             "VtUi.DoLayoutChg KVtEngHandleLayoutChange == KErrNotReady (ok)" )
         TVtEngCommandId pendingCommand = Model().CommandHandler().PendingCommand();
+        TVtEngCommandId invalidCommand = Model().CommandHandler().InvalidCommand();
         if ( pendingCommand  == KVtEngMuteOutgoingAudio || 
                 pendingCommand  == KVtEngUnmuteOutgoingAudio ||
                 pendingCommand  == KVtEngSetAudioRouting ||
                 pendingCommand  == KVtEngSetAudioVolume ||
                 pendingCommand  == KVtEngSetSource ||
                 pendingCommand  == KVtEngPrepareCamera ||
-                pendingCommand  == KVtEngUnfreeze )
+                pendingCommand  == KVtEngUnfreeze ||
+                invalidCommand  == KVtEngHandleLayoutChange )
             {
             iUiStates->SetLayoutChangeNeeded( ETrue );
             }
@@ -6977,7 +7039,8 @@
             aCommand  == KVtEngSetAudioVolume ||
             aCommand  == KVtEngSetSource ||
             aCommand  == KVtEngPrepareCamera ||
-            aCommand  == KVtEngUnfreeze ) )
+            aCommand  == KVtEngUnfreeze ||
+            aCommand  == KVtEngHandleLayoutChange ) )
         {
         iAppUi.iUiStates->SetLayoutChangeNeeded( EFalse );
         iAppUi.DoHandleLayoutChangedL();
--- a/vtuis/videotelui/src/features/toolbar/cvtuifixedtoolbar.cpp	Mon Mar 15 12:40:49 2010 +0200
+++ b/vtuis/videotelui/src/features/toolbar/cvtuifixedtoolbar.cpp	Wed Mar 31 21:35:06 2010 +0300
@@ -159,7 +159,11 @@
             {
             iIdle = CIdle::NewL( CActive::EPriorityIdle );
             }
-        iIdle->Start( TCallBack( &DoDimToolbarButtons, this ) );
+        
+        if ( !iIdle->IsActive() )
+            {
+            iIdle->Start( TCallBack( &DoDimToolbarButtons, this ) );
+            }
         }
     // Landsacpe to portrait hide tb
     else
@@ -181,8 +185,8 @@
 void CVtUiFixedToolbar::DimToolbarbuttons( TBool aIsDimmed )
     {
     __VTPRINTENTER( "FixedToolbar.DimToolbarbuttons" )
-    iToolbar->SetItemDimmed( EVtUiCmdToolbarToggleVideo, aIsDimmed, EFalse );
-    iToolbar->SetItemDimmed( EVtUiCmdToolbarToggleMicrophone, aIsDimmed, EFalse );
+    iToolbar->SetItemDimmed( EVtUiCmdToolbarToggleVideo, aIsDimmed, ETrue );
+    iToolbar->SetItemDimmed( EVtUiCmdToolbarToggleMicrophone, aIsDimmed, ETrue );
     iToolbar->SetItemDimmed( EVtUiCmdToolbarAudioRouting, aIsDimmed, ETrue );
     __VTPRINTEXITR( "FixedToolbar.DimToolbarbuttons %d", aIsDimmed )
     }