mmsengine/mmscodecclient/src/mmscodecclient.cpp
branchRCL_3
changeset 60 7fdbb852d323
parent 57 ebe688cedc25
equal deleted inserted replaced
57:ebe688cedc25 60:7fdbb852d323
   220 //
   220 //
   221 EXPORT_C TInt CMmsCodecClient::DeleteMM(
   221 EXPORT_C TInt CMmsCodecClient::DeleteMM(
   222     TMsvId aMmId )
   222     TMsvId aMmId )
   223     {
   223     {
   224     //Let's first make sure that the client is not illegally trashing the 
   224     //Let's first make sure that the client is not illegally trashing the 
   225     //message store with empty entries. Only the AddMML -function is allowed to 
   225     //message store with empty entrys. Only the AddMML -function is allowed to 
   226     //be called after the new entry has been created.
   226     //be called after the new entry has been created.
   227     ResetChunkedMode();
   227     ResetChunkedMode();
   228     
   228     
   229     if ( iState == EEntryCreated ) 
   229     if ( iState == EEntryCreated ) 
   230         {
   230         {
   252     {
   252     {
   253     iClientStatus = &aStatus;
   253     iClientStatus = &aStatus;
   254     
   254     
   255     ResetChunkedMode();
   255     ResetChunkedMode();
   256     //Let's first make sure that the client is not illegally trashing the 
   256     //Let's first make sure that the client is not illegally trashing the 
   257     //message store with empty entries. Only the AddMM -function is allowed to 
   257     //message store with empty entrys. Only the AddMM -function is allowed to 
   258     //be called after the new entry has been created.
   258     //be called after the new entry has been created.
   259     if ( iState == EEntryCreated ) 
   259     if ( iState == EEntryCreated ) 
   260         {
   260         {
   261         // delete entry
   261         // delete entry
   262         DeleteCurrentEntryL();
   262         DeleteCurrentEntryL();
   318     TRequestStatus& aStatus )
   318     TRequestStatus& aStatus )
   319     {
   319     {
   320     iClientStatus = &aStatus;
   320     iClientStatus = &aStatus;
   321     ResetChunkedMode();
   321     ResetChunkedMode();
   322     //Let's first make sure that the client is not illegally trashing the 
   322     //Let's first make sure that the client is not illegally trashing the 
   323     //message store with empty entries. Only the AddMM -function is allowed to 
   323     //message store with empty entrys. Only the AddMM -function is allowed to 
   324     //be called after the new entry has been created.
   324     //be called after the new entry has been created.
   325     if ( iState == EEntryCreated ) 
   325     if ( iState == EEntryCreated ) 
   326         {
   326         {
   327         // delete entry
   327         // delete entry
   328         DeleteCurrentEntryL();   
   328         DeleteCurrentEntryL();   
   354     TRequestStatus& aStatus )
   354     TRequestStatus& aStatus )
   355     {
   355     {
   356     iClientStatus = &aStatus;
   356     iClientStatus = &aStatus;
   357     ResetChunkedMode();
   357     ResetChunkedMode();
   358     //Let's first make sure that the client is not illegally trashing the 
   358     //Let's first make sure that the client is not illegally trashing the 
   359     //message store with empty entries. Only the AddMM -function is allowed to 
   359     //message store with empty entrys. Only the AddMM -function is allowed to 
   360     //be called after the new entry has been created.
   360     //be called after the new entry has been created.
   361     if ( iState == EEntryCreated ) 
   361     if ( iState == EEntryCreated ) 
   362         {
   362         {
   363         // delete entry
   363         // delete entry
   364         DeleteCurrentEntryL();   
   364         DeleteCurrentEntryL();   
   441                                TRequestStatus& aStatus )
   441                                TRequestStatus& aStatus )
   442     {
   442     {
   443     iClientStatus = &aStatus;
   443     iClientStatus = &aStatus;
   444     ResetChunkedMode();
   444     ResetChunkedMode();
   445     //Let's first make sure that the client is not illegally trashing the 
   445     //Let's first make sure that the client is not illegally trashing the 
   446     //message store with empty entries. Only the AddMM -function is allowed to 
   446     //message store with empty entrys. Only the AddMM -function is allowed to 
   447     //be called after the new entry has been created.
   447     //be called after the new entry has been created.
   448     if ( iState == EEntryCreated ) 
   448     if ( iState == EEntryCreated ) 
   449         {
   449         {
   450         // delete entry
   450         // delete entry
   451         DeleteCurrentEntryL();
   451         DeleteCurrentEntryL();
   523     TBool aUnread )
   523     TBool aUnread )
   524     {
   524     {
   525     TInt error( KErrNone );
   525     TInt error( KErrNone );
   526     ResetChunkedMode();
   526     ResetChunkedMode();
   527     //Let's first make sure that the client is not illegally trashing the 
   527     //Let's first make sure that the client is not illegally trashing the 
   528     //message store with empty entries. Only the AddMM -function is allowed to 
   528     //message store with empty entrys. Only the AddMM -function is allowed to 
   529     //be called after the new entry has been created.
   529     //be called after the new entry has been created.
   530     if ( iState == EEntryCreated ) 
   530     if ( iState == EEntryCreated ) 
   531         {
   531         {
   532         // delete entry, not allowed to leave
   532         // delete entry, not allowed to leave
   533         if ( iEntryBeingHandled != KMsvNullIndexEntryId )
   533         if ( iEntryBeingHandled != KMsvNullIndexEntryId )
   704     // set our entry to point to the newly created entry
   704     // set our entry to point to the newly created entry
   705     // to get data content to it.
   705     // to get data content to it.
   706 
   706 
   707     ResetChunkedMode();
   707     ResetChunkedMode();
   708     //Let's first make sure that the client is not illegally trashing the 
   708     //Let's first make sure that the client is not illegally trashing the 
   709     //message store with empty entries. Only the AddMM -function is allowed to be called
   709     //message store with empty entrys. Only the AddMM -function is allowed to be called
   710     //after the new entry has been created.
   710     //after the new entry has been created.
   711     if ( iState == EEntryCreated ) 
   711     if ( iState == EEntryCreated ) 
   712         {
   712         {
   713         // delete entry
   713         // delete entry
   714         DeleteCurrentEntryL();
   714         DeleteCurrentEntryL();
   839     TPtr aliasPtr = alias->Des();
   839     TPtr aliasPtr = alias->Des();
   840     const CDesCArray& addresses = iMmsHeaders->ToRecipients();
   840     const CDesCArray& addresses = iMmsHeaders->ToRecipients();
   841     TInt addrCnt = addresses.Count();
   841     TInt addrCnt = addresses.Count();
   842 
   842 
   843     TPtrC stringToAdd;
   843     TPtrC stringToAdd;
   844     for ( TInt i = 0; i < addrCnt; ++i)
   844     for ( TInt i = 0; i < addrCnt; i++)
   845         {      
   845         {      
   846         TPtrC address = TMmsGenUtils::PureAddress( addresses[i] );
   846         TPtrC address = TMmsGenUtils::PureAddress( addresses[i] );
   847 
   847 
   848         //GetAlias guarantees that the alias length is KMaxDetailsLength at max
   848         //GetAlias guarantees that the alias length is KMaxDetailsLength at max
   849         TMmsGenUtils::GetAlias(
   849         TMmsGenUtils::GetAlias(
   889                 }
   889                 }
   890 
   890 
   891             if ( charsToAdd >= stringToAdd.Length() )
   891             if ( charsToAdd >= stringToAdd.Length() )
   892                 {
   892                 {
   893                 //Guarantee that charsToAdd is not larger that stringToAdd 
   893                 //Guarantee that charsToAdd is not larger that stringToAdd 
   894                 //length
   894                 //lenght 
   895                 charsToAdd = stringToAdd.Length();
   895                 charsToAdd = stringToAdd.Length();
   896                 }
   896                 }
   897 
   897 
   898             aDetails.Append( stringToAdd.Left( charsToAdd ) );
   898             aDetails.Append( stringToAdd.Left( charsToAdd ) );
   899             break;
   899             break;
  1227     TBool aUnread )
  1227     TBool aUnread )
  1228     {
  1228     {
  1229     
  1229     
  1230     ResetChunkedMode();
  1230     ResetChunkedMode();
  1231     //Let's first make sure that the client is not illegally trashing the 
  1231     //Let's first make sure that the client is not illegally trashing the 
  1232     //message store with empty entries. Only the AddMM -function is allowed to 
  1232     //message store with empty entrys. Only the AddMM -function is allowed to 
  1233     //be called after the new entry has been created.
  1233     //be called after the new entry has been created.
  1234     if ( iState == EEntryCreated ) 
  1234     if ( iState == EEntryCreated ) 
  1235         {
  1235         {
  1236         // delete entry
  1236         // delete entry
  1237         DeleteCurrentEntryL();   
  1237         DeleteCurrentEntryL();