appfw/apparchitecture/aplist/aplapplistitem.cpp
branchRCL_3
changeset 20 c2c61fdca848
parent 19 924385140d98
equal deleted inserted replaced
19:924385140d98 20:c2c61fdca848
    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
       
    31 
    28 
    32 // Delays in the pseudo idle object that builds the application list
    29 // Delays in the pseudo idle object that builds the application list
    33 //
    30 //
    34 
    31 
    35 //
    32 //
   234 
   231 
   235 //
   232 //
   236 // Class CApaAppData
   233 // Class CApaAppData
   237 //
   234 //
   238 
   235 
   239 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
   236 EXPORT_C CApaAppData* CApaAppData::NewL(const TApaAppEntry& aAppEntry, RFs& aFs)
       
   237 	{
       
   238 	CApaAppData* self=new(ELeave) CApaAppData(aFs);
       
   239 	CleanupStack::PushL(self);
       
   240 	self->ConstructL(aAppEntry);
       
   241 	CleanupStack::Pop(); // self
       
   242 	return self;
       
   243 	}
       
   244 
   240 CApaAppData::CApaAppData(RFs& aFs)
   245 CApaAppData::CApaAppData(RFs& aFs)
   241     :iCaption(NULL), iShortCaption(NULL), 
   246 	:iCaption(NULL), iShortCaption(NULL), 
   242     iFs(aFs),
   247 	iIsPresent(CApaAppData::EIsPresent), iFs(aFs),
   243     iNonMbmIconFile(EFalse),
   248 	iNonMbmIconFile(EFalse),
   244     iApplicationLanguage(ELangNone), iIndexOfFirstOpenService(-1),
   249 	iApplicationLanguage(ELangNone), iIndexOfFirstOpenService(-1),
   245     iShortCaptionFromResourceFile(NULL)
   250 	iNonNativeApplicationType(TUid::Null()),
   246     {
   251 	iShortCaptionFromResourceFile(NULL)
   247     }
   252 	{
   248 EXPORT_C CApaAppData* CApaAppData::NewL(const Usif::CApplicationRegistrationData& aAppInfo, RFs& aFs, const Usif::RSoftwareComponentRegistry& aScrCon)
   253 	}
   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 
       
   401 EXPORT_C CApaAppData* CApaAppData::NewL(const TApaAppEntry& aAppEntry, RFs& aFs)
       
   402     {
       
   403     CApaAppData* self=new(ELeave) CApaAppData(aFs);
       
   404     CleanupStack::PushL(self);
       
   405     self->ConstructL(aAppEntry);
       
   406     CleanupStack::Pop(); // self
       
   407     return self;
       
   408     }
       
   409 
   254 
   410 void CApaAppData::ConstructL(const TApaAppEntry& aAppEntry)
   255 void CApaAppData::ConstructL(const TApaAppEntry& aAppEntry)
   411     {
   256 	{
   412     iUidType = aAppEntry.iUidType; // if the 2nd UID is KUidAppRegistrationFile, iUidType will be updated in ReadApplicationInformationFromResourceFiles() to reflect the TUidType for the application binary
   257 	iUidType = aAppEntry.iUidType; // if the 2nd UID is KUidAppRegistrationFile, iUidType will be updated in ReadApplicationInformationFromResourceFiles() to reflect the TUidType for the application binary
   413 
   258 	if (ApaUtils::TypeUidIsForRegistrationFile(aAppEntry.iUidType))
   414     if (ApaUtils::TypeUidIsForRegistrationFile(aAppEntry.iUidType))
   259 		{
   415         {
   260 		iRegistrationFile = aAppEntry.iFullName.AllocL();
   416         iRegistrationFile = aAppEntry.iFullName.AllocL();
   261 		}
   417         }
   262 	else
   418     else
   263 		{
   419         {
   264 		iFullName = aAppEntry.iFullName.AllocL();
   420         iFullName = aAppEntry.iFullName.AllocL();
   265 		}
   421         }
   266 
   422     
   267 	iCapabilityBuf.FillZ(iCapabilityBuf.MaxLength());
   423     iCapabilityBuf.FillZ(iCapabilityBuf.MaxLength());
   268 	iIcons = CApaAppIconArray::NewL();
   424     iIcons = CApaAppIconArray::NewL();
   269 	iViewDataArray=new(ELeave) CArrayPtrFlat<CApaAppViewData>(1);
   425     iViewDataArray=new(ELeave) CArrayPtrFlat<CApaAppViewData>(1);
   270 	iOwnedFileArray=new(ELeave) CDesCArraySeg(1);
   426     iOwnedFileArray=new(ELeave) CDesCArraySeg(1);
   271 	User::LeaveIfError(ReadApplicationInformationFromResourceFiles());
   427     User::LeaveIfError(ReadApplicationInformationFromResourceFiles());    
   272 	}
   428     }
       
   429 
   273 
   430 // Return a standard error code
   274 // Return a standard error code
   431 // The value returned only reflect the caption status
   275 // The value returned only reflect the caption status
   432 // If there is errors setting up captions the old values are retained
   276 // If there is errors setting up captions the old values are retained
   433 // All other errors are silently ignored
   277 // All other errors are silently ignored
   435 // 1. This method is deliberately very similar to the old CApaAppData::GetAifData
   279 // 1. This method is deliberately very similar to the old CApaAppData::GetAifData
   436 //    in order to maintain behavioural compatibility for V1 apps
   280 //    in order to maintain behavioural compatibility for V1 apps
   437 // 2. Be very careful in this method, because it can be called on a newly constructed object,
   281 // 2. Be very careful in this method, because it can be called on a newly constructed object,
   438 //    or on an existing object, so don't assume member data pointers will be NULL
   282 //    or on an existing object, so don't assume member data pointers will be NULL
   439 TInt CApaAppData::ReadApplicationInformationFromResourceFiles()
   283 TInt CApaAppData::ReadApplicationInformationFromResourceFiles()
   440     {
   284 	{
   441     HBufC* caption = NULL;
   285 	HBufC* caption = NULL;
   442     HBufC* shortCaption = NULL;
   286 	HBufC* shortCaption = NULL;
   443 
   287 
   444     iTimeStamp = TTime(0); // cannot init in constructor because this function can be called on an existing CApaAppData object
   288 	iTimeStamp = TTime(0); // cannot init in constructor because this function can be called on an existing CApaAppData object
   445 
   289 
   446     if(iRegistrationFile)
   290 	if(iRegistrationFile)
   447         {
   291 		{
   448         CApaAppInfoReader* appInfoReader = NULL;
   292 		CApaAppInfoReader* appInfoReader = NULL;
   449         TRAP_IGNORE(appInfoReader = CApaAppInfoReader::NewL(iFs, *iRegistrationFile, iUidType[2])); 
   293 		TRAP_IGNORE(appInfoReader = CApaAppInfoReader::NewL(iFs, *iRegistrationFile, iUidType[2]));	
   450         if (!appInfoReader)
   294 		if (!appInfoReader)
   451             {
   295 			{
   452             if (!iFullName)
   296 			if (!iFullName)
   453                 {
   297 				{
   454                 // assume that if iFullName is NULL, this method has been called as part
   298 				// assume that if iFullName is NULL, this method has been called as part
   455                 // of constructing a new app data object. The CApaAppInfoReader derived object
   299 				// of constructing a new app data object. The CApaAppInfoReader derived object
   456                 // could not be created, therefore we have no way to determine the full filename
   300 				// could not be created, therefore we have no way to determine the full filename
   457                 // of the app binary, so give up
   301 				// of the app binary, so give up
   458                 return KErrNoMemory;
   302 				return KErrNoMemory;
   459                 }
   303 				}
   460             }
   304 			}
   461         else
   305 		else
   462             {
   306 			{
   463             TBool readSuccessful=EFalse;
   307 			TBool readSuccessful=EFalse;
   464             TRAP_IGNORE(readSuccessful= appInfoReader->ReadL());
   308 			TRAP_IGNORE(readSuccessful= appInfoReader->ReadL());
   465 
   309 
   466             HBufC* const appBinaryFullName = appInfoReader->AppBinaryFullName();
   310 			HBufC* const appBinaryFullName = appInfoReader->AppBinaryFullName();
   467             if (appBinaryFullName)
   311 			if (appBinaryFullName)
   468                 {
   312 				{
   469                 delete iFullName;
   313 				delete iFullName;
   470                 iFullName = appBinaryFullName;
   314 				iFullName = appBinaryFullName;
   471                 }
   315 				}
   472                 
   316 				
   473             if (!iFullName)
   317 			if (!iFullName)
   474                 {
   318 				{
   475                 delete appInfoReader;
   319 				delete appInfoReader;
   476                 return KErrNoMemory;
   320 				return KErrNoMemory;
   477                 }
   321 				}
   478                 
   322 				
   479             // if this object has just been constructed, iUidType is currently the TUidType
   323 			// if this object has just been constructed, iUidType is currently the TUidType
   480             // of the registration file, it should be the TUidType of the app binary file
   324 			// of the registration file, it should be the TUidType of the app binary file
   481             TUidType uidType = appInfoReader->AppBinaryUidType();
   325 			TUidType uidType = appInfoReader->AppBinaryUidType();
   482             if (uidType[1].iUid != KNullUid.iUid)
   326 			if (uidType[1].iUid != KNullUid.iUid)
   483                 iUidType = uidType;
   327 				iUidType = uidType;
   484 
   328 
   485             // must get captions regardless of value of readSuccessful,
   329 			// must get captions regardless of value of readSuccessful,
   486             // because the V1 reader might have read captions
   330 			// because the V1 reader might have read captions
   487             // this is done to maintain behavioural compatibility with V1
   331 			// this is done to maintain behavioural compatibility with V1
   488             caption = appInfoReader->Caption();
   332 			caption = appInfoReader->Caption();
   489             shortCaption = appInfoReader->ShortCaption();
   333 			shortCaption = appInfoReader->ShortCaption();
   490 
   334 
   491             CApaAppIconArray* icons = appInfoReader->Icons();
   335 			CApaAppIconArray* icons = appInfoReader->Icons();
   492             if(icons)
   336 			if(icons)
   493                 {
   337 				{
   494                 delete iIcons;
   338 				delete iIcons;
   495                 iIcons = icons;
   339 				iIcons = icons;
   496                 iIconLoader = appInfoReader->IconLoader();
   340 				iIconLoader = appInfoReader->IconLoader();
   497                 }
   341 				}
   498             else
   342 			else
   499                 {           
   343 				{			
   500                 TRAPD(err, icons = CApaAppIconArray::NewL());
   344 				TRAPD(err, icons = CApaAppIconArray::NewL());
   501                 if(err == KErrNone)
   345 				if(err == KErrNone)
   502                     {
   346 					{
   503                     delete iIcons;
   347 					delete iIcons;
   504                     iIcons = icons;
   348 					iIcons = icons;
   505                     }
   349 					}
   506                 }
   350 				}
   507                 
   351 				
   508             iTimeStamp = appInfoReader->TimeStamp();
   352 			iTimeStamp = appInfoReader->TimeStamp();
   509             delete iLocalisableResourceFileName;
   353 			delete iLocalisableResourceFileName;
   510             iLocalisableResourceFileName = appInfoReader->LocalisableResourceFileName();
   354 			iLocalisableResourceFileName = appInfoReader->LocalisableResourceFileName();
   511             iLocalisableResourceFileTimeStamp = appInfoReader->LocalisableResourceFileTimeStamp();
   355 			iLocalisableResourceFileTimeStamp = appInfoReader->LocalisableResourceFileTimeStamp();
   512 
   356 
   513             const TBool isNonNativeApp = 
   357 			const TBool isNonNativeApp = 
   514                 (TParsePtrC(*iRegistrationFile).Path().CompareF(KLitPathForNonNativeResourceAndIconFiles) == 0);
   358 				(TParsePtrC(*iRegistrationFile).Path().CompareF(KLitPathForNonNativeResourceAndIconFiles) == 0);
   515                 
   359 				
   516             if (isNonNativeApp)
   360 			if (isNonNativeApp)
   517                 {
   361 				{
   518                 // In the case of a non-native app, the resource file has been prefixed with a
   362 				// In the case of a non-native app, the resource file has been prefixed with a
   519                 // TCheckedUid, the second of whose UIDs is the non-native application type uid.
   363 				// TCheckedUid, the second of whose UIDs is the non-native application type uid.
   520                 TEntry entry;
   364 				TEntry entry;
   521                 const TInt error=iFs.Entry(*iRegistrationFile, entry);
   365 				const TInt error=iFs.Entry(*iRegistrationFile, entry);
   522                 if (error!=KErrNone)
   366 				if (error!=KErrNone)
   523                     {
   367 					{
   524                     delete appInfoReader;
   368 					delete appInfoReader;
   525                     return error;
   369 					return error;
   526                     }
   370 					}
   527                     
   371 					
   528                 __ASSERT_DEBUG(entry.iType[0].iUid==KUidPrefixedNonNativeRegistrationResourceFile, Panic(EPanicUnexpectedUid));
   372 				__ASSERT_DEBUG(entry.iType[0].iUid==KUidPrefixedNonNativeRegistrationResourceFile, Panic(EPanicUnexpectedUid));
   529                 iNonNativeApplicationType=entry.iType[1];
   373 				iNonNativeApplicationType=entry.iType[1];
   530                 }
   374 				}
   531 
   375 
   532             delete iOpaqueData;
   376 			delete iOpaqueData;
   533             iOpaqueData = appInfoReader->OpaqueData();
   377 			iOpaqueData = appInfoReader->OpaqueData();
   534 
   378 
   535             if (readSuccessful)
   379 			if (readSuccessful)
   536                 {
   380 				{
   537                 appInfoReader->Capability(iCapabilityBuf);
   381 				appInfoReader->Capability(iCapabilityBuf);
   538 
   382 
   539                 iDefaultScreenNumber = appInfoReader->DefaultScreenNumber();
   383 				iDefaultScreenNumber = appInfoReader->DefaultScreenNumber();
   540 
   384 
   541                 delete iIconFileName;
   385 				delete iIconFileName;
   542                 iIconFileName = appInfoReader->IconFileName();
   386 				iIconFileName = appInfoReader->IconFileName();
   543                 iIconFileTimeStamp = appInfoReader->IconFileTimeStamp();
   387 				iIconFileTimeStamp = appInfoReader->IconFileTimeStamp();
   544                 iNonMbmIconFile = appInfoReader->NonMbmIconFile();
   388 				iNonMbmIconFile = appInfoReader->NonMbmIconFile();
   545                 iNumOfAppIcons = appInfoReader->NumOfAppIcons();
   389 				iNumOfAppIcons = appInfoReader->NumOfAppIcons();
   546                 iApplicationLanguage = appInfoReader->AppLanguage();
   390 				iApplicationLanguage = appInfoReader->AppLanguage();
   547                         
   391 						
   548                 // views
   392 				// views
   549                 iViewDataArray->ResetAndDestroy();
   393 				iViewDataArray->ResetAndDestroy();
   550                 CArrayPtrFlat<CApaAppViewData>* viewDataArray = appInfoReader->Views();
   394 				CArrayPtrFlat<CApaAppViewData>* viewDataArray = appInfoReader->Views();
   551                 if (viewDataArray)
   395 				if (viewDataArray)
   552                     {
   396 					{
   553                     delete iViewDataArray;
   397 					delete iViewDataArray;
   554                     iViewDataArray = viewDataArray;
   398 					iViewDataArray = viewDataArray;
   555                     
   399 					
   556                     if(!iIconLoader && ViewMbmIconsRequireLoading())
   400 					if(!iIconLoader && ViewMbmIconsRequireLoading())
   557                         {
   401 					    {
   558                         //if VIEW_DATA contains a MBM icon we need to initialize iIconLoader
   402 					    //if VIEW_DATA contains a MBM icon we need to initialize iIconLoader
   559                         iIconLoader = appInfoReader->IconLoader();
   403 					    iIconLoader = appInfoReader->IconLoader();
   560                         }
   404 					    }
   561                     }
   405 					}
   562 
   406 
   563                 // owned files
   407 				// owned files
   564                 iOwnedFileArray->Reset();
   408 				iOwnedFileArray->Reset();
   565                 CDesCArray* const ownedFileArray = appInfoReader->OwnedFiles();
   409 				CDesCArray* const ownedFileArray = appInfoReader->OwnedFiles();
   566                 if (ownedFileArray)
   410 				if (ownedFileArray)
   567                     {
   411 					{
   568                     delete iOwnedFileArray;
   412 					delete iOwnedFileArray;
   569                     iOwnedFileArray = ownedFileArray;
   413 					iOwnedFileArray = ownedFileArray;
   570                     }
   414 					}
   571                 
   415 				
   572                 UpdateServiceArray(appInfoReader->ServiceArray(iIndexOfFirstOpenService));
   416 				UpdateServiceArray(appInfoReader->ServiceArray(iIndexOfFirstOpenService));
   573                 }
   417 				}
   574 
   418 
   575             delete appInfoReader;
   419 			delete appInfoReader;
   576             }
   420 			}
   577         }
   421 		}
   578         
   422 		
   579     if (!caption)
   423 	if (!caption)
   580         {
   424 		{
   581         TParsePtrC parse (*iFullName);
   425 		TParsePtrC parse (*iFullName);
   582         caption = parse.Name().Alloc();
   426 		caption = parse.Name().Alloc();
   583         }
   427 		}
   584 
   428 
   585     // Put the captions into place
   429 	// Put the captions into place
   586     if (caption)
   430 	if (caption)
   587         {
   431 		{
   588         if (!shortCaption)
   432 		if (!shortCaption)
   589             {
   433 			{
   590             shortCaption = caption->Alloc();
   434 			shortCaption = caption->Alloc();
   591             if (!shortCaption)
   435 			if (!shortCaption)
   592                 {
   436 				{
   593                 delete caption;
   437 				delete caption;
   594                 caption = NULL;
   438 				caption = NULL;
   595                 }
   439 				}
   596             }
   440 			}
   597 
   441 
   598         delete iCaption;
   442 		delete iCaption;
   599         iCaption = caption;
   443 		iCaption = caption;
   600         delete iShortCaption;
   444 		delete iShortCaption;
   601         iShortCaption = shortCaption;
   445 		iShortCaption = shortCaption;
   602         }
   446 		}
   603 
   447 
   604     return caption ? KErrNone : KErrNoMemory;
   448 	return caption ? KErrNone : KErrNoMemory;
   605     }
   449 	}
   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     }
       
   764 
   450 
   765 EXPORT_C CApaAppData::~CApaAppData()
   451 EXPORT_C CApaAppData::~CApaAppData()
   766 // Just delete components, NOT iNext (next CApaAppData in the list).
   452 // Just delete components, NOT iNext (next CApaAppData in the list).
   767 	{
   453 	{
   768 	delete iSuccessor;
   454 	delete iSuccessor;
   777 		iViewDataArray->ResetAndDestroy();
   463 		iViewDataArray->ResetAndDestroy();
   778 		delete iViewDataArray;
   464 		delete iViewDataArray;
   779 		}
   465 		}
   780 	delete iOwnedFileArray;
   466 	delete iOwnedFileArray;
   781 	delete iIconFileName;
   467 	delete iIconFileName;
   782 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK	
       
   783 	delete iLocalisableResourceFileName;
   468 	delete iLocalisableResourceFileName;
   784     delete iRegistrationFile;	
       
   785 #endif	
       
   786 	if (iServiceArray)
   469 	if (iServiceArray)
   787 		{
   470 		{
   788 		CleanupServiceArray(iServiceArray);
   471 		CleanupServiceArray(iServiceArray);
   789 		iServiceArray = NULL;
   472 		iServiceArray = NULL;
   790 		}
   473 		}
   791 	delete iOpaqueData;
   474 	delete iOpaqueData;
       
   475 	delete iRegistrationFile;
   792 	iNext = NULL;
   476 	iNext = NULL;
   793 	}
   477 	}
   794 
       
   795 
   478 
   796 void CApaAppData::UpdateServiceArray(CArrayFixFlat<TApaAppServiceInfo>* aNewServiceArray)
   479 void CApaAppData::UpdateServiceArray(CArrayFixFlat<TApaAppServiceInfo>* aNewServiceArray)
   797 	{
   480 	{
   798 	// clear out any existing service info
   481 	// clear out any existing service info
   799 	if (iServiceArray)
   482 	if (iServiceArray)
   891 @return A pointer to an array of the icon sizes. The caller takes ownership. */
   574 @return A pointer to an array of the icon sizes. The caller takes ownership. */
   892 	{
   575 	{
   893 	return iIcons->IconSizesL();
   576 	return iIcons->IconSizesL();
   894 	}
   577 	}
   895 
   578 
       
   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 
   896 
   587 
   897 EXPORT_C void CApaAppData::Capability(TDes8& aCapabilityBuf)const
   588 EXPORT_C void CApaAppData::Capability(TDes8& aCapabilityBuf)const
   898 /** Gets the application's capabilities.
   589 /** Gets the application's capabilities.
   899 
   590 
   900 @param aCapabilityBuf On return, contains the application's capabilities, 
   591 @param aCapabilityBuf On return, contains the application's capabilities, 
   921 EXPORT_C CDesCArray* CApaAppData::OwnedFiles() const
   612 EXPORT_C CDesCArray* CApaAppData::OwnedFiles() const
   922 	{
   613 	{
   923 	return iOwnedFileArray;
   614 	return iOwnedFileArray;
   924 	}
   615 	}
   925 
   616 
       
   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 	}
   926 
   693 
   927 EXPORT_C TDataTypePriority CApaAppData::DataType(const TDataType& aDataType) const
   694 EXPORT_C TDataTypePriority CApaAppData::DataType(const TDataType& aDataType) const
   928 // returns the priority of the data type
   695 // returns the priority of the data type
   929 /** If the application supports the specified data type, the function returns 
   696 /** If the application supports the specified data type, the function returns 
   930 the priority with which it should be selected for handling it.
   697 the priority with which it should be selected for handling it.
   950 		}
   717 		}
   951 	return KDataTypePriorityNotSupported;
   718 	return KDataTypePriorityNotSupported;
   952 	}
   719 	}
   953 
   720 
   954 
   721 
       
   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 	}
   955 
   728 
   956 EXPORT_C TBool CApaAppData::CanUseScreenMode(TInt aScreenMode)
   729 EXPORT_C TBool CApaAppData::CanUseScreenMode(TInt aScreenMode)
   957 /** Tests whether the specified screen mode is valid for any of 
   730 /** Tests whether the specified screen mode is valid for any of 
   958 this application's views. If the app has no views, the function 
   731 this application's views. If the app has no views, the function 
   959 assumes that only the default screen mode (at screen mode index 
   732 assumes that only the default screen mode (at screen mode index 
  1000 EXPORT_C TUint CApaAppData::DefaultScreenNumber() const
   773 EXPORT_C TUint CApaAppData::DefaultScreenNumber() const
  1001 	{
   774 	{
  1002 	return iDefaultScreenNumber;
   775 	return iDefaultScreenNumber;
  1003 	}
   776 	}
  1004 
   777 
       
   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 
  1005 /** Returns the non-native application opaque data
   823 /** Returns the non-native application opaque data
  1006 
   824 
  1007 @return The non-native application opaque data.
   825 @return The non-native application opaque data.
  1008 @internalComponent
   826 @internalComponent
  1009 */
   827 */
  1017 		{
   835 		{
  1018 		return TPtrC8(KNullDesC8);
   836 		return TPtrC8(KNullDesC8);
  1019 		}
   837 		}
  1020 	}
   838 	}
  1021 
   839 
       
   840 EXPORT_C TUid CApaAppData::NonNativeApplicationType() const
       
   841 /** @internalComponent */
       
   842 	{
       
   843 	return iNonNativeApplicationType;
       
   844 	}
  1022 
   845 
  1023 /** Returns the full filename of the file containing application icons
   846 /** Returns the full filename of the file containing application icons
  1024 
   847 
  1025 @return The full path and filename of the icon file.
   848 @return The full path and filename of the icon file.
  1026 */
   849 */
  1166 		{
   989 		{
  1167 	 	iNumOfAppIconsFromResourceFile = iNumOfAppIcons;
   990 	 	iNumOfAppIconsFromResourceFile = iNumOfAppIcons;
  1168 	 	iIconFileNameFromResourceFile = iIconFileName;
   991 	 	iIconFileNameFromResourceFile = iIconFileName;
  1169 	 	iIconFileName = NULL;
   992 	 	iIconFileName = NULL;
  1170 	 	iNonMbmIconFileFromResourceFile = iNonMbmIconFile;
   993 	 	iNonMbmIconFileFromResourceFile = iNonMbmIconFile;
  1171 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK	 	
       
  1172 	 	iIconFileTimeStampFromResourceFile = iIconFileTimeStamp;
   994 	 	iIconFileTimeStampFromResourceFile = iIconFileTimeStamp;
  1173 #endif	 	
       
  1174 		}
   995 		}
  1175 		
   996 		
  1176 	iNonMbmIconFile = !CApaAppInfoReader::FileIsMbmWithGenericExtensionL(aFileName);
   997 	iNonMbmIconFile = !CApaAppInfoReader::FileIsMbmWithGenericExtensionL(aFileName);
  1177 	iNumOfAppIcons = aNumIcons;
   998 	iNumOfAppIcons = aNumIcons;
  1178 	
   999 	
  1202 		delete iIcons;
  1023 		delete iIcons;
  1203 		iIcons = icons;
  1024 		iIcons = icons;
  1204 		}
  1025 		}
  1205 	}
  1026 	}
  1206 
  1027 
       
  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 
  1207 void CApaAppData::InternalizeL(RReadStream& aReadStream)
  1041 void CApaAppData::InternalizeL(RReadStream& aReadStream)
  1208 /** Internalizes the appdata from the AppsList.bin file */
  1042 /** Internalizes the appdata from the AppsList.bin file */
  1209 	{
  1043 	{
  1210 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK    
       
  1211 	TUint highTime = aReadStream.ReadUint32L();
  1044 	TUint highTime = aReadStream.ReadUint32L();
  1212 	TUint lowTime = aReadStream.ReadUint32L();
  1045 	TUint lowTime = aReadStream.ReadUint32L();
  1213 	iTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));
  1046 	iTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));
  1214 	
  1047 
  1215 	highTime = aReadStream.ReadUint32L();
  1048 	highTime = aReadStream.ReadUint32L();
  1216 	lowTime = aReadStream.ReadUint32L();
  1049 	lowTime = aReadStream.ReadUint32L();
  1217 	iIconFileTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));
  1050 	iIconFileTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));
  1218 #endif
       
  1219 	
       
  1220 	iCaption = HBufC::NewL(aReadStream, KMaxFileName);	// Caption
  1051 	iCaption = HBufC::NewL(aReadStream, KMaxFileName);	// Caption
  1221 	iShortCaption = HBufC::NewL(aReadStream, KMaxFileName);	// Shortcaption
  1052 	iShortCaption = HBufC::NewL(aReadStream, KMaxFileName);	// Shortcaption
  1222 	iFullName = HBufC::NewL(aReadStream, KMaxFileName);		// Filename of application binary
  1053 	iFullName = HBufC::NewL(aReadStream, KMaxFileName);		// Filename of application binary
  1223 
  1054 
  1224 	TUid uid1;
  1055 	TUid uid1;
  1228 	TUid uid3;
  1059 	TUid uid3;
  1229 	uid3.iUid = aReadStream.ReadUint32L();
  1060 	uid3.iUid = aReadStream.ReadUint32L();
  1230 	iUidType = TUidType(uid1, uid2, uid3);	// Application UID
  1061 	iUidType = TUidType(uid1, uid2, uid3);	// Application UID
  1231 	
  1062 	
  1232 	aReadStream >> iCapabilityBuf;
  1063 	aReadStream >> iCapabilityBuf;
  1233 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 	
       
  1234 	iRegistrationFile = HBufC::NewL(aReadStream, KMaxFileName);	// Registration Filename
  1064 	iRegistrationFile = HBufC::NewL(aReadStream, KMaxFileName);	// Registration Filename
  1235 #endif	
       
  1236 	iDefaultScreenNumber = aReadStream.ReadUint32L();	// Default Screen number
  1065 	iDefaultScreenNumber = aReadStream.ReadUint32L();	// Default Screen number
  1237 	iNumOfAppIcons = aReadStream.ReadInt32L();	// No. of icons
  1066 	iNumOfAppIcons = aReadStream.ReadInt32L();	// No. of icons
  1238 	iNonMbmIconFile = aReadStream.ReadUint32L();
  1067 	iNonMbmIconFile = aReadStream.ReadUint32L();
  1239 
  1068 
  1240 	HBufC* iconFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Icon Filename
  1069 	HBufC* iconFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Icon Filename
  1261 		{
  1090 		{
  1262 		delete iconFileName;
  1091 		delete iconFileName;
  1263 		TRAP_IGNORE(iIcons = CApaAppIconArray::NewDefaultIconsL()); // Creates and Loads Default Icons.
  1092 		TRAP_IGNORE(iIcons = CApaAppIconArray::NewDefaultIconsL()); // Creates and Loads Default Icons.
  1264 		}
  1093 		}
  1265 
  1094 
  1266 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 
       
  1267 	HBufC* localisableResourceFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Registration Filename
  1095 	HBufC* localisableResourceFileName = HBufC::NewL(aReadStream, KMaxFileName);	// Registration Filename
  1268 	if (*localisableResourceFileName != KNullDesC)
  1096 	if (*localisableResourceFileName != KNullDesC)
  1269 		iLocalisableResourceFileName = localisableResourceFileName;
  1097 		iLocalisableResourceFileName = localisableResourceFileName;
  1270 	else
  1098 	else
  1271 		delete localisableResourceFileName;
  1099 		delete localisableResourceFileName;
  1272 
  1100 
  1273 	highTime = aReadStream.ReadUint32L();
  1101 	highTime = aReadStream.ReadUint32L();
  1274 	lowTime = aReadStream.ReadUint32L();
  1102 	lowTime = aReadStream.ReadUint32L();
  1275 	iLocalisableResourceFileTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));	// Localisable file timestamp
  1103 	iLocalisableResourceFileTimeStamp = TTime(MAKE_TINT64(highTime, lowTime));	// Localisable file timestamp
  1276 #endif
  1104 
  1277 	
       
  1278 	iApplicationLanguage = (TLanguage)aReadStream.ReadInt32L();	// Application Language
  1105 	iApplicationLanguage = (TLanguage)aReadStream.ReadInt32L();	// Application Language
  1279 	iIndexOfFirstOpenService = aReadStream.ReadUint32L();		// Index of first open service
  1106 	iIndexOfFirstOpenService = aReadStream.ReadUint32L();		// Index of first open service
  1280 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 	
       
  1281 	iNonNativeApplicationType.iUid = aReadStream.ReadUint32L();
  1107 	iNonNativeApplicationType.iUid = aReadStream.ReadUint32L();
  1282 #endif
       
  1283 
  1108 
  1284 	HBufC8* opaqueData = HBufC8::NewL(aReadStream, KMaxFileName);	// Opaque Data
  1109 	HBufC8* opaqueData = HBufC8::NewL(aReadStream, KMaxFileName);	// Opaque Data
  1285 	if (*opaqueData != KNullDesC8)
  1110 	if (*opaqueData != KNullDesC8)
  1286 		iOpaqueData = opaqueData;
  1111 		iOpaqueData = opaqueData;
  1287 	else
  1112 	else
  1376 	return EFalse; // icons were loaded already so no need to load them again.
  1201 	return EFalse; // icons were loaded already so no need to load them again.
  1377 	}
  1202 	}
  1378 
  1203 
  1379 void CApaAppData::ExternalizeL(RWriteStream& aWriteStream) const
  1204 void CApaAppData::ExternalizeL(RWriteStream& aWriteStream) const
  1380 	{
  1205 	{
  1381 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK     
       
  1382 	aWriteStream.WriteUint32L(I64HIGH(iTimeStamp.Int64()));
  1206 	aWriteStream.WriteUint32L(I64HIGH(iTimeStamp.Int64()));
  1383 	aWriteStream.WriteUint32L(I64LOW(iTimeStamp.Int64()));
  1207 	aWriteStream.WriteUint32L(I64LOW(iTimeStamp.Int64()));
  1384 
  1208 
  1385 	if (iIconFileNameFromResourceFile)
  1209 	if (iIconFileNameFromResourceFile)
  1386 		{
  1210 		{
  1390 	else
  1214 	else
  1391 		{
  1215 		{
  1392 		aWriteStream.WriteUint32L(I64HIGH(iIconFileTimeStamp.Int64()));
  1216 		aWriteStream.WriteUint32L(I64HIGH(iIconFileTimeStamp.Int64()));
  1393 		aWriteStream.WriteUint32L(I64LOW(iIconFileTimeStamp.Int64()));
  1217 		aWriteStream.WriteUint32L(I64LOW(iIconFileTimeStamp.Int64()));
  1394 		}
  1218 		}
  1395 #endif	
       
  1396 	
  1219 	
  1397 	if (iCaptionFromResourceFile) // Caption present in the resource file would be externalized if the one in applist has dynamically changed
  1220 	if (iCaptionFromResourceFile) // Caption present in the resource file would be externalized if the one in applist has dynamically changed
  1398 		{
  1221 		{
  1399 		aWriteStream << *iCaptionFromResourceFile;
  1222 		aWriteStream << *iCaptionFromResourceFile;
  1400 		}
  1223 		}
  1413 	TInt i = 0;
  1236 	TInt i = 0;
  1414 	for (i = 0; i < 3; ++i)
  1237 	for (i = 0; i < 3; ++i)
  1415 		aWriteStream << iUidType[i];	// Uid Type
  1238 		aWriteStream << iUidType[i];	// Uid Type
  1416 
  1239 
  1417 	aWriteStream << iCapabilityBuf;
  1240 	aWriteStream << iCapabilityBuf;
  1418 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 	
       
  1419 	aWriteStream << RegistrationFileName();	// Registration filename
  1241 	aWriteStream << RegistrationFileName();	// Registration filename
  1420 #endif	
       
  1421 	aWriteStream.WriteUint32L(iDefaultScreenNumber);	// Default screen number
  1242 	aWriteStream.WriteUint32L(iDefaultScreenNumber);	// Default screen number
  1422 
  1243 
  1423 	if (iIconFileNameFromResourceFile)
  1244 	if (iIconFileNameFromResourceFile)
  1424 		{
  1245 		{
  1425 		aWriteStream.WriteUint32L(iNumOfAppIconsFromResourceFile);	// number of icons
  1246 		aWriteStream.WriteUint32L(iNumOfAppIconsFromResourceFile);	// number of icons
  1430 		{
  1251 		{
  1431 		aWriteStream.WriteUint32L(iNumOfAppIcons);	// number of icons
  1252 		aWriteStream.WriteUint32L(iNumOfAppIcons);	// number of icons
  1432 		aWriteStream.WriteUint32L(iNonMbmIconFile);
  1253 		aWriteStream.WriteUint32L(iNonMbmIconFile);
  1433 		aWriteStream << IconFileName();
  1254 		aWriteStream << IconFileName();
  1434 		}
  1255 		}
  1435 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 
  1256 
  1436 	aWriteStream << LocalisableResourceFileName();
  1257 	aWriteStream << LocalisableResourceFileName();
  1437 
  1258 
  1438 	aWriteStream.WriteUint32L(I64HIGH(iLocalisableResourceFileTimeStamp.Int64()));
  1259 	aWriteStream.WriteUint32L(I64HIGH(iLocalisableResourceFileTimeStamp.Int64()));
  1439 	aWriteStream.WriteUint32L(I64LOW(iLocalisableResourceFileTimeStamp.Int64()));
  1260 	aWriteStream.WriteUint32L(I64LOW(iLocalisableResourceFileTimeStamp.Int64()));
  1440 #endif	
       
  1441 
  1261 
  1442 	aWriteStream.WriteInt32L(iApplicationLanguage);
  1262 	aWriteStream.WriteInt32L(iApplicationLanguage);
  1443 
  1263 
  1444 	aWriteStream.WriteUint32L(iIndexOfFirstOpenService);
  1264 	aWriteStream.WriteUint32L(iIndexOfFirstOpenService);
  1445 
  1265 
  1446 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 
       
  1447 	aWriteStream.WriteUint32L(iNonNativeApplicationType.iUid);
  1266 	aWriteStream.WriteUint32L(iNonNativeApplicationType.iUid);
  1448 #endif
       
  1449 
  1267 
  1450 	aWriteStream << OpaqueData();
  1268 	aWriteStream << OpaqueData();
  1451 	
  1269 	
  1452 	TInt count = iViewDataArray->Count();
  1270 	TInt count = iViewDataArray->Count();
  1453 	aWriteStream.WriteUint32L(count);
  1271 	aWriteStream.WriteUint32L(count);