browserutilities/browserdialogsprovider/Src/BrowserDialogsProvider.cpp
changeset 36 0ed94ceaa377
parent 27 60c5402cb945
child 37 cb62a4f66ebe
equal deleted inserted replaced
32:9a9a761f03f1 36:0ed94ceaa377
    17 
    17 
    18 
    18 
    19 // INCLUDE Files
    19 // INCLUDE Files
    20 
    20 
    21 // User includes
    21 // User includes
    22 #include "BrowserDialogsProvider.h"	// Class header
    22 #include "browserdialogsprovider.h"	// Class header
    23 #include "BrowserDialogsProvider.hrh"
    23 #include "BrowserDialogsProvider.hrh"
    24 #include "BrowserAuthenticationDialog.h"
    24 #include "BrowserAuthenticationDialog.h"
    25 #include "BrowserDialogsProviderConstants.h"
    25 #include "BrowserDialogsProviderConstants.h"
    26 #include "BrowserDialogsProviderObserver.h" //obs
    26 #include "browserdialogsproviderobserver.h" //obs
    27 
    27 
    28 // Browser as a Plugin - own classes
    28 // Browser as a Plugin - own classes
    29 #include "BrowserViewImagesPopup.h"		// For DialogDisplayPageImagesL
    29 #include "BrowserViewImagesPopup.h"		// For DialogDisplayPageImagesL
    30 #include "BrowserScriptPromptDialog.h"	// For DialogPromptLC
    30 #include "BrowserScriptPromptDialog.h"	// For DialogPromptLC
    31 #include "BrowserSelectElementDlg.h"	// For DialogFileSelectLC
    31 #include "BrowserSelectElementDlg.h"	// For DialogFileSelectLC
    59 // Resources
    59 // Resources
    60 #include <coneresloader.h>
    60 #include <coneresloader.h>
    61 #include <BrowserDialogsProvider.rsg>
    61 #include <BrowserDialogsProvider.rsg>
    62 
    62 
    63 // Data Caging
    63 // Data Caging
    64 #include <data_caging_path_literals.hrh>    
    64 #include <data_caging_path_literals.hrh>
    65 
    65 
    66 // CONSTANTS
    66 // CONSTANTS
    67 const TInt KBrCtlObjectElementMaxLength = 50;
    67 const TInt KBrCtlObjectElementMaxLength = 50;
    68 const TInt KBrCtlMBFormat = 4;
    68 const TInt KBrCtlMBFormat = 4;
    69 const TInt KBrCtlGBFormat = 10;
    69 const TInt KBrCtlGBFormat = 10;
    70 const TInt KBrCtlMegabyte = 1000;	// although 1MB=1024 kB, treat as 1000kb for user simplicity
    70 const TInt KBrCtlMegabyte = 1000;	// although 1MB=1024 kB, treat as 1000kb for user simplicity
       
    71 const TInt KBrowserFileNotFound  = -26003; // Defined in ErrorDefs.h but not exported so define here
    71 
    72 
    72 // DLL resource file name with path
    73 // DLL resource file name with path
    73 _LIT( KBrowserDialogsProviderDirAndFile, "z:BrowserDialogsProvider.rsc" );// resource
    74 _LIT( KBrowserDialogsProviderDirAndFile, "z:BrowserDialogsProvider.rsc" );// resource
    74 
    75 
    75 //Mime Types
    76 //Mime Types
   163             DialogNoteL( msg );
   164             DialogNoteL( msg );
   164             break;
   165             break;
   165             }
   166             }
   166         default:
   167         default:
   167             {
   168             {
   168             // Handle all others as system error dialog
   169             // change error code to browser error code, when trying to open file
   169             CCoeEnv::Static()->HandleError( aErrCode );
   170             // that doesn't exist
       
   171             if ( KErrNotFound == aErrCode )
       
   172             	{
       
   173             	iCoeEnv.HandleError( KBrowserFileNotFound );
       
   174             	}
       
   175             else
       
   176             	{
       
   177 				// Handle all others as system error dialog
       
   178             	iCoeEnv.HandleError( aErrCode );
       
   179             	}
   170         	break;
   180         	break;
   171             }
   181             }
   172         }   // end of switch
   182         }   // end of switch
   173 	
   183 	
   174    CleanupStack::PopAndDestroy(); //textresolver
   184    CleanupStack::PopAndDestroy(); //textresolver