appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandlerbase.cpp
changeset 52 92f864ef0288
parent 42 d17dc5398051
child 55 ac7f90a6ff4c
child 60 245df5276b97
--- a/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandlerbase.cpp	Fri Jun 11 13:45:18 2010 +0300
+++ b/appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginuihandlerbase.cpp	Wed Jun 23 18:20:02 2010 +0300
@@ -17,6 +17,7 @@
 
 #include "sisxsifpluginuihandlerbase.h"     // CSisxSifPluginUiHandlerBase
 #include "sisxsifplugininstallparams.h"     // CSisxSifPluginInstallParams
+#include "sisxsifpluginerrorhandler.h"      // CSisxSifPluginErrorHandler
 #include "sisxsifcleanuputils.h"            // CleanupResetAndDestroyPushL
 
 using namespace Usif;
@@ -28,7 +29,9 @@
 // CSisxSifPluginUiHandlerBase::CSisxSifPluginUiHandlerBase()
 // ---------------------------------------------------------------------------
 //
-CSisxSifPluginUiHandlerBase::CSisxSifPluginUiHandlerBase( RFs& aFs ) : iFs( aFs )
+CSisxSifPluginUiHandlerBase::CSisxSifPluginUiHandlerBase( RFs& aFs,
+        CSisxSifPluginErrorHandler& aErrorHandler ) : iFs( aFs ),
+        iErrorHandler( aErrorHandler )
     {
     }
 
@@ -136,13 +139,102 @@
 // CSisxSifPluginUiHandlerBase::PublishCompletionL()
 // ---------------------------------------------------------------------------
 //
-void CSisxSifPluginUiHandlerBase::PublishCompletionL( TErrorCategory aErrorCategory,
-        TInt aErrorCode, const TDesC& aErrorMessage, const TDesC& aErrorDetails )
+void CSisxSifPluginUiHandlerBase::PublishCompletionL( const CSisxSifPluginErrorHandler& aError )
     {
     User::LeaveIfNull( iPublishSifOperationInfo );
     CSifOperationEndData* data = CSifOperationEndData::NewLC( *iGlobalComponentId,
-            aErrorCategory, aErrorCode, aErrorMessage, aErrorDetails );
+            aError.ErrorCategory(), aError.ErrorCode(), aError.ErrorMessage(),
+            aError.ErrorMessageDetails() );
     iPublishSifOperationInfo->PublishCompletionL( *data );
     CleanupStack::PopAndDestroy( data );
     }
 
+// ---------------------------------------------------------------------------
+// CSisxSifPluginUiHandlerBase::SetDisplayErrorL()
+// ---------------------------------------------------------------------------
+//
+void CSisxSifPluginUiHandlerBase::SetDisplayErrorL( Swi::TErrorDialog aType, const TDesC& aParam )
+    {
+    iErrorHandler.SetExtendedErrorCode( aType );
+
+    // TODO: localised detailed error messages
+    TBuf<512> details;
+    switch( aType )
+        {
+        case Swi::EUiAlreadyInRom:
+            details.Copy(_L("EUiAlreadyInRom"));
+            break;
+        case Swi::EUiMissingDependency:
+            details.Copy(_L("EUiMissingDependency"));
+            break;
+        case Swi::EUiRequireVer:
+            details.Copy(_L("EUiRequireVer"));
+            break;
+        case Swi::EUiRequireVerOrGreater:
+            details.Copy(_L("EUiRequireVerOrGreater"));
+            break;
+        case Swi::EUiFileCorrupt:
+            details.Copy(_L("EUiFileCorrupt"));
+            break;
+        case Swi::EUiDiskNotPresent:
+            details.Copy(_L("EUiDiskNotPresent"));
+            break;
+        case Swi::EUiCannotRead:
+            details.Copy(_L("EUiCannotRead"));
+            break;
+        case Swi::EUiCannotDelete:
+            details.Copy(_L("EUiCannotDelete"));
+            break;
+        case Swi::EUiInvalidFileName:
+            details.Copy(_L("EUiInvalidFileName"));
+            break;
+        case Swi::EUiFileNotFound:
+            details.Copy(_L("EUiFileNotFound"));
+            break;
+        case Swi::EUiInsufficientSpaceOnDrive:
+            details.Copy(_L("EUiInsufficientSpaceOnDrive"));
+            break;
+        case Swi::EUiCapabilitiesCannotBeGranted:
+            details.Copy(_L("EUiCapabilitiesCannotBeGranted"));
+            break;
+        case Swi::EUiUnknownFile:
+            details.Copy(_L("EUiUnknownFile"));
+            break;
+        case Swi::EUiMissingBasePackage:
+            details.Copy(_L("EUiMissingBasePackage"));
+            break;
+        case Swi::EUiConstraintsExceeded:
+            details.Copy(_L("EUiConstraintsExceeded"));
+            break;
+        case Swi::EUiSIDViolation:
+            details.Copy(_L("EUiSIDViolation"));
+            break;
+        case Swi::EUiVIDViolation:
+            details.Copy(_L("EUiVIDViolation"));
+            break;
+        case Swi::EUiNoMemoryInDrive:
+            details.Copy(_L("EUiNoMemoryInDrive"));
+            break;
+        case Swi::EUiUIDPackageViolation:
+            details.Copy(_L("EUiUIDPackageViolation"));
+            break;
+        case Swi::EUiOSExeViolation:
+            details.Copy(_L("EUiOSExeViolation"));
+            break;
+        case Swi::EUiSIDMismatch:
+            details.Copy(_L("EUiSIDMismatch"));
+            break;
+        case Swi::EUiBlockingEclipsingFile:
+            details.Copy(_L("EUiBlockingEclipsingFile"));
+            break;
+        default:
+            break;
+        }
+
+    if( aParam.Length() )
+        {
+        details.Append( _L("\n") );
+        details.Append( aParam );
+        }
+    }
+