serviceproviders/sapi_messaging/messagingservice/src/messagingservice.cpp
changeset 22 fc9cf246af83
parent 19 989d2f495d90
child 33 50974a8b132e
equal deleted inserted replaced
19:989d2f495d90 22:fc9cf246af83
    18 
    18 
    19 #include <e32base.h>
    19 #include <e32base.h>
    20 #include <msvstd.h>
    20 #include <msvstd.h>
    21 #include <msvapi.h>
    21 #include <msvapi.h>
    22 #include <msvids.h>
    22 #include <msvids.h>
       
    23 #include <senduiconsts.h>
    23 
    24 
    24 #include "messageheader.h"
    25 #include "messageheader.h"
    25 #include "messagingservice.h"
    26 #include "messagingservice.h"
    26 #include "messagenotify.h"
    27 #include "messagenotify.h"
    27 #include "sendmessage.h"
    28 #include "sendmessage.h"
    94 
    95 
    95 	if ( aMessageParam->TemplateId() > 0 )
    96 	if ( aMessageParam->TemplateId() > 0 )
    96 		{
    97 		{
    97 		CMessageDetail* detailObj = NULL;
    98 		CMessageDetail* detailObj = NULL;
    98 		
    99 		
       
   100 		CMsvEntry * messageEntry = iMsgServerSession->GetEntryL( aMessageParam->TemplateId() );
       
   101 		
       
   102 	    CleanupStack::PushL(messageEntry);
       
   103 		
       
   104 	    if ( aMessageParam->MessageType() == KSenduiMtmSmsUid && 
       
   105 	            messageEntry->Entry().iMtm == KSenduiMtmMmsUid )
       
   106             {
       
   107             User::Leave( KErrNotSupported );
       
   108             }
       
   109 				
       
   110 	    CleanupStack::PopAndDestroy(messageEntry);
       
   111 		
    99 		detailObj = CMessageDetail::NewL( *iMsgServerSession );
   112 		detailObj = CMessageDetail::NewL( *iMsgServerSession );
   100 		
   113 		
   101 		CleanupStack::PushL( detailObj );
   114 		CleanupStack::PushL( detailObj );
   102 		
   115 		
   103 		detailObj->GetMessageDetailL( aMessageParam->TemplateId(), templateDetail );
   116 		detailObj->GetMessageDetailL( aMessageParam->TemplateId(), templateDetail );
   202 // Gives a sorted list of message Ids 
   215 // Gives a sorted list of message Ids 
   203 // ---------------------------------------------------------------------------
   216 // ---------------------------------------------------------------------------
   204 //
   217 //
   205 EXPORT_C void CMessagingService::GetIdListL( CFilterParamInfo* aFilterParams,
   218 EXPORT_C void CMessagingService::GetIdListL( CFilterParamInfo* aFilterParams,
   206 											TMsvId /*aFolderId*/,
   219 											TMsvId /*aFolderId*/,
   207 									        CMsgCallbackBase* 	/*aCallback*/,
   220 									        CMsgCallbackBase* 	aCallback,
   208 									        CMsvEntrySelection*& aEntrySelection )
   221 									        CMsvEntrySelection*& aEntrySelection )
   209 	{
   222 	{
   210 	// Hard coding for Inbox/Draft
   223 	// Hard coding for Inbox/Draft
   211 	// Folder Id can be passed as input parameter, to support access any folder
   224 	// Folder Id can be passed as input parameter, to support access any folder
   212 	TMsvId 	folderId = KFolderId;
   225 	TMsvId 	folderId = KFolderId;
   213 	
   226 	
   214 	CMessagingAccessFolder* obj = CMessagingAccessFolder::NewL( *iMsgServerSession );
   227 	CMessagingAccessFolder* obj = CMessagingAccessFolder::NewL( *iMsgServerSession );
   215 	
   228 	
   216 	CleanupStack::PushL( obj );
   229 	CleanupStack::PushL( obj );
   217 	
   230 	
       
   231 	obj->SetInputParamsL(aCallback,this);
       
   232 	
       
   233 	if ( aCallback )
       
   234 	{
       
   235 	AddAsyncObjL( aCallback->iTransactionId,obj);
       
   236 	}
       
   237 	
   218 	obj->GetIdListL( folderId, aFilterParams, aEntrySelection );
   238 	obj->GetIdListL( folderId, aFilterParams, aEntrySelection );
   219 	
   239 	
   220 	CleanupStack::PopAndDestroy( obj );
   240 	CleanupStack::Pop( obj );
       
   241 	
       
   242 	if ( !aCallback )
       
   243 	    delete obj;
   221 	}
   244 	}
   222 
   245 
   223 EXPORT_C void CMessagingService::GetNextHeaderL( CFilterParamInfo* aFilterParams,
   246 EXPORT_C void CMessagingService::GetNextHeaderL( CFilterParamInfo* aFilterParams,
   224 													CMsvEntrySelection* aEntrySelection,
   247 													CMsvEntrySelection* aEntrySelection,
   225 													TInt& aIndex, 
   248 													TInt& aIndex,