contentstorage/cautils/src/cainnerentry.cpp
changeset 103 b99b84bcd2d1
parent 66 32469d7d46ff
child 127 7b66bc3c6dc9
equal deleted inserted replaced
83:156f692b1687 103:b99b84bcd2d1
    70     aStream.WriteL( iText, iText.Length() );
    70     aStream.WriteL( iText, iText.Length() );
    71     aStream.WriteUint32L( iDescription.Length() );
    71     aStream.WriteUint32L( iDescription.Length() );
    72     aStream.WriteL( iDescription, iDescription.Length() );
    72     aStream.WriteL( iDescription, iDescription.Length() );
    73     aStream.WriteUint32L( iEntryTypeName.Length() );
    73     aStream.WriteUint32L( iEntryTypeName.Length() );
    74     aStream.WriteL( iEntryTypeName, iEntryTypeName.Length() );
    74     aStream.WriteL( iEntryTypeName, iEntryTypeName.Length() );
       
    75     aStream.WriteUint32L( iTextLocalized );
       
    76     aStream.WriteUint32L( iDescriptionLocalized );
    75     iAttributes.ExternalizeL( aStream );
    77     iAttributes.ExternalizeL( aStream );
    76     iIcon->ExternalizeL( aStream );
    78     iIcon->ExternalizeL( aStream );
    77     aStream.CommitL();
    79     aStream.CommitL();
    78     }
    80     }
    79 
    81 
    97     aStream.ReadL( iDescription, length);
    99     aStream.ReadL( iDescription, length);
    98     length = aStream.ReadUint32L( );
   100     length = aStream.ReadUint32L( );
    99     iEntryTypeName.Close();
   101     iEntryTypeName.Close();
   100     iEntryTypeName.CreateL( length );
   102     iEntryTypeName.CreateL( length );
   101     aStream.ReadL( iEntryTypeName, length );
   103     aStream.ReadL( iEntryTypeName, length );
       
   104     iTextLocalized = aStream.ReadUint32L();
       
   105     iDescriptionLocalized = aStream.ReadUint32L();
   102     iAttributes.InternalizeL( aStream );
   106     iAttributes.InternalizeL( aStream );
   103     iIcon->InternalizeL( aStream );
   107     iIcon->InternalizeL( aStream );
   104     }
   108     }
   105 
   109 
   106 // ---------------------------------------------------------------------------
   110 // ---------------------------------------------------------------------------
   108 // ---------------------------------------------------------------------------
   112 // ---------------------------------------------------------------------------
   109 //
   113 //
   110 void CCaInnerEntry::ConstructL()
   114 void CCaInnerEntry::ConstructL()
   111     {
   115     {
   112     iIcon = CCaInnerIconDescription::NewL();
   116     iIcon = CCaInnerIconDescription::NewL();
       
   117     iTextLocalized = EFalse;
       
   118     iDescriptionLocalized = EFalse;
   113     }
   119     }
   114 
   120 
   115 // ---------------------------------------------------------------------------
   121 // ---------------------------------------------------------------------------
   116 //
   122 //
   117 // ---------------------------------------------------------------------------
   123 // ---------------------------------------------------------------------------
   222 
   228 
   223 // ---------------------------------------------------------------------------
   229 // ---------------------------------------------------------------------------
   224 //
   230 //
   225 // ---------------------------------------------------------------------------
   231 // ---------------------------------------------------------------------------
   226 //
   232 //
   227 EXPORT_C void CCaInnerEntry::SetTextL( const TDesC& aText )
   233 EXPORT_C void CCaInnerEntry::SetTextL( const TDesC& aText, TBool localized )
   228     {
   234     {
   229     iText.Close();
   235     iText.Close();
   230     iText.CreateL( aText );
   236     iText.CreateL( aText );
   231     }
   237     iTextLocalized = localized;
   232 
   238     }
   233 // ---------------------------------------------------------------------------
   239 
   234 //
   240 // ---------------------------------------------------------------------------
   235 // ---------------------------------------------------------------------------
   241 //
   236 //
   242 // ---------------------------------------------------------------------------
   237 EXPORT_C void CCaInnerEntry::SetDescriptionL( const TDesC& aText )
   243 //
       
   244 EXPORT_C void CCaInnerEntry::SetDescriptionL( 
       
   245         const TDesC& aText, TBool localized )
   238     {
   246     {
   239     iDescription.Close();
   247     iDescription.Close();
   240     iDescription.CreateL( aText );
   248     iDescription.CreateL( aText );
       
   249     iDescriptionLocalized = localized;
   241     }
   250     }
   242 
   251 
   243 // ---------------------------------------------------------------------------
   252 // ---------------------------------------------------------------------------
   244 //
   253 //
   245 // ---------------------------------------------------------------------------
   254 // ---------------------------------------------------------------------------
   342 //
   351 //
   343 EXPORT_C void CCaInnerEntry::SetIconId( TInt aIconId )
   352 EXPORT_C void CCaInnerEntry::SetIconId( TInt aIconId )
   344     {
   353     {
   345     iIcon->SetId( aIconId );
   354     iIcon->SetId( aIconId );
   346     }
   355     }
       
   356 
       
   357 // ---------------------------------------------------------------------------
       
   358 //
       
   359 // ---------------------------------------------------------------------------
       
   360 //
       
   361 EXPORT_C TBool CCaInnerEntry::isLocalized(TLocalizedType aLocalized) const
       
   362     {
       
   363     if(aLocalized == EDescriptionLocalized)
       
   364         {
       
   365         return iDescriptionLocalized;
       
   366         }
       
   367     if(aLocalized == ENameLocalized)
       
   368         {
       
   369         return iTextLocalized;
       
   370         }
       
   371     else 
       
   372         return EFalse;
       
   373     }
       
   374 
       
   375