contentcontrolsrv/hsccclient/hsccproviderclient/src/hsccproviderclient.cpp
changeset 2 b7904b40483f
parent 0 79c6a41cd166
child 18 bd874ee5e5e2
--- a/contentcontrolsrv/hsccclient/hsccproviderclient/src/hsccproviderclient.cpp	Thu Jan 07 12:55:39 2010 +0200
+++ b/contentcontrolsrv/hsccclient/hsccproviderclient/src/hsccproviderclient.cpp	Mon Jan 18 20:32:13 2010 +0200
@@ -159,6 +159,12 @@
             case EHsCcActivateAppReq:
                 HandleActivateAppReqL( *message );
                 break;
+            case EHsCcActiveAppReq:
+                HandleActiveAppReqL( *message );
+                break;
+            case EHsCcActiveViewReq:
+                HandleActiveViewReqL( *message );
+                break;
             default:
                 HandleNotSupportedReqL( *message );
                 break;
@@ -553,6 +559,43 @@
     }
 
 // -----------------------------------------------------------------------------
+// CHsCcProviderClient::HandleActiveViewReqL()
+// -----------------------------------------------------------------------------
+//
+void CHsCcProviderClient::HandleActiveViewReqL(
+    CCcSrvMsg& aMessage )
+    {
+    // Get active view
+    CHsContentInfo* view = CHsContentInfo::NewL();
+    CleanupStack::PushL( view );
+    TInt err = iController.ActiveViewL( *view );
+
+    // Create and send ActiveViewResp
+    CCcSrvMsg* message = CCcSrvMsg::NewL();
+    CleanupStack::PushL( message );
+    message->SetMsgId( EHsCcActiveViewResp );
+    message->SetTrId( aMessage.TrId() );
+    message->SetStatus( err );
+    
+    if ( !err )
+        {
+        // Externalize view list
+        HBufC8* dataBuf = view->MarshalL();
+        CleanupStack::PushL( dataBuf );
+        TPtr8 dataPtr( NULL, 0 );
+        dataPtr.Set( dataBuf->Des() );
+        message->SetData( dataPtr );
+        CleanupStack::PopAndDestroy( dataBuf );
+        }
+    
+    SendRespL( *message );
+    
+    CleanupStack::PopAndDestroy( message );    
+    CleanupStack::PopAndDestroy( view );
+
+    }
+
+// -----------------------------------------------------------------------------
 // CHsCcProviderClient::HandleAppListReqL()
 // -----------------------------------------------------------------------------
 //
@@ -630,6 +673,42 @@
     }
 
 // -----------------------------------------------------------------------------
+// CHsCcProviderClient::HandleActiveAppReqL()
+// -----------------------------------------------------------------------------
+//
+void CHsCcProviderClient::HandleActiveAppReqL(
+    CCcSrvMsg& aMessage )
+    {
+    // Get active application info
+    CHsContentInfo* app = CHsContentInfo::NewL();
+    CleanupStack::PushL( app );
+    TInt err = iController.ActiveAppL( *app );
+
+    // Create and send ActiveViewResp
+    CCcSrvMsg* message = CCcSrvMsg::NewL();
+    CleanupStack::PushL( message );
+    message->SetMsgId( EHsCcActiveAppResp );
+    message->SetTrId( aMessage.TrId() );
+    message->SetStatus( err );
+    
+    if ( !err )
+        {
+        // Externalize application info
+        HBufC8* dataBuf = app->MarshalL();
+        CleanupStack::PushL( dataBuf );
+        TPtr8 dataPtr( NULL, 0 );
+        dataPtr.Set( dataBuf->Des() );
+        message->SetData( dataPtr );
+        CleanupStack::PopAndDestroy( dataBuf );
+        }
+    
+    SendRespL( *message );
+    
+    CleanupStack::PopAndDestroy( message );    
+    CleanupStack::PopAndDestroy( app );
+    }
+
+// -----------------------------------------------------------------------------
 // CHsCcProviderClient::HandleNotSupportedReqL()
 // -----------------------------------------------------------------------------
 //