serviceproviders/sapi_applicationmanager/src/appmanagerinterface.cpp
branchRCL_3
changeset 46 5146369cfdc9
parent 23 50974a8b132e
equal deleted inserted replaced
45:a9c0808a1095 46:5146369cfdc9
    20 
    20 
    21 
    21 
    22 #include <liwcommon.h>
    22 #include <liwcommon.h>
    23 #include <liwbufferextension.h>
    23 #include <liwbufferextension.h>
    24 #include <utf.h>
    24 #include <utf.h>
    25 
    25 #include <BAUTILS.H>
    26 #include "appmanagerinterface.h"
    26 #include "appmanagerinterface.h"
    27 #include "appmanagerservice.h"
    27 #include "appmanagerservice.h"
    28 #include "appitemslist.h"
    28 #include "appitemslist.h"
    29 #include "appserviceobserver.h"
    29 #include "appserviceobserver.h"
    30 #include "serviceerrno.h"
    30 #include "serviceerrno.h"
    72 _LIT8(KResponse,"ReturnValue");
    72 _LIT8(KResponse,"ReturnValue");
    73 _LIT8(KErrorCode,"ErrorCode");
    73 _LIT8(KErrorCode,"ErrorCode");
    74 _LIT8(KTransactionID,"TransactionID");
    74 _LIT8(KTransactionID,"TransactionID");
    75 
    75 
    76 
    76 
       
    77 _LIT(KRtspPrefix,"rtsp://");
       
    78 _LIT(KTempFile, "c:\\system\\temp\\tempvideo.ram");
       
    79 _LIT(KTempPath, "c:\\system\\temp\\");
       
    80 _LIT8(KRamMime, "application/ram");
       
    81 
    77 
    82 
    78 // -----------------------------------------------------------------------------
    83 // -----------------------------------------------------------------------------
    79 // CAppManagerInterface::NewLC
    84 // CAppManagerInterface::NewLC
    80 // Returns the instance of CAppManagerInterface.
    85 // Returns the instance of CAppManagerInterface.
    81 // -----------------------------------------------------------------------------
    86 // -----------------------------------------------------------------------------
    94 // CAppManagerInterface::~CAppManagerInterface
    99 // CAppManagerInterface::~CAppManagerInterface
    95 // Destructor of class
   100 // Destructor of class
    96 // -----------------------------------------------------------------------------
   101 // -----------------------------------------------------------------------------
    97 CAppManagerInterface::~CAppManagerInterface()
   102 CAppManagerInterface::~CAppManagerInterface()
    98 	{
   103 	{
       
   104     RFs fs;
       
   105     User::LeaveIfError(fs.Connect());
       
   106     if( BaflUtils::FileExists(fs,KTempFile) )
       
   107         {
       
   108         BaflUtils::DeleteFile(fs,KTempFile);
       
   109         }
       
   110     fs.Close() ;
    99      //Release the instance of core class
   111      //Release the instance of core class
   100 	 delete iCoreClass;
   112 	 delete iCoreClass;
   101      iCoreClass = NULL;
   113      iCoreClass = NULL;
   102 	}
   114 	}
   103 
   115 
   978        HBufC8* heapBuffer = HBufC8::NewL( mimetype.Length() );
   990        HBufC8* heapBuffer = HBufC8::NewL( mimetype.Length() );
   979        CleanupStack::PushL( heapBuffer );
   991        CleanupStack::PushL( heapBuffer );
   980        TPtr8 mimetype8( heapBuffer->Des() );
   992        TPtr8 mimetype8( heapBuffer->Des() );
   981        mimetype8.Copy( mimetype );
   993        mimetype8.Copy( mimetype );
   982        TPtrC filename;
   994        TPtrC filename;
       
   995        // RTSP handling       
       
   996        if( ! document.iPath.Left(KRtspPrefix().Length()).CompareF(KRtspPrefix) )
       
   997            {
       
   998            RFs fs;
       
   999            User::LeaveIfError(fs.Connect());
       
  1000            RFile file;
       
  1001            fs.MkDir( KTempPath );
       
  1002            file.Replace( fs, KTempFile, EFileWrite | EFileStreamText );  
       
  1003            HBufC8 *tempPath = HBufC8::NewLC( document.iPath.Length() );
       
  1004            tempPath->Des().Copy( document.iPath );
       
  1005            file.Write( *tempPath );
       
  1006            document.iPath.Set( KTempFile );
       
  1007            file.Close();
       
  1008            fs.Close();
       
  1009            HBufC8 *tempMime;
       
  1010            tempMime = KRamMime().AllocLC();
       
  1011            mimetype8.Set( tempMime->Des() );
       
  1012            CleanupStack::PopAndDestroy( tempMime );
       
  1013            CleanupStack::PopAndDestroy( tempPath );
       
  1014            }
       
  1015       
   983 
  1016 
   984        if( aCallBack )
  1017        if( aCallBack )
   985             {
  1018             {
   986              //Asynch Call
  1019              //Asynch Call
   987              CAppServiceObserver* observer = CAppServiceObserver::NewL( aCallBack );
  1020              CAppServiceObserver* observer = CAppServiceObserver::NewL( aCallBack );