clfwrapper/ClientSrc/CCLFItemImpl.cpp
changeset 0 c53acadfccc6
child 1 acef663c1218
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include    "CCLFItemImpl.h"
       
    21 #include    "CCLFDbItemContainer.h"
       
    22 #include    "CLFConsts.h"
       
    23 #include    "CLF2MdEConsts.h"
       
    24 #include    <f32file.h>
       
    25 #include    "MGDebugPrint.h"
       
    26 #include    <mdesession.h>
       
    27 #include    <mdetextproperty.h>
       
    28 #include    <mdenumberproperty.h>
       
    29 #include    <mdeobjectdef.h>
       
    30 #include    <mdeconstants.h>
       
    31 
       
    32 // ============================ MEMBER FUNCTIONS ===============================
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // CCLFItemImpl::CCLFItemImpl
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 CCLFItemImpl::CCLFItemImpl( CCLFContainerItem& aContainerItem,
       
    39                                    CCLFDbItemContainer& aDbItemContainer )
       
    40     : iItem( aContainerItem ),
       
    41       iMdEObject( aContainerItem.DbItem() ),
       
    42       iDbItemContainer( aDbItemContainer )
       
    43     {
       
    44     iItem.IncreaseReferenceCount();
       
    45     }
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CCLFItemImpl::NewLC
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 CCLFItemImpl* CCLFItemImpl::NewLC( CCLFContainerItem& aContainerItem,
       
    52                                    CCLFDbItemContainer& aDbItemContainer )
       
    53     {
       
    54     CCLFItemImpl* self =
       
    55             new ( ELeave ) CCLFItemImpl( aContainerItem, aDbItemContainer );
       
    56 
       
    57     CleanupStack::PushL( self );
       
    58 
       
    59     return self;
       
    60     }
       
    61 
       
    62 // -----------------------------------------------------------------------------
       
    63 // CCLFItemImpl::NewL
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 CCLFItemImpl* CCLFItemImpl::NewL( CCLFContainerItem& aContainerItem,
       
    67                                    CCLFDbItemContainer& aDbItemContainer )
       
    68     {   
       
    69     return new( ELeave ) CCLFItemImpl( aContainerItem, aDbItemContainer );
       
    70     }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // CCLFItemImpl::~CCLFItemImpl
       
    74 // Destructor
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 CCLFItemImpl::~CCLFItemImpl()
       
    78     {
       
    79     iDbItemContainer.ReleaseItem( &iItem );
       
    80     }
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // CCLFItemImpl::ItemId
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 TCLFItemId CCLFItemImpl::ItemId() const
       
    87     {
       
    88     TCLFItemId id = (TCLFItemId) iMdEObject.Id();
       
    89     return id;
       
    90     }
       
    91 
       
    92 // -----------------------------------------------------------------------------
       
    93 // CCLFItemImpl::DataType
       
    94 // -----------------------------------------------------------------------------
       
    95 //
       
    96 TCLFItemDataType CCLFItemImpl::DataType( const TCLFFieldId aFieldId ) const
       
    97     {
       
    98     MG_DEBUG2( DT, "[CLF]\t CCLFItemImpl::DataType aFieldId: %d", aFieldId );
       
    99 
       
   100     TCLFItemDataType ret = ECLFItemDataTypeNull;
       
   101     const TDesC& property = MapFieldToMdEProperty( aFieldId );
       
   102 
       
   103     if ( property != KNullDesC )
       
   104         {
       
   105         const CMdEPropertyDef* propertyDef = NULL;
       
   106         TRAP_IGNORE( propertyDef = &iMdEObject.Def().GetPropertyDefL( property ));
       
   107 
       
   108         switch ( propertyDef->PropertyType())
       
   109             {
       
   110             case EPropertyBool:
       
   111             case EPropertyInt8:
       
   112             case EPropertyUint8:
       
   113             case EPropertyInt16:
       
   114             case EPropertyUint16:
       
   115             case EPropertyInt32:
       
   116             case EPropertyUint32:
       
   117             case EPropertyInt64:
       
   118             case EPropertyReal32:
       
   119             case EPropertyReal64:
       
   120                 {
       
   121                 ret = ECLFItemDataTypeTInt32;
       
   122                 break;
       
   123                 }
       
   124             case EPropertyTime:
       
   125                 {
       
   126                 ret = ECLFItemDataTypeTTime;
       
   127                 break;
       
   128                 }
       
   129             case EPropertyText:
       
   130                 {
       
   131                 ret = ECLFItemDataTypeDesC;
       
   132                 break;
       
   133                 }
       
   134             default:
       
   135                 {
       
   136                 /* Fall through */
       
   137                 break;
       
   138                 }
       
   139             }
       
   140         }
       
   141     return ret;
       
   142     }
       
   143 
       
   144 // -----------------------------------------------------------------------------
       
   145 // CCLFItemImpl::DeduceFieldFromURI
       
   146 // -----------------------------------------------------------------------------
       
   147 //
       
   148 TBool CCLFItemImpl::DeduceFieldFromURI( const TCLFFieldId aFieldId, TPtrC& aValue ) const
       
   149     {
       
   150     TBool done = ETrue;
       
   151     TPtrC path = iMdEObject.Uri();
       
   152     TParsePtrC nameParse( path );
       
   153 
       
   154     switch ( aFieldId )
       
   155         {
       
   156         case ECLFFieldIdFileName:
       
   157             {
       
   158             aValue.Set( nameParse.Name() );
       
   159             break;
       
   160             }
       
   161         case ECLFFieldIdFileExtension:
       
   162             {
       
   163             aValue.Set( nameParse.Ext() );
       
   164             break;
       
   165             }
       
   166         case ECLFFieldIdPath:
       
   167             {
       
   168             aValue.Set( nameParse.Path() );
       
   169             break;
       
   170             }
       
   171         case ECLFFieldIdDrive:
       
   172             {
       
   173             aValue.Set( nameParse.Drive() );
       
   174             break;
       
   175             }
       
   176         case ECLFFieldIdFileNameAndPath:
       
   177             {
       
   178             aValue.Set( path );
       
   179             break;
       
   180             }
       
   181         default:
       
   182             {
       
   183             done = EFalse; // Field deduction from URI did not work.
       
   184             break;
       
   185             }
       
   186         }
       
   187     return done;
       
   188     }
       
   189 
       
   190 // -----------------------------------------------------------------------------
       
   191 // CCLFItemImpl::GetMediaTypeL
       
   192 // -----------------------------------------------------------------------------
       
   193 //
       
   194 TInt CCLFItemImpl::GetMediaTypeL( CMdEObjectDef& aObjectDef, TInt32& aValue ) const
       
   195     {
       
   196     const TDesC* mdemediatypes[] =
       
   197         {
       
   198         &MdeConstants::Audio::KAudioObject,
       
   199         &MdeConstants::Video::KVideoObject,
       
   200         &MdeConstants::Image::KImageObject,
       
   201         };
       
   202     const TInt clfmediatypes[] =
       
   203         {
       
   204         ECLFMediaTypeSound,
       
   205         ECLFMediaTypeVideo,
       
   206         ECLFMediaTypeImage,
       
   207         };
       
   208     const TPtrC name = aObjectDef.Name();
       
   209     TInt32 error = KErrNotFound;
       
   210 
       
   211     aValue = ECLFMediaTypeUnknown; // Default to this.
       
   212     for ( TInt i = 0; i < sizeof( clfmediatypes ) / sizeof( TInt ); ++i )
       
   213         {
       
   214         if ( name.Compare( *mdemediatypes[ i ] ) == 0 )
       
   215             {
       
   216             aValue = clfmediatypes[ i ];
       
   217             error = KErrNone;
       
   218             break;
       
   219             }
       
   220         }
       
   221 
       
   222     if ( aValue == ECLFMediaTypeSound )
       
   223         {
       
   224         DetermineIfMusicL( aObjectDef, aValue );
       
   225         }
       
   226     return error;
       
   227     }
       
   228 
       
   229 // -----------------------------------------------------------------------------
       
   230 // CCLFItemImpl::DetermineIfMusicL
       
   231 // -----------------------------------------------------------------------------
       
   232 //
       
   233 void CCLFItemImpl::DetermineIfMusicL( CMdEObjectDef& aObjectDef, TInt32& aValue ) const
       
   234     {
       
   235     // This is a hard-coded list used to determine if the media type is music. CLF uses a
       
   236     // separate MIME type manager to map MIME types to CLF media types, but this is located on
       
   237     // the CLF server side, which this wrapper removes/obsoletes. The MIME type manager uses a
       
   238     // resource file for mapping MIME types.
       
   239     const TDesC* clfwrappermusictypes[] =
       
   240         {
       
   241         &KCLFWrapperMusicTypeMpeg,
       
   242         &KCLFWrapperMusicTypeAac,
       
   243         &KCLFWrapperMusicTypeMp3,
       
   244         &KCLFWrapperMusicTypeX_Mp3,
       
   245         &KCLFWrapperMusicTypeMp4,
       
   246         &KCLFWrapperMusicType3gpp,
       
   247         &KCLFWrapperMusicTypeM4a,
       
   248         &KCLFWrapperMusicType3gpp2,
       
   249         &KCLFWrapperMusicTypeMpeg4,
       
   250         &KCLFWrapperMusicTypeX_Pn_RealAudio,
       
   251         &KCLFWrapperMusicTypeX_Ms_Wma,
       
   252         };
       
   253 
       
   254     const CMdEPropertyDef* propertyDef = NULL;
       
   255     propertyDef = &aObjectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
       
   256 
       
   257     if ( propertyDef )
       
   258         {
       
   259         // Get the actual data
       
   260         CMdEProperty* prop = NULL;
       
   261         TInt index = iMdEObject.Property( *propertyDef, prop );
       
   262         if ( prop )
       
   263             {
       
   264             const TInt num = sizeof ( clfwrappermusictypes ) / sizeof( TDesC* );
       
   265 
       
   266             for ( TInt i = 0; i < num; ++i )
       
   267                 {
       
   268                 if ( *clfwrappermusictypes[ i ] == prop->TextValueL() )
       
   269                     {
       
   270                     aValue = ECLFMediaTypeMusic;
       
   271                     break;
       
   272                     }
       
   273                 }
       
   274             }
       
   275         }
       
   276     }
       
   277 
       
   278 // -----------------------------------------------------------------------------
       
   279 // CCLFItemImpl::GetField
       
   280 // -----------------------------------------------------------------------------
       
   281 //
       
   282 TInt CCLFItemImpl::GetField( const TCLFFieldId aFieldId, TPtrC& aValue ) const
       
   283     {
       
   284     MG_DEBUG2( GF, "[CLF]\t CCLFItemImpl::GetField (TPtrC) aFieldId: %d", aFieldId );
       
   285     TInt error = KErrNotFound;
       
   286 
       
   287     if ( DeduceFieldFromURI( aFieldId, aValue ))
       
   288         {
       
   289         error = KErrNone;
       
   290         }
       
   291     else
       
   292         {
       
   293         // Get property
       
   294         const TDesC& property = MapFieldToMdEProperty( aFieldId );
       
   295         if ( property != KNullDesC )
       
   296             {
       
   297             CMdEPropertyDef* propertyDef = NULL;
       
   298             TRAP_IGNORE( propertyDef = &iMdEObject.Def().GetPropertyDefL( property ));
       
   299 
       
   300             if ( propertyDef )
       
   301                 {
       
   302                 // Get the actual data
       
   303                 CMdEProperty* prop = NULL;
       
   304                 const TInt index = iMdEObject.Property( *propertyDef, prop );
       
   305                 if ( prop )
       
   306                     {
       
   307                     if ( index >= 0 )
       
   308                         {
       
   309                         CMdETextProperty* textprop = ( CMdETextProperty* ) prop;
       
   310                         aValue.Set( textprop->Value() );
       
   311                         MG_DEBUG2( GF2, "[CLF]\t CCLFItemImpl::GetField value %S", &aValue );
       
   312                         error = KErrNone;          
       
   313                         }
       
   314                     }
       
   315                 }
       
   316             }
       
   317         }
       
   318 
       
   319     MG_DEBUG2( GF3, "[CLF]\t CCLFItemImpl::GetField (TPtrC) end %d", error );
       
   320     return error;   
       
   321     }
       
   322 
       
   323 // -----------------------------------------------------------------------------
       
   324 // CCLFItemImpl::GetField
       
   325 // -----------------------------------------------------------------------------
       
   326 //
       
   327 TInt CCLFItemImpl::GetField( const TCLFFieldId aFieldId, TInt32& aValue ) const
       
   328     {
       
   329     MG_DEBUG2( GF4, "[CLF]\t CCLFItemImpl::GetField (TInt) aFieldId: %d", aFieldId );
       
   330     TInt error = KErrNotFound;
       
   331 
       
   332     // Get property
       
   333     const TDesC& property = MapFieldToMdEProperty( aFieldId );
       
   334     if ( property != KNullDesC )
       
   335         {
       
   336         CMdEPropertyDef* propertyDef = NULL;
       
   337         TRAP_IGNORE( propertyDef = &iMdEObject.Def().GetPropertyDefL( property ));
       
   338 
       
   339         if ( propertyDef )
       
   340             {
       
   341             // Get the actual data
       
   342             CMdEProperty* prop = NULL;
       
   343             const TInt index = iMdEObject.Property( *propertyDef, prop );
       
   344             if ( prop )
       
   345                 {
       
   346                 if ( index >= 0 )
       
   347                     {
       
   348                     // The following code is a Gallery behavior fix.
       
   349                     if ( &property == &MdeConstants::MediaObject::KTrackProperty )
       
   350                         {
       
   351                         error = KErrNone;
       
   352                         TRAP( error, aValue = prop->Uint16ValueL());
       
   353                         }
       
   354                     else
       
   355                         {
       
   356                         error = KErrNone;
       
   357                         TRAP( error, aValue = prop->Uint32ValueL());
       
   358                         }
       
   359                     }
       
   360                 }
       
   361             }
       
   362         }
       
   363     else
       
   364         {
       
   365         // Media type is checked here.
       
   366         if ( aFieldId == ECLFFieldIdMediaType )
       
   367             {
       
   368             CMdEObjectDef& objectDef = iMdEObject.Def();
       
   369             TRAP( error, error = GetMediaTypeL( objectDef, aValue ));
       
   370             }
       
   371         }
       
   372  
       
   373     return error;   
       
   374     }
       
   375 
       
   376 // -----------------------------------------------------------------------------
       
   377 // CCLFItemImpl::GetField
       
   378 // -----------------------------------------------------------------------------
       
   379 //
       
   380 TInt CCLFItemImpl::GetField( const TCLFFieldId aFieldId, TTime& aValue ) const
       
   381     {
       
   382     MG_DEBUG2( GF6, "[CLF]\t CCLFItemImpl::GetField (TTime) aFieldId: %d", aFieldId );
       
   383     TInt error = KErrNotFound;
       
   384 
       
   385     // Get property
       
   386     const TDesC& property = MapFieldToMdEProperty( aFieldId );
       
   387     if ( property != KNullDesC )
       
   388         {
       
   389         CMdEPropertyDef* propertyDef = NULL;
       
   390         TRAP_IGNORE( propertyDef = &iMdEObject.Def().GetPropertyDefL( property ));
       
   391 
       
   392         if ( propertyDef )
       
   393             {
       
   394             // Get the actual data
       
   395             CMdEProperty* prop = NULL;
       
   396             const TInt index = iMdEObject.Property( *propertyDef, prop );
       
   397             if ( prop )
       
   398                 {
       
   399                 if ( index >= 0 )
       
   400                     {
       
   401                     CMdETimeProperty* timeprop = ( CMdETimeProperty* ) prop;
       
   402                     TRAP_IGNORE( aValue = timeprop->Value() );  // Value() is leaving function
       
   403                     error = KErrNone;
       
   404                     }
       
   405                 }
       
   406             }
       
   407         }
       
   408 
       
   409     return error;     
       
   410     }
       
   411 
       
   412 // -----------------------------------------------------------------------------
       
   413 // CCLFItemImpl::MapFieldToMdEProperty
       
   414 // -----------------------------------------------------------------------------
       
   415 //
       
   416 const TDesC& CCLFItemImpl::MapFieldToMdEProperty( const TCLFFieldId aField )
       
   417     {
       
   418     MG_DEBUG2( MFP, "[CLF]\t CCLFItemImpl::MapFieldToMdEProperty aField: %d", aField );
       
   419     const TDesC* ret;
       
   420 
       
   421     switch ( aField )
       
   422         {
       
   423         /// integer
       
   424         case ECLFFieldIdFileSize:
       
   425             {
       
   426             ret = &MdeConstants::Object::KSizeProperty;
       
   427             break;
       
   428             }
       
   429         /// File date field:
       
   430         /// date/time
       
   431         case ECLFFieldIdFileDate: 
       
   432             {
       
   433             ret = &MdeConstants::Object::KLastModifiedDateProperty;
       
   434             break;
       
   435             }
       
   436         /// Mime type field:
       
   437         /// descriptor
       
   438         case ECLFFieldIdMimeType:
       
   439             {
       
   440             ret = &MdeConstants::Object::KItemTypeProperty;
       
   441             break;
       
   442             }
       
   443         /// Music file song name tag:
       
   444         /// descriptor
       
   445         case ECLFFieldIdSongName:
       
   446             {
       
   447             ret = &MdeConstants::Object::KTitleProperty;
       
   448             break;
       
   449             }
       
   450         /// Music file artist tag:
       
   451         /// descriptor
       
   452         case ECLFFieldIdArtist:
       
   453             {
       
   454             ret = &MdeConstants::MediaObject::KArtistProperty;
       
   455             break;
       
   456             }
       
   457         /// Music file album tag:
       
   458         /// descriptor
       
   459         case ECLFFieldIdAlbum:
       
   460             {
       
   461             ret = &MdeConstants::Audio::KAlbumProperty;
       
   462             break;
       
   463             }
       
   464         /// Music file genre tag:
       
   465         /// descriptor
       
   466         case ECLFFieldIdGenre:
       
   467             {
       
   468             ret = &MdeConstants::MediaObject::KGenreProperty;
       
   469             break;
       
   470             }
       
   471         /// Music file track number tag:
       
   472         /// integer
       
   473         case ECLFFieldIdTrackNumber:
       
   474             {
       
   475             ret = &MdeConstants::MediaObject::KTrackProperty;
       
   476             break;
       
   477             }
       
   478         /// Music file composer tag:
       
   479         /// descriptor
       
   480         case ECLFFieldIdComposer:
       
   481             {
       
   482             ret = &MdeConstants::Audio::KComposerProperty;
       
   483             break;
       
   484             }
       
   485         default:
       
   486             {
       
   487             ret = &KNullDesC;
       
   488             break;
       
   489             }
       
   490         }
       
   491     return *ret;
       
   492     }
       
   493 
       
   494 // -----------------------------------------------------------------------------
       
   495 // CCLFModifiableItemImpl::CCLFModifiableItemImpl
       
   496 // -----------------------------------------------------------------------------
       
   497 //
       
   498 CCLFModifiableItemImpl::CCLFModifiableItemImpl()
       
   499     {
       
   500     }
       
   501 
       
   502 // -----------------------------------------------------------------------------
       
   503 // CCLFModifiableItemImpl::NewL
       
   504 // -----------------------------------------------------------------------------
       
   505 //
       
   506 CCLFModifiableItemImpl* CCLFModifiableItemImpl::NewL()
       
   507     {
       
   508     return new ( ELeave ) CCLFModifiableItemImpl();
       
   509     }
       
   510 
       
   511 // -----------------------------------------------------------------------------
       
   512 // CCLFModifiableItemImpl::~CCLFModifiableItemImpl
       
   513 // -----------------------------------------------------------------------------
       
   514 //
       
   515 CCLFModifiableItemImpl::~CCLFModifiableItemImpl()
       
   516     {
       
   517     iIntMap.Close();
       
   518     iTimeMap.Close();
       
   519     
       
   520     THashMapIter<TCLFFieldId, HBufC*> hashIter(iTextMap);
       
   521     for ( HBufC* const* p = hashIter.NextValue(); p; p = hashIter.NextValue() )
       
   522         {
       
   523         delete *p;
       
   524         }
       
   525     iTextMap.Close();
       
   526     }
       
   527 
       
   528 // -----------------------------------------------------------------------------
       
   529 // CCLFModifiableItemImpl::ItemId
       
   530 // -----------------------------------------------------------------------------
       
   531 //
       
   532 TCLFItemId CCLFModifiableItemImpl::ItemId() const
       
   533     {
       
   534     const TInt id = 1;
       
   535     return id;
       
   536     }
       
   537 
       
   538 // -----------------------------------------------------------------------------
       
   539 // CCLFModifiableItemImpl::DataType
       
   540 // -----------------------------------------------------------------------------
       
   541 //
       
   542 TCLFItemDataType CCLFModifiableItemImpl::DataType( const TCLFFieldId aFieldId ) const
       
   543     {
       
   544     if (iIntMap.Find(aFieldId))
       
   545         {
       
   546         return ECLFItemDataTypeTInt32;
       
   547         }
       
   548     else if (iTimeMap.Find(aFieldId))
       
   549         {
       
   550         return ECLFItemDataTypeTTime;
       
   551         }
       
   552     else if (iTextMap.Find(aFieldId))
       
   553         {
       
   554         return ECLFItemDataTypeDesC;
       
   555         }
       
   556     else
       
   557         {
       
   558         return ECLFItemDataTypeNull;
       
   559         }
       
   560     }
       
   561 
       
   562 // -----------------------------------------------------------------------------
       
   563 // CCLFModifiableItemImpl::GetField
       
   564 // -----------------------------------------------------------------------------
       
   565 //
       
   566 TInt CCLFModifiableItemImpl::GetField( const TCLFFieldId aFieldId,
       
   567                                        TPtrC& aValue ) const
       
   568     {
       
   569     if (iTextMap.Find(aFieldId))
       
   570         {
       
   571         aValue.Set( (*iTextMap.Find(aFieldId))->Des() );
       
   572         return KErrNone;
       
   573         }
       
   574         
       
   575     return KErrNotFound;
       
   576     }
       
   577 
       
   578 // -----------------------------------------------------------------------------
       
   579 // CCLFModifiableItemImpl::GetField
       
   580 // -----------------------------------------------------------------------------
       
   581 //
       
   582 TInt CCLFModifiableItemImpl::GetField( const TCLFFieldId aFieldId,
       
   583                                        TInt32& aValue ) const
       
   584     {
       
   585     if (iIntMap.Find(aFieldId))
       
   586         {
       
   587         aValue = *iIntMap.Find(aFieldId);
       
   588         return KErrNone;
       
   589         }
       
   590         
       
   591     return KErrNotFound;
       
   592     }
       
   593 
       
   594 // -----------------------------------------------------------------------------
       
   595 // CCLFModifiableItemImpl::GetField
       
   596 // -----------------------------------------------------------------------------
       
   597 //
       
   598 TInt CCLFModifiableItemImpl::GetField( const TCLFFieldId aFieldId,
       
   599                                        TTime& aValue ) const
       
   600     {
       
   601     if (iTimeMap.Find(aFieldId))
       
   602         {
       
   603         aValue = TTime(*iTimeMap.Find(aFieldId));
       
   604         return KErrNone;
       
   605         }
       
   606        
       
   607     return KErrNotFound;
       
   608     }
       
   609 
       
   610 // -----------------------------------------------------------------------------
       
   611 // CCLFModifiableItemImpl::AddFieldL
       
   612 // -----------------------------------------------------------------------------
       
   613 //
       
   614 void CCLFModifiableItemImpl::AddFieldL( TCLFFieldId aFieldID,
       
   615                                         const TDesC& aValue )
       
   616     {
       
   617     iTextMap.InsertL( aFieldID, aValue.AllocL() );
       
   618     }
       
   619 
       
   620 // -----------------------------------------------------------------------------
       
   621 // CCLFModifiableItemImpl::AddFieldL
       
   622 // -----------------------------------------------------------------------------
       
   623 //
       
   624 void CCLFModifiableItemImpl::AddFieldL( TCLFFieldId aFieldID, TInt32 aValue )
       
   625     {
       
   626     iIntMap.InsertL( aFieldID, aValue );
       
   627     }
       
   628 
       
   629 // -----------------------------------------------------------------------------
       
   630 // CCLFModifiableItemImpl::AddFieldL
       
   631 // -----------------------------------------------------------------------------
       
   632 //
       
   633 void CCLFModifiableItemImpl::AddFieldL( TCLFFieldId aFieldID,
       
   634                                         const TTime& aValue )
       
   635     {
       
   636     iTimeMap.InsertL( aFieldID, aValue.Int64() );
       
   637     }
       
   638 
       
   639 //  End of File