commondrm/drmutility/src/drmutilityui.cpp
branchRCL_3
changeset 32 457cd4423b8c
parent 18 8a03a285ab14
child 71 1221b68b8a5f
--- a/commondrm/drmutility/src/drmutilityui.cpp	Tue Apr 27 16:56:11 2010 +0300
+++ b/commondrm/drmutility/src/drmutilityui.cpp	Tue May 11 16:28:38 2010 +0300
@@ -32,6 +32,7 @@
 #include <AknGlobalNote.h>
 #include <AknQueryDialog.h>
 #include <aknlistquerydialog.h>
+#include <aknmessagequerydialog.h> 
 
 // secondary display support
 #include <AknMediatorFacade.h>
@@ -231,6 +232,8 @@
     iNoteList.Close();
 
     FeatureManager::UnInitializeLib();
+    delete iNoteWrapper;	
+    	
     }
 
 // -----------------------------------------------------------------------------
@@ -769,6 +772,39 @@
 
 #endif  // RD_DRM_PREVIEW_RIGHT_FOR_AUDIO
 
+EXPORT_C TInt DRM::CDrmUtilityUI::DisplayMessageQueryL( TInt aMessage, TInt aHeader, const TDesC& aString)
+    {
+    TInt buttonCode = 0;
+		if ( iCoeEnv )
+	    	{
+		    CAknMessageQueryDialog* messageQuery = new (ELeave) CAknMessageQueryDialog();
+		    messageQuery->PrepareLC(R_DRMUTILITY_SYNC_DIALOG);
+		    		    
+		    HBufC* headerStringholder ( StringLoader::LoadLC( aHeader, iCoeEnv ) );
+        
+		    messageQuery->QueryHeading()->SetTextL(*headerStringholder);
+ 				CleanupStack::PopAndDestroy(); // headerStringholder
+ 				 				
+ 				HBufC* messageStringholder ( StringLoader::LoadLC( aMessage, aString, iCoeEnv ) );
+ 				
+ 				messageQuery->SetMessageTextL(*messageStringholder);
+ 				CleanupStack::PopAndDestroy(); // messageStringholder
+		    
+		    buttonCode =  messageQuery->RunLD();
+		    }
+		else
+		  	{
+		  	if(!iNoteWrapper)
+		  			{
+		    		iNoteWrapper = DRM::CDrmUtilityGlobalNoteWrapper::NewL( iUtilityStringResourceReader );
+        		}
+        		
+        iNoteWrapper->ShowMessageQueryL(aMessage, aHeader, aString);
+				}
+		return buttonCode;
+    }
+
+
 // -----------------------------------------------------------------------------
 // CDrmUtilityUI::CreateNoteForResourceL
 // -----------------------------------------------------------------------------