emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp
changeset 1 12c456ceeff2
parent 0 8466d47a6819
child 2 5253a20d2a1e
equal deleted inserted replaced
0:8466d47a6819 1:12c456ceeff2
   104     {
   104     {
   105     FUNC_LOG;
   105     FUNC_LOG;
   106     // create resourcefile 
   106     // create resourcefile 
   107     CCoeEnv* env = CCoeEnv::Static();
   107     CCoeEnv* env = CCoeEnv::Static();
   108     
   108     
   109     TFileName resourceFile;
   109     // Load resource file from the same drive where this dll is loaded from
       
   110     TFileName dllFileName;
       
   111     Dll::FileName( dllFileName );
   110     TParse parse;
   112     TParse parse;
   111     
   113     User::LeaveIfError( parse.Set( KResourceFile, &dllFileName, NULL ) );
   112     parse.Set( KResourceFile, &KDC_ECOM_RESOURCE_DIR, NULL ); 
   114     TFileName resourceFile( parse.FullName() );
   113     resourceFile = parse.FullName();
       
   114     
   115     
   115     BaflUtils::NearestLanguageFile( env->FsSession(), resourceFile );
   116     BaflUtils::NearestLanguageFile( env->FsSession(), resourceFile );
   116     iResourceFileOffset = env->AddResourceFileL( resourceFile );
   117     iResourceFileOffset = env->AddResourceFileL( resourceFile );
   117     }
   118     }
   118 
   119 
   472             iconIds.Copy(KMifPrefix);
   473             iconIds.Copy(KMifPrefix);
   473             iconIds.Append(brandedIconIds);
   474             iconIds.Append(brandedIconIds);
   474             }
   475             }
   475         }
   476         }
   476 
   477 
       
   478     // Parse mif file full path by own dll drive letter
       
   479     TFileName dllFileName;
       
   480     Dll::FileName( dllFileName );
       
   481     TParse mifParse;
       
   482     User::LeaveIfError( mifParse.Set( KMifPath, &dllFileName, NULL ) );
       
   483 
   477     if (!iconIds.Length())
   484     if (!iconIds.Length())
   478         {
   485         {
   479         TBuf<KMaxDescLen> id;
   486         TBuf<KMaxDescLen> id;
   480         iconIds.Copy(KMifPrefix);
   487         iconIds.Copy( KMifPrefix );
   481         iconIds.Append(KMifPath);
   488         iconIds.Append( mifParse.FullName() );
   482         iconIds.Append(KSpace);
   489         iconIds.Append( KSpace );
   483         id.Num(aBitmapId);
   490         id.Num( aBitmapId );
   484         iconIds.Append(id);     
   491         iconIds.Append( id );
   485         iconIds.Append(KSpace);
   492         iconIds.Append( KSpace );
   486         id.Num(aBitmapMaskId);
   493         id.Num( aBitmapMaskId );
   487         iconIds.Append(id);        
   494         iconIds.Append( id );
   488         }
   495         }
   489 
   496 
   490     // The actual image publishing part starts here   
   497     // The actual image publishing part starts here   
   491     CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
   498     CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
   492     CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
   499     CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
   493 
   500 
   494     TLiwGenericParam type( KType, TLiwVariant(KCpData));
   501     TLiwGenericParam type( KType, TLiwVariant( KCpData ) );
   495     inparam->AppendL( type );
   502     inparam->AppendL( type );
   496 
   503 
   497     CLiwDefaultMap* pdatamap = CLiwDefaultMap::NewLC();
   504     CLiwDefaultMap* pdatamap = CLiwDefaultMap::NewLC();
   498     CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC();
   505     CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC();
   499 
   506 
   500     pdatamap->InsertL( KPublisherId, TLiwVariant( KPubId ));
   507     pdatamap->InsertL( KPublisherId, TLiwVariant( KPubId ) );
   501     pdatamap->InsertL( KContentType, TLiwVariant( aContentType ));
   508     pdatamap->InsertL( KContentType, TLiwVariant( aContentType ) );
   502     pdatamap->InsertL( KContentId, TLiwVariant( aContentId ));
   509     pdatamap->InsertL( KContentId, TLiwVariant( aContentId ) );
   503     
   510     
   504     datamap->InsertL(aKey, TLiwVariant(iconIds));
   511     datamap->InsertL( aKey, TLiwVariant(iconIds) );
   505 
   512 
   506     pdatamap->InsertL( KDataMap, TLiwVariant(datamap) );
   513     pdatamap->InsertL( KDataMap, TLiwVariant(datamap) );
   507     TLiwGenericParam item( KItem, TLiwVariant( pdatamap ));       
   514     TLiwGenericParam item( KItem, TLiwVariant( pdatamap ) );       
   508     inparam->AppendL( item );
   515     inparam->AppendL( item );
   509     
   516     
   510     // Publish icon ( or remove it from widget when no id provided )
   517     // Publish icon ( or remove it from widget when no id provided )
   511     if ( aBitmapId == KNullIcon )
   518     if ( aBitmapId == KNullIcon )
   512         {
   519         {
   513         iMsgInterface->ExecuteCmdL( KDelete, *inparam, *outparam);    
   520         iMsgInterface->ExecuteCmdL( KDelete, *inparam, *outparam );    
   514         }
   521         }
   515     else
   522     else
   516         {
   523         {
   517         iMsgInterface->ExecuteCmdL( KAdd, *inparam, *outparam);
   524         iMsgInterface->ExecuteCmdL( KAdd, *inparam, *outparam );
   518         }
   525         }
   519     
   526     
   520     CleanupStack::PopAndDestroy( datamap );
   527     CleanupStack::PopAndDestroy( datamap );
   521     CleanupStack::PopAndDestroy( pdatamap );    
   528     CleanupStack::PopAndDestroy( pdatamap );    
   522     
   529