phonebookui/Phonebook2/ccapplication/ccamycardplugin/src/ccappmycardimageloader.cpp
branchRCL_3
changeset 6 e8e3147d53eb
parent 3 04ab22b956c2
child 8 5586b4d2ec3e
equal deleted inserted replaced
5:81f8547efd4f 6:e8e3147d53eb
   101     for ( TInt i = 0; i < fieldCount;  ++i )
   101     for ( TInt i = 0; i < fieldCount;  ++i )
   102         {
   102         {
   103         MVPbkStoreContactField& field = fields.FieldAt( i );    
   103         MVPbkStoreContactField& field = fields.FieldAt( i );    
   104         const MVPbkFieldType* fieldType = field.BestMatchingFieldType();
   104         const MVPbkFieldType* fieldType = field.BestMatchingFieldType();
   105         
   105         
   106         if ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_THUMBNAILPIC )
   106         if ( fieldType )
   107             {
   107             {
   108             MVPbkContactFieldData& contactField = field.FieldData(); 
   108             if ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_THUMBNAILPIC )
   109             iImageBuffer = 
   109                 {
   110                 MVPbkContactFieldBinaryData::Cast(contactField).BinaryData().AllocL();
   110                 MVPbkContactFieldData& contactField = field.FieldData(); 
   111             }
   111                 iImageBuffer = 
   112         
   112                     MVPbkContactFieldBinaryData::Cast(contactField).BinaryData().AllocL();
   113         if ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_CALLEROBJIMG )
   113                 }
   114             {
   114             
   115             MVPbkContactFieldData& contactField = field.FieldData();                        
   115             if ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_CALLEROBJIMG )
   116             iImageFileName = MVPbkContactFieldTextData::Cast(contactField).Text().AllocL();
   116                 {
       
   117                 MVPbkContactFieldData& contactField = field.FieldData();                        
       
   118                 iImageFileName = MVPbkContactFieldTextData::Cast(contactField).Text().AllocL();
       
   119                 }
   117             }
   120             }
   118         }
   121         }
   119         
   122         
   120     if( iImageBuffer )
   123     if( iImageBuffer )
   121         {
   124         {
   140     CCA_DP(KMyCardLogFile, 
   143     CCA_DP(KMyCardLogFile, 
   141         CCA_L("<-CCCAppMyCardImageLoader::LoadContactImageL()"));
   144         CCA_L("<-CCCAppMyCardImageLoader::LoadContactImageL()"));
   142     }
   145     }
   143 
   146 
   144 // ---------------------------------------------------------------------------
   147 // ---------------------------------------------------------------------------
       
   148 // CCCAppMyCardImageLoader::LoadImageL
       
   149 // ---------------------------------------------------------------------------
       
   150 //
       
   151 void CCCAppMyCardImageLoader::LoadImageL( 
       
   152     const TDesC8& aImageData,
       
   153     const TDesC& aImageFileName,
       
   154     const TSize& aThumbnailSize )
       
   155     {
       
   156     CCA_DP(KMyCardLogFile, 
       
   157         CCA_L("->CCCAppMyCardImageLoader::LoadImageL()"));
       
   158 
       
   159     delete iImageDecoding;
       
   160     iImageDecoding = NULL;
       
   161     
       
   162     RFs& fs = CEikonEnv::Static()->FsSession();
       
   163     iImageDecoding = CCCAppImageDecoding::NewL(
       
   164             *this, 
       
   165             fs, 
       
   166             aImageData.AllocLC(), 
       
   167             aImageFileName.AllocLC() );
       
   168     CleanupStack::Pop( 2 ); // imagedata, imagefilename
       
   169     iImageDecoding->StartL( aThumbnailSize );      
       
   170 
       
   171     CCA_DP(KMyCardLogFile, 
       
   172         CCA_L("<-CCCAppMyCardImageLoader::LoadImageL()"));
       
   173     }
       
   174 
       
   175 // ---------------------------------------------------------------------------
   145 // CCCAppMyCardImageLoader::ResizeImageL
   176 // CCCAppMyCardImageLoader::ResizeImageL
   146 // ---------------------------------------------------------------------------
   177 // ---------------------------------------------------------------------------
   147 //
   178 //
   148 void CCCAppMyCardImageLoader::ResizeImageL( const TSize& aThumbnailSize )
   179 void CCCAppMyCardImageLoader::ResizeImageL( const TSize& aThumbnailSize )
   149     {
   180     {