emailservices/emailstore/base_plugin/src/baseplugintranslator.cpp
branchRCL_3
changeset 25 3533d4323edc
parent 24 d189ee25cf9d
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 
    19 
    20 #include "BasePlugin.h"
    20 #include "baseplugin.h"
    21 #include "baseplugincommonutils.h"
    21 #include "baseplugincommonutils.h"
    22 #include "CFSMailCommon.h"
    22 #include "cfsmailcommon.h"
    23 
    23 
    24 
    24 
    25 static void TranslateMsgStoreAttendeeL(
    25 static void TranslateMsgStoreAttendeeL(
    26     CMsgStorePropertyContainer& aSrc,
    26     CMsgStorePropertyContainer& aSrc,
    27     TUint aIdx,
    27     TUint aIdx,
    91 
    91 
    92 
    92 
    93 /**
    93 /**
    94  *
    94  *
    95  */
    95  */
    96 void CBasePlugin::TranslateMsgStorePropsL(
    96 EXPORT_C void CBasePlugin::TranslateMsgStorePropsL(
    97     const TFSMailMsgId& aMailBoxId,
    97     const TFSMailMsgId& aMailBoxId,
    98     CMsgStorePropertyContainer& aMessage,
    98     CMsgStorePropertyContainer& aMessage,
    99     CFSMailMessagePart& aFsMsg,
    99     CFSMailMessagePart& aFsMsg,
   100     const TFSMailDetails aDetails )
   100     const TFSMailDetails aDetails )
   101 
   101 
   316  * Common msgstore meeting request fields translation to Freestyle.
   316  * Common msgstore meeting request fields translation to Freestyle.
   317  *
   317  *
   318  * @param aMessage
   318  * @param aMessage
   319  * @param aFsMsg
   319  * @param aFsMsg
   320  */
   320  */
   321 void CBasePlugin::TranslateMsgStoreMrL(
   321 EXPORT_C void CBasePlugin::TranslateMsgStoreMrL(
   322     const TFSMailMsgId& aMailBoxId,
   322     const TFSMailMsgId& aMailBoxId,
   323     CMsgStorePropertyContainer& aMessage,
   323     CMsgStorePropertyContainer& aMessage,
   324     CMsgStorePropertyContainer& aCalendar,
   324     CMsgStorePropertyContainer& aCalendar,
   325     CFSMailMessagePart& aFsMsg )
   325     CFSMailMessagePart& aFsMsg )
   326     
   326     
   611         CleanupClosePushL( days );
   611         CleanupClosePushL( days );
   612         
   612         
   613         if ( aCalendar.FindProperty( KMsgStorePropertyMrMonthDay, idx ) )
   613         if ( aCalendar.FindProperty( KMsgStorePropertyMrMonthDay, idx ) )
   614             {
   614             {
   615             TUint32 monthDayNo = aCalendar.PropertyValueUint32L( idx );
   615             TUint32 monthDayNo = aCalendar.PropertyValueUint32L( idx );
   616             days.AppendL(monthDayNo);
   616             days.Append(monthDayNo);
   617             /**@ double check that when testing starts.*/
   617             /**@ double check that when testing starts.*/
   618             }
   618             }
   619             
   619             
   620         recurrenceRule->SetRecurrentMonthDaysL( days );
   620         recurrenceRule->SetRecurrentMonthDaysL( days );
   621         
   621         
   712 
   712 
   713 
   713 
   714 /**
   714 /**
   715  *
   715  *
   716  */
   716  */
   717 void CBasePlugin::TranslateEmailFwMessageL(
   717 EXPORT_C void CBasePlugin::TranslateEmailFwMessageL(
   718     CFSMailMessagePart& aSrc,
   718     CFSMailMessagePart& aSrc,
   719     CMsgStoreMessagePart& aDst,
   719     CMsgStoreMessagePart& aDst,
   720     TBool aInInbox )
   720     TBool aInInbox )
   721 
   721 
   722     {
   722     {
   774 	    aDst.AddOrUpdatePropertyL( KMsgStorePropertyReceivedAt, sentTime );
   774 	    aDst.AddOrUpdatePropertyL( KMsgStorePropertyReceivedAt, sentTime );
   775 	    aSrc.SetDate( sentTime );
   775 	    aSrc.SetDate( sentTime );
   776     	}
   776     	}
   777     
   777     
   778     //to recipients.
   778     //to recipients.
   779 //<qmail> Return by val (as in earlier Cmail version)
   779     RPointerArray<CFSMailAddress>& toRecipients = aSrc.GetToRecipients();
   780     RPointerArray<CFSMailAddress> toRecipients = aSrc.GetToRecipients();
       
   781     TranslateEmailFwRecipientsL( aDst, KMsgStorePropertyTo, toRecipients );
   780     TranslateEmailFwRecipientsL( aDst, KMsgStorePropertyTo, toRecipients );
   782 
   781 
   783     //cc recipients.
   782     //cc recipients.
   784     RPointerArray<CFSMailAddress> ccRecipients = aSrc.GetCCRecipients();
   783     RPointerArray<CFSMailAddress>& ccRecipients = aSrc.GetCCRecipients();
   785     TranslateEmailFwRecipientsL( aDst, KMsgStorePropertyCc, ccRecipients );
   784     TranslateEmailFwRecipientsL( aDst, KMsgStorePropertyCc, ccRecipients );
   786 
   785 
   787     //bcc recipients.
   786     //bcc recipients.
   788     RPointerArray<CFSMailAddress> bccRecipients = aSrc.GetBCCRecipients();
   787     RPointerArray<CFSMailAddress>& bccRecipients = aSrc.GetBCCRecipients();
   789     TranslateEmailFwRecipientsL( aDst, KMsgStorePropertyBcc, bccRecipients );
   788     TranslateEmailFwRecipientsL( aDst, KMsgStorePropertyBcc, bccRecipients );
   790 //</qmail>
       
   791 
   789 
   792     //flags.
   790     //flags.
   793     //the cast is important otherwise the TBool overload gets called.
   791     //the cast is important otherwise the TBool overload gets called.
   794     TUint32 flag = static_cast<TUint32>( aSrc.GetFlags() );
   792     TUint32 flag = static_cast<TUint32>( aSrc.GetFlags() );
   795     aDst.AddOrUpdatePropertyL(
   793     aDst.AddOrUpdatePropertyL(
   869 
   867 
   870 
   868 
   871 /**
   869 /**
   872  *
   870  *
   873  */
   871  */
   874 void CBasePlugin::TranslateEmailFwMrL(
   872 EXPORT_C void CBasePlugin::TranslateEmailFwMrL(
   875     MMRInfoObject& aSrc,
   873     MMRInfoObject& aSrc,
   876     CMsgStorePropertyContainer& aDst )
   874     CMsgStorePropertyContainer& aDst )
   877 
   875 
   878     {
   876     {
   879     __LOG_ENTER( "TranslateEmailFwMrL" )
   877     __LOG_ENTER( "TranslateEmailFwMrL" )
  1116  * step is supplied via the day of week ftor. See CDayOfWeekFtor for further
  1114  * step is supplied via the day of week ftor. See CDayOfWeekFtor for further
  1117  * information. Although not strictly necessary this avoids duplicating all the if's
  1115  * information. Although not strictly necessary this avoids duplicating all the if's
  1118  * when dealing with rule translation.
  1116  * when dealing with rule translation.
  1119  *
  1117  *
  1120  * @param aDayOfWeekMask day of week mask in the MsgStore format, see
  1118  * @param aDayOfWeekMask day of week mask in the MsgStore format, see
  1121  * MsgStorePropertyKeys.h for information.
  1119  * msgstorepropertykeys.h for information.
  1122  * @param aFtor translation ftor.
  1120  * @param aFtor translation ftor.
  1123  */
  1121  */
  1124 void CBasePlugin::TranslateMsgStoreDayOfWeek(
  1122 void CBasePlugin::TranslateMsgStoreDayOfWeek(
  1125     TUint32 aDayOfWeekMask,
  1123     TUint32 aDayOfWeekMask,
  1126     TDayOfWeekFtor& aFtor )
  1124     TDayOfWeekFtor& aFtor )
  1225 
  1223 
  1226 
  1224 
  1227 /**
  1225 /**
  1228  *
  1226  *
  1229  */
  1227  */
  1230 void CBasePlugin::TranslateEmailFwAttendeeL(
  1228 EXPORT_C void CBasePlugin::TranslateEmailFwAttendeeL(
  1231     MMROrganizer& aSrc,
  1229     MMROrganizer& aSrc,
  1232     RMsgStoreAddress& aDst )
  1230     RMsgStoreAddress& aDst )
  1233 
  1231 
  1234     {
  1232     {
  1235     const TDesC& address = aSrc.Address();
  1233     const TDesC& address = aSrc.Address();
  1247 
  1245 
  1248 
  1246 
  1249 /**
  1247 /**
  1250  *
  1248  *
  1251  */
  1249  */
  1252 void CBasePlugin::RemoveAllPropertiesL(
  1250 EXPORT_C inline void CBasePlugin::RemoveAllPropertiesL(
  1253     CMsgStorePropertyContainer& aContainer,
  1251     CMsgStorePropertyContainer& aContainer,
  1254     const TDesC8& aName )
  1252     const TDesC8& aName )
  1255 
  1253 
  1256     {
  1254     {
  1257     TUint index = 0;
  1255     TUint index = 0;