commondrm/drmutility/src/DrmUtilityGlobalNoteWrapper.cpp
branchRCL_3
changeset 18 8a03a285ab14
parent 0 95b198f216e5
child 32 457cd4423b8c
--- a/commondrm/drmutility/src/DrmUtilityGlobalNoteWrapper.cpp	Fri Mar 12 15:43:46 2010 +0200
+++ b/commondrm/drmutility/src/DrmUtilityGlobalNoteWrapper.cpp	Mon Mar 15 12:41:43 2010 +0200
@@ -18,20 +18,20 @@
 
 
 // INCLUDE FILES
-#include <stringloader.h>
-#include <aknglobalconfirmationquery.h>
-#include <akngloballistquery.h>
+#include <StringLoader.h>
+#include <AknGlobalConfirmationQuery.h>
+#include <AknGlobalListQuery.h>
 #include <badesca.h>
 #include <avkon.hrh> // EAknSoftkeyNo
 #include <drmutility.rsg>
 
-#include <aknmediatorfacade.h>
-#include <aknsddata.h>
+#include <AknMediatorFacade.h>
+#include <aknSDData.h>
 #include <featmgr.h>
 
 #include "drmutilitysecondarydisplay.h"
-#include "drmutilityglobalnotewrapper.h"
-#include "drmutilityinfonotewrapper.h"
+#include "DrmUtilityGlobalNoteWrapper.h"
+#include "DrmUtilityInfoNoteWrapper.h"
 
 // ============================= LOCAL FUNCTIONS ===============================
 
@@ -43,7 +43,7 @@
 // might leave.
 // -----------------------------------------------------------------------------
 //
-DRM::CDrmUtilityGlobalNoteWrapper::CDrmUtilityGlobalNoteWrapper() 
+DRM::CDrmUtilityGlobalNoteWrapper::CDrmUtilityGlobalNoteWrapper()
     : CActive( EPriorityStandard )
     {
     CActiveScheduler::Add( this );
@@ -54,7 +54,7 @@
 // Symbian 2nd phase constructor can leave.
 // -----------------------------------------------------------------------------
 //
-void DRM::CDrmUtilityGlobalNoteWrapper::ConstructL( 
+void DRM::CDrmUtilityGlobalNoteWrapper::ConstructL(
     CStringResourceReader* aResourceReader )
     {
     iResourceReader = aResourceReader;
@@ -66,10 +66,10 @@
 // Two-phased constructor.
 // -----------------------------------------------------------------------------
 //
-DRM::CDrmUtilityGlobalNoteWrapper* DRM::CDrmUtilityGlobalNoteWrapper::NewLC( 
+DRM::CDrmUtilityGlobalNoteWrapper* DRM::CDrmUtilityGlobalNoteWrapper::NewLC(
     CStringResourceReader* aResourceReader )
     {
-    DRM::CDrmUtilityGlobalNoteWrapper* self( 
+    DRM::CDrmUtilityGlobalNoteWrapper* self(
                                 new (ELeave) CDrmUtilityGlobalNoteWrapper() );
     CleanupStack::PushL( self );
     self->ConstructL( aResourceReader );
@@ -84,7 +84,7 @@
     return self;
     }
 
-    
+
 // Destructor
 DRM::CDrmUtilityGlobalNoteWrapper::~CDrmUtilityGlobalNoteWrapper()
     {
@@ -95,15 +95,15 @@
 // CDrmUtilityGlobalNoteWrapper::ShowNoteL
 // -----------------------------------------------------------------------------
 //
-TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowNoteWithButtonsL( 
-    TInt aResourceId, 
+TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowNoteWithButtonsL(
+    TInt aResourceId,
     TInt aButtonsId )
     {
     TInt ret( 0 );
-    
+
     iTextBuffer = iResourceReader->ReadResourceString( aResourceId );
-    
-    iButtonsId = aButtonsId;   
+
+    iButtonsId = aButtonsId;
     ret = DoShowNoteL( aResourceId );
     iButtonsId = R_AVKON_SOFTKEYS_YES_NO__YES;
     return ret;
@@ -113,35 +113,35 @@
 // CDrmUtilityGlobalNoteWrapper::ShowNoteWithButtonsL
 // -----------------------------------------------------------------------------
 //
-TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowNoteWithButtonsL( 
-    TInt aResourceId, 
+TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowNoteWithButtonsL(
+    TInt aResourceId,
     TInt aButtonsId,
     const TDesC& aString )
     {
     TInt ret( 0 );
-    
-    TBuf<DRM::KDRMNoteBufferMaxSize> srcBuffer( 
+
+    TBuf<DRM::KDRMNoteBufferMaxSize> srcBuffer(
         iResourceReader->ReadResourceString( aResourceId ) );
-    
+
     StringLoader::Format( iTextBuffer, srcBuffer, -1, aString );
-            
-    iButtonsId = aButtonsId;   
+
+    iButtonsId = aButtonsId;
     ret = DoShowNoteL( aResourceId, aString );
     iButtonsId = R_AVKON_SOFTKEYS_YES_NO__YES;
     return ret;
     }
-    
+
 // -----------------------------------------------------------------------------
 // CDrmUtilityGlobalNoteWrapper::ShowNoteL
 // -----------------------------------------------------------------------------
 //
-TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowNoteL( 
-    TInt aResourceId, 
+TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowNoteL(
+    TInt aResourceId,
     TInt aValue )
     {
-    TBuf<DRM::KDRMNoteBufferMaxSize> srcBuffer( 
+    TBuf<DRM::KDRMNoteBufferMaxSize> srcBuffer(
         iResourceReader->ReadResourceString( aResourceId ) );
-        
+
     StringLoader::Format( iTextBuffer, srcBuffer, -1, aValue );
     return DoShowNoteL( aResourceId, KNullDesC, aValue );
     }
@@ -150,13 +150,13 @@
 // CDrmUtilityGlobalNoteWrapper::ShowNoteL
 // -----------------------------------------------------------------------------
 //
-TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowNoteL( 
-    TInt aResourceId, 
+TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowNoteL(
+    TInt aResourceId,
     const TDesC& aString )
     {
-    TBuf<DRM::KDRMNoteBufferMaxSize> srcBuffer( 
+    TBuf<DRM::KDRMNoteBufferMaxSize> srcBuffer(
         iResourceReader->ReadResourceString( aResourceId ) );
-        
+
     StringLoader::Format( iTextBuffer, srcBuffer, -1, aString );
     return DoShowNoteL( aResourceId, aString );
     }
@@ -165,16 +165,16 @@
 // CDrmUtilityGlobalNoteWrapper::ShowNoteL
 // -----------------------------------------------------------------------------
 //
-TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowNoteL( 
-    TInt aResourceId, 
+TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowNoteL(
+    TInt aResourceId,
     const TDesC& aString,
-    TInt aValue, 
+    TInt aValue,
     TInt aStringPos,
     TInt aValuePos)
     {
-    TBuf<DRM::KDRMNoteBufferMaxSize> srcBuffer( 
+    TBuf<DRM::KDRMNoteBufferMaxSize> srcBuffer(
         iResourceReader->ReadResourceString( aResourceId ) );
-    
+
     StringLoader::Format( iTextBuffer, srcBuffer, aValuePos, aValue );
     srcBuffer = iTextBuffer;
     StringLoader::Format( iTextBuffer, srcBuffer, aStringPos, aString );
@@ -187,62 +187,62 @@
 //
 #ifdef RD_DRM_PREVIEW_RIGHT_FOR_AUDIO
 
-TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowPreviewListQueryL( 
+TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowPreviewListQueryL(
     TInt aResourceId )
     {
     TInt index( 0 );
     CAknGlobalListQuery* listQuery( CAknGlobalListQuery::NewLC() );
     HBufC* buffer( HBufC::NewLC( DRM::KDRMNoteBufferMaxSize ) );
     TPtr bufPtr( buffer->Des() );
-    
+
     bufPtr = iResourceReader->ReadResourceString( R_DRMUTILITY_ACTIVATE_PREVIEW );
     listQuery->SetHeadingL( bufPtr );
-    
+
     CDesCArray* listArray( new( ELeave ) CDesCArrayFlat( 2 ) );
     CleanupStack::PushL( listArray );
-    
+
     bufPtr = iResourceReader->ReadResourceString( R_DRMUTILITY_ACTIVATE );
     listArray->AppendL( bufPtr );
-    
+
     switch( aResourceId )
         {
         case R_DRMUTILITY_PREV_AUDIO_GET_LIST_QUERY:
-        
-            bufPtr = iResourceReader->ReadResourceString( 
+
+            bufPtr = iResourceReader->ReadResourceString(
                                             R_DRMUTILITY_GET_PREVIEW );
-            
-            
+
+
             break;
-            
+
         case R_DRMUTILITY_PREV_VIDEO_GET_LIST_QUERY:
-        
-            bufPtr = iResourceReader->ReadResourceString( 
+
+            bufPtr = iResourceReader->ReadResourceString(
                                             R_DRMUTILITY_GET_PREVIEW_VIDEO );
-            
+
             break;
-            
+
         case R_DRMUTILITY_PREV_AUDIO_PLAY_LIST_QUERY:
-        
-            bufPtr = iResourceReader->ReadResourceString( 
+
+            bufPtr = iResourceReader->ReadResourceString(
                                             R_DRMUTILITY_PLAY_PREVIEW );
-            
+
             break;
-            
+
         case R_DRMUTILITY_PREV_VIDEO_PLAY_LIST_QUERY:
-        
-            bufPtr = iResourceReader->ReadResourceString( 
+
+            bufPtr = iResourceReader->ReadResourceString(
                                             R_DRMUTILITY_PLAY_PREVIEW_VIDEO );
-            
+
             break;
-        
+
         default:
-        
+
             return 0;
 
         }
-    
+
     listArray->AppendL( bufPtr );
-    
+
     if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) &&
         DRM::CDrmUtilityInfoNoteWrapper::EvaluateCoverResourceId( aResourceId ) )
         {
@@ -250,39 +250,39 @@
         TUid myProcessUid( KNullUid );
         RThread().Process( myProcess );
         myProcessUid = myProcess.Identity();
-   
+
         TUtilitySDData utilityData;
         // First field is DrmUtility's Uid
         utilityData.iUtilityUid = KUidCoverUiCategoryDrmUtility;
         // ProcessId which uses DrmUtility
-        utilityData.iHandlerProcessId = myProcessUid; 
-        TUtilitySDDataPckg pckg( utilityData );                   
-        CAknSDData* sd( CAknSDData::NewL( KUidCoverUiCategoryDrmUtility, 
-                                          aResourceId, 
+        utilityData.iHandlerProcessId = myProcessUid;
+        TUtilitySDDataPckg pckg( utilityData );
+        CAknSDData* sd( CAknSDData::NewL( KUidCoverUiCategoryDrmUtility,
+                                          aResourceId,
                                           pckg ) );
-        
-        // ownership to notifier client                                   
+
+        // ownership to notifier client
         listQuery->SetSecondaryDisplayData( sd );
         }
-    
+
     iStatus = KRequestPending;
     listQuery->ShowListQueryL( listArray, iStatus );
     SetActive();
     iWait.Start();
-    
+
     CleanupStack::PopAndDestroy( 3, listQuery ); //listArray, buffer, listQuery
-    
+
     if ( iStatus.Int() != EAknSoftkeyNo )
         {
         index = iStatus.Int() + 1;
         }
-    
+
     return index;
     }
 
 #else
 
-TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowPreviewListQueryL( 
+TInt DRM::CDrmUtilityGlobalNoteWrapper::ShowPreviewListQueryL(
     TInt /*aResourceId*/ )
     {
     return 0;
@@ -311,22 +311,22 @@
 // CDrmUtilityGlobalNoteWrapper::DoShowNoteL
 // -----------------------------------------------------------------------------
 //
-TInt DRM::CDrmUtilityGlobalNoteWrapper::DoShowNoteL( 
-    TInt aResourceId, 
-    const TDesC& aString, 
+TInt DRM::CDrmUtilityGlobalNoteWrapper::DoShowNoteL(
+    TInt aResourceId,
+    const TDesC& aString,
     TInt aValue )
     {
     TPtr bufPtr( NULL, 0 );
-    TInt animation( iButtonsId == R_AVKON_SOFTKEYS_YES_NO__YES ? 
+    TInt animation( iButtonsId == R_AVKON_SOFTKEYS_YES_NO__YES ?
                                                     0 : R_QGN_NOTE_INFO_ANIM );
-    
+
     CAknGlobalConfirmationQuery* globalNote(
                                         CAknGlobalConfirmationQuery::NewLC() );
-         	
-    bufPtr.Set( const_cast <TUint16*>( iTextBuffer.Ptr() ), 
-                                       iTextBuffer.Length(), 
+
+    bufPtr.Set( const_cast <TUint16*>( iTextBuffer.Ptr() ),
+                                       iTextBuffer.Length(),
                                        iTextBuffer.Length() );
-    
+
     AknTextUtils::LanguageSpecificNumberConversion( bufPtr );
 
 
@@ -337,12 +337,12 @@
         TUid myProcessUid( KNullUid );
         RThread().Process( myProcess );
         myProcessUid = myProcess.Identity();
-   
+
         TUtilitySDData utilityData;
         // First field is DrmUtility's Uid
         utilityData.iUtilityUid = KUidCoverUiCategoryDrmUtility;
         // ProcessId which uses DrmUtility
-        utilityData.iHandlerProcessId = myProcessUid; 
+        utilityData.iHandlerProcessId = myProcessUid;
         if ( aString.Compare( KNullDesC ) )
             {
             // If there is filename given, it's always in the PrimaryString
@@ -354,27 +354,27 @@
             utilityData.iNumParam.AppendNum( aValue );
             }
 
-        TUtilitySDDataPckg pckg( utilityData );                   
-        CAknSDData* sd( CAknSDData::NewL( KUidCoverUiCategoryDrmUtility, 
-                                          aResourceId, 
+        TUtilitySDDataPckg pckg( utilityData );
+        CAknSDData* sd( CAknSDData::NewL( KUidCoverUiCategoryDrmUtility,
+                                          aResourceId,
                                           pckg ) );
-        
-        // ownership to notifier client                                   
+
+        // ownership to notifier client
         globalNote->SetSecondaryDisplayData( sd );
         }
 
     iStatus = KRequestPending;
-    globalNote->ShowConfirmationQueryL( iStatus, 
-                                        iTextBuffer, 
+    globalNote->ShowConfirmationQueryL( iStatus,
+                                        iTextBuffer,
                                         iButtonsId,
                                         animation );
-                                         
+
     SetActive();
     iWait.Start();
     CleanupStack::PopAndDestroy( globalNote );
     if ( iStatus.Int() != EAknSoftkeyNo )
         {
-        return iStatus.Int();    
+        return iStatus.Int();
         }
     else
         {
@@ -382,4 +382,4 @@
         }
     }
 
-//  End of File  
+//  End of File