Msrp/MsrpClient/src/CMSRPSession.cpp
branchMSRP_FrameWork
changeset 58 cdb720e67852
parent 25 505ad3f0ce5c
--- a/Msrp/MsrpClient/src/CMSRPSession.cpp	Sat Jun 12 14:30:11 2010 +0530
+++ b/Msrp/MsrpClient/src/CMSRPSession.cpp	Thu Nov 25 13:59:42 2010 +0200
@@ -17,68 +17,92 @@
 // System Includes
 #include <e32base.h>
 
-
 //  Include Files
 #include "CMSRPSession.h"
 #include "CMSRPSessionImplementation.h"
 
-
-//  Member Functions
-
-CMSRPSession* CMSRPSession::NewL( RMSRP& aRMSRP,
-                                           MMSRPSessionObserver& aObserver,
-                                           const TUint aIapId )
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
+CMSRPSession* CMSRPSession::NewL( 
+    RMSRP& aRMSRP,
+    MMSRPSessionObserver& aObserver,
+    const TUint aIapId,
+    const TDesC8& aSessionId )
 	{
 	MSRPLOG("CMSRP Session.. NewL");
-	CMSRPSession* self = CMSRPSession::NewLC( aRMSRP, aObserver, aIapId );
+	CMSRPSession* self = CMSRPSession::NewLC( aRMSRP, aObserver, aIapId, aSessionId );
 	CleanupStack::Pop(self);
 	return self;
 	}
 
-
-CMSRPSession* CMSRPSession::NewLC( RMSRP& aRMSRP,
-                                            MMSRPSessionObserver& aObserver,
-                                            const TUint aIapId )
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
+CMSRPSession* CMSRPSession::NewLC( 
+    RMSRP& aRMSRP,
+    MMSRPSessionObserver& aObserver,
+    const TUint aIapId,
+    const TDesC8& aSessionId )
     {
     MSRPLOG("CMSRP Session.. NewLC");
     CMSRPSession* self = new (ELeave) CMSRPSession;
     CleanupStack::PushL(self);
-    self->ConstructL( aRMSRP, aObserver, aIapId );
+    self->ConstructL( aRMSRP, aObserver, aIapId, aSessionId );
     return self;
     }
 
-
-void CMSRPSession::ConstructL( RMSRP& aRMSRP,
-                               MMSRPSessionObserver& aObserver,
-                               const TUint aIapId )
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
+void CMSRPSession::ConstructL( 
+    RMSRP& aRMSRP,
+    MMSRPSessionObserver& aObserver,
+    const TUint aIapId,
+    const TDesC8& aSessionId )
 	{
 	MSRPLOG("CMSRP Session.. ConstructL");
-	iMSRPSessionImpl = CMSRPSessionImplementation::NewL( aRMSRP, aObserver, aIapId );	 
+	iMSRPSessionImpl = CMSRPSessionImplementation::NewL( aRMSRP, aObserver, aIapId, aSessionId );	 
 	}
 
-
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
 CMSRPSession::~CMSRPSession()
 	{
-	MSRPLOG("CMSRP Session.. Dtor");
-	if(NULL != iMSRPSessionImpl)
-		delete iMSRPSessionImpl;
+	MSRPLOG("-> CMSRPSession::~CMSRPSession()");
+	delete iMSRPSessionImpl;
+    MSRPLOG("<- CMSRPSession::~CMSRPSession()");
 	}
 
-
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
 EXPORT_C TDesC8& CMSRPSession::LocalMSRPPath()
     {
     MSRPLOG("CMSRP Session.. LocalMSRPPath");
     return iMSRPSessionImpl->LocalMSRPPath();
     }
 
-
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
 EXPORT_C void CMSRPSession::SetSessionParams( CMSRPSessionParams& aSessionParams )
     {
     MSRPLOG("CMSRP Session.. SetSessionParams");
     iMSRPSessionImpl->SetSessionParams( aSessionParams );
     }
 
-    
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
 EXPORT_C TInt CMSRPSession::Connect( const TDesC8& aRemoteMsrpPath )
 	{
 	MSRPLOG("CMSRP Session.. Connect");
@@ -86,7 +110,10 @@
 	return err;
 	}
 
-
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
 EXPORT_C TInt CMSRPSession::Listen( const TDesC8& aRemoteMsrpPath )
 	{
 	MSRPLOG("CMSRP Session.. Listen");
@@ -94,7 +121,10 @@
 	return err;
 	}
 
-
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
 EXPORT_C HBufC8* CMSRPSession::SendBuffer(
     const TDesC8& aMessage,
     const TDesC8& aMimeType )
@@ -105,50 +135,54 @@
     TRAPD( err, messageId = iMSRPSessionImpl->SendBufferL( aMessage, aMimeType ) );
     if ( err )
         {
-        return NULL;
+        messageId = NULL;
         }
     return messageId;
     }
 
-EXPORT_C TInt CMSRPSession::SendFile(
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C HBufC8* CMSRPSession::SendFile(
     const TFileName& aFileName,
     const TDesC8& aMimeType )
     {
    
     MSRPLOG("CMSRP Session.. SendFile");
-    TRAPD( err,iMSRPSessionImpl->SendFileL(aFileName, aMimeType ) );
-    return err;
-    
+    HBufC8* messageId = NULL;
+    TRAPD( err, messageId = iMSRPSessionImpl->SendFileL(aFileName, aMimeType ) );
+    if ( err )
+        {
+        messageId = NULL;
+        }
+    return messageId;
     }
 
-EXPORT_C TInt CMSRPSession::CancelFileSending( )
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt CMSRPSession::CancelReceiving( TDesC8& aMessageId )
     {
-    MSRPLOG("CMSRP Session.. CancelFileSending");
-/*    TInt err;
-    return err;*/
-    return 0;
-    }
-
-EXPORT_C TInt CMSRPSession::ReceiveFile(
-        const TFileName& aFileName,
-        const TInt aFileSize,
-        const TDesC8& aMimeType)
-    {
-    MSRPLOG("CMSRP Session.. ReceiveFile");
-    TRAPD( err,iMSRPSessionImpl->ReceiveFileL(aFileName,aFileSize,aMimeType ));
+    MSRPLOG("-> CMSRPSession::CancelReceiveFile");
+    TRAPD( err, iMSRPSessionImpl->CancelReceivingL( aMessageId ) );
     return err;
     }
 
-EXPORT_C TInt CMSRPSession::CancelReceiveFile()
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMSRPSession::NotifyProgress(TBool aFlag)
     {
-    return 0;
+    iMSRPSessionImpl->NotifyProgress( aFlag );
     }
 
-EXPORT_C void CMSRPSession::NotifyProgress(TBool aFlag)
-    {
-    iMSRPSessionImpl->NotifyProgress(aFlag);
-    }
-
+// -----------------------------------------------------------------------------
+// CMSRPSession::NewL
+// -----------------------------------------------------------------------------
+//
 EXPORT_C TInt CMSRPSession::CancelSending( TDesC8& aMessageId )
     {
     MSRPLOG("CMSRP Session.. CancelSending");
@@ -156,3 +190,4 @@
     return err;
     }
 
+// End of File