appfw/apparchitecture/aplist/aplapplistitem.cpp
changeset 29 6a787171e1de
parent 0 2e3d3ce01487
child 81 676b6116ca93
equal deleted inserted replaced
28:b0b858956ed5 29:6a787171e1de
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    23 #include "../apgrfx/APGPRIV.H"		// KLitPathForNonNativeResourceAndIconFiles
    23 #include "../apgrfx/APGPRIV.H"		// KLitPathForNonNativeResourceAndIconFiles
    24 #include "../apgrfx/apprivate.h"	// KLitPathForNonNativeResourceAndIconFiles
    24 #include "../apgrfx/apprivate.h"	// KLitPathForNonNativeResourceAndIconFiles
    25 #include "aplappinforeader.h"
    25 #include "aplappinforeader.h"
    26 #include <e32uid.h>
    26 #include <e32uid.h>
    27 
    27 
       
    28 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
    29 #include <usif/scr/appregentries.h>
       
    30 #endif
    28 
    31 
    29 // Delays in the pseudo idle object that builds the application list
    32 // Delays in the pseudo idle object that builds the application list
    30 //
    33 //
    31 
    34 
    32 //
    35 //
   231 
   234 
   232 //
   235 //
   233 // Class CApaAppData
   236 // Class CApaAppData
   234 //
   237 //
   235 
   238 
       
   239 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   240 CApaAppData::CApaAppData(RFs& aFs)
       
   241     :iCaption(NULL), iShortCaption(NULL), 
       
   242     iFs(aFs),
       
   243     iNonMbmIconFile(EFalse),
       
   244     iApplicationLanguage(ELangNone), iIndexOfFirstOpenService(-1),
       
   245     iShortCaptionFromResourceFile(NULL)
       
   246     {
       
   247     }
       
   248 EXPORT_C CApaAppData* CApaAppData::NewL(const Usif::CApplicationRegistrationData& aAppInfo, RFs& aFs, const Usif::RSoftwareComponentRegistry& aScrCon)
       
   249     {
       
   250     CApaAppData* self=new(ELeave) CApaAppData(aFs);
       
   251     CleanupStack::PushL(self);
       
   252     self->ConstructL(aAppInfo, aScrCon);
       
   253     CleanupStack::Pop(self); // self
       
   254     return self;
       
   255     }
       
   256 
       
   257 void CApaAppData::ConstructL(const Usif::CApplicationRegistrationData& aAppInfo, const Usif::RSoftwareComponentRegistry& aScrCon)
       
   258     {
       
   259     iCapabilityBuf.FillZ(iCapabilityBuf.MaxLength());
       
   260     iIcons = CApaAppIconArray::NewL();
       
   261     iViewDataArray=new(ELeave) CArrayPtrFlat<CApaAppViewData>(1);
       
   262     iOwnedFileArray=new(ELeave) CDesCArraySeg(1);
       
   263     User::LeaveIfError(ReadApplicationInformationFromSCRL(aAppInfo, aScrCon));   
       
   264     }
       
   265 
       
   266 //Initializes the CApaAppData object with information read from SCR. Leaves if any error occurs during initialization.
       
   267 
       
   268 TInt CApaAppData::ReadApplicationInformationFromSCRL(const Usif::CApplicationRegistrationData& aAppInfo, const Usif::RSoftwareComponentRegistry& aScrCon)
       
   269     {
       
   270     HBufC* caption = NULL;
       
   271     HBufC* shortCaption = NULL;
       
   272 
       
   273     CApaAppInfoReader* appInfoReader = NULL;
       
   274     appInfoReader = CApaAppInfoReader::NewL(iFs, aAppInfo, aScrCon); 
       
   275     CleanupStack::PushL(appInfoReader);
       
   276     TBool readSuccessful=EFalse;
       
   277     readSuccessful= appInfoReader->ReadL();
       
   278     
       
   279     iFullName=appInfoReader->AppBinaryFullName();
       
   280     
       
   281     iUidType = appInfoReader->AppBinaryUidType();
       
   282 
       
   283     caption = appInfoReader->Caption();
       
   284     shortCaption = appInfoReader->ShortCaption();
       
   285 
       
   286     CApaAppIconArray* icons = appInfoReader->Icons();
       
   287     if(icons)
       
   288         {
       
   289         delete iIcons;
       
   290         iIcons = icons;
       
   291         iIconLoader = appInfoReader->IconLoader();
       
   292         }
       
   293     else
       
   294         {           
       
   295         TRAPD(err, icons = CApaAppIconArray::NewL());
       
   296         if(err == KErrNone)
       
   297             {
       
   298             delete iIcons;
       
   299             iIcons = icons;
       
   300             }
       
   301         }
       
   302         
       
   303                
       
   304     iOpaqueData = appInfoReader->OpaqueData();
       
   305 
       
   306     if (readSuccessful)
       
   307         {
       
   308         appInfoReader->Capability(iCapabilityBuf);
       
   309 
       
   310         iDefaultScreenNumber = appInfoReader->DefaultScreenNumber();
       
   311 
       
   312         delete iIconFileName;
       
   313         iIconFileName = appInfoReader->IconFileName();
       
   314         iNonMbmIconFile = appInfoReader->NonMbmIconFile();
       
   315         iNumOfAppIcons = appInfoReader->NumOfAppIcons();
       
   316         iApplicationLanguage = appInfoReader->AppLanguage();
       
   317                 
       
   318         // views
       
   319         iViewDataArray->ResetAndDestroy();
       
   320         CArrayPtrFlat<CApaAppViewData>* viewDataArray = appInfoReader->Views();
       
   321         if (viewDataArray)
       
   322             {
       
   323             delete iViewDataArray;
       
   324             iViewDataArray = viewDataArray;
       
   325             
       
   326             if(!iIconLoader && ViewMbmIconsRequireLoading())
       
   327                 {
       
   328                 //if VIEW_DATA contains a MBM icon we need to initialize iIconLoader
       
   329                 iIconLoader = appInfoReader->IconLoader();
       
   330                 }
       
   331             }
       
   332 
       
   333             // owned files
       
   334             iOwnedFileArray->Reset();
       
   335             CDesCArray* const ownedFileArray = appInfoReader->OwnedFiles();
       
   336             if (ownedFileArray)
       
   337                 {
       
   338                 delete iOwnedFileArray;
       
   339                 iOwnedFileArray = ownedFileArray;
       
   340                 }
       
   341             
       
   342             UpdateServiceArray(appInfoReader->ServiceArray(iIndexOfFirstOpenService));
       
   343             }
       
   344 
       
   345     CleanupStack::PopAndDestroy(appInfoReader);
       
   346 
       
   347     if (!caption)
       
   348         {
       
   349         TParsePtrC parse (*iFullName);
       
   350         caption = parse.Name().Alloc();
       
   351         }
       
   352 
       
   353     // Put the captions into place
       
   354     if (caption)
       
   355         {
       
   356         if (!shortCaption)
       
   357             {
       
   358             shortCaption = caption->Alloc();
       
   359             if (!shortCaption)
       
   360                 {
       
   361                 delete caption;
       
   362                 caption = NULL;
       
   363                 }
       
   364             }
       
   365 
       
   366         delete iCaption;
       
   367         iCaption = caption;
       
   368         delete iShortCaption;
       
   369         iShortCaption = shortCaption;
       
   370         }
       
   371     
       
   372     return caption ? KErrNone : KErrNoMemory;
       
   373     }
       
   374 
       
   375 
       
   376 EXPORT_C TUid CApaAppData::NonNativeApplicationType() const
       
   377 /** @internalComponent */
       
   378     {
       
   379     if (iCapabilityBuf().iAttributes & TApaAppCapability::ENonNative)
       
   380         return iUidType[1];
       
   381     else
       
   382         return TUid::Null();
       
   383     }
       
   384 
       
   385 EXPORT_C TBool CApaAppData::IsLangChangePending()
       
   386 {
       
   387     return iIsLangChangePending;
       
   388 }
       
   389 
       
   390 #else
       
   391 CApaAppData::CApaAppData(RFs& aFs)
       
   392     :iCaption(NULL), iShortCaption(NULL), 
       
   393     iIsPresent(CApaAppData::EIsPresent), iFs(aFs),
       
   394     iNonMbmIconFile(EFalse),
       
   395     iApplicationLanguage(ELangNone), iIndexOfFirstOpenService(-1),
       
   396     iNonNativeApplicationType(TUid::Null()),
       
   397     iShortCaptionFromResourceFile(NULL)
       
   398     {
       
   399     }
       
   400 
   236 EXPORT_C CApaAppData* CApaAppData::NewL(const TApaAppEntry& aAppEntry, RFs& aFs)
   401 EXPORT_C CApaAppData* CApaAppData::NewL(const TApaAppEntry& aAppEntry, RFs& aFs)
   237 	{
   402     {
   238 	CApaAppData* self=new(ELeave) CApaAppData(aFs);
   403     CApaAppData* self=new(ELeave) CApaAppData(aFs);
   239 	CleanupStack::PushL(self);
   404     CleanupStack::PushL(self);
   240 	self->ConstructL(aAppEntry);
   405     self->ConstructL(aAppEntry);
   241 	CleanupStack::Pop(); // self
   406     CleanupStack::Pop(); // self
   242 	return self;
   407     return self;
   243 	}
   408     }
   244 
       
   245 CApaAppData::CApaAppData(RFs& aFs)
       
   246 	:iCaption(NULL), iShortCaption(NULL), 
       
   247 	iIsPresent(CApaAppData::EIsPresent), iFs(aFs),
       
   248 	iNonMbmIconFile(EFalse),
       
   249 	iApplicationLanguage(ELangNone), iIndexOfFirstOpenService(-1),
       
   250 	iNonNativeApplicationType(TUid::Null()),
       
   251 	iShortCaptionFromResourceFile(NULL)
       
   252 	{
       
   253 	}
       
   254 
   409 
   255 void CApaAppData::ConstructL(const TApaAppEntry& aAppEntry)
   410 void CApaAppData::ConstructL(const TApaAppEntry& aAppEntry)
   256 	{
   411     {
   257 	iUidType = aAppEntry.iUidType; // if the 2nd UID is KUidAppRegistrationFile, iUidType will be updated in ReadApplicationInformationFromResourceFiles() to reflect the TUidType for the application binary
   412     iUidType = aAppEntry.iUidType; // if the 2nd UID is KUidAppRegistrationFile, iUidType will be updated in ReadApplicationInformationFromResourceFiles() to reflect the TUidType for the application binary
   258 	if (ApaUtils::TypeUidIsForRegistrationFile(aAppEntry.iUidType))
   413 
   259 		{
   414     if (ApaUtils::TypeUidIsForRegistrationFile(aAppEntry.iUidType))
   260 		iRegistrationFile = aAppEntry.iFullName.AllocL();
   415         {
   261 		}
   416         iRegistrationFile = aAppEntry.iFullName.AllocL();
   262 	else
   417         }
   263 		{
   418     else
   264 		iFullName = aAppEntry.iFullName.AllocL();
   419         {
   265 		}
   420         iFullName = aAppEntry.iFullName.AllocL();
   266 
   421         }
   267 	iCapabilityBuf.FillZ(iCapabilityBuf.MaxLength());
   422     
   268 	iIcons = CApaAppIconArray::NewL();
   423     iCapabilityBuf.FillZ(iCapabilityBuf.MaxLength());
   269 	iViewDataArray=new(ELeave) CArrayPtrFlat<CApaAppViewData>(1);
   424     iIcons = CApaAppIconArray::NewL();
   270 	iOwnedFileArray=new(ELeave) CDesCArraySeg(1);
   425     iViewDataArray=new(ELeave) CArrayPtrFlat<CApaAppViewData>(1);
   271 	User::LeaveIfError(ReadApplicationInformationFromResourceFiles());
   426     iOwnedFileArray=new(ELeave) CDesCArraySeg(1);
   272 	}
   427     User::LeaveIfError(ReadApplicationInformationFromResourceFiles());    
       
   428     }
   273 
   429 
   274 // Return a standard error code
   430 // Return a standard error code
   275 // The value returned only reflect the caption status
   431 // The value returned only reflect the caption status
   276 // If there is errors setting up captions the old values are retained
   432 // If there is errors setting up captions the old values are retained
   277 // All other errors are silently ignored
   433 // All other errors are silently ignored
   279 // 1. This method is deliberately very similar to the old CApaAppData::GetAifData
   435 // 1. This method is deliberately very similar to the old CApaAppData::GetAifData
   280 //    in order to maintain behavioural compatibility for V1 apps
   436 //    in order to maintain behavioural compatibility for V1 apps
   281 // 2. Be very careful in this method, because it can be called on a newly constructed object,
   437 // 2. Be very careful in this method, because it can be called on a newly constructed object,
   282 //    or on an existing object, so don't assume member data pointers will be NULL
   438 //    or on an existing object, so don't assume member data pointers will be NULL
   283 TInt CApaAppData::ReadApplicationInformationFromResourceFiles()
   439 TInt CApaAppData::ReadApplicationInformationFromResourceFiles()
   284 	{
   440     {
   285 	HBufC* caption = NULL;
   441     HBufC* caption = NULL;
   286 	HBufC* shortCaption = NULL;
   442     HBufC* shortCaption = NULL;
   287 
   443 
   288 	iTimeStamp = TTime(0); // cannot init in constructor because this function can be called on an existing CApaAppData object
   444     iTimeStamp = TTime(0); // cannot init in constructor because this function can be called on an existing CApaAppData object
   289 
   445 
   290 	if(iRegistrationFile)
   446     if(iRegistrationFile)
   291 		{
   447         {
   292 		CApaAppInfoReader* appInfoReader = NULL;
   448         CApaAppInfoReader* appInfoReader = NULL;
   293 		TRAP_IGNORE(appInfoReader = CApaAppInfoReader::NewL(iFs, *iRegistrationFile, iUidType[2]));	
   449         TRAP_IGNORE(appInfoReader = CApaAppInfoReader::NewL(iFs, *iRegistrationFile, iUidType[2])); 
   294 		if (!appInfoReader)
   450         if (!appInfoReader)
   295 			{
   451             {
   296 			if (!iFullName)
   452             if (!iFullName)
   297 				{
   453                 {
   298 				// assume that if iFullName is NULL, this method has been called as part
   454                 // assume that if iFullName is NULL, this method has been called as part
   299 				// of constructing a new app data object. The CApaAppInfoReader derived object
   455                 // of constructing a new app data object. The CApaAppInfoReader derived object
   300 				// could not be created, therefore we have no way to determine the full filename
   456                 // could not be created, therefore we have no way to determine the full filename
   301 				// of the app binary, so give up
   457                 // of the app binary, so give up
   302 				return KErrNoMemory;
   458                 return KErrNoMemory;
   303 				}
   459                 }
   304 			}
   460             }
   305 		else
   461         else
   306 			{
   462             {
   307 			TBool readSuccessful=EFalse;
   463             TBool readSuccessful=EFalse;
   308 			TRAP_IGNORE(readSuccessful= appInfoReader->ReadL());
   464             TRAP_IGNORE(readSuccessful= appInfoReader->ReadL());
   309 
   465 
   310 			HBufC* const appBinaryFullName = appInfoReader->AppBinaryFullName();
   466             HBufC* const appBinaryFullName = appInfoReader->AppBinaryFullName();
   311 			if (appBinaryFullName)
   467             if (appBinaryFullName)
   312 				{
   468                 {
   313 				delete iFullName;
   469                 delete iFullName;
   314 				iFullName = appBinaryFullName;
   470                 iFullName = appBinaryFullName;
   315 				}
   471                 }
   316 				
   472                 
   317 			if (!iFullName)
   473             if (!iFullName)
   318 				{
   474                 {
   319 				delete appInfoReader;
   475                 delete appInfoReader;
   320 				return KErrNoMemory;
   476                 return KErrNoMemory;
   321 				}
   477                 }
   322 				
   478                 
   323 			// if this object has just been constructed, iUidType is currently the TUidType
   479             // if this object has just been constructed, iUidType is currently the TUidType
   324 			// of the registration file, it should be the TUidType of the app binary file
   480             // of the registration file, it should be the TUidType of the app binary file
   325 			TUidType uidType = appInfoReader->AppBinaryUidType();
   481             TUidType uidType = appInfoReader->AppBinaryUidType();
   326 			if (uidType[1].iUid != KNullUid.iUid)
   482             if (uidType[1].iUid != KNullUid.iUid)
   327 				iUidType = uidType;
   483                 iUidType = uidType;
   328 
   484 
   329 			// must get captions regardless of value of readSuccessful,
   485             // must get captions regardless of value of readSuccessful,
   330 			// because the V1 reader might have read captions
   486             // because the V1 reader might have read captions
   331 			// this is done to maintain behavioural compatibility with V1
   487             // this is done to maintain behavioural compatibility with V1
   332 			caption = appInfoReader->Caption();
   488             caption = appInfoReader->Caption();
   333 			shortCaption = appInfoReader->ShortCaption();
   489             shortCaption = appInfoReader->ShortCaption();
   334 
   490 
   335 			CApaAppIconArray* icons = appInfoReader->Icons();
   491             CApaAppIconArray* icons = appInfoReader->Icons();
   336 			if(icons)
   492             if(icons)
   337 				{
   493                 {
   338 				delete iIcons;
   494                 delete iIcons;
   339 				iIcons = icons;
   495                 iIcons = icons;
   340 				iIconLoader = appInfoReader->IconLoader();
   496                 iIconLoader = appInfoReader->IconLoader();
   341 				}
   497                 }
   342 			else
   498             else
   343 				{			
   499                 {           
   344 				TRAPD(err, icons = CApaAppIconArray::NewL());
   500                 TRAPD(err, icons = CApaAppIconArray::NewL());
   345 				if(err == KErrNone)
   501                 if(err == KErrNone)
   346 					{
   502                     {
   347 					delete iIcons;
   503                     delete iIcons;
   348 					iIcons = icons;
   504                     iIcons = icons;
   349 					}
   505                     }
   350 				}
   506                 }
   351 				
   507                 
   352 			iTimeStamp = appInfoReader->TimeStamp();
   508             iTimeStamp = appInfoReader->TimeStamp();
   353 			delete iLocalisableResourceFileName;
   509             delete iLocalisableResourceFileName;
   354 			iLocalisableResourceFileName = appInfoReader->LocalisableResourceFileName();
   510             iLocalisableResourceFileName = appInfoReader->LocalisableResourceFileName();
   355 			iLocalisableResourceFileTimeStamp = appInfoReader->LocalisableResourceFileTimeStamp();
   511             iLocalisableResourceFileTimeStamp = appInfoReader->LocalisableResourceFileTimeStamp();
   356 
   512 
   357 			const TBool isNonNativeApp = 
   513             const TBool isNonNativeApp = 
   358 				(TParsePtrC(*iRegistrationFile).Path().CompareF(KLitPathForNonNativeResourceAndIconFiles) == 0);
   514                 (TParsePtrC(*iRegistrationFile).Path().CompareF(KLitPathForNonNativeResourceAndIconFiles) == 0);
   359 				
   515                 
   360 			if (isNonNativeApp)
   516             if (isNonNativeApp)
   361 				{
   517                 {
   362 				// In the case of a non-native app, the resource file has been prefixed with a
   518                 // In the case of a non-native app, the resource file has been prefixed with a
   363 				// TCheckedUid, the second of whose UIDs is the non-native application type uid.
   519                 // TCheckedUid, the second of whose UIDs is the non-native application type uid.
   364 				TEntry entry;
   520                 TEntry entry;
   365 				const TInt error=iFs.Entry(*iRegistrationFile, entry);
   521                 const TInt error=iFs.Entry(*iRegistrationFile, entry);
   366 				if (error!=KErrNone)
   522                 if (error!=KErrNone)
   367 					{
   523                     {
   368 					delete appInfoReader;
   524                     delete appInfoReader;
   369 					return error;
   525                     return error;
   370 					}
   526                     }
   371 					
   527                     
   372 				__ASSERT_DEBUG(entry.iType[0].iUid==KUidPrefixedNonNativeRegistrationResourceFile, Panic(EPanicUnexpectedUid));
   528                 __ASSERT_DEBUG(entry.iType[0].iUid==KUidPrefixedNonNativeRegistrationResourceFile, Panic(EPanicUnexpectedUid));
   373 				iNonNativeApplicationType=entry.iType[1];
   529                 iNonNativeApplicationType=entry.iType[1];
   374 				}
   530                 }
   375 
   531 
   376 			delete iOpaqueData;
   532             delete iOpaqueData;
   377 			iOpaqueData = appInfoReader->OpaqueData();
   533             iOpaqueData = appInfoReader->OpaqueData();
   378 
   534 
   379 			if (readSuccessful)
   535             if (readSuccessful)
   380 				{
   536                 {
   381 				appInfoReader->Capability(iCapabilityBuf);
   537                 appInfoReader->Capability(iCapabilityBuf);
   382 
   538 
   383 				iDefaultScreenNumber = appInfoReader->DefaultScreenNumber();
   539                 iDefaultScreenNumber = appInfoReader->DefaultScreenNumber();
   384 
   540 
   385 				delete iIconFileName;
   541                 delete iIconFileName;
   386 				iIconFileName = appInfoReader->IconFileName();
   542                 iIconFileName = appInfoReader->IconFileName();
   387 				iIconFileTimeStamp = appInfoReader->IconFileTimeStamp();
   543                 iIconFileTimeStamp = appInfoReader->IconFileTimeStamp();
   388 				iNonMbmIconFile = appInfoReader->NonMbmIconFile();
   544                 iNonMbmIconFile = appInfoReader->NonMbmIconFile();
   389 				iNumOfAppIcons = appInfoReader->NumOfAppIcons();
   545                 iNumOfAppIcons = appInfoReader->NumOfAppIcons();
   390 				iApplicationLanguage = appInfoReader->AppLanguage();
   546                 iApplicationLanguage = appInfoReader->AppLanguage();
   391 						
   547                         
   392 				// views
   548                 // views
   393 				iViewDataArray->ResetAndDestroy();
   549                 iViewDataArray->ResetAndDestroy();
   394 				CArrayPtrFlat<CApaAppViewData>* viewDataArray = appInfoReader->Views();
   550                 CArrayPtrFlat<CApaAppViewData>* viewDataArray = appInfoReader->Views();
   395 				if (viewDataArray)
   551                 if (viewDataArray)
   396 					{
   552                     {
   397 					delete iViewDataArray;
   553                     delete iViewDataArray;
   398 					iViewDataArray = viewDataArray;
   554                     iViewDataArray = viewDataArray;
   399 					
   555                     
   400 					if(!iIconLoader && ViewMbmIconsRequireLoading())
   556                     if(!iIconLoader && ViewMbmIconsRequireLoading())
   401 					    {
   557                         {
   402 					    //if VIEW_DATA contains a MBM icon we need to initialize iIconLoader
   558                         //if VIEW_DATA contains a MBM icon we need to initialize iIconLoader
   403 					    iIconLoader = appInfoReader->IconLoader();
   559                         iIconLoader = appInfoReader->IconLoader();
   404 					    }
   560                         }
   405 					}
   561                     }
   406 
   562 
   407 				// owned files
   563                 // owned files
   408 				iOwnedFileArray->Reset();
   564                 iOwnedFileArray->Reset();
   409 				CDesCArray* const ownedFileArray = appInfoReader->OwnedFiles();
   565                 CDesCArray* const ownedFileArray = appInfoReader->OwnedFiles();
   410 				if (ownedFileArray)
   566                 if (ownedFileArray)
   411 					{
   567                     {
   412 					delete iOwnedFileArray;
   568                     delete iOwnedFileArray;
   413 					iOwnedFileArray = ownedFileArray;
   569                     iOwnedFileArray = ownedFileArray;
   414 					}
   570                     }
   415 				
   571                 
   416 				UpdateServiceArray(appInfoReader->ServiceArray(iIndexOfFirstOpenService));
   572                 UpdateServiceArray(appInfoReader->ServiceArray(iIndexOfFirstOpenService));
   417 				}
   573                 }
   418 
   574 
   419 			delete appInfoReader;
   575             delete appInfoReader;
   420 			}
   576             }
   421 		}
   577         }
   422 		
   578         
   423 	if (!caption)
   579     if (!caption)
   424 		{
   580         {
   425 		TParsePtrC parse (*iFullName);
   581         TParsePtrC parse (*iFullName);
   426 		caption = parse.Name().Alloc();
   582         caption = parse.Name().Alloc();
   427 		}
   583         }
   428 
   584 
   429 	// Put the captions into place
   585     // Put the captions into place
   430 	if (caption)
   586     if (caption)
   431 		{
   587         {
   432 		if (!shortCaption)
   588         if (!shortCaption)
   433 			{
   589             {
   434 			shortCaption = caption->Alloc();
   590             shortCaption = caption->Alloc();
   435 			if (!shortCaption)
   591             if (!shortCaption)
   436 				{
   592                 {
   437 				delete caption;
   593                 delete caption;
   438 				caption = NULL;
   594                 caption = NULL;
   439 				}
   595                 }
   440 			}
   596             }
   441 
   597 
   442 		delete iCaption;
   598         delete iCaption;
   443 		iCaption = caption;
   599         iCaption = caption;
   444 		delete iShortCaption;
   600         delete iShortCaption;
   445 		iShortCaption = shortCaption;
   601         iShortCaption = shortCaption;
   446 		}
   602         }
   447 
   603 
   448 	return caption ? KErrNone : KErrNoMemory;
   604     return caption ? KErrNone : KErrNoMemory;
   449 	}
   605     }
       
   606 
       
   607 
       
   608 /** Returns true if app info was provided by a registration file
       
   609 
       
   610 @return true if app info was provided by a registration file
       
   611 */
       
   612 EXPORT_C TBool CApaAppData::RegistrationFileUsed() const
       
   613     {
       
   614     return iRegistrationFile != NULL;
       
   615     }
       
   616 
       
   617 /** Returns the full filename of the registration resource file
       
   618 
       
   619 @return The full path and filename of the registration resource file.
       
   620 @internalTechnology
       
   621 */
       
   622 EXPORT_C TPtrC CApaAppData::RegistrationFileName() const
       
   623     {
       
   624     if (iRegistrationFile)
       
   625         {
       
   626         return *iRegistrationFile;
       
   627         }
       
   628     else
       
   629         {
       
   630         return TPtrC(KNullDesC);
       
   631         }
       
   632     }
       
   633 
       
   634 
       
   635 /** Returns the full filename of the localisable resource file
       
   636 
       
   637 @return The full path and filename of the localisable resource file.
       
   638 @internalTechnology
       
   639 */
       
   640 EXPORT_C TPtrC CApaAppData::LocalisableResourceFileName() const
       
   641     {
       
   642     if (iLocalisableResourceFileName)
       
   643         {
       
   644         return *iLocalisableResourceFileName;
       
   645         }
       
   646     else
       
   647         {
       
   648         return TPtrC(KNullDesC);
       
   649         }
       
   650     }
       
   651 
       
   652 
       
   653 TBool CApaAppData::Update()
       
   654 // returns true if changes were made to the cached data
       
   655     {
       
   656     __APA_PROFILE_START(17);
       
   657     TBool changed=EFalse;
       
   658 
       
   659     // Get app info file entry
       
   660     TEntry entry;
       
   661     TInt ret;
       
   662     if (iRegistrationFile != NULL)
       
   663         {
       
   664         ret = iFs.Entry(*iRegistrationFile, entry);
       
   665         if (ret==KErrNone && entry.iModified!=iTimeStamp)
       
   666             {
       
   667             // assume registration file may have changed
       
   668             changed = ETrue;
       
   669             }
       
   670         else
       
   671             {
       
   672             if (iLocalisableResourceFileName)
       
   673                 {
       
   674                 // see if localisable resource information might have changed
       
   675                 TParse parse;
       
   676                 ret = parse.SetNoWild(KAppResourceFileExtension, iLocalisableResourceFileName, NULL);
       
   677                 if (ret == KErrNone)
       
   678                     {
       
   679                     TFileName resourceFileName(parse.FullName());
       
   680                     TLanguage language;
       
   681                     BaflUtils::NearestLanguageFileV2(iFs, resourceFileName, language);
       
   682                     (void)language;
       
   683                     if (resourceFileName.CompareF(*iLocalisableResourceFileName)!=0)
       
   684                         {
       
   685                         changed = ETrue;
       
   686                         }
       
   687                     else
       
   688                         {
       
   689                         ret = iFs.Entry(*iLocalisableResourceFileName, entry);
       
   690                         if ((ret==KErrNotFound && iLocalisableResourceFileTimeStamp!=TTime(0)) ||
       
   691                             (ret==KErrNone && entry.iModified!=iLocalisableResourceFileTimeStamp))
       
   692                             {
       
   693                             changed = ETrue;
       
   694                             }
       
   695                         }
       
   696                     }
       
   697                 }
       
   698             }
       
   699         }
       
   700     if (changed)
       
   701         {
       
   702         // re-read data
       
   703         // Ignore result, nothing we can do in case failure
       
   704         // and the old values should be preserved
       
   705         const TInt ignore = ReadApplicationInformationFromResourceFiles();
       
   706         } //lint !e529 Symbol 'ignore' not subsequently referenced
       
   707         
       
   708     else 
       
   709         {
       
   710         if (iIconFileName)
       
   711             {
       
   712             ret = iFs.Entry(*iIconFileName, entry);
       
   713             // See if the icon file has been "modified"
       
   714             // It could have been replaced with a differnt version, deleted or added 
       
   715             // if the icon file specified in the resource was missing
       
   716             if ((ret==KErrNotFound && iIconFileTimeStamp!=TTime(0)) ||
       
   717                     (ret==KErrNone && entry.iModified!=iIconFileTimeStamp))
       
   718                     {
       
   719                     // Assume the icon file has changed
       
   720                     iIconFileTimeStamp = entry.iModified;
       
   721                     changed = ETrue;
       
   722                     }
       
   723             }
       
   724         }
       
   725 
       
   726     __APA_PROFILE_END(17);
       
   727     return changed;
       
   728     }
       
   729 
       
   730 EXPORT_C TBool CApaAppData::IsPending() const
       
   731 /* Returns true if the app info is not yet updated by the current scan. */
       
   732     {
       
   733     return (iIsPresent==CApaAppData::EPresentPendingUpdate 
       
   734         || iIsPresent==CApaAppData::ENotPresentPendingUpdate);
       
   735     }
       
   736 
       
   737 EXPORT_C TUid CApaAppData::NonNativeApplicationType() const
       
   738 /** @internalComponent */
       
   739     {
       
   740     return iNonNativeApplicationType;
       
   741     }
       
   742 
       
   743 void CApaAppData::SetAppPending()
       
   744     {
       
   745     if (iIsPresent == CApaAppData::ENotPresent 
       
   746         || iIsPresent == CApaAppData::ENotPresentPendingUpdate)
       
   747         {
       
   748         iIsPresent = CApaAppData::ENotPresentPendingUpdate;
       
   749         }
       
   750     else
       
   751         {
       
   752         iIsPresent = CApaAppData::EPresentPendingUpdate;
       
   753         }
       
   754     }
       
   755 #endif
       
   756 
       
   757 EXPORT_C TApaAppEntry CApaAppData::AppEntry() const
       
   758 /** Constructs an application entry based on this object.
       
   759 
       
   760 @return The application entry. */
       
   761     {
       
   762     return TApaAppEntry(iUidType,*iFullName);
       
   763     }
   450 
   764 
   451 EXPORT_C CApaAppData::~CApaAppData()
   765 EXPORT_C CApaAppData::~CApaAppData()
   452 // Just delete components, NOT iNext (next CApaAppData in the list).
   766 // Just delete components, NOT iNext (next CApaAppData in the list).
   453 	{
   767 	{
   454 	delete iSuccessor;
   768 	delete iSuccessor;
   463 		iViewDataArray->ResetAndDestroy();
   777 		iViewDataArray->ResetAndDestroy();
   464 		delete iViewDataArray;
   778 		delete iViewDataArray;
   465 		}
   779 		}
   466 	delete iOwnedFileArray;
   780 	delete iOwnedFileArray;
   467 	delete iIconFileName;
   781 	delete iIconFileName;
       
   782 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK	
   468 	delete iLocalisableResourceFileName;
   783 	delete iLocalisableResourceFileName;
       
   784     delete iRegistrationFile;	
       
   785 #endif	
   469 	if (iServiceArray)
   786 	if (iServiceArray)
   470 		{
   787 		{
   471 		CleanupServiceArray(iServiceArray);
   788 		CleanupServiceArray(iServiceArray);
   472 		iServiceArray = NULL;
   789 		iServiceArray = NULL;
   473 		}
   790 		}
   474 	delete iOpaqueData;
   791 	delete iOpaqueData;
   475 	delete iRegistrationFile;
       
   476 	iNext = NULL;
   792 	iNext = NULL;
   477 	}
   793 	}
       
   794 
   478 
   795 
   479 void CApaAppData::UpdateServiceArray(CArrayFixFlat<TApaAppServiceInfo>* aNewServiceArray)
   796 void CApaAppData::UpdateServiceArray(CArrayFixFlat<TApaAppServiceInfo>* aNewServiceArray)
   480 	{
   797 	{
   481 	// clear out any existing service info
   798 	// clear out any existing service info
   482 	if (iServiceArray)
   799 	if (iServiceArray)
   574 @return A pointer to an array of the icon sizes. The caller takes ownership. */
   891 @return A pointer to an array of the icon sizes. The caller takes ownership. */
   575 	{
   892 	{
   576 	return iIcons->IconSizesL();
   893 	return iIcons->IconSizesL();
   577 	}
   894 	}
   578 
   895 
   579 EXPORT_C TApaAppEntry CApaAppData::AppEntry() const
       
   580 /** Constructs an application entry based on this object.
       
   581 
       
   582 @return The application entry. */
       
   583 	{
       
   584 	return TApaAppEntry(iUidType,*iFullName);
       
   585 	}
       
   586 
       
   587 
   896 
   588 EXPORT_C void CApaAppData::Capability(TDes8& aCapabilityBuf)const
   897 EXPORT_C void CApaAppData::Capability(TDes8& aCapabilityBuf)const
   589 /** Gets the application's capabilities.
   898 /** Gets the application's capabilities.
   590 
   899 
   591 @param aCapabilityBuf On return, contains the application's capabilities, 
   900 @param aCapabilityBuf On return, contains the application's capabilities, 
   612 EXPORT_C CDesCArray* CApaAppData::OwnedFiles() const
   921 EXPORT_C CDesCArray* CApaAppData::OwnedFiles() const
   613 	{
   922 	{
   614 	return iOwnedFileArray;
   923 	return iOwnedFileArray;
   615 	}
   924 	}
   616 
   925 
   617 TBool CApaAppData::Update()
       
   618 // returns true if changes were made to the cached data
       
   619 	{
       
   620 	__APA_PROFILE_START(17);
       
   621 	TBool changed=EFalse;
       
   622 
       
   623 	// Get app info file entry
       
   624 	TEntry entry;
       
   625 	TInt ret;
       
   626 	if (iRegistrationFile != NULL)
       
   627 		{
       
   628 		ret = iFs.Entry(*iRegistrationFile, entry);
       
   629 		if (ret==KErrNone && entry.iModified!=iTimeStamp)
       
   630 			{
       
   631 			// assume registration file may have changed
       
   632 			changed = ETrue;
       
   633 			}
       
   634 		else
       
   635 			{
       
   636 			if (iLocalisableResourceFileName)
       
   637 				{
       
   638 				// see if localisable resource information might have changed
       
   639 				TParse parse;
       
   640 				ret = parse.SetNoWild(KAppResourceFileExtension, iLocalisableResourceFileName, NULL);
       
   641 				if (ret == KErrNone)
       
   642 					{
       
   643 					TFileName resourceFileName(parse.FullName());
       
   644 					TLanguage language;
       
   645 					BaflUtils::NearestLanguageFileV2(iFs, resourceFileName, language);
       
   646 					(void)language;
       
   647 					if (resourceFileName.CompareF(*iLocalisableResourceFileName)!=0)
       
   648 						{
       
   649 						changed = ETrue;
       
   650 						}
       
   651 					else
       
   652 						{
       
   653 						ret = iFs.Entry(*iLocalisableResourceFileName, entry);
       
   654 						if ((ret==KErrNotFound && iLocalisableResourceFileTimeStamp!=TTime(0)) ||
       
   655 							(ret==KErrNone && entry.iModified!=iLocalisableResourceFileTimeStamp))
       
   656 							{
       
   657 							changed = ETrue;
       
   658 							}
       
   659 						}
       
   660 					}
       
   661 				}
       
   662 			}
       
   663 		}
       
   664 	if (changed)
       
   665 		{
       
   666 		// re-read data
       
   667 		// Ignore result, nothing we can do in case failure
       
   668 		// and the old values should be preserved
       
   669 		const TInt ignore = ReadApplicationInformationFromResourceFiles();
       
   670 		} //lint !e529 Symbol 'ignore' not subsequently referenced
       
   671 		
       
   672 	else 
       
   673 		{
       
   674 		if (iIconFileName)
       
   675 			{
       
   676 			ret = iFs.Entry(*iIconFileName, entry);
       
   677 			// See if the icon file has been "modified"
       
   678 			// It could have been replaced with a differnt version, deleted or added 
       
   679 			// if the icon file specified in the resource was missing
       
   680 			if ((ret==KErrNotFound && iIconFileTimeStamp!=TTime(0)) ||
       
   681 					(ret==KErrNone && entry.iModified!=iIconFileTimeStamp))
       
   682 					{
       
   683 					// Assume the icon file has changed
       
   684 					iIconFileTimeStamp = entry.iModified;
       
   685 					changed = ETrue;
       
   686 					}
       
   687 			}
       
   688 		}
       
   689 
       
   690 	__APA_PROFILE_END(17);
       
   691 	return changed;
       
   692 	}
       
   693 
   926 
   694 EXPORT_C TDataTypePriority CApaAppData::DataType(const TDataType& aDataType) const
   927 EXPORT_C TDataTypePriority CApaAppData::DataType(const TDataType& aDataType) const
   695 // returns the priority of the data type
   928 // returns the priority of the data type
   696 /** If the application supports the specified data type, the function returns 
   929 /** If the application supports the specified data type, the function returns 
   697 the priority with which it should be selected for handling it.
   930 the priority with which it should be selected for handling it.
   717 		}
   950 		}
   718 	return KDataTypePriorityNotSupported;
   951 	return KDataTypePriorityNotSupported;
   719 	}
   952 	}
   720 
   953 
   721 
   954 
   722 EXPORT_C TBool CApaAppData::IsPending() const
       
   723 /* Returns true if the app info is not yet updated by the current scan. */
       
   724 	{
       
   725 	return (iIsPresent==CApaAppData::EPresentPendingUpdate 
       
   726 		|| iIsPresent==CApaAppData::ENotPresentPendingUpdate);
       
   727 	}
       
   728 
   955 
   729 EXPORT_C TBool CApaAppData::CanUseScreenMode(TInt aScreenMode)
   956 EXPORT_C TBool CApaAppData::CanUseScreenMode(TInt aScreenMode)
   730 /** Tests whether the specified screen mode is valid for any of 
   957 /** Tests whether the specified screen mode is valid for any of 
   731 this application's views. If the app has no views, the function 
   958 this application's views. If the app has no views, the function 
   732 assumes that only the default screen mode (at screen mode index 
   959 assumes that only the default screen mode (at screen mode index 
   773 EXPORT_C TUint CApaAppData::DefaultScreenNumber() const
  1000 EXPORT_C TUint CApaAppData::DefaultScreenNumber() const
   774 	{
  1001 	{
   775 	return iDefaultScreenNumber;
  1002 	return iDefaultScreenNumber;
   776 	}
  1003 	}
   777 
  1004 
   778 /** Returns true if app info was provided by a registration file
       
   779 
       
   780 @return true if app info was provided by a registration file
       
   781 */
       
   782 EXPORT_C TBool CApaAppData::RegistrationFileUsed() const
       
   783 	{
       
   784 	return iRegistrationFile != NULL;
       
   785 	}
       
   786 
       
   787 /** Returns the full filename of the registration resource file
       
   788 
       
   789 @return The full path and filename of the registration resource file.
       
   790 @internalTechnology
       
   791 */
       
   792 EXPORT_C TPtrC CApaAppData::RegistrationFileName() const
       
   793 	{
       
   794 	if (iRegistrationFile)
       
   795 		{
       
   796 		return *iRegistrationFile;
       
   797 		}
       
   798 	else
       
   799 		{
       
   800 		return TPtrC(KNullDesC);
       
   801 		}
       
   802 	}
       
   803 
       
   804 
       
   805 /** Returns the full filename of the localisable resource file
       
   806 
       
   807 @return The full path and filename of the localisable resource file.
       
   808 @internalTechnology
       
   809 */
       
   810 EXPORT_C TPtrC CApaAppData::LocalisableResourceFileName() const
       
   811 	{
       
   812 	if (iLocalisableResourceFileName)
       
   813 		{
       
   814 		return *iLocalisableResourceFileName;
       
   815 		}
       
   816 	else
       
   817 		{
       
   818 		return TPtrC(KNullDesC);
       
   819 		}
       
   820 	}
       
   821 
       
   822 
       
   823 /** Returns the non-native application opaque data
  1005 /** Returns the non-native application opaque data
   824 
  1006 
   825 @return The non-native application opaque data.
  1007 @return The non-native application opaque data.
   826 @internalComponent
  1008 @internalComponent
   827 */
  1009 */
   835 		{
  1017 		{
   836 		return TPtrC8(KNullDesC8);
  1018 		return TPtrC8(KNullDesC8);
   837 		}
  1019 		}
   838 	}
  1020 	}
   839 
  1021 
   840 EXPORT_C TUid CApaAppData::NonNativeApplicationType() const
       
   841 /** @internalComponent */
       
   842 	{
       
   843 	return iNonNativeApplicationType;
       
   844 	}
       
   845 
  1022 
   846 /** Returns the full filename of the file containing application icons
  1023 /** Returns the full filename of the file containing application icons
   847 
  1024 
   848 @return The full path and filename of the icon file.
  1025 @return The full path and filename of the icon file.
   849 */
  1026 */
   989 		{
  1166 		{
   990 	 	iNumOfAppIconsFromResourceFile = iNumOfAppIcons;
  1167 	 	iNumOfAppIconsFromResourceFile = iNumOfAppIcons;
   991 	 	iIconFileNameFromResourceFile = iIconFileName;
  1168 	 	iIconFileNameFromResourceFile = iIconFileName;
   992 	 	iIconFileName = NULL;
  1169 	 	iIconFileName = NULL;
   993 	 	iNonMbmIconFileFromResourceFile = iNonMbmIconFile;
  1170 	 	iNonMbmIconFileFromResourceFile = iNonMbmIconFile;
       
  1171 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK	 	
   994 	 	iIconFileTimeStampFromResourceFile = iIconFileTimeStamp;
  1172 	 	iIconFileTimeStampFromResourceFile = iIconFileTimeStamp;
       
  1173 #endif	 	
   995 		}
  1174 		}
   996 		
  1175 		
   997 	iNonMbmIconFile = !CApaAppInfoReader::FileIsMbmWithGenericExtensionL(aFileName);
  1176 	iNonMbmIconFile = !CApaAppInfoReader::FileIsMbmWithGenericExtensionL(aFileName);
   998 	iNumOfAppIcons = aNumIcons;
  1177 	iNumOfAppIcons = aNumIcons;
   999 	
  1178 	
  1023 		delete iIcons;
  1202 		delete iIcons;
  1024 		iIcons = icons;
  1203 		iIcons = icons;
  1025 		}
  1204 		}
  1026 	}
  1205 	}
  1027 
  1206 
  1028 void CApaAppData::SetAppPending()
       
  1029 	{
       
  1030 	if (iIsPresent == CApaAppData::ENotPresent 
       
  1031 		|| iIsPresent == CApaAppData::ENotPresentPendingUpdate)
       
  1032 		{
       
  1033 		iIsPresent = CApaAppData::ENotPresentPendingUpdate;
       
  1034 		}
       
  1035 	else
       
  1036 		{
       
  1037 		iIsPresent = CApaAppData::EPresentPendingUpdate;
       
  1038 		}
       
  1039 	}
       
  1040 
       
  1041 void CApaAppData::InternalizeL(RReadStream& aReadStream)
  1207 void CApaAppData::InternalizeL(RReadStream& aReadStream)
  1042 /** Internalizes the appdata from the AppsList.bin file */
  1208 /** Internalizes the appdata from the AppsList.bin file */
  1043 	{
  1209 	{
       
  1210 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK    
  1044 	TUint highTime = aReadStream.ReadUint32L();
  1211 	TUint highTime = aReadStream.ReadUint32L();
  1045 	TUint lowTime = aReadStream.ReadUint32L();
  1212 	TUint lowTime = aReadStream.ReadUint32L();
  1046 	iTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));
  1213 	iTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));
  1047 
  1214 	
  1048 	highTime = aReadStream.ReadUint32L();
  1215 	highTime = aReadStream.ReadUint32L();
  1049 	lowTime = aReadStream.ReadUint32L();
  1216 	lowTime = aReadStream.ReadUint32L();
  1050 	iIconFileTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));
  1217 	iIconFileTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));
       
  1218 #endif
       
  1219 	
  1051 	iCaption = HBufC::NewL(aReadStream, KMaxFileName);	// Caption
  1220 	iCaption = HBufC::NewL(aReadStream, KMaxFileName);	// Caption
  1052 	iShortCaption = HBufC::NewL(aReadStream, KMaxFileName);	// Shortcaption
  1221 	iShortCaption = HBufC::NewL(aReadStream, KMaxFileName);	// Shortcaption
  1053 	iFullName = HBufC::NewL(aReadStream, KMaxFileName);		// Filename of application binary
  1222 	iFullName = HBufC::NewL(aReadStream, KMaxFileName);		// Filename of application binary
  1054 
  1223 
  1055 	TUid uid1;
  1224 	TUid uid1;
  1059 	TUid uid3;
  1228 	TUid uid3;
  1060 	uid3.iUid = aReadStream.ReadUint32L();
  1229 	uid3.iUid = aReadStream.ReadUint32L();
  1061 	iUidType = TUidType(uid1, uid2, uid3);	// Application UID
  1230 	iUidType = TUidType(uid1, uid2, uid3);	// Application UID
  1062 	
  1231 	
  1063 	aReadStream >> iCapabilityBuf;
  1232 	aReadStream >> iCapabilityBuf;
       
  1233 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 	
  1064 	iRegistrationFile = HBufC::NewL(aReadStream, KMaxFileName);	// Registration Filename
  1234 	iRegistrationFile = HBufC::NewL(aReadStream, KMaxFileName);	// Registration Filename
       
  1235 #endif	
  1065 	iDefaultScreenNumber = aReadStream.ReadUint32L();	// Default Screen number
  1236 	iDefaultScreenNumber = aReadStream.ReadUint32L();	// Default Screen number
  1066 	iNumOfAppIcons = aReadStream.ReadInt32L();	// No. of icons
  1237 	iNumOfAppIcons = aReadStream.ReadInt32L();	// No. of icons
  1067 	iNonMbmIconFile = aReadStream.ReadUint32L();
  1238 	iNonMbmIconFile = aReadStream.ReadUint32L();
  1068 
  1239 
  1069 	HBufC* iconFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Icon Filename
  1240 	HBufC* iconFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Icon Filename
  1090 		{
  1261 		{
  1091 		delete iconFileName;
  1262 		delete iconFileName;
  1092 		TRAP_IGNORE(iIcons = CApaAppIconArray::NewDefaultIconsL()); // Creates and Loads Default Icons.
  1263 		TRAP_IGNORE(iIcons = CApaAppIconArray::NewDefaultIconsL()); // Creates and Loads Default Icons.
  1093 		}
  1264 		}
  1094 
  1265 
       
  1266 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 
  1095 	HBufC* localisableResourceFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Registration Filename
  1267 	HBufC* localisableResourceFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Registration Filename
  1096 	if (*localisableResourceFileName != KNullDesC)
  1268 	if (*localisableResourceFileName != KNullDesC)
  1097 		iLocalisableResourceFileName = localisableResourceFileName;
  1269 		iLocalisableResourceFileName = localisableResourceFileName;
  1098 	else
  1270 	else
  1099 		delete localisableResourceFileName;
  1271 		delete localisableResourceFileName;
  1100 
  1272 
  1101 	highTime = aReadStream.ReadUint32L();
  1273 	highTime = aReadStream.ReadUint32L();
  1102 	lowTime = aReadStream.ReadUint32L();
  1274 	lowTime = aReadStream.ReadUint32L();
  1103 	iLocalisableResourceFileTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));	// Localisable file timestamp
  1275 	iLocalisableResourceFileTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));	// Localisable file timestamp
  1104 
  1276 #endif
       
  1277 	
  1105 	iApplicationLanguage = (TLanguage)aReadStream.ReadInt32L();	// Application Language
  1278 	iApplicationLanguage = (TLanguage)aReadStream.ReadInt32L();	// Application Language
  1106 	iIndexOfFirstOpenService = aReadStream.ReadUint32L();		// Index of first open service
  1279 	iIndexOfFirstOpenService = aReadStream.ReadUint32L();		// Index of first open service
       
  1280 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 	
  1107 	iNonNativeApplicationType.iUid = aReadStream.ReadUint32L();
  1281 	iNonNativeApplicationType.iUid = aReadStream.ReadUint32L();
       
  1282 #endif
  1108 
  1283 
  1109 	HBufC8* opaqueData = HBufC8::NewL(aReadStream, KMaxFileName);	// Opaque Data
  1284 	HBufC8* opaqueData = HBufC8::NewL(aReadStream, KMaxFileName);	// Opaque Data
  1110 	if (*opaqueData != KNullDesC8)
  1285 	if (*opaqueData != KNullDesC8)
  1111 		iOpaqueData = opaqueData;
  1286 		iOpaqueData = opaqueData;
  1112 	else
  1287 	else
  1201 	return EFalse; // icons were loaded already so no need to load them again.
  1376 	return EFalse; // icons were loaded already so no need to load them again.
  1202 	}
  1377 	}
  1203 
  1378 
  1204 void CApaAppData::ExternalizeL(RWriteStream& aWriteStream) const
  1379 void CApaAppData::ExternalizeL(RWriteStream& aWriteStream) const
  1205 	{
  1380 	{
       
  1381 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK     
  1206 	aWriteStream.WriteUint32L(I64HIGH(iTimeStamp.Int64()));
  1382 	aWriteStream.WriteUint32L(I64HIGH(iTimeStamp.Int64()));
  1207 	aWriteStream.WriteUint32L(I64LOW(iTimeStamp.Int64()));
  1383 	aWriteStream.WriteUint32L(I64LOW(iTimeStamp.Int64()));
  1208 
  1384 
  1209 	aWriteStream.WriteUint32L(I64HIGH(iIconFileTimeStamp.Int64()));
       
  1210 	aWriteStream.WriteUint32L(I64LOW(iIconFileTimeStamp.Int64()));
       
  1211 	aWriteStream << *iCaption;	// Caption
       
  1212 	if (iIconFileNameFromResourceFile)
  1385 	if (iIconFileNameFromResourceFile)
  1213 		{
  1386 		{
  1214 		aWriteStream.WriteUint32L(I64HIGH(iIconFileTimeStampFromResourceFile.Int64()));
  1387 		aWriteStream.WriteUint32L(I64HIGH(iIconFileTimeStampFromResourceFile.Int64()));
  1215 	    aWriteStream.WriteUint32L(I64LOW(iIconFileTimeStampFromResourceFile.Int64()));
  1388 	    aWriteStream.WriteUint32L(I64LOW(iIconFileTimeStampFromResourceFile.Int64()));
  1216 		}
  1389 		}
  1217 	else
  1390 	else
  1218 		{
  1391 		{
  1219 		aWriteStream.WriteUint32L(I64HIGH(iIconFileTimeStamp.Int64()));
  1392 		aWriteStream.WriteUint32L(I64HIGH(iIconFileTimeStamp.Int64()));
  1220 		aWriteStream.WriteUint32L(I64LOW(iIconFileTimeStamp.Int64()));
  1393 		aWriteStream.WriteUint32L(I64LOW(iIconFileTimeStamp.Int64()));
  1221 		}
  1394 		}
       
  1395 #endif	
  1222 	
  1396 	
  1223 	if (iCaptionFromResourceFile) // Caption present in the resource file would be externalized if the one in applist has dynamically changed
  1397 	if (iCaptionFromResourceFile) // Caption present in the resource file would be externalized if the one in applist has dynamically changed
  1224 		{
  1398 		{
  1225 		aWriteStream << *iCaptionFromResourceFile;
  1399 		aWriteStream << *iCaptionFromResourceFile;
  1226 		}
  1400 		}
  1239 	TInt i = 0;
  1413 	TInt i = 0;
  1240 	for (i = 0; i < 3; ++i)
  1414 	for (i = 0; i < 3; ++i)
  1241 		aWriteStream << iUidType[i];	// Uid Type
  1415 		aWriteStream << iUidType[i];	// Uid Type
  1242 
  1416 
  1243 	aWriteStream << iCapabilityBuf;
  1417 	aWriteStream << iCapabilityBuf;
       
  1418 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 	
  1244 	aWriteStream << RegistrationFileName();	// Registration filename
  1419 	aWriteStream << RegistrationFileName();	// Registration filename
       
  1420 #endif	
  1245 	aWriteStream.WriteUint32L(iDefaultScreenNumber);	// Default screen number
  1421 	aWriteStream.WriteUint32L(iDefaultScreenNumber);	// Default screen number
  1246 
  1422 
  1247 	if (iIconFileNameFromResourceFile)
  1423 	if (iIconFileNameFromResourceFile)
  1248 		{
  1424 		{
  1249 		aWriteStream.WriteUint32L(iNumOfAppIconsFromResourceFile);	// number of icons
  1425 		aWriteStream.WriteUint32L(iNumOfAppIconsFromResourceFile);	// number of icons
  1254 		{
  1430 		{
  1255 		aWriteStream.WriteUint32L(iNumOfAppIcons);	// number of icons
  1431 		aWriteStream.WriteUint32L(iNumOfAppIcons);	// number of icons
  1256 		aWriteStream.WriteUint32L(iNonMbmIconFile);
  1432 		aWriteStream.WriteUint32L(iNonMbmIconFile);
  1257 		aWriteStream << IconFileName();
  1433 		aWriteStream << IconFileName();
  1258 		}
  1434 		}
  1259 
  1435 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 
  1260 	aWriteStream << LocalisableResourceFileName();
  1436 	aWriteStream << LocalisableResourceFileName();
  1261 
  1437 
  1262 	aWriteStream.WriteUint32L(I64HIGH(iLocalisableResourceFileTimeStamp.Int64()));
  1438 	aWriteStream.WriteUint32L(I64HIGH(iLocalisableResourceFileTimeStamp.Int64()));
  1263 	aWriteStream.WriteUint32L(I64LOW(iLocalisableResourceFileTimeStamp.Int64()));
  1439 	aWriteStream.WriteUint32L(I64LOW(iLocalisableResourceFileTimeStamp.Int64()));
       
  1440 #endif	
  1264 
  1441 
  1265 	aWriteStream.WriteInt32L(iApplicationLanguage);
  1442 	aWriteStream.WriteInt32L(iApplicationLanguage);
  1266 
  1443 
  1267 	aWriteStream.WriteUint32L(iIndexOfFirstOpenService);
  1444 	aWriteStream.WriteUint32L(iIndexOfFirstOpenService);
  1268 
  1445 
       
  1446 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 
  1269 	aWriteStream.WriteUint32L(iNonNativeApplicationType.iUid);
  1447 	aWriteStream.WriteUint32L(iNonNativeApplicationType.iUid);
       
  1448 #endif
  1270 
  1449 
  1271 	aWriteStream << OpaqueData();
  1450 	aWriteStream << OpaqueData();
  1272 	
  1451 	
  1273 	TInt count = iViewDataArray->Count();
  1452 	TInt count = iViewDataArray->Count();
  1274 	aWriteStream.WriteUint32L(count);
  1453 	aWriteStream.WriteUint32L(count);