# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1276066885 -10800 # Node ID ace62b58f4b2641efea7c9300f68bc578a8ed3cd # Parent 1b207dd38b723225b2c752ce5e05b633d3e5635c Revision: 201021 Kit: 2010123 diff -r 1b207dd38b72 -r ace62b58f4b2 contentpublishingsrv/contentpublishingserver/cpserver/inc/cpnotificationhandler.h --- a/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpnotificationhandler.h Tue May 25 13:01:39 2010 +0300 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/inc/cpnotificationhandler.h Wed Jun 09 10:01:25 2010 +0300 @@ -170,6 +170,13 @@ TBool CheckRegistryTypeL( const CLiwMap& aMap, const CCPLiwMap& aFilter ); + /** + * Appends KDataMap for notification list if needed + * + * @param aMap Map with notifications + */ + void AppendDataMapL( CLiwDefaultList* aListOfMaps ); + private: // data diff -r 1b207dd38b72 -r ace62b58f4b2 contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp --- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp Tue May 25 13:01:39 2010 +0300 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpnotificationhandler.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -255,6 +255,11 @@ else { //notification cannot be sent in this moment + //append KDataMap if exists + if( iDataMapCache.TypeId() == EVariantTypeDesC8 ) + { + TRAP_IGNORE( AppendDataMapL( aListOfMaps ) ); + } aListOfMaps->IncRef( ); iNotifications.AppendL( aListOfMaps ); } @@ -264,7 +269,6 @@ // // ---------------------------------------------------------------------------- // - const CLiwGenericParamList* CCPNotificationHandler::GetPointerToChangeInfoList() { return iChangeInfoList; @@ -552,3 +556,57 @@ CleanupStack::PopAndDestroy( &type ); return result; } + +// ---------------------------------------------------------------------------- +// +// ---------------------------------------------------------------------------- +// +void CCPNotificationHandler::AppendDataMapL( CLiwDefaultList* aListOfMaps ) + { + CP_DEBUG( _L8("CCPNotificationHandler::SendChangeInfoListL()") ); + //for every observer in session + THashMapIter iter( iFilters ); + const CCPLiwMap*const* filter = iter.NextValue( ); + while( filter ) + { + TInt count = aListOfMaps->Count( ); + //for every item in the input list + for ( TInt j = 0; j < count; j++ ) + { + TLiwVariant variant; + variant.PushL( ); + aListOfMaps->AtL( j, variant ); + if ( variant.TypeId() == EVariantTypeMap ) + { + const CLiwMap* map = variant.AsMap(); + if ( IsProperForFilterL( *map, **filter ) ) + { + if (iExtendedFlags.FindL(*iter.CurrentKey()) + && (iDataMapCache.TypeId() == EVariantTypeDesC8)) + { + //extended notifications - append data map + CLiwDefaultMap* extendedMap = CLiwDefaultMap::NewLC(); + TInt count = map->Count(); + for(TInt i=0; i key; + map->AtL(i,key); + map->FindL(key, temporary); + extendedMap->InsertL(key,temporary); + CleanupStack::PopAndDestroy(&temporary); + } + extendedMap->InsertL( KDataMap,iDataMapCache ); + aListOfMaps->Remove( j ); + aListOfMaps->AppendL( TLiwVariant( extendedMap ) ); + CleanupStack::PopAndDestroy(extendedMap); + } + } + + } + CleanupStack::PopAndDestroy( &variant ); + } + filter = iter.NextValue( ); + } + } diff -r 1b207dd38b72 -r ace62b58f4b2 contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp --- a/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp Tue May 25 13:01:39 2010 +0300 +++ b/contentpublishingsrv/contentpublishingserver/cpserver/src/cpserversession.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -339,21 +339,23 @@ const TLiwGenericParam* param = NULL; TInt pos(0); param = genericList->FindFirst(pos, KFilters); - const CLiwList* maps = param->Value().AsList(); - CLiwDefaultList* cpMaps = CheckValidityLC(maps); - //execute actions - for (TInt i = 0; i < cpMaps->Count(); i++) + if( param && pos!= KErrNotFound ) { - TLiwVariant mapVariant; - mapVariant.PushL(); - cpMaps->AtL(i, mapVariant); - const CCPLiwMap* map = - static_cast (mapVariant.AsMap()); - TRAP_IGNORE(ExecuteActionL(map, ETrue, options)); - CleanupStack::PopAndDestroy(&mapVariant); + const CLiwList* maps = param->Value().AsList(); + CLiwDefaultList* cpMaps = CheckValidityLC(maps); + //execute actions + for (TInt i = 0; i < cpMaps->Count(); i++) + { + TLiwVariant mapVariant; + mapVariant.PushL(); + cpMaps->AtL(i, mapVariant); + const CCPLiwMap* map = + static_cast (mapVariant.AsMap()); + TRAP_IGNORE(ExecuteActionL(map, ETrue, options)); + CleanupStack::PopAndDestroy(&mapVariant); + } + CleanupStack::PopAndDestroy(cpMaps); } - - CleanupStack::PopAndDestroy(cpMaps); CleanupStack::PopAndDestroy(genericList); } diff -r 1b207dd38b72 -r ace62b58f4b2 contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstorageengine.cpp --- a/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstorageengine.cpp Tue May 25 13:01:39 2010 +0300 +++ b/contentpublishingsrv/contentpublishingserver/cpsqlitestorage/src/cpstorageengine.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -177,6 +177,8 @@ iDataMapCache.Reset(); map->FindL(KDataMap, iDataMapCache); iCallback->HandleChangeL( listOfMaps ); + //data cache must be cleaned here, otherwise it can mess up other requests. + iDataMapCache.Reset(); CleanupStack::PopAndDestroy( listOfMaps ) ; } else diff -r 1b207dd38b72 -r ace62b58f4b2 group/bld.inf --- a/group/bld.inf Tue May 25 13:01:39 2010 +0300 +++ b/group/bld.inf Wed Jun 09 10:01:25 2010 +0300 @@ -15,10 +15,6 @@ * */ -#include - -PRJ_EXPORTS -../inc/aisystemuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aisystemuids.hrh) #include "../xcfw/group/bld.inf" #include "../homescreenpluginsrv/group/bld.inf" diff -r 1b207dd38b72 -r ace62b58f4b2 group/robot_patch.zip Binary file group/robot_patch.zip has changed diff -r 1b207dd38b72 -r ace62b58f4b2 homescreenpluginsrv/hspsmanager/client/hspsclientsession.cpp --- a/homescreenpluginsrv/hspsmanager/client/hspsclientsession.cpp Tue May 25 13:01:39 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/client/hspsclientsession.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -24,6 +24,9 @@ #include "hspsthemeserver.h" #include "hspsclientsession.h" +const TInt KRetryMax = 256; +const TInt KRetryInterval = 100000; // 100ms + // Standard server startup code static TInt StartServer() { @@ -72,28 +75,37 @@ // ----------------------------------------------------------------------------- // EXPORT_C TInt RhspsClientSession::Connect() - { - TVersion ver = TVersion(KhspsThemeServerMajorVersionNumber,KhspsThemeServerMinorVersionNumber, - KhspsThemeServerBuildVersionNumber); - TInt retry=2; - for (;;) + { + TVersion ver = TVersion( KhspsThemeServerMajorVersionNumber, + KhspsThemeServerMinorVersionNumber, + KhspsThemeServerBuildVersionNumber); + + TInt retry = KRetryMax; + + for(;;) { - TInt r=CreateSession(KhspsThemeServerName, ver, KDefaultMessageSlots); + TInt r = CreateSession( KhspsThemeServerName, ver, KDefaultMessageSlots ); - if (r!=KErrNotFound && r!=KErrServerTerminated) + if( r != KErrNotFound && r != KErrServerTerminated ) { return r; - } - - if (--retry==0) + } + + retry--; + if( retry == 0 ) { return r; - } + } - r=StartServer(); - if (r!=KErrNone && r!=KErrAlreadyExists) + r = StartServer(); + if( r != KErrNone && r != KErrAlreadyExists ) { return r; + } + + if( r == KErrAlreadyExists ) + { + User::After( KRetryInterval ); } } } diff -r 1b207dd38b72 -r ace62b58f4b2 homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h Tue May 25 13:01:39 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsinstallationhandler.h Wed Jun 09 10:01:25 2010 +0300 @@ -577,19 +577,23 @@ /** * Finds locale specific subdirectories and resources and appends those * into the resource array + * * @since S60 5.0 - * @param aPath is a directory where the locale specific subdirectories exits + * @param aPath is a directory where the locale specific subdirectories exits + * @param aProcessOnlyDTD If ETrue, then only DTD files are processed. */ void AddLocalesL( - const TDesC& aPath ); + const TDesC& aPath, + const TBool aProcessOnlyDTD ); /** - * Adds localized resources from the provided subdirectory + * Adds localized dtd resources from the provided subdirectory + * * @since S60 5.0 - * @param aLanguage is name of the subdirectory - * @param aPath is path to the subdirectory where the locale specific resources can be found + * @param aPath Path to the subdirectory where the locale specific resources can be found + * @param aLanguage Name of the subdirectory */ - void AddLocalizedResourcesL( + void AddDtdFileL( const TDesC& aPath, const TLanguage aLanguage ); @@ -599,17 +603,7 @@ * @return path to a Xuikon etc folder or an empty string */ TFileName GetInterfacePath(); - - /** - * Add DTD files from the HSPS folder. - */ - void AddHspsLocalesV2L( - const TDesC& aPath ); - - void AddLocalizedResourcesDTDV2L( - const TDesC& aPath, - const TLanguage aLanguage ); - + /** * Finds all language specific folders and resources * under the interface path in ROM or UDA drive. diff -r 1b207dd38b72 -r ace62b58f4b2 homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Tue May 25 13:01:39 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsserverutil.h Wed Jun 09 10:01:25 2010 +0300 @@ -138,8 +138,42 @@ static TPtrC8 FindConfigurationAttrL( const ChspsODT& aOdt, const TDesC8& aAttr ); + + /** + * Removes plug-in resources from the client app. + * @since S60 5.2 + * @param aFilemanager File manager instance + * @param aAppUid UID of the application configuration + * @param aPluginODT Plugin configuration + */ + static void RemoveResourceFilesL( + CFileMan& aFilemanager, + RFs& aFs, + const TInt aAppUid, + const ChspsODT& aPluginODT ); /** + * Finds language specific resources from a plug-in and handles copying + * of the resources to a destination folder. + * @since S60 5.0 + * @param aAppODT Application configuration + * @param aFs Reference to OPEN file server session handle. + * @param aFilemanager File manager instance + * @param aDeviceLanguage Device language + * @param aConfUid Idenifies the plug-in which is to be processed + * @param aDestination Target path where the files should be copied to + * @param aIsRelevant Set if the source file should be copied without the checks + */ + static TInt CopyResourceFilesL( + ChspsODT& aAppODT, + RFs& aFs, + CFileMan& aFilemanager, + const TInt aDeviceLanguage, + const TInt aConfUid, + const TDesC& aDestination, + const TBool aIsRelevant = EFalse ); + + /** * Copies a file to a target path when neccessary. * Target path is created if it's missing. * File is copied if the target's size or date are different or @@ -149,13 +183,15 @@ * @param aFilemanager Referemce to file manager instance * @param aTargetPath Path where the file should be copied to * @param aFilename Path and name of the file to be copied + * @param aIsRelevant Set if the source file should be copied without the checks * @return error code */ static TInt CopyResourceFileL( RFs& aFs, CFileMan& aFilemanager, const TPath& aTargetPath, - const TFileName& aSourceFile ); + const TFileName& aSourceFile, + const TBool aIsRelevant = EFalse ); /** * Checks: @@ -473,7 +509,8 @@ TFileName& aFilename ); /** - * Resolve resource files that need to be copied. + * Resolve resource files that need to be copied, + * plug-in may not have requested localization. * * @since S60 5.1 * @@ -484,7 +521,7 @@ * of resources if any applicable. * Ownership of given resources is not transferred! */ - static void GetValidResourcesL( + static void GetResourcesForLanguageL( ChspsODT& aODT, const TInt aConfUid, const TLanguage aActiveLanguage, diff -r 1b207dd38b72 -r ace62b58f4b2 homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h Tue May 25 13:01:39 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsthemeserver.h Wed Jun 09 10:01:25 2010 +0300 @@ -534,6 +534,16 @@ TInt& aPos ); /** + * Erases resource files from plug-in specific subdirectories under + * the client's private path. + * Plug-ins that belong to an active application configuration will + * be processed. + * @since S60 5.2 + * @param aAppODT is an application configuration to be checked + */ + void ResetResourcesL( ChspsODT& aAppODT ); + + /** * Localizes an ODT. * Testing: change first two digits from \epoc32\RELEASE\WINSCW\udeb\ * Z\resource\BootData\Languages.txt file and reboot the emulator. @@ -1028,6 +1038,7 @@ TBool iHeaderListPending; RFs iFsSession; + CFileMan* iFileMan; ChspsDefinitionRepository* iDefinitionRepository; CRepository* iCentralRepository; ChspsSecurityEnforcer* iSecurityEnforcer; diff -r 1b207dd38b72 -r ace62b58f4b2 homescreenpluginsrv/hspsmanager/inc/hspsthemeserversession.h --- a/homescreenpluginsrv/hspsmanager/inc/hspsthemeserversession.h Tue May 25 13:01:39 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/inc/hspsthemeserversession.h Wed Jun 09 10:01:25 2010 +0300 @@ -315,21 +315,7 @@ void FindWidgetUidsL( ChspsODT& aAppODT, RArray& aUidArray ); - - /** - * Handles copying of widget resources to a destination folder. - * @since S60 5.0.1 - * @param aAppODT Application configuration - * @param aFilemanager File manager - * @param aConfUid Widget which is to be processed - * @param aDestination Target path where the files should be copied to - */ - TInt DoCopyResourceFilesL( - ChspsODT& aAppODT, - CFileMan& aFilemanager, - const TInt aConfUid, - const TDesC& aDestination ); - + private: RFs iFs; ChspsInstallationHandler* iInstallationHandler; diff -r 1b207dd38b72 -r ace62b58f4b2 homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Tue May 25 13:01:39 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/src/hspsinstallationhandler.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -520,28 +520,28 @@ // void ChspsInstallationHandler::FinalizeParsingL() { - // Check resources + // Add resources TFileName interfacePath( GetInterfacePath() ); if ( interfacePath.Length() ) - { - // If name of the DTD file was specified in the manifest - if ( iDtdFile ) - { - TParse pathParser; - pathParser.Set( iThemeFilePath, NULL, NULL ); - pathParser.PopDir(); // pop locale specific folder - - // Find locale specific DTD file - AddHspsLocalesV2L( pathParser.FullName() ); - } - - // Find Xuikon resources of each locale - AddInterfaceResourcesV2L( interfacePath ); + { + // If name of the DTD file was specified in the manifest + if ( iDtdFile ) + { + TParse pathParser; + pathParser.Set( iThemeFilePath, NULL, NULL ); + pathParser.PopDir(); // pop locale specific folder + + // Find locale specific DTD file + AddLocalesL( pathParser.FullName(), ETrue ); + } + + // Find Xuikon resources of each locale + AddInterfaceResourcesV2L( interfacePath ); } else { // Find DTD files and locale specific resources from subdirectories under the installation path - AddLocalesL( iThemeFilePath ); + AddLocalesL( iThemeFilePath, EFalse ); } // Validate other input from the manifest @@ -2198,126 +2198,6 @@ } // ----------------------------------------------------------------------------- -// Finds locale specific subdirectories and DTD resources and appends those -// into the resource array -// Should be executed prior to the CheckHeader method! -// ----------------------------------------------------------------------------- -// -void ChspsInstallationHandler::AddHspsLocalesV2L( - const TDesC& aPath ) - { - // Find all locale specific subfolders - TFindFile fileFinder( iFsSession ); - _LIT( KFilter, "*" ); - CDir* fileList( NULL ); - fileFinder.FindWildByDir( KFilter, aPath, fileList ); - if ( fileList ) - { - CleanupStack::PushL( fileList ); - TFileName localePath; - for( TInt i = 0; i < fileList->Count(); i++ ) - { - const TEntry& entry = (*fileList)[i]; - if ( entry.IsDir() ) - { - TInt languageIndex = 0; - TLex lex( entry.iName ); - TInt error = lex.Val( languageIndex ); - - // See enumarations from e32lang.h - if( !error && languageIndex >= ELangTest ) - { - - // Process only supported languages - CArrayFixFlat* languageCodes = NULL; - hspsServerUtil::GetInstalledLanguagesL( languageCodes ); - CleanupStack::PushL( languageCodes ); - TBool isSupported = EFalse; - for( TInt i=0; iCount(); i++ ) - { - if( languageCodes->At( i ) == languageIndex ) - { - isSupported = ETrue; - break; - } - } - CleanupStack::PopAndDestroy( languageCodes ); - if( !isSupported ) - { - continue; - } - - // If we found the first language specification - if ( !iDefaultSpecificationSet ) - { - // Assume this is the default language shown incase - // there is no locale for the active UI language - iDefaultSpecification = (TLanguage)languageIndex; - iDefaultSpecificationSet = ETrue; - } - - // Setup a path to the subdirectory - localePath.Copy( aPath ); - localePath.Append( entry.iName ); - localePath.Append( KPathDelim ); - - // Find localized resources - AddLocalizedResourcesDTDV2L( - localePath, - (TLanguage)languageIndex ); - } - } - - } - CleanupStack::PopAndDestroy( fileList ); - fileList = NULL; - } - } - -// ----------------------------------------------------------------------------- -// Adds localized resources from the provided subdirectory -// ----------------------------------------------------------------------------- -// -void ChspsInstallationHandler::AddLocalizedResourcesDTDV2L( - const TDesC& aPath, - const TLanguage aLanguage ) - { - // Append path with the default name of DTD files - const TInt len = aPath.Length() + iDtdFile->Des().Length(); - HBufC* dtdPath = HBufC::NewLC( len ); - dtdPath->Des().Copy( aPath ); - dtdPath->Des().Append( *iDtdFile ); - - // Check whether the file exists - if( !BaflUtils::FileExists( iFsSession, *dtdPath ) ) - { -#ifdef HSPS_LOG_ACTIVE - if( iLogBus ) - { - iLogBus->LogText( _L( "ChspsInstallationHandler::AddLocalizedResourcesDTDV2L(): - DTD file was not found '%S'" ), - &dtdPath ); - } -#endif - iFileNotFound = ETrue; - iResult->iXuikonError = KErrDtdFileNotFound; - User::Leave( KErrNotFound ); - } - - // Store locale specific DTD files into the resource array - TPtrC8 mediaType; - TPtrC8 tags; - AddResourceL( - *iResourceList, - *dtdPath, - aLanguage, - EResourceDTD, - mediaType, - tags ); - - CleanupStack::PopAndDestroy( dtdPath ); - } - -// ----------------------------------------------------------------------------- // ChspsInstallationHandler::AddInterfaceResourcesV2L // ----------------------------------------------------------------------------- // @@ -2353,7 +2233,8 @@ // ----------------------------------------------------------------------------- // void ChspsInstallationHandler::AddLocalesL( - const TDesC& aPath ) + const TDesC& aPath, + const TBool aProcessOnlyDTD ) { // Retrieve phone supported language. CArrayFixFlat* languageCodes = NULL; @@ -2361,19 +2242,32 @@ CleanupStack::PushL( languageCodes ); // Ensure that path contains '\' at the end. - TFileName xuikonPath; - xuikonPath.Copy( aPath ); - if( xuikonPath.Length() > KPathDelim().Length() ) + TFileName pathBase; + pathBase.Copy( aPath ); + if( pathBase.Length() > KPathDelim().Length() ) { - if( xuikonPath.Mid( xuikonPath.Length() - - KPathDelim().Length() - ).Compare( KPathDelim ) != 0 ) + if( pathBase.Mid( pathBase.Length() - + KPathDelim().Length() + ).Compare( KPathDelim ) != 0 ) { - xuikonPath.Append( KPathDelim ); + pathBase.Append( KPathDelim ); } } - _LIT( KFormatting, "%02d" ); + TParsePtrC driveParser( pathBase ); + TInt driveEnum = KErrNotFound; + + if( !aProcessOnlyDTD ) + { + if( driveParser.DrivePresent() && driveParser.Drive().Length() > 0 ) + { + User::LeaveIfError( + RFs::CharToDrive( ( driveParser.Drive() )[0], + driveEnum ) ); + } + } + + _LIT( KFormatNN, "%02d" ); TFileName localePath; for( TInt i = 0; i < languageCodes->Count(); i++ ) @@ -2383,8 +2277,15 @@ // Construct locale path using two digit minium // width and zero as padding. - localePath.Copy( xuikonPath ); - localePath.AppendFormat( KFormatting, languageCode ); + localePath.Copy( pathBase ); + if( languageCode < 10 ) + { + localePath.AppendFormat( KFormatNN, languageCode ); + } + else + { + localePath.AppendNum( languageCode ); + } localePath.Append( KPathDelim ); // Check if folder for supported language exists. @@ -2395,10 +2296,10 @@ exists = ETrue; } - // Support also one digit type folder naming. + // Support also one digit type folder naming possibly used by the imports. if( !exists && languageCode < 10 ) { - localePath.Copy( xuikonPath ); + localePath.Copy( pathBase ); localePath.AppendNum( languageCode ); localePath.Append( KPathDelim ); @@ -2418,12 +2319,24 @@ iDefaultSpecification = (TLanguage)languageCode; iDefaultSpecificationSet = ETrue; } - - - // Find and add localized resources - AddLocalizedResourcesL( - localePath, - (TLanguage)languageCode ); + + // Add dtd file if existing. + AddDtdFileL( localePath, (TLanguage)languageCode ); + + if( !aProcessOnlyDTD ) + { + // Find localized files from the provided directory + RArray driveArray; + CleanupClosePushL( driveArray ); + driveArray.Append( driveEnum ); + + FindResourceFilesL( localePath, + EFalse, + driveArray, + NULL ); + + CleanupStack::PopAndDestroy(); // driveArray + } } } @@ -2432,13 +2345,13 @@ } // ----------------------------------------------------------------------------- -// Adds localized resources from the provided subdirectory +// Adds localized dtd resources from the provided subdirectory // ----------------------------------------------------------------------------- // -void ChspsInstallationHandler::AddLocalizedResourcesL( +void ChspsInstallationHandler::AddDtdFileL( const TDesC& aPath, const TLanguage aLanguage ) - { + { // If FileDTD was declared if ( iDtdFile && iDtdFile->Des().Length() ) { @@ -2475,17 +2388,7 @@ tagsPtr ); CleanupStack::PopAndDestroy( dtdPath ); - } - - // Find localized files from the provided directory - RArray driveArray; - CleanupClosePushL( driveArray ); - driveArray.Append( EDriveE ); - driveArray.Append( EDriveC ); - - FindResourceFilesL( aPath, EFalse, driveArray, NULL ); - - CleanupStack::PopAndDestroy(); // driveArray + } } // ----------------------------------------------------------------------------- diff -r 1b207dd38b72 -r ace62b58f4b2 homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Tue May 25 13:01:39 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/src/hspsserverutil.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -37,6 +37,7 @@ _LIT( KThemesFolder, "\\themes\\" ); _LIT( KDoubleBackSlash, "\\" ); _LIT8( KHexPrefix8, "0x" ); +_LIT( KClientSources, "c:\\private\\%x\\%D\\%D\\%D\\%S\\sources\\%S" ); // ----------------------------------------------------------------------------- // hspsServerUtil::GenerateConfigurationAttributesL @@ -558,6 +559,110 @@ } // ----------------------------------------------------------------------------- +// hspsServerUtil::RemoveResourceFilesL +// ----------------------------------------------------------------------------- +void hspsServerUtil::RemoveResourceFilesL( + CFileMan& aFilemanager, + RFs& aFs, + const TInt aAppUid, + const ChspsODT& aPluginODT ) + { + // Remove all plug-in resources + for( TInt i=0; i< aPluginODT.ResourceCount(); i++ ) + { + ChspsResource& r = aPluginODT.ResourceL( i ); + if( r.FileName().Find( KSourcesFolder ) > 0 ) + { + TPtrC id( GetFixedOdtName( r.ResourceId() ) ); + const TDesC& ver( aPluginODT.ThemeVersion() ); + TFileName resource; + resource.Format( + KClientSources, + aAppUid, + aPluginODT.RootUid(), + aPluginODT.ProviderUid(), + aPluginODT.ThemeUid(), + &ver, + &id ); + if( BaflUtils::FileExists( aFs, resource ) ) + { + aFilemanager.Delete( resource, 0 ); + } + } + } + } + + +// ----------------------------------------------------------------------------- +// hspsServerUtil::CopyResourceFilesL +// ----------------------------------------------------------------------------- +TInt hspsServerUtil::CopyResourceFilesL( + ChspsODT& aAppODT, + RFs& aFs, + CFileMan& aFilemanager, + const TInt aDeviceLanguage, + const TInt aConfUid, + const TDesC& aDestination, + const TBool aIsRelevant ) + { + TInt error( KErrNone ); + RPointerArray widgetResources; // Objects are not owned. + CleanupClosePushL( widgetResources ); + + // Find resources for the language or common to all languages or test resources + // if others couldn't be found + GetResourcesForLanguageL( + aAppODT, + aConfUid, + (TLanguage)aDeviceLanguage, + widgetResources ); + + // Copy the resources found + for( TInt i = 0; ( i < widgetResources.Count() && !error ); i++ ) + { + ChspsResource* resource = widgetResources[i]; + if( !resource ) + { + continue; + } + + // Get relative path under the themes folder + TPath relativePath; + GetRelativeResourcePath( + resource->FileName(), + relativePath ); + + // Strip language indicator from the relative path + GetLocaleIndependentResourcePath( + resource->Language(), + relativePath ); + + // Finalize target path + TPath targetPath; + targetPath.Copy( aDestination ); + targetPath.Append( relativePath ); + + // Create target path and copy files when required + error = CopyResourceFileL( + aFs, + aFilemanager, + targetPath, + resource->FileName(), + aIsRelevant ); + if ( error == KErrAlreadyExists ) + { + error = KErrNone; + } + + } // copy loop + + widgetResources.Reset(); + CleanupStack::PopAndDestroy( 1, &widgetResources ); + + return error; + } + +// ----------------------------------------------------------------------------- // hspsServerUtil::CopyResourceFileL // ----------------------------------------------------------------------------- // @@ -565,7 +670,8 @@ RFs& aFs, CFileMan& aFilemanager, const TPath& aTargetPath, - const TFileName& aSourceFile ) + const TFileName& aSourceFile, + const TBool aIsRelevant ) { // Construct target file with full path. TFileName targetFile; @@ -587,10 +693,11 @@ TInt error = KErrNone; - if ( hspsServerUtil::ResourceCopyIsRelevantL( - aSourceFile, - targetFile, - aFs ) + if ( aIsRelevant + || hspsServerUtil::ResourceCopyIsRelevantL( + aSourceFile, + targetFile, + aFs ) ) { // Make target folder @@ -616,7 +723,17 @@ aTargetPath, 0, KEntryAttReadOnly, - TTime( 0 ) ); // TTime(0) = preserve original time stamp. + TTime( 0 ) ); // TTime(0) = preserve original time stamp. + +#ifdef HSPS_LOG_ACTIVE + if ( iLogBus ) + { + iLogBus->LogText( + _L( "hspsServerUtil::CopyResourceFileL(): - %S was copied" ), + &aTargetPath + ); + } +#endif } } @@ -1702,9 +1819,9 @@ } // ----------------------------------------------------------------------------- -// hspsServerUtil::GetValidResourcesL +// hspsServerUtil::GetResourcesForLanguageL // ----------------------------------------------------------------------------- -void hspsServerUtil::GetValidResourcesL( +void hspsServerUtil::GetResourcesForLanguageL( ChspsODT& aODT, const TInt aConfUid, const TLanguage aActiveLanguage, @@ -1780,7 +1897,8 @@ RPointerArray widgetResources; // Objects are not owned. CleanupClosePushL( widgetResources ); - GetValidResourcesL( aODT, + GetResourcesForLanguageL( + aODT, aODT.ThemeUid(), aActiveLanguage, widgetResources ); @@ -2049,6 +2167,9 @@ } // driveIndex } +// ----------------------------------------------------------------------------- +// hspsServerUtil::GetInstalledLanguagesL +// ----------------------------------------------------------------------------- void hspsServerUtil::GetInstalledLanguagesL( CArrayFixFlat*& aLanguages ) { diff -r 1b207dd38b72 -r ace62b58f4b2 homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Tue May 25 13:01:39 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserver.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -75,6 +75,8 @@ // prevent ROM installation on every boot up _LIT( KDummyVersionInfo, "dummyversioninfo" ); +_LIT( KProcessFindString, "hspsthemeserver*" ); + const TUint KAppId_hspsAS = 270486738; // 0x101F4CD2 from S60 3.1 Xuikon AppShell in 3.1 product. const TUint KAppId_hspsAI = 271012080 ; // 0x102750F0 support for Xuikon-based ActiveIdle const TUint KAppId_LE = 270551469 ; // 0x102049AD LayoutTest @@ -177,7 +179,20 @@ // ----------------------------------------------------------------------------- // TInt E32Main() - { + { + TFindProcess processFinder( KProcessFindString ); + TFullName fullName; + TInt count = 0; + while( processFinder.Next( fullName ) == KErrNone ) + { + count++; + } + if( count > 1 ) + { + return KErrAlreadyExists; + } + fullName = KNullDesC(); + RAllocator* iAllocator = MemoryManager::SwitchToFastAllocator(); __UHEAP_MARK; @@ -333,11 +348,7 @@ // Find header files from the Plug-in Repository UpdateHeaderListCacheL(); - - // Adds the server with the specified name to the active scheduler, and issues the - // first request for messages, and leaves if the operation fails - StartL( KhspsThemeServerName ); - + // Initialize remove index iThemeIndexToRemove = KErrNotFound; @@ -386,6 +397,10 @@ iShutdown = CShutdown::NewL( *this ); #endif // _hsps_SERVER_SHUTDOWN_ENABLED_ + // Adds the server with the specified name to the active scheduler, and issues the + // first request for messages, and leaves if the operation fails + StartL( KhspsThemeServerName ); + #ifdef HSPS_LOG_ACTIVE iLogBus->LogText( _L( "hspsThemeServer: server fully constructed" ) ); iLogBus->LogText( _L( "--------------------------------------------------------" ) ); @@ -436,6 +451,7 @@ iLogBus->LogText( _L( "hspsThemeServer: server is shutting down" ) ); #endif + delete iFileMan; if( iDefinitionRepository ) { iDefinitionRepository->UnregisterObserver( *this ); @@ -482,7 +498,7 @@ delete iBRHandler; iCacheMask = NULL; - + iFsSession.Close(); } @@ -1456,6 +1472,12 @@ { started = ETrue; } + else + { + delete iInstalledSisxThemes[ iThemeIndexToRemove ]; + iInstalledSisxThemes[ iThemeIndexToRemove ] = NULL; + iInstalledSisxThemes.Remove( iThemeIndexToRemove ); + } } } break; @@ -2142,16 +2164,13 @@ #ifdef HSPS_LOG_ACTIVE iLogBus->LogText( _L( "ChspsThemeServer::HandleLanguageChangeL()") ); #endif - - // Set key for fetching previously used language from the cenrep - const TInt KCenrepLangKey = 100000001; - + // The key should already exist const TUint32 fullMask = 0xFFFFFFFF; RArray res; CleanupClosePushL( res ); - iCentralRepository->FindL( KCenrepLangKey, fullMask, res ); + iCentralRepository->FindL( KCenrepKeyLang, fullMask, res ); if ( res.Count() == 0 ) { #ifdef HSPS_LOG_ACTIVE @@ -2163,16 +2182,18 @@ // Check the cenrep key's value TInt prevLanguage = ELangNone; - iCentralRepository->Get( KCenrepLangKey, prevLanguage ); + iCentralRepository->Get( KCenrepKeyLang, prevLanguage ); // If the language has been changed if( iDeviceLanguage != prevLanguage ) { // Update all the ODTs so that the localized configurations can be fetched LocalizeConfigurationsL(); + + UpdateHeaderListCacheL(); // Finally, update the cenrep with the new language - TInt errorCode = iCentralRepository->Set( KCenrepLangKey, iDeviceLanguage ); + TInt errorCode = iCentralRepository->Set( KCenrepKeyLang, iDeviceLanguage ); if ( errorCode ) { #ifdef HSPS_LOG_ACTIVE @@ -2257,6 +2278,57 @@ } // ----------------------------------------------------------------------------- +// ChspsThemeServer::ResetResourcesL() +// ----------------------------------------------------------------------------- +// +void ChspsThemeServer::ResetResourcesL( + ChspsODT& aAppODT ) + { + // If active configuration + TInt confUid = -1; + iCentralRepository->Get( aAppODT.RootUid(), confUid ); + if( confUid == aAppODT.ThemeUid() ) + { + if( !iFileMan ) + { + iFileMan= CFileMan::NewL( iFsSession ); + } + + // Find unique plug-in UIDs from the app configuration + RArray uidArray; + CleanupClosePushL( uidArray ); + hspsServerUtil::FindUniquePluginsL( aAppODT, uidArray ); + + // Remove old copies from the client path, localized copies will be + // restored when the app configuration is fetched again + for( TInt i=0; i < uidArray.Count(); i++ ) + { + ChspsODT* pluginODT = ChspsODT::NewL(); + CleanupStack::PushL( pluginODT ); + + GetConfigurationL( + 0, + uidArray[i], + *pluginODT ); + + if( pluginODT->ThemeUid() ) + { + hspsServerUtil::RemoveResourceFilesL( + *iFileMan, + iFsSession, + aAppODT.RootUid(), + *pluginODT ); + } + + CleanupStack::PopAndDestroy(); + } + + uidArray.Reset(); + CleanupStack::PopAndDestroy( &uidArray ); + } + } + +// ----------------------------------------------------------------------------- // ChspsThemeServer::LocalizeL() // ----------------------------------------------------------------------------- // @@ -2286,6 +2358,8 @@ aEngine, aOdt, requestedLanguage ); + + ResetResourcesL( aOdt ); } else { diff -r 1b207dd38b72 -r ace62b58f4b2 homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp --- a/homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp Tue May 25 13:01:39 2010 +0300 +++ b/homescreenpluginsrv/hspsmanager/src/hspsthemeserversession.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -796,81 +796,6 @@ } // ----------------------------------------------------------------------------- -// ChspsThemeServerSession::DoCopyResourceFilesL -// ----------------------------------------------------------------------------- -TInt ChspsThemeServerSession::DoCopyResourceFilesL( - ChspsODT& aAppODT, - CFileMan& aFilemanager, - const TInt aConfUid, - const TDesC& aDestination ) - { - TInt error( KErrNone ); - RPointerArray widgetResources; // Objects are not owned. - CleanupClosePushL( widgetResources ); - - // Get resources that need to be copied. - hspsServerUtil::GetValidResourcesL( aAppODT, - aConfUid, - Server().DeviceLanguage(), - widgetResources ); - - // Copy the resources found - for( TInt i = 0; ( i < widgetResources.Count() && !error ); i++ ) - { - ChspsResource* resource = widgetResources[i]; - if( !resource ) - { - continue; - } - - // Get relative path under the themes folder - TPath relativePath; - hspsServerUtil::GetRelativeResourcePath( - resource->FileName(), - relativePath ); - - // Strip language indicator from the relative path - hspsServerUtil::GetLocaleIndependentResourcePath( - resource->Language(), - relativePath ); - - // Finalize target path - TPath targetPath; - targetPath.Copy( aDestination ); - targetPath.Append( relativePath ); - - // Create missing target path and copy files when needed only - error = hspsServerUtil::CopyResourceFileL( - iFs, - aFilemanager, - targetPath, - resource->FileName() ); - if ( !error ) - { -#ifdef HSPS_LOG_ACTIVE - if ( iLogBus ) - { - iLogBus->LogText( - _L( "hspsServerUtil::DoCopyResourceFilesL(): - %S was copied" ), - &targetPath - ); - } -#endif - } - if ( error == KErrAlreadyExists ) - { - error = KErrNone; - } - - } // copy loop - - widgetResources.Reset(); - CleanupStack::PopAndDestroy( 1, &widgetResources ); - - return error; - } - -// ----------------------------------------------------------------------------- // ChspsThemeServerSession::CopyResourceFilesL // (other items were commented in a header). // ----------------------------------------------------------------------------- @@ -918,31 +843,33 @@ { phaseCounter++; - RArray widgetArray; - CleanupClosePushL( widgetArray ); + RArray uidArray; + CleanupClosePushL( uidArray ); // Find unique configuration UIDs from the resource array - FindWidgetUidsL( *odt, widgetArray ); + FindWidgetUidsL( *odt, uidArray ); CFileMan* fileManager = NULL; fileManager = CFileMan::NewL( iFs ); CleanupStack::PushL( fileManager ); // Loop widgets belonging to the root configuration - const TInt uidCount = widgetArray.Count(); + const TInt uidCount = uidArray.Count(); for( TInt i = 0; i < uidCount && !error; i++ ) { // Copy widget's resources to client's private folder - error = DoCopyResourceFilesL( - *odt, - *fileManager, - widgetArray[i], - destinationPath ); + error = hspsServerUtil::CopyResourceFilesL( + *odt, + iFs, + *fileManager, + Server().DeviceLanguage(), + uidArray[i], + destinationPath ); } - widgetArray.Reset(); + uidArray.Reset(); - CleanupStack::PopAndDestroy( 2, &widgetArray ); // fileManager, widgetArray + CleanupStack::PopAndDestroy( 2, &uidArray ); // fileManager, uidArray } // KErrNone //Tidy-up diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/hs_widget_publisher_api/inc/hsdataobserver.h --- a/homescreensrv_plat/hs_widget_publisher_api/inc/hsdataobserver.h Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hsdataobserver.h Wed Jun 09 10:01:25 2010 +0300 @@ -58,7 +58,8 @@ EActivate = 1, ///< Activation event: Means that widget has been added to HS as content. EDeactivate = 2, ///< Deactivation event: Means that widget has been removed frm. ESuspend = 3, ///< Suspension event: Means that HS reading widget data is suspended. - EResume = 4 ///< Resume event. Means that HS reading widget data is resumed. + EResume = 4, ///< Resume event. Means that HS reading widget data is resumed. + EPluginshutdown = 5 ///< Plugin Shutdown event. Means widget is removed from HS. }; /** diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/hs_widget_publisher_api/inc/hsglobals.h --- a/homescreensrv_plat/hs_widget_publisher_api/inc/hsglobals.h Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hsglobals.h Wed Jun 09 10:01:25 2010 +0300 @@ -80,6 +80,8 @@ _LIT8( KActive, "active" ); _LIT8( KDeActive, "deactive" ); +_LIT8( KPluginshutdown, "pluginshutdown"); + _LIT8( KSuspend, "suspend" ); _LIT8( KResume, "resume" ); _LIT8( KSelected, "selected" ); diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetitem.h --- a/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetitem.h Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetitem.h Wed Jun 09 10:01:25 2010 +0300 @@ -62,13 +62,21 @@ /** */ bool isStringValue(); - + + /** + */ + void triggerAdded(); + + /** + */ + bool isTriggerAdded(); private: std::string mItemName; std::string mItemString; int mItemInt; bool mIsString; + bool mTrigger; }; } diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h --- a/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/hs_widget_publisher_api/inc/hswidgetpublisherimpl.h Wed Jun 09 10:01:25 2010 +0300 @@ -33,6 +33,7 @@ namespace Hs { class HsWidget; +class HsWidgetItem; typedef std::map WidgetContentIdMapType; @@ -137,8 +138,8 @@ /** */ - int HandleWidgetActionL( const TDesC8& aActionDes, - HsWidget& aWidget ); + void HandleWidgetActionL( const TDesC8& aActionDes, + const TDesC& aContentIdDes, HsWidget& aWidget ); /** */ @@ -172,6 +173,11 @@ /** */ + void InsertWidgetDataIdentifiersL( HsWidget& aWidget, + CLiwDefaultMap* aDataMap, const TDesC& aContentType ); + + /** + */ void InsertWidgetInfoL( HsWidget& aWidget, CLiwDefaultMap* aDataMap ); @@ -190,8 +196,7 @@ /** */ - void InsertItemsTriggersL( HsWidget& aWidget, - CLiwDefaultMap* aTriggerMap ); + void AddItemsActionsL( HsWidget& aWidgetItem, TInt aItemIndex ); /** */ diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/hs_widget_publisher_api/src/hswidgetitem.cpp --- a/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetitem.cpp Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetitem.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -25,7 +25,9 @@ // --------------------------------------------------------------------------- // HsWidgetItem::HsWidgetItem(std::string& aItemName, std::string& aValue): - mItemName(aItemName), mItemString(aValue), mItemInt(0), mIsString(true) + mItemName(aItemName), mItemString(aValue), mItemInt(0), + mIsString(true),mTrigger(false) + { } @@ -102,5 +104,20 @@ return mIsString; } +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetItem::triggerAdded() + { + mTrigger = true; + } - +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +bool HsWidgetItem::isTriggerAdded() + { + return mTrigger; + } diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp --- a/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/hs_widget_publisher_api/src/hswidgetpublisherimpl.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -96,8 +96,8 @@ mWidgets.push_back( widget); TInt err( KErrNone ); TRAP( err, + RegisterNotificationL( *widget ); PublishWidgetActionsL( *widget ); - RegisterNotificationL( *widget ); ) if( err != KErrNone ) { @@ -139,11 +139,7 @@ if ( changeMapsList->AtL(index, variant) ) { const CLiwMap* map = variant.AsMap(); - HsWidget* widget = GetWidgetL( map ); - if( !widget ) - { - break; - } + variant.Reset(); if ( map->FindL(KOperation, variant) ) {// Check what triggered a notification variant.Get(operation); @@ -155,11 +151,19 @@ { variant.Get(trigger ); } - if( !HandleWidgetActionL( trigger, *widget ) ) - { - break; - } - HandleWidgetItemActionL( trigger, *widget ); + HsWidget* widget = GetWidgetL( map ); + if( !widget ) + { + break; + } + variant.Reset(); + if ( !map->FindL( KContentId, variant ) ) + { + User::Leave( KErrNotFound ); + } + HandleWidgetActionL( trigger, variant.AsDes(), *widget ); + HandleWidgetItemActionL( trigger, *widget ); + variant.Reset(); } } } @@ -172,12 +176,39 @@ // // --------------------------------------------------------------------------- // -int HsWidgetPublisherImpl::HandleWidgetActionL( const TDesC8& aActionDes, - HsWidget& aWidget ) +void HsWidgetPublisherImpl::HandleWidgetActionL( const TDesC8& aActionDes, + const TDesC& aContentIdDes, HsWidget& aWidget ) { - int ret( 1 );//not found IHsDataObserver::EEvent action( IHsDataObserver::EUnknown ); TranslateObserverAction( aActionDes, action ); + switch( action ) + { + case IHsDataObserver::EActivate: + { + // add / update the Instance Id + std::wstring contentId( ToWideStringL( aContentIdDes ) ); + mWidgetContentIds[aWidget.getIdentifier()] = contentId; + }; + break; + case IHsDataObserver::EDeactivate: + { + mWidgetContentIds.erase( aWidget.getIdentifier() ); + }; + break; + case IHsDataObserver::EPluginshutdown: + { + // remove widget data when widget removed from screen + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + InsertWidgetDataIdentifiersL( aWidget, cpdatamap ); + // removal may fail if the client has already removed the data + TRAP_IGNORE( RemoveFromCpsL( cpdatamap, KCpData ) ); + CleanupStack::PopAndDestroy( cpdatamap ); + }; + break; + default : + break; + }; + if( action == IHsDataObserver::EActivate || action == IHsDataObserver::EDeactivate || action == IHsDataObserver::EResume || @@ -193,22 +224,8 @@ { observerError = exception.getReason(); } - - if ( action == IHsDataObserver::EDeactivate ) - { - // remove widget data when widget removed from screen - CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); - InsertWidgetDataIdentifiersL( aWidget, cpdatamap ); - // removal may fail if the client has already removed the data - TRAP_IGNORE( RemoveFromCpsL( cpdatamap, KCpData ) ); - mWidgetContentIds.erase( aWidget.getIdentifier() ); - CleanupStack::PopAndDestroy( cpdatamap ); - } - User::LeaveIfError( observerError ); - ret = 0; } - return ret; } // --------------------------------------------------------------------------- @@ -222,6 +239,10 @@ { aAction = IHsDataObserver::EActivate; } + if( !aActionDes.Compare( KPluginshutdown() ) ) + { + aAction = IHsDataObserver::EPluginshutdown; + } if( !aActionDes.Compare( KDeActive() ) ) { aAction = IHsDataObserver::EDeactivate; @@ -426,16 +447,8 @@ cpdatamap->InsertL( KDataMap, TLiwVariant( datamap ) ); InsertWidgetACLL( cpdatamap ); - int count = aWidget.itemsCount(); - if( count > 0 ) - { - CLiwDefaultMap* triggermap = CLiwDefaultMap::NewLC(); - InsertItemsTriggersL( aWidget, triggermap ); - cpdatamap->InsertL( KActionMap, TLiwVariant( triggermap ) ); - CleanupStack::PopAndDestroy( triggermap ); - } - - // add to CPS + + // add to CPS TLiwGenericParam item( KItem, TLiwVariant( cpdatamap )); inParam->AppendL( item ); mServiceInterface->ExecuteCmdL( KAdd, @@ -450,6 +463,15 @@ outParam->Reset(); inParam->Reset(); User::LeaveIfError( ret ); + + int count = aWidget.itemsCount(); + for ( TInt itemIndex = 0; itemIndex< count; itemIndex++) + { + if ( ! aWidget.getWidgetItem(itemIndex)->isTriggerAdded() ) + { + AddItemsActionsL( aWidget, itemIndex ); + } + } } // --------------------------------------------------------------------------- @@ -666,32 +688,14 @@ std::string strIdentifier( GetWidgetIdentifierFromPublisherNameL( *publisherName ) ); CleanupStack::PopAndDestroy( publisherName ); - publisherName = 0; + CleanupStack::PopAndDestroy( &variant ); - TBuf contentIdDesc; - if ( !aMap->FindL( KContentId, variant ) ) - { - User::Leave( KErrNotFound ); - } - variant.Get( contentIdDesc ); - CleanupStack::PopAndDestroy( &variant ); - std::wstring contentId( ToWideStringL( contentIdDesc ) ); - std::string strTemplate; std::string strWidgetName; - if( CheckIfWidgetExist(strTemplate, strWidgetName, strIdentifier, ETrue) ) { ret = &GetWidget( strTemplate, strWidgetName, strIdentifier); - - // verify that content id does not change - __ASSERT_DEBUG( !mWidgetContentIds.count( ret->getIdentifier() ) || - mWidgetContentIds[ret->getIdentifier()] == contentId, - User::Invariant() ); - - mWidgetContentIds[ret->getIdentifier()] = contentId; } - return ret; } @@ -774,7 +778,17 @@ // --------------------------------------------------------------------------- // void HsWidgetPublisherImpl::InsertWidgetDataIdentifiersL( HsWidget& aWidget, - CLiwDefaultMap* aDataMap ) + CLiwDefaultMap* aDataMap ) + { + InsertWidgetDataIdentifiersL( aWidget, aDataMap, KAll ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +void HsWidgetPublisherImpl::InsertWidgetDataIdentifiersL( HsWidget& aWidget, + CLiwDefaultMap* aDataMap, const TDesC& aContentType ) { WidgetContentIdMapType::const_iterator contentIdIter = mWidgetContentIds.find( aWidget.getIdentifier() ); @@ -788,7 +802,7 @@ HBufC* publisherName = StdStringToUnicodeLC( GetPublisherNameL( aWidget ) ); aDataMap->InsertL( KPublisherId, TLiwVariant( *publisherName ) ); - aDataMap->InsertL( KContentType, TLiwVariant( KAll ) ); + aDataMap->InsertL( KContentType, TLiwVariant( aContentType ) ); aDataMap->InsertL( KContentId, TLiwVariant( contentId ) ); CleanupStack::PopAndDestroy( publisherName ); @@ -938,29 +952,56 @@ // // --------------------------------------------------------------------------- // -void HsWidgetPublisherImpl::InsertItemsTriggersL( HsWidget& aWidget, - CLiwDefaultMap* aTriggerMap ) +void HsWidgetPublisherImpl::AddItemsActionsL(HsWidget& aWidget, TInt aItemIndex ) { - int count = aWidget.itemsCount(); - CLiwDefaultMap* activateAction = CLiwDefaultMap::NewLC(); - activateAction->InsertL( KPluginId, TLiwVariant( KCASpaAppLauncherPlugin ) ); - + HsWidgetItem* widgetItem = aWidget.getWidgetItem(aItemIndex); + TPtrC8 itemName = ((TUint8*)widgetItem->getItemName().c_str()); + + CLiwGenericParamList* inParam = &(mServiceHandler->InParamListL()); + CLiwGenericParamList* outParam = &(mServiceHandler->OutParamListL()); + + + TLiwGenericParam type(KType, TLiwVariant(KCpData)); + inParam->AppendL(type); + + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + HBufC* itemName16 = Utf8ToUnicodeLC(itemName ); + InsertWidgetDataIdentifiersL( aWidget, cpdatamap, itemName16->Des() ); + CleanupStack::PopAndDestroy( itemName16 ); + + CLiwDefaultMap* mapAction = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* activateAction = CLiwDefaultMap::NewLC(); CLiwDefaultMap* activate = CLiwDefaultMap::NewLC(); activate->InsertL( KType, TLiwVariant( KActionValueLaunchApplication ) ); activate->InsertL( KLaunchMethod, TLiwVariant( KLaunchMethodValueCmdLine ) ); activate->InsertL( KApplicationUid, TLiwVariant( iWidgetUid ) ); activate->InsertL( KApaCommand, TLiwVariant( KApaCommandBackground ) ); - + + activateAction->InsertL( KPluginId, TLiwVariant( KCASpaAppLauncherPlugin ) ); activateAction->InsertL( KData, TLiwVariant( activate ) ); - - for (int index = 0; index < count; index++) - { - HsWidgetItem* const item = aWidget.getWidgetItem( index ); - TPtrC8 itemName = ((TUint8*)item->getItemName().c_str()); - aTriggerMap->InsertL( itemName, TLiwVariant( activateAction )); - } CleanupStack::PopAndDestroy( activate ); - CleanupStack::PopAndDestroy( activateAction ); + + mapAction->InsertL(itemName, TLiwVariant( activateAction )); + CleanupStack::PopAndDestroy( activateAction ); + cpdatamap->InsertL( KActionMap, TLiwVariant( mapAction ) ); + CleanupStack::PopAndDestroy( mapAction ); + + InsertWidgetACLL( cpdatamap ); + + TLiwGenericParam item( KItem, TLiwVariant( cpdatamap )); + inParam->AppendL( item ); + + mServiceInterface->ExecuteCmdL( KAdd, *inParam, *outParam ); + TInt ret= ObtainErrorCode( *outParam ); + + CleanupStack::PopAndDestroy( cpdatamap ); + item.Reset(); + type.Reset(); + outParam->Reset(); + inParam->Reset(); + User::LeaveIfError( ret ); + + widgetItem->triggerAdded(); } // --------------------------------------------------------------------------- diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/idlefw_api/group/bld.inf --- a/homescreensrv_plat/idlefw_api/group/bld.inf Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/idlefw_api/group/bld.inf Wed Jun 09 10:01:25 2010 +0300 @@ -22,6 +22,7 @@ DEFAULT PRJ_EXPORTS +../inc/aisystemuids.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aisystemuids.hrh) ../inc/aiuicontrolleruid.hrh MW_LAYER_PLATFORM_EXPORT_PATH(aiuicontrolleruid.hrh) ../inc/aiconsts.h MW_LAYER_PLATFORM_EXPORT_PATH(aiconsts.h) ../inc/aifweventhandler.h MW_LAYER_PLATFORM_EXPORT_PATH(aifweventhandler.h) diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/idlefw_api/inc/aisystemuids.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/idlefw_api/inc/aisystemuids.hrh Wed Jun 09 10:01:25 2010 +0300 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: UIDs for the Active Idle subsystem components. +* +*/ + + +#ifndef AISYSTEMUIDS_HRH +#define AISYSTEMUIDS_HRH + +/** + * AI3 Test Application. + */ +#define AI3_UID_EXE_TEST_APPLICATION 0x2001CB4F + +/** + * Ecom implementation uid for XML UI controller. + */ +#define AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML 0x2001952C +#define AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML 0x102750F2 + +/** + * Ecom implementation uid for native UI controller. + */ +#define AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE 0x2001952E +#define AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE 0x102750F4 + +/** + * Ecom implementation uid for Device Status plugin. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN 0x102750F8 + +/** + * Ecom implementation uid for Device Status plugin. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SHORTCUTPLUGIN 0x102750FA + +/** + * Ecom implementation uid for AI Profile plug-in. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN 0x10275101 + +/** + * Ecom implementation uid for sat plugin. + */ +#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SATPLUGIN 0x102078EB + +/** + * Ecom dll uid for XML UI controller. + */ +#define AI3_UID_ECOM_DLL_UICONTROLLER_XML 0x2001952A +#define AI_UID_ECOM_DLL_UICONTROLLER_XML 0x102750F1 + + +/** + * Ecom dll uid for native UI controller. + */ +#define AI3_UID_ECOM_DLL_UICONTROLLER_NATIVE 0x2001952D +#define AI_UID_ECOM_DLL_UICONTROLLER_NATIVE 0x102750F3 + +/** + * Ecom dll uid for device status plugin. + */ +#define AI_UID_ECOM_DLL_CONTENTPUBLISHER_DEVSTAPLUGIN 0x102750F7 + +/** + * Common UID3 for Active Idle framework components. + */ +#define AI_UID3_AIFW_COMMON 0x102750F0 + +/** + * Uid3 for AI framework dll. + */ +#define AI_UID3_AIFW_DLL AI_UID3_AIFW_COMMON + +/** + * Uid3 for AI framework launcher exe. + */ +#define AI_UID3_AIFW_EXE AI_UID3_AIFW_COMMON + +/** + * SID for aifw launcher exe. + */ +#define AI_SID_AIFW_EXE AI_UID3_AIFW_EXE + +/** + * Uid3 for AI Voice Dial UI. + */ +#define AI_UID3_VOICE_DIAL_UI 0x101F8543 + +/** + * Uid3 for ai3 layoutengine + */ +#define AI3_UID_LAYOUT_ENGINE 0x2001CB50 + +/** + * Uid3 for ai3 utils + */ +#define AI3_UID_UTILS 0x2001CB51 + +/** + * Uids for rendering plugins + */ +#define AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY 0x2001952F +#define AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY_IMPLEMENTATION 0x20019530 + +#define AI3_UID_RENDERING_PLUGIN_MENUFACTORY 0x20019582 +#define AI3_UID_RENDERING_PLUGIN_MENUFACTORY_IMPLEMENTATION 0x20019583 + +#define AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY 0x20019584 +#define AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY_IMPLEMENTATION 0x20019585 + +#define AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY 0x20019586 +#define AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY_IMPLEMENTATION 0x20019587 + +#define AI3_UID_RENDERING_PLUGIN_POPUPFACTORY 0x20019588 +#define AI3_UID_RENDERING_PLUGIN_POPUPFACTORY_IMPLEMENTATION 0x20019589 + +#define AI3_UID_RENDERING_PLUGIN_TEXTFACTORY 0x2001958A +#define AI3_UID_RENDERING_PLUGIN_TEXTFACTORY_IMPLEMENTATION 0x2001958B + +#define AI3_UID_RENDERING_PLUGIN_CLOCKFACTORY 0x2001CB52 +#define AI3_UID_RENDERING_PLUGIN_CLOCKFACTORY_IMPLEMENTATION 0x2001CB52 + +#define AI3_UID_RENDERING_PLUGIN_VIEWFACTORY 0x2001958E +#define AI3_UID_RENDERING_PLUGIN_VIEWFACTORY_IMPLEMENTATION 0x2001958F + +#define AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY 0x20019590 +#define AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY_IMPLEMENTATION 0x20019591 + +#define AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID 0x20019592 + +#define AI3_EXTERNAL_RENDERING_PLUGIN_ECOM_UID 0x200286DF + +#define AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY 0x20022FD3 +#define AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY_IMPLEMENTATION 0x20022FD3 + +#define AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY 0x200286E2 +#define AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY_IMPLEMENTATION 0x200286E2 + +#endif // AISYSTEMUIDS_HRH + + diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/menu_content_service_api/inc/mcsmenuitem.h --- a/homescreensrv_plat/menu_content_service_api/inc/mcsmenuitem.h Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/menu_content_service_api/inc/mcsmenuitem.h Wed Jun 09 10:01:25 2010 +0300 @@ -40,6 +40,7 @@ enum TFlags ///< Item flags. { + ENoFlag = 0x0, ///< Item has no flags. ELockDelete = 0x1, ///< Item cannot be deleted. ELockName = 0x2, ///< Item cannot be renamed. ELockIcon = 0x4, ///< Icon cannot be changed. diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/inc/mt_hspsconfigurationif.h Wed Jun 09 10:01:25 2010 +0300 @@ -409,6 +409,11 @@ */ void RequestNotify_6_L(); /** + * Test case function for test case SisxUpgrade(1) + * See HSPS module test specification + */ + void SisxUpgrade_1_L(); + /** * Test case function for test case SisxInstallation(1) * See HSPS module test specification */ diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp --- a/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/sapi_homescreenplugin/tsrc/hspsconfigurationif/src/mt_hspsconfigurationif.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -263,9 +263,9 @@ // Remove test configuration resource files TRAP( err, RemoveResourceFilesL( iFileserver ) ); if ( err != KErrNone ) - { - EUNIT_FAIL_TEST( "Teardown failed." ); - } + { + EUNIT_FAIL_TEST( "Teardown failed." ); + } } //------------------------------------------------------------------------------ @@ -2640,6 +2640,211 @@ EUNIT_PRINT( _L8( "Test step passed" ) ); } + +//------------------------------------------------------------------------------ +// Test case: SisxUpgrade(1) +//------------------------------------------------------------------------------ +void MT_CHSPSConfigurationIf::SisxUpgrade_1_L() + { + // Pre conditions + + // Attach to HSPS + EUNIT_PRINT( _L8( "Pre conditions: Attach to HSPS service IConfiguration interface" ) ); + AttachServiceL( KHSPS, KHSPSConfigurationIf, KHSPSTestAppUid ); + + // Test step 1: + EUNIT_PRINT( _L8( "Test step 1: simulate installation of a SISX package" ) ); + + CFileMan* fileManager = CFileMan::NewL( iFileserver ); + CleanupStack::PushL( fileManager ); + + // Copy installation files to c\private\200159c0\import + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\0\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\0\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\1\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\1\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\9\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\9\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\widgetconfiguration.xml" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\" ), + CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\manifest.dat" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\" ), + CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\plugin_0998_101FB657_2000B133_1.0.dat" ), + _L( "c:\\private\\200159c0\\import\\" ), + CFileMan::EOverWrite ) ); + + // Wait until configuration is installed + User::After( 4000000 ); + + // Make sure "InstalledWidget" is installed + if ( !BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) ) + { + // Installation failed - remove imports to be able to re-run the test again + // The ChspsThemeServer::HandleConfigurationImportsL does handle newly + // added files only + User::LeaveIfError( fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ) ); + fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133.dat" ), + 0, KEntryAttReadOnly, TTime( 0 ) ); // TTime(0) = preserve original time stamp. + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) ); + + // Leave - the test was not successfull + User::Leave( KErrGeneral ); + } + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 1: + EUNIT_PRINT( _L8( "Test step 2: simulate upgrade to v2 of a SISX package" ) ); + // Copy installation files to c\private\200159c0\import + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget_v2\\0\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\2.0\\0\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget_v2\\1\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\2.0\\1\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget_v2\\9\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\2.0\\9\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget_v2\\widgetconfiguration.xml" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\2.0\\" ), + CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget_v2\\manifest.dat" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\2.0\\" ), + CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget_v2\\plugin_0998_101FB657_2000B133_2.0.dat" ), + _L( "c:\\private\\200159c0\\import\\" ), + CFileMan::EOverWrite ) ); + + // Wait until configuration is installed + User::After( 4000000 ); + + // Make sure "InstalledWidget v1" is removed + if ( BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) ) + { + // Installation failed - remove imports to be able to re-run the test again + // The ChspsThemeServer::HandleConfigurationImportsL does handle newly + // added files only + User::LeaveIfError( fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ) ); + fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ), + 0, KEntryAttReadOnly, TTime( 0 ) ); // TTime(0) = preserve original time stamp. + fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_2.0.dat" ), + 0, KEntryAttReadOnly, TTime( 0 ) ); // TTime(0) = preserve original time stamp. + + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) ); + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_2.0.dat" ) ) ); + // Leave - the test was not successfull + User::Leave( KErrGeneral ); + } + + EUNIT_PRINT( _L8( "Test step passed" ) ); + + + // Test step 3: + EUNIT_PRINT( _L8( "Test step 3: simulate uninstalation of a SISX package" ) ); + // Remove installation files to c\private\200159c0\import + User::LeaveIfError( fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ) ); + fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ), + 0, KEntryAttReadOnly, TTime( 0 ) ); // TTime(0) = preserve original time stamp. + fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_2.0.dat" ), + 0, KEntryAttReadOnly, TTime( 0 ) ); // TTime(0) = preserve original time stamp. + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) ); + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_2.0.dat" ) ) ); + + EUNIT_PRINT( _L8( "Test step passed" ) ); + User::After( 4000000 ); + + // check + // Copy installation files to c\private\200159c0\import + EUNIT_PRINT( _L8( "Test step 4: simulate installation of a SISX package" ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\0\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\0\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\1\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\1\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\9\\" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\9\\" ), + CFileMan::ERecurse|CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\widgetconfiguration.xml" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\" ), + CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\manifest.dat" ), + _L( "c:\\private\\200159c0\\import\\0998\\101FB657\\2000B133\\1.0\\" ), + CFileMan::EOverWrite ) ); + User::LeaveIfError( fileManager->Copy( + _L( "c:\\data\\mt_hsps\\installed_widget\\plugin_0998_101FB657_2000B133_1.0.dat" ), + _L( "c:\\private\\200159c0\\import\\" ), + CFileMan::EOverWrite ) ); + + // Wait until configuration is installed + User::After( 4000000 ); + + // Make sure "InstalledWidget" is installed + if ( !BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) ) + { + // Installation failed - remove imports to be able to re-run the test again + // The ChspsThemeServer::HandleConfigurationImportsL does handle newly + // added files only + User::LeaveIfError( fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ) ); + fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ), + 0, KEntryAttReadOnly, TTime( 0 ) ); // TTime(0) = preserve original time stamp. + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) ); + + // Leave - the test was not successfull + User::Leave( KErrGeneral ); + } + + EUNIT_PRINT( _L8( "Test step passed" ) ); + + // Test step 2: + EUNIT_PRINT( _L8( "Test step 5: simulate un-installation of the SISX package" ) ); + + // Remove installation files from c\private\200159c0\import + User::LeaveIfError( fileManager->RmDir( _L( "c:\\private\\200159c0\\import\\0998\\" ) ) ); + fileManager->Attribs( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133.dat" ), + 0, + KEntryAttReadOnly, + TTime( 0 ) ); // TTime(0) = preserve original time stamp. + User::LeaveIfError( fileManager->Delete( _L( "c:\\private\\200159c0\\import\\plugin_0998_101FB657_2000B133_1.0.dat" ) ) ); + // Removing of *.dat file causes configuration uninstallation + // Wait until configuration is uninstalled + User::After( 4000000 ); + + // Make sure "InstalledWidget" is uninstalled + if ( BaflUtils::FileExists( iFileserver, _L( "c:\\private\\200159c0\\themes\\2456\\270513751\\536916275\\1.0\\InstallWidgetConf.o0000" ) ) ) + { + User::Leave( KErrGeneral ); + } + + EUNIT_PRINT( _L8( "Test step passed" ) ); + + CleanupStack::PopAndDestroy( fileManager ); + }; + + + + //------------------------------------------------------------------------------ // Test case: SisxInstallation(1) //------------------------------------------------------------------------------ @@ -3423,11 +3628,11 @@ SetupL, SetPluginSettings_6_L, Teardown ) EUNIT_TEST( - "GetPluginSettings(1)", - "IConfiguration", - "GetPluginSettings", - "FUNCTIONALITY", - SetupL, GetPluginSettings_1_L, Teardown ) + "GetPluginSettings(1)", + "IConfiguration", + "GetPluginSettings", + "FUNCTIONALITY", + SetupL, GetPluginSettings_1_L, Teardown ) EUNIT_TEST( "GetPluginSettings(2)", @@ -3569,13 +3774,20 @@ "FUNCTIONALITY", SetupL, RequestNotify_6_L, Teardown ) - EUNIT_TEST( + EUNIT_TEST( + "SisxUpgrade(1)", + "IConfiguration", + "SisxUpgrade", + "FUNCTIONALITY", + SetupL, SisxUpgrade_1_L, Teardown ) + + EUNIT_TEST( "SisxInstallation(1)", "IConfiguration", "SisxInstallation", "FUNCTIONALITY", SetupL, SisxInstallation_1_L, Teardown ) - + EUNIT_TEST( "NativeInstallation(1)", "IConfiguration", diff -r 1b207dd38b72 -r ace62b58f4b2 homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsexecuteaction.cpp --- a/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsexecuteaction.cpp Tue May 25 13:01:39 2010 +0300 +++ b/homescreensrv_plat/sapi_menucontent/mcsservice/src/mcsexecuteaction.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -124,10 +124,15 @@ void CMCSExecuteAction::RunL() { TInt err = iStatus.Int(); + if ( err == KErrNone ) { - ExecuteL( iItemId, iAction ); - } + TRAP( err, ExecuteL( iItemId, iAction ) ); + } + if(err != KErrNone) + { + NotifyRequestResult( err ); + } } // --------------------------------------------------------------------------- @@ -137,6 +142,10 @@ TInt CMCSExecuteAction::RunError(TInt aError) { NotifyRequestResult( aError ); + if ( (aError != KErrDiskFull) && (aError != KErrNoMemory)) + { + aError = KErrNone; + } return aError; } diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/devicestatus/inc/ainetworkinfolistener.h --- a/idlefw/plugins/devicestatus/inc/ainetworkinfolistener.h Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/devicestatus/inc/ainetworkinfolistener.h Wed Jun 09 10:01:25 2010 +0300 @@ -225,7 +225,8 @@ ERegistrationStatusReceived = 0x00000010, ENetworkInfoChangeReceived = 0x00000020, EProgrammableOperatorInfoReceived = 0x00000040, - EProgrammableOperatorInfoReceivedOk = 0x00000080 + EProgrammableOperatorInfoReceivedOk = 0x00000080, + ECSRegistrationNotOk = 0x00000100 }; /** diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp --- a/idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/devicestatus/src/ainetworkinfolistener.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -155,8 +155,8 @@ void CAiNetworkInfoListener::HandleNetworkMessage( const TNWMessages aMessage ) { - __PRINTS("XAI: Handle NW message"); - //Insert message into the message cache. Only one messsage of one type. + __PRINT(__DBG_FORMAT("XAI: Handle NW message %d"), aMessage ); + //Insert message into the message cache. Only one messsage of one type. TRAPD( err, iMessageCache->InsertIsqL( aMessage, iKeyProperties ) ); if( err == KErrAlreadyExists ) { @@ -249,8 +249,8 @@ // Registration status and network information must have been received. // Operator name information must have been received. // Device must be camped to a network. + // CS registration should be completed (only valid in AT&T NW) - TBool csAlphaFlag( EFalse ); switch ( aMessage ) { case MNWMessageObserver::ENWMessageNetworkInfoChange: @@ -296,7 +296,13 @@ if ( !( RPacketService::KCapsRxCSCall & iInfo.iDynamicCapsFlags ) ) { - csAlphaFlag = ETrue; + __PRINTS("XAI: CS registration failed"); + iReceivedMessageFlags |= ECSRegistrationNotOk; + } + else + { + __PRINTS("XAI: CS registration ok"); + iReceivedMessageFlags &= ~ECSRegistrationNotOk; } } FeatureManager::UnInitializeLib(); @@ -316,6 +322,7 @@ ( ENetworkInfoChangeReceived & iReceivedMessageFlags ) && ( ERegistrationStatusReceived & iReceivedMessageFlags ) && ( iInfo.iStatus == ENWStatusCurrent ) ); + TBool csAlphaFlag( ECSRegistrationNotOk & iReceivedMessageFlags ); return !serviceProviderNameFetched || diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/mcsplugin/group/qgn_mcsplugin_log_out.svg --- a/idlefw/plugins/mcsplugin/group/qgn_mcsplugin_log_out.svg Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/mcsplugin/group/qgn_mcsplugin_log_out.svg Wed Jun 09 10:01:25 2010 +0300 @@ -1,123 +1,127 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - - + + + + + + + - - - - - + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + - - - - - + + + + + + + + + + + + + + + + - - + + - - + - - - - - - - - - - - - - - - + + - - - + - - - - - - + + + + - - - - - - - - - - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - - + + diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp --- a/idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/mcsplugin/handler/src/mcspluginhandler.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -44,6 +44,7 @@ _LIT( KMenuAttrParam, "param" ); #define KMCSCmailUidValue 0x2001E277 +#define KMCSCmailMailboxDefaultViewIdValue 0x1 #define KMCSCmailMailboxViewIdValue 0x2 #define KMCSCmailMtmUidValue 0x2001F406 @@ -211,7 +212,10 @@ } else { - iVwsSession->StartApp( TUid::Uid( KMCSCmailUidValue ) ); + const TVwsViewId viewId( TUid::Uid( KMCSCmailUidValue ), + TUid::Uid( KMCSCmailMailboxDefaultViewIdValue ) ); + iVwsSession->CreateActivateViewEvent( viewId, + TUid::Uid( KMCSCmailUidValue ), KNullDesC8() ); } } diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h --- a/idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/mcsplugin/publisher/inc/mcsplugindata.h Wed Jun 09 10:01:25 2010 +0300 @@ -221,11 +221,12 @@ /** * Get bookmark data item + * @param aUid, used for bookmark uid * @param aView, used for bookmark url * @param aParam, used for bookmark name * @param aData, is filled with appropriate values */ - void GetBkmDataL( const TDesC8& aView, const TDesC8& aParam, CMCSData& aData ); + void GetBkmDataL( const TDesC8& aUid, const TDesC8& aView, const TDesC8& aParam, CMCSData& aData ); /** * Get folder data item diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp --- a/idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcsplugin.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -158,11 +158,6 @@ } CMenuItem* item = iEngine->FetchMenuItemL( aData ); - if ( !item ) - { - User::Leave( KErrNotFound ); - } - CleanupStack::PushL( item ); // One widget item has iDataCount number of elements diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp --- a/idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcsplugindata.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -370,7 +370,7 @@ CleanupStack::PushL( data ); if( type == KProperValueBookmark ) { - GetBkmDataL( view, param, *data ); + GetBkmDataL( uid, view, param, *data ); } else if( type == KProperValueFolder ) { @@ -392,9 +392,26 @@ // Creates bookmark data item. // --------------------------------------------------------------------------- // -void CMCSPluginData::GetBkmDataL( const TDesC8& aView, const TDesC8& aParam, CMCSData& aData ) +void CMCSPluginData::GetBkmDataL( const TDesC8& aUid, const TDesC8& aView, const TDesC8& aParam, CMCSData& aData ) { TMenuItem item; + + if( aUid.Length() > 0 ) + { + CMenuFilter* filter = CMenuFilter::NewLC(); + HBufC* name( NULL ); + HBufC* value( NULL ); + name = AiUtility::CopyToBufferL( name, KProperNameUid ); + CleanupStack::PushL( name ); + value = AiUtility::CopyToBufferL( value, aUid ); + CleanupStack::PushL( value ); + filter->HaveAttributeL( *name, *value ); + CleanupStack::PopAndDestroy( value ); + CleanupStack::PopAndDestroy( name ); + item = iEngine.FindMenuItemL( *filter ); + CleanupStack::PopAndDestroy( filter ); + } + item.SetType( KMenuTypeUrl ); aData.SetMenuItem( item ); diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp --- a/idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/mcsplugin/publisher/src/mcspluginengine.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -324,6 +324,14 @@ CMenuItem* CMCSPluginEngine::FetchMenuItemL( CMCSData& aData ) { CMenuItem* item = NULL; + + TRAP_IGNORE( item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ) ); + + if( item ) + { + return item; + } + if( aData.MenuItem().Type() == KMenuTypeUrl ) { item = CreateBkmItemL( aData ); @@ -332,10 +340,6 @@ { item = CreateMailboxItemL( aData); } - else - { - item = CMenuItem::OpenL( iMenu, aData.MenuItem().Id() ); - } return item; } diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/profileplugin/inc/caiprofileengine.h --- a/idlefw/plugins/profileplugin/inc/caiprofileengine.h Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/profileplugin/inc/caiprofileengine.h Wed Jun 09 10:01:25 2010 +0300 @@ -37,6 +37,7 @@ class MProEngProfileNameArray; class RSSSettings; +class CAknQueryDialog; /** * @ingroup group_profileplugin @@ -190,6 +191,8 @@ TBool iTimed; /** Flag to indicate whether active profile is silent */ TBool iSilent; + /** Offline query dialog */ + CAknQueryDialog* iOfflineQueryDialog; }; #endif // CAIPROFILEENGINE_H diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/profileplugin/src/caiprofileengine.cpp --- a/idlefw/plugins/profileplugin/src/caiprofileengine.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/profileplugin/src/caiprofileengine.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -137,6 +137,9 @@ // CAiProfileEngine::~CAiProfileEngine() { + delete iOfflineQueryDialog; + iOfflineQueryDialog = NULL; + iSSSettings.CancelAll( *this ); iSSSettings.Close(); @@ -276,9 +279,12 @@ } else { - CAknQueryDialog* dlg = CAknQueryDialog::NewL(); - - result = dlg->ExecuteLD( R_AI_LEAVE_OFFLINE_MODE_QUERY ); + if ( iOfflineQueryDialog == NULL ) + { + iOfflineQueryDialog = CAknQueryDialog::NewL(); + result = iOfflineQueryDialog->ExecuteLD( R_AI_LEAVE_OFFLINE_MODE_QUERY ); + iOfflineQueryDialog = NULL; + } } return result; @@ -665,6 +671,13 @@ // void CAiProfileEngine::HandleProfileActivatedL( TInt /*aProfileId*/ ) { + // prevents duplicate offline notes on the screen. + if ( iOfflineQueryDialog ) + { + delete iOfflineQueryDialog; + iOfflineQueryDialog = NULL; + } + DetermineTimedAndSilentStatesL(); NotifyContentUpdate(); diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/sapidataplugin/inc/sapidataplugin.h --- a/idlefw/plugins/sapidataplugin/inc/sapidataplugin.h Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/sapidataplugin/inc/sapidataplugin.h Wed Jun 09 10:01:25 2010 +0300 @@ -221,6 +221,14 @@ TBool IsActive() const; /** + * Is plugin stopped + * + * @param void + * @return boolean (ETrue/EFalse) + */ + TBool IsStopped() const; + + /** * Publish a specific text of the widget * * @param aObserver observer @@ -253,6 +261,17 @@ */ void PublishImageL(MAiContentObserver* aObserver, TInt aContentId, TDesC& aPath ); + + /** + * Publish a data stream to the widget + * + * @param aObserver observer + * @param aContentId content model id + * @param aData data stream + * @return void + */ + void PublishData( MAiContentObserver* aObserver, + TInt& aContentId, const TDesC8& aData ); /** * Cleans a data from the widget diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/sapidataplugin/inc/sapidatapluginconst.h --- a/idlefw/plugins/sapidataplugin/inc/sapidatapluginconst.h Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/sapidataplugin/inc/sapidatapluginconst.h Wed Jun 09 10:01:25 2010 +0300 @@ -31,13 +31,13 @@ /** * Content Model type identifier */ -_LIT(KText ,"text"); +_LIT(KText, "text"); _LIT(KImage, "image"); -_LIT(KPlugin, "plugin"); +_LIT(KNewsTicker, "title"); +_LIT(KTextEditor, "texteditor"); +_LIT(KData, "data"); -_LIT(KNewsTicker ,"newsticker"); -_LIT(KTextEditor, "texteditor"); - +_LIT(KPlugin, "plugin"); // CPS Constants _LIT(KService, "service"); diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/sapidataplugin/src/sapidata.cpp --- a/idlefw/plugins/sapidataplugin/src/sapidata.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/sapidataplugin/src/sapidata.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -443,15 +443,18 @@ TLiwVariant variant; HBufC8* itemName = CnvUtfConverter::ConvertFromUnicodeToUtf8L(*iItemList[pIndex]->iName); CleanupStack::PushL( itemName ); + if ( aDataMap->FindL( *itemName, variant ) ) - { - TPtrC valPtr; - if( iItemList[pIndex]->iType->Des() == KText ) + { + const TDesC& type( *iItemList[pIndex]->iType ); + TPtrC valPtr; + + if ( type == KText ) { valPtr.Set( variant.AsDes() ); iPlugin->PublishTextL( aObserver, iItemList[pIndex]->iId, valPtr ); } - else if( iItemList[pIndex]->iType->Des() == KImage ) + else if( type == KImage ) { TInt handle = KErrBadHandle; TUint uintHandle = 0; @@ -494,9 +497,18 @@ iPlugin->PublishImageL(aObserver, iItemList[pIndex]->iId, handle, maskHandle ); } } + else if ( type == KData ) + { + TPtrC8 ptr; + + ptr.Set( variant.AsData() ); + + iPlugin->PublishData( aObserver, iItemList[pIndex]->iId, ptr ); + } } - variant.Reset(); - CleanupStack::PopAndDestroy( itemName ); + + variant.Reset(); + CleanupStack::PopAndDestroy( itemName ); } } // --------------------------------------------------------------------------- @@ -749,7 +761,7 @@ // void CSapiData::UpdatePublisherStatusL( TDesC& aPublisher ) { - if ( aPublisher == iPublisher ) + if ( aPublisher == iPublisher && !iPlugin->IsStopped() ) { // Resend the plugin status to publisher CLiwDefaultList* actionsToLaunch = CLiwDefaultList::NewLC(); diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp --- a/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -149,7 +149,7 @@ } // --------------------------------------------------------------------------- -// Publish a specific text of the widget +// Publish a specific text to the widget // --------------------------------------------------------------------------- // void CSapiDataPlugin::PublishTextL(MAiContentObserver* aObserver, @@ -174,7 +174,7 @@ } // --------------------------------------------------------------------------- -// Publish a specific image of the widget +// Publish a specific image to the widget // --------------------------------------------------------------------------- // void CSapiDataPlugin::PublishImageL(MAiContentObserver* aObserver, @@ -270,11 +270,11 @@ } // --------------------------------------------------------------------------- -// Publish a image of the widget +// Publish a image to the widget // --------------------------------------------------------------------------- // void CSapiDataPlugin::PublishImageL(MAiContentObserver* aObserver, - TInt& aContentId, TInt aHandle, TInt aMaskHandle ) + TInt& aContentId, TInt aHandle, TInt aMaskHandle ) { if ( aObserver->CanPublish( *this, aContentId , aContentId ) ) { @@ -303,7 +303,20 @@ aObserver->Clean( *this, aContentId, aContentId ); } } - } + } + } + +// --------------------------------------------------------------------------- +// Publish a data to the widget +// --------------------------------------------------------------------------- +// +void CSapiDataPlugin::PublishData( MAiContentObserver* aObserver, + TInt& aContentId, const TDesC8& aData ) + { + if ( aObserver->CanPublish( *this, aContentId, aContentId ) ) + { + aObserver->Publish( *this, aContentId, aData, aContentId ); + } } // --------------------------------------------------------------------------- @@ -342,6 +355,10 @@ { return KImage(); } + else if ( iContentModel[i].type == KAiContentTypeData ) + { + return KData(); + } } } @@ -570,15 +587,11 @@ // void CSapiDataPlugin::ConfigureL( RAiSettingsItemArray& aSettings ) { - if ( iDataCount > 0 ) - { - // We own the array so destroy it - aSettings.ResetAndDestroy(); - return; - } + RAiSettingsItemArray contentItemsArr; + CleanupClosePushL( contentItemsArr ); - RAiSettingsItemArray contentItemsArr; RAiSettingsItemArray configurationItemsArr; + CleanupClosePushL( configurationItemsArr ); TInt count( aSettings.Count() ); @@ -598,68 +611,67 @@ iDataCount = contentItemsArr.Count(); - if ( iDataCount > 0 ) + // Create the content Model + HBufC* contentId = HBufC::NewLC( + KAiContentIdMaxLength + KAiPluginNameMaxLength ); + + iContentModel = new TAiContentItem[iDataCount]; + + for ( TInt i = 0; i < iDataCount; i++ ) { - // Create the content Model - HBufC* contentId = HBufC::NewLC( - KAiContentIdMaxLength + KAiPluginNameMaxLength ); + MAiPluginContentItem& contentItem( + contentItemsArr[i]->AiPluginContentItem() ); + + iContentModel[i].id = i; - iContentModel = new TAiContentItem[iDataCount]; + const TDesC& type( contentItem.Type() ); - for ( TInt i = 0; i < iDataCount; i++ ) + if ( type == KText() || type == KNewsTicker() || + type == KTextEditor() ) { - MAiPluginContentItem& contentItem( - contentItemsArr[i]->AiPluginContentItem() ); - - iContentModel[i].id = i; - - if( contentItem.Type() == KText() || - contentItem.Type() == KNewsTicker() || - contentItem.Type() == KTextEditor() ) - { - // text - iContentModel[i].type = KAiContentTypeText; - } - if( contentItem.Type() == KImage() ) - { - // image - iContentModel[i].type = KAiContentTypeBitmap; - } + // text + iContentModel[i].type = KAiContentTypeText; + } + else if ( type == KImage() ) + { + // image + iContentModel[i].type = KAiContentTypeBitmap; + } + else if ( type == KData() ) + { + // data stream + iContentModel[i].type = KAiContentTypeData; + } + + contentId->Des().Copy( contentItem.Name() ); + contentId->Des().Delete( 0, + contentId->Des().LocateReverse( KPluginNameSeprator ) + 1 ); + + TInt sizeOfContentId( contentId->Des().Size() + sizeof( wchar_t ) ); + + iContentModel[i].cid = + static_cast< const wchar_t* >( User::Alloc( sizeOfContentId ) ); - contentId->Des().Copy( contentItem.Name() ); - contentId->Des().Delete( 0, - contentId->Des().LocateReverse( KPluginNameSeprator ) + 1 ); - - TInt sizeOfContentId( contentId->Des().Size() + sizeof( wchar_t ) ); - - iContentModel[i].cid = - static_cast< const wchar_t* >( User::Alloc( sizeOfContentId ) ); - - Mem::Copy( ( TAny* )iContentModel[i].cid, - contentId->Des().PtrZ(), sizeOfContentId ); - - contentId->Des().Delete( 0, contentId->Des().Length() ); - } + Mem::Copy( ( TAny* )iContentModel[i].cid, + contentId->Des().PtrZ(), sizeOfContentId ); - CleanupStack::PopAndDestroy( contentId ); + contentId->Des().Delete( 0, contentId->Des().Length() ); + } + + CleanupStack::PopAndDestroy( contentId ); - iContent = AiUtility::CreateContentItemArrayIteratorL( - iContentModel, iDataCount ); - - iData->SetContentIdL( PublisherInfo().Namespace() ); - - // Configurations - iData->ConfigureL( configurationItemsArr ); + iContent = AiUtility::CreateContentItemArrayIteratorL( + iContentModel, iDataCount ); - // Listen the publisher content update - iData->RegisterContentObserverL(); - } + iData->SetContentIdL( PublisherInfo().Namespace() ); - contentItemsArr.Reset(); - configurationItemsArr.Reset(); - - // We own the array so destroy it - aSettings.ResetAndDestroy(); + // Configurations + iData->ConfigureL( configurationItemsArr ); + + // Listen the publisher content update + iData->RegisterContentObserverL(); + + CleanupStack::PopAndDestroy( 2, &contentItemsArr ); // configurationItemsArr } // ---------------------------------------------------------------------------- @@ -720,6 +732,16 @@ } // ---------------------------------------------------------------------------- +// CSapiDataPlugin::IsStopped +// +// ---------------------------------------------------------------------------- +// +TBool CSapiDataPlugin::IsStopped() const + { + return iPluginState == EStopped; + } + +// ---------------------------------------------------------------------------- // CSapiDataPlugin::Data // // ---------------------------------------------------------------------------- @@ -740,3 +762,4 @@ } // End of file + diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h --- a/idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/wrtdataplugin/inc/wrtdataplugin.h Wed Jun 09 10:01:25 2010 +0300 @@ -59,9 +59,10 @@ */ enum TPluginStates { - ENone, + EStopped, + EStarted, EResume, - ESuspend + ESuspend }; /** @@ -189,6 +190,14 @@ TBool IsActive() const; /** + * Is plugin stopped + * + * @param void + * @return boolean (ETrue/EFalse) + */ + TBool IsStopped() const; + + /** * Publish a specific text of the widget * * @param aObserver observer @@ -341,8 +350,6 @@ RFs iRfs; /** Timer for initial data republishing, owned */ CPeriodic* iTimer; - /** Flag to indicate if this plugin is stopped */ - TBool iStopped; }; #endif // WRTDATAPLUGIN_H diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/wrtdataplugin/src/wrtdata.cpp --- a/idlefw/plugins/wrtdataplugin/src/wrtdata.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdata.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -130,29 +130,32 @@ // void CWrtData::UpdatePublisherStatusL() { - // Resent the plugin status to publisher - CLiwDefaultList* actions= CLiwDefaultList::NewLC(); - actions->AppendL( TLiwVariant( KActive )); - if ( iPlugin->IsActive() ) - { - actions->AppendL( TLiwVariant( KResume ) ); - } - else - { - actions->AppendL( TLiwVariant( KSuspend )); - } - // forward the network status if it uses. - if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOnline ) + if ( !iPlugin->IsStopped() ) { - actions->AppendL( TLiwVariant( KOnLine )); + // Resent the plugin status to publisher + CLiwDefaultList* actions= CLiwDefaultList::NewLC(); + actions->AppendL( TLiwVariant( KActive )); + if ( iPlugin->IsActive() ) + { + actions->AppendL( TLiwVariant( KResume ) ); + } + else + { + actions->AppendL( TLiwVariant( KSuspend )); + } + // forward the network status if it uses. + if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOnline ) + { + actions->AppendL( TLiwVariant( KOnLine )); + } + else if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOffline ) + { + actions->AppendL( TLiwVariant( KOffLine)); + } + + ReSendNotificationL( actions ); + CleanupStack::PopAndDestroy( actions ); } - else if ( iPlugin->NetworkStatus() == CWrtDataPlugin::EOffline ) - { - actions->AppendL( TLiwVariant( KOffLine)); - } - - ReSendNotificationL( actions ); - CleanupStack::PopAndDestroy( actions ); } // --------------------------------------------------------------------------- diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp --- a/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/plugins/wrtdataplugin/src/wrtdataplugin.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -84,7 +84,7 @@ // ---------------------------------------------------------------------------- // CWrtDataPlugin::CWrtDataPlugin() - : iNetworkStatus( EUnknown ), iPluginState( ENone ) + : iNetworkStatus( EUnknown ), iPluginState( EStopped ) { } @@ -138,7 +138,7 @@ // void CWrtDataPlugin::Start( TStartReason aReason ) { - iStopped = EFalse; + iPluginState = EStarted; if( aReason == ESystemStartup || aReason == EPluginStartup ) @@ -155,13 +155,13 @@ // void CWrtDataPlugin::Stop( TStopReason aReason ) { + iPluginState = EStopped; + if( aReason == EPluginShutdown || aReason == ESystemShutdown ) { TRAP_IGNORE(iData->NotifyPublisherL( KDeActive )); } - - iStopped = ETrue; } // ---------------------------------------------------------------------------- @@ -171,7 +171,7 @@ // void CWrtDataPlugin::Resume( TResumeReason aReason ) { - if ( aReason == EForeground && !iStopped ) + if ( aReason == EForeground && iPluginState != EStopped ) { iPluginState = EResume; @@ -186,7 +186,7 @@ // void CWrtDataPlugin::Suspend( TSuspendReason aReason ) { - if ( aReason == EBackground && !iStopped ) + if ( aReason == EBackground && iPluginState != EStopped ) { iPluginState = ESuspend; @@ -201,7 +201,7 @@ // void CWrtDataPlugin::SetOnline() { - if ( !iStopped ) + if ( iPluginState != EStopped ) { iNetworkStatus = EOnline; TRAP_IGNORE( iData->NotifyPublisherL( KOnLine )); @@ -215,7 +215,7 @@ // void CWrtDataPlugin::SetOffline() { - if ( !iStopped ) + if ( iPluginState != EStopped ) { iNetworkStatus = EOffline; TRAP_IGNORE( iData->NotifyPublisherL( KOffLine )); @@ -239,13 +239,6 @@ // void CWrtDataPlugin::ConfigureL( RAiSettingsItemArray& aSettings ) { - if( iDataCount > 0 ) - { - // We own the array so destroy it - aSettings.ResetAndDestroy(); - return; - } - RAiSettingsItemArray contentItemsArr; RAiSettingsItemArray configurationItemsArr; TInt count( aSettings.Count() ); @@ -265,63 +258,58 @@ } iDataCount = contentItemsArr.Count(); + + // Create the content Model + HBufC16* contentId = HBufC16::NewLC( + KAiContentIdMaxLength + KAiPluginNameMaxLength ); - if ( iDataCount > 0 ) + iContentModel = new TAiContentItem[iDataCount]; + + for( TInt i = 0; i < iDataCount; i++ ) { - // Create the content Model - HBufC16* contentId = HBufC16::NewLC( - KAiContentIdMaxLength + KAiPluginNameMaxLength ); + MAiPluginContentItem& contentItem( + contentItemsArr[i]->AiPluginContentItem() ); - iContentModel = new TAiContentItem[iDataCount]; - - for( TInt i = 0; i < iDataCount; i++ ) + iContentModel[i].id = i; + if( contentItem.Type() == KText() ) { - MAiPluginContentItem& contentItem( - contentItemsArr[i]->AiPluginContentItem() ); - - iContentModel[i].id = i; - if( contentItem.Type() == KText() ) - { - // text - iContentModel[i].type = KAiContentTypeText; - } - if( contentItem.Type() == KImage() || - contentItem.Type() == KAnimation() ) - { - // image - iContentModel[i].type = KAiContentTypeBitmap; - } + // text + iContentModel[i].type = KAiContentTypeText; + } + if( contentItem.Type() == KImage() || + contentItem.Type() == KAnimation() ) + { + // image + iContentModel[i].type = KAiContentTypeBitmap; + } + + contentId->Des().Copy( contentItem.Name() ); + contentId->Des().Delete( 0, + contentId->Des().LocateReverse( KPluginNameSeprator ) + 1 ); + + TInt sizeOfContentId( contentId->Des().Size()+sizeof( wchar_t ) ); + + iContentModel[i].cid = + static_cast< const wchar_t* >( User::Alloc( sizeOfContentId ) ); - contentId->Des().Copy( contentItem.Name() ); - contentId->Des().Delete( 0, - contentId->Des().LocateReverse( KPluginNameSeprator ) + 1 ); - - TInt sizeOfContentId( contentId->Des().Size()+sizeof( wchar_t ) ); - - iContentModel[i].cid = - static_cast< const wchar_t* >( User::Alloc( sizeOfContentId ) ); - - Mem::Copy( ( TAny* )iContentModel[i].cid, - contentId->Des().PtrZ(), sizeOfContentId ); - - contentId->Des().Delete( 0, contentId->Des().Length() ); - } + Mem::Copy( ( TAny* )iContentModel[i].cid, + contentId->Des().PtrZ(), sizeOfContentId ); - CleanupStack::PopAndDestroy( contentId ); - iContent = AiUtility::CreateContentItemArrayIteratorL( - iContentModel, iDataCount ); - - // Configurations - iData->ConfigureL( configurationItemsArr ); + contentId->Des().Delete( 0, contentId->Des().Length() ); + } + + CleanupStack::PopAndDestroy( contentId ); + iContent = AiUtility::CreateContentItemArrayIteratorL( + iContentModel, iDataCount ); + + // Configurations + iData->ConfigureL( configurationItemsArr ); - iPluginState = ESuspend; - - // Register for notifications - iData->RegisterL(); - - // Activate the publisher - iData->NotifyPublisherL( KActive ); - } + // Register for notifications + iData->RegisterL(); + + // Activate the publisher + iData->NotifyPublisherL( KActive ); contentItemsArr.Reset(); configurationItemsArr.Reset(); @@ -375,7 +363,17 @@ // TBool CWrtDataPlugin::IsActive() const { - return iPluginState == EResume && !iStopped; + return iPluginState == EResume; + } + +// ---------------------------------------------------------------------------- +// CWrtDataPlugin::IsStopped +// +// ---------------------------------------------------------------------------- +// +TBool CWrtDataPlugin::IsStopped() const + { + return iPluginState == EStopped; } // ---------------------------------------------------------------------------- diff -r 1b207dd38b72 -r ace62b58f4b2 idlefw/src/idleint/aiuiidleintegration.cpp --- a/idlefw/src/idleint/aiuiidleintegration.cpp Tue May 25 13:01:39 2010 +0300 +++ b/idlefw/src/idleint/aiuiidleintegration.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -26,6 +26,7 @@ #include #include + // User includes #include #include @@ -106,7 +107,9 @@ iEikEnv.SetSystem( ETrue ); - TInt wgId( iEikEnv.RootWin().Identifier() ); + RWindowGroup& windowGroup = iEikEnv.RootWin(); + windowGroup.AutoForeground(EFalse); + TInt wgId( windowGroup.Identifier() ); TInt focusWgId( iEikEnv.WsSession().GetFocusWindowGroup() ); if ( focusWgId == wgId ) @@ -218,6 +221,8 @@ // void CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL() { + __PRINTS( "*** CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL" ); + if( !iIncallBubbleAllowed ) { TInt callStatus( 0 ); @@ -229,8 +234,11 @@ // Call ongoing => show bubble if( err == KErrNone && callStatus > EPSCTsyCallStateNone ) { - iIncallBubble->SetIncallBubbleAllowedInIdleL( ETrue ); - iIncallBubbleAllowed = ETrue; + __PRINTS( "*** CAiUiIdleIntegrationImpl::SetCallBubbleIfNeededL - enable" ); + + iIncallBubble->SetIncallBubbleAllowedInUsualL( ETrue ); + iIncallBubble->SetIncallBubbleAllowedInIdleL( ETrue ); + iIncallBubbleAllowed = ETrue; } } } @@ -241,11 +249,16 @@ // void CAiUiIdleIntegrationImpl::ClearCallBubbleL() { + __PRINTS( "*** CAiUiIdleIntegrationImpl::ClearCallBubbleL" ); + if( iIncallBubbleAllowed ) { + __PRINTS( "*** CAiUiIdleIntegrationImpl::ClearCallBubbleL - disable" ); + iIncallBubble->SetIncallBubbleAllowedInIdleL( EFalse ); + iIncallBubble->SetIncallBubbleAllowedInUsualL( EFalse ); iIncallBubbleAllowed = EFalse; - } + } } // ---------------------------------------------------------------------------- @@ -279,34 +292,16 @@ if ( err == KErrNone ) { // Call ongoing => show bubble if not showing already - TBool allowed = EFalse; - if ( !self->iIncallBubbleAllowed && self->iForeground && ( callStatus > EPSCTsyCallStateNone ) ) { - allowed = ETrue; - - TRAP( err, - self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) ); - - if ( err == KErrNone ) - { - self->iIncallBubbleAllowed = allowed; - } + TRAP_IGNORE( self->SetCallBubbleIfNeededL() ); } // No call ongoing => hide if bubble is visible else if ( self->iIncallBubbleAllowed && callStatus <= EPSCTsyCallStateNone ) { - allowed = EFalse; - - TRAP( err, - self->iIncallBubble->SetIncallBubbleAllowedInIdleL( allowed ) ); - - if ( err == KErrNone ) - { - self->iIncallBubbleAllowed = allowed; - } + TRAP_IGNORE( self->ClearCallBubbleL() ); } } diff -r 1b207dd38b72 -r ace62b58f4b2 inc/aisystemuids.hrh --- a/inc/aisystemuids.hrh Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: UIDs for the Active Idle subsystem components. -* -*/ - - -#ifndef AISYSTEMUIDS_HRH -#define AISYSTEMUIDS_HRH - -/** - * AI3 Test Application. - */ -#define AI3_UID_EXE_TEST_APPLICATION 0x2001CB4F - -/** - * Ecom implementation uid for XML UI controller. - */ -#define AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML 0x2001952C -#define AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_XML 0x102750F2 - -/** - * Ecom implementation uid for native UI controller. - */ -#define AI3_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE 0x2001952E -#define AI_UID_ECOM_IMPLEMENTATION_UICONTROLLER_NATIVE 0x102750F4 - -/** - * Ecom implementation uid for Device Status plugin. - */ -#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DEVSTAPLUGIN 0x102750F8 - -/** - * Ecom implementation uid for Device Status plugin. - */ -#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SHORTCUTPLUGIN 0x102750FA - -/** - * Ecom implementation uid for AI Profile plug-in. - */ -#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_PROFILEPLUGIN 0x10275101 - -/** - * Ecom implementation uid for sat plugin. - */ -#define AI_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_SATPLUGIN 0x102078EB - -/** - * Ecom dll uid for XML UI controller. - */ -#define AI3_UID_ECOM_DLL_UICONTROLLER_XML 0x2001952A -#define AI_UID_ECOM_DLL_UICONTROLLER_XML 0x102750F1 - - -/** - * Ecom dll uid for native UI controller. - */ -#define AI3_UID_ECOM_DLL_UICONTROLLER_NATIVE 0x2001952D -#define AI_UID_ECOM_DLL_UICONTROLLER_NATIVE 0x102750F3 - -/** - * Ecom dll uid for device status plugin. - */ -#define AI_UID_ECOM_DLL_CONTENTPUBLISHER_DEVSTAPLUGIN 0x102750F7 - -/** - * Common UID3 for Active Idle framework components. - */ -#define AI_UID3_AIFW_COMMON 0x102750F0 - -/** - * Uid3 for AI framework dll. - */ -#define AI_UID3_AIFW_DLL AI_UID3_AIFW_COMMON - -/** - * Uid3 for AI framework launcher exe. - */ -#define AI_UID3_AIFW_EXE AI_UID3_AIFW_COMMON - -/** - * SID for aifw launcher exe. - */ -#define AI_SID_AIFW_EXE AI_UID3_AIFW_EXE - -/** - * Uid3 for AI Voice Dial UI. - */ -#define AI_UID3_VOICE_DIAL_UI 0x101F8543 - -/** - * Uid3 for ai3 layoutengine - */ -#define AI3_UID_LAYOUT_ENGINE 0x2001CB50 - -/** - * Uid3 for ai3 utils - */ -#define AI3_UID_UTILS 0x2001CB51 - -/** - * Uids for rendering plugins - */ -#define AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY 0x2001952F -#define AI3_UID_RENDERING_PLUGIN_BITMAPFACTORY_IMPLEMENTATION 0x20019530 - -#define AI3_UID_RENDERING_PLUGIN_MENUFACTORY 0x20019582 -#define AI3_UID_RENDERING_PLUGIN_MENUFACTORY_IMPLEMENTATION 0x20019583 - -#define AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY 0x20019584 -#define AI3_UID_RENDERING_PLUGIN_NEWSTICKERFACTORY_IMPLEMENTATION 0x20019585 - -#define AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY 0x20019586 -#define AI3_UID_RENDERING_PLUGIN_NPPLUGINFACTORY_IMPLEMENTATION 0x20019587 - -#define AI3_UID_RENDERING_PLUGIN_POPUPFACTORY 0x20019588 -#define AI3_UID_RENDERING_PLUGIN_POPUPFACTORY_IMPLEMENTATION 0x20019589 - -#define AI3_UID_RENDERING_PLUGIN_TEXTFACTORY 0x2001958A -#define AI3_UID_RENDERING_PLUGIN_TEXTFACTORY_IMPLEMENTATION 0x2001958B - -#define AI3_UID_RENDERING_PLUGIN_CLOCKFACTORY 0x2001CB52 -#define AI3_UID_RENDERING_PLUGIN_CLOCKFACTORY_IMPLEMENTATION 0x2001CB52 - -#define AI3_UID_RENDERING_PLUGIN_VIEWFACTORY 0x2001958E -#define AI3_UID_RENDERING_PLUGIN_VIEWFACTORY_IMPLEMENTATION 0x2001958F - -#define AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY 0x20019590 -#define AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY_IMPLEMENTATION 0x20019591 - -#define AI3_RENDERING_PLUGIN_ECOM_FACTORY_UID 0x20019592 - -#define AI3_EXTERNAL_RENDERING_PLUGIN_ECOM_UID 0x200286DF - -#define AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY 0x20022FD3 -#define AI3_UID_RENDERING_PLUGIN_TEXTEDITORFACTORY_IMPLEMENTATION 0x20022FD3 - -#define AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY 0x200286E2 -#define AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY_IMPLEMENTATION 0x200286E2 - -#endif // AISYSTEMUIDS_HRH - - diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/enginc/menueng.h --- a/menucontentsrv/enginc/menueng.h Tue May 25 13:01:39 2010 +0300 +++ b/menucontentsrv/enginc/menueng.h Wed Jun 09 10:01:25 2010 +0300 @@ -145,7 +145,7 @@ * @return Current state. */ inline TState State() const; - + /* * Gets legacy format * @return legacy format @@ -264,15 +264,18 @@ IMPORT_C CMenuEngObject& ModifiableObjectL( TInt aId, TInt aEvent = RMenuNotifier::EItemAttributeChanged ); - + /** * Append new notification to the list of pending notifications. * @param aFolder Folder. * @param aEvents Events. */ IMPORT_C void AppendNotifyL( TInt aFolder, TInt aEvents ); - - + + /** + * Checks if object exists and is not hidden nor missing. + * @param aId item id. + */ IMPORT_C TBool Exist( TInt aId ) const; private: // from CActive @@ -306,7 +309,7 @@ * Called when there's an error during parsing / saving. * @param aErrorCode Error code */ - void HandleEngineErrorL( TInt aErrorCode ); + void HandleEngineErrorL( TInt aErrorCode ); private: // types @@ -493,7 +496,7 @@ // ----------------------------------------------------------------------------- // CMenuEng::State // ----------------------------------------------------------------------------- -// +// CMenuEng::TState CMenuEng::State() const { return iState; diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/engsrc/menueng.cpp --- a/menucontentsrv/engsrc/menueng.cpp Tue May 25 13:01:39 2010 +0300 +++ b/menucontentsrv/engsrc/menueng.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -567,7 +567,7 @@ } - + // --------------------------------------------------------- // CMenuEng::AppendNotifyL // --------------------------------------------------------- @@ -591,17 +591,19 @@ // EXPORT_C TBool CMenuEng::Exist( TInt aId ) const { - MXCFWNode* node = NULL; + TBool exists(EFalse); const RNodeArray& nodes = iTree->Nodes(); for ( TInt i = 0; i < nodes.Count(); i++ ) { - node = nodes[i]; - if ( aId == Object( *node ).Id() ) + CMenuEngObject& object = Object( *nodes[i] ); + if ( aId == object.Id() + && !( ( object.Flags() & TMenuItem::EHidden ) + || ( object.Flags() & TMenuItem::EMissing ) ) ) { - return ETrue; + exists = ETrue; } } - return EFalse; + return exists; } // --------------------------------------------------------- // CMenuEng::RunL @@ -718,13 +720,13 @@ if ( iActiveWait->IsStarted() ) { iActiveWait->AsyncStop(); - } - + } + iState = EDead; iObserver.EngineError( aError ); // Can't delete the tree now, XCFW Engine keeps a pointer to it // and still uses it even after reporting the error. :( - + break; } @@ -785,9 +787,9 @@ if ( iActiveWait->IsStarted() ) { iActiveWait->AsyncStop(); - } - - TBool legacyFormat = iObjectFactory->IsLegacyFormat(); + } + + TBool legacyFormat = iObjectFactory->IsLegacyFormat(); // Reset object factory in all cases. iObjectFactory->Reset(); // Tree is up (maybe unsaved yet). @@ -1130,7 +1132,7 @@ TraverseNodeL( aRootNode, idManagerInit ); // Make sure all nodes have ID. TMenuEngIdSetter idSetter( *iIdManager ); - TraverseNodeL( aRootNode, idSetter ); + TraverseNodeL( aRootNode, idSetter ); } // --------------------------------------------------------- @@ -1220,7 +1222,7 @@ __ASSERT_DEBUG( !iTree, User::Invariant() ); iTree = CXCFWTree::NewL(); // Legacy xml format supported only if the xml is from rom: - iObjectFactory->SupportLegacyFormat( EFalse ); + iObjectFactory->SupportLegacyFormat( EFalse ); iEngine->LoadL( *iTree, iRamFileName ); } @@ -1238,7 +1240,7 @@ delete iTree; iTree = NULL; iTree = CXCFWTree::NewL(); // Legacy xml format supported only if the xml is from rom: - iObjectFactory->SupportLegacyFormat( ETrue ); + iObjectFactory->SupportLegacyFormat( ETrue ); iEngine->LoadL( *iTree, fname ); } @@ -1378,4 +1380,4 @@ } } -// End of File +// End of File diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/group/mcsmenu.mmp --- a/menucontentsrv/group/mcsmenu.mmp Tue May 25 13:01:39 2010 +0300 +++ b/menucontentsrv/group/mcsmenu.mmp Wed Jun 09 10:01:25 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: -* Version : %version: sa1spcx1#11.1.7.1.7 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: sa1spcx1#11.1.7.1.8 % << Don't touch! Updated by Synergy at check-out. * */ @@ -80,12 +80,6 @@ SOURCE mcsmmcobserver.cpp SOURCE mcsfreespaceobserver.cpp SOURCE mcsinstallnotifier.cpp -SOURCE mcssuiteobjectattr.cpp -SOURCE mcssuiteobject.cpp -SOURCE mcssuiteobjectfactory.cpp -SOURCE mcssuiteparser.cpp -SOURCE menusvrsuite.cpp -SOURCE mcssuitehandler.cpp SOURCE mcsgetlistcreatorinterface.cpp SOURCE mcsgetlisthandler.cpp diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/handlersrc/menuuninstalloperation.cpp --- a/menucontentsrv/handlersrc/menuuninstalloperation.cpp Tue May 25 13:01:39 2010 +0300 +++ b/menucontentsrv/handlersrc/menuuninstalloperation.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -265,6 +265,7 @@ found = ETrue; } } + packageFiles.ResetAndDestroy(); CleanupStack::PopAndDestroy( &packageEntry ); } } diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvinc/mcsgetlistcreatorinterface.h --- a/menucontentsrv/srvinc/mcsgetlistcreatorinterface.h Tue May 25 13:01:39 2010 +0300 +++ b/menucontentsrv/srvinc/mcsgetlistcreatorinterface.h Wed Jun 09 10:01:25 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: The API supports item information that is not supported by +* Description: The API supports item information that is not supported by * the MCS server itself * */ @@ -27,51 +27,6 @@ class CLiwDefaultMap; class CMenuSrvEng; - -/** - * CMcsGetAttrStrategy - * Abstract class for sttribute getting strategy - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CMcsGetAttrStrategy ): public CBase - { -public: - - /** - * Constructor. - */ - CMcsGetAttrStrategy( CMenuSrvEng& aEng ); - - /** - * Destructor. - */ - virtual ~CMcsGetAttrStrategy(); - - - /** - * TODO: add comment - */ - virtual void PrepareL(TInt aId) = 0; - - /** - * Get attribute value. - * @since S60 v5.0 - * @param aAttrName Attribute name. - * @param aAttrExists Will be set to indicate whether attribute exists - * or not. - * @return Attribute value. Empty string if attribute does not exist. - */ - virtual void GetAttributeL(const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ) = 0; - -protected: - /** - * Engine. not own - */ - CMenuSrvEng& iEng; - }; - - /** * Interface for creating list containg result for getlist operation * @@ -195,15 +150,13 @@ /* * Sets actual attribute getting strategy for give item id. */ - void SetGetterStrategyL(TInt aId); + void SetItemIdL(TInt aId); protected: /** * Engine. not own */ CMenuSrvEng& iEng ; - CMcsGetAttrStrategy* iActualGetter; ///< Actual strategy for item. - CMcsGetAttrStrategy* iSuiteGetter; ///< Get strategy for suite. Own. - CMcsGetAttrStrategy* iNormalGetter; ///< Get strategy for not suite. Own. + TInt iId; ///< a id of an item. }; #endif __MCSGETLISTCREATORINTERFACE_H__ diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvinc/mcssuitehandler.h --- a/menucontentsrv/srvinc/mcssuitehandler.h Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,229 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef MCSSUITEHANDLER_H_ -#define MCSSUITEHANDLER_H_ - -#include -#include - - -#include "menusvrsuite.h" -#include "mcsinstallnotifier.h" -#include "menuengoperation.h" -#include "mcsmmcobserver.h" -#include "mcsfreespaceobserver.h" - -class CMenuEng; -class TMenuItem; - -/** - * Suite Handler. - * @lib mcsdrmhandler.lib - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CMcsSuiteHandler ): - public CBase, MMcsInstallListener, MMenuEngOperation, MMcsMmcObserver, - MMcsFreeSpaceObserver - { -public: - - /** - * Two-phased constructor. Leaves on failure. - * @return The constructed object. - */ - static CMcsSuiteHandler* NewL( - CMenuEng& aEng, const TDesC& aDirName ); - - /** - * Destructor. - * @since S60 v5.0 - * @capability None. - * @throws None. - * @panic None. - */ - virtual ~CMcsSuiteHandler(); - - /** - * Check if suite of given name is present - * in handler. - */ - TBool HaveSuite(const TDesC& aSuiteName); - - /** - * Get attribute from suite handler. - */ - void GetAttribute( const TDesC& aSuiteName, const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ); - -private: - - /** - * Execute engine operation: - * Do the application scan and update menu accordingly. - */ - void RunMenuEngOperationL(); - void CompletedMenuEngOperation( TInt aErr ); - /** - * Constructor. - */ - CMcsSuiteHandler( CMenuEng& aEng ); - - /** - * 2nd phase constructor. - */ - void ConstructL(const TDesC& aDirName); - - /** - * Handle Install Event - */ - void HandleInstallNotifyL(TInt aEvent); - - /** - * Handle Mmc Event - */ - void HandleMmcEventL(TInt aEvent); - - /** - * Handle Free Space Event. - */ - void HandleFreeSpaceEventL(); - /** - * Lists new suits - */ - void CheckSuiteDirL(); - - /** - * Add new suits - */ - void AddNew(); - - /** - * Remove old suits - */ - void RemoveOld(); - - /** - * Removes not installed suites from content xml file(basically during restore) - * @since S60 v5.0. - */ - void ScanSuitesL(); - - - /** - * Check if file is installed - */ - TBool FileInstalled(const TDesC& aFileName); - - /** - * Check if file was removed from installed file list - */ - TBool FileUninstalled(const TDesC& aFileName); - - /** - * Check if file need Update - * @param aTimestamp - actual timestamp of file - */ - TBool FileNeedUpdate(const TDesC& aFileName, const TTime& aTimestamp); - - /** - * Validates file extansion - */ - TBool ValidExtansion(const TDesC& aFileName); - - /** - * Install file with suites - */ - void InstallFileL(const TDesC& aFileName, const TTime& aTimestam); - - /** - * Removes file with suites - */ - void UninstallFileL(const TDesC& aFileName); - - /** - * Update file with suites - */ - void UpdateFileL(const TDesC& aFileName, const TTime& aTimestam); - - /** - * Get suites from a file - */ - void GetSuitesL(const TDesC& aFileName, RPointerArray& aSuiteArray); - - /* - * Reopen older suite. Used when deleteing suite that was replaced by newer one. - */ - void ReopenSuiteL(TInt aSuiteArrayPos); - - /** - * Append suite items to array - * @since S60 v5.0. - * @param aItemArray array to append suite items - * @param aAttrName attribute name - * @param aAttrValue attribute value - */ - void GetMenuSuitesL( - RArray& aItemArray, - const TDesC& aAttrName, - const TDesC& aAttrValue ); - - - /** - * Addes or updates suite - */ - void AddSuiteL( const TPtrC& aSuiteName ); - - /** - * Removes suite - */ - void RemoveSuiteFromXmlL( const TPtrC& aSuiteName ); - - /** - * Updates suites in content xml file - * @since S60 v5.0. - * @param aMcsItems suite items - * @param aIndex index of suite item to update - */ - void UpdateSuiteInXmlL( - RArray & aMcsItems, - TInt aIndex ); - - /** - * Addes suite to main xml file - */ - void AddSuiteToXmlL( const TPtrC& aSuiteName ); - - - void UpdateItemsL( const RArray& aItemArray ); - -private: // data - CMenuEng& iEng ; ///< Engine. Not Own. - RFs iFs; ///< File Server. Own. - RBuf iDirPath; ///< Path to observerd dir. Own. - CDesCArrayFlat* iFileNewList; ///< List of new files in dir. Own. - CDesCArrayFlat* iInstalledFileList; ///< List of installed suites. Own. - RArray iNewTimestamps; ///< List of current files' timestamps. Own. - RArray iTimestamps; ///< List of files' timestamps when isntalled. Own. - CMcsInstallNotifier* iInstallNotifier; ///< Own - CMcsMmcObserver* iMmcObserver; - CMcsFreeSpaceObserver* iFreeSpaceObserver; /// Free space observer. Own. - RMenuSrvSuiteArray iSuites; ///< Suite array. Own. - TInt iEvent;/// < last event. Own - }; - -#endif /* MCSSUITEHANDLER_H_ */ diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvinc/mcssuiteobject.h --- a/menucontentsrv/srvinc/mcssuiteobject.h Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#ifndef SUITEOBJECT_H -#define SUITEOBJECT_H - -#include -#include "mcssuiteobjectattr.h" - -/** -* Menu Engine Object attribute. -*/ -NONSHARABLE_CLASS( CSuiteObject ): public CBase - { - -public: // construction - - /** - * Destructor. - */ - virtual ~CSuiteObject(); - - /** - * Two-phased constructor. - * @param aFileName File Name. - * @return The created object. - */ - static CSuiteObject* NewL( const TDesC& aFileName ); - - /** - * Two-phased constructor. - * @param aFileName File Name. - * @return The created object. - */ - static CSuiteObject* NewLC( const TDesC& aFileName ); - -protected: // construction - - /** - * Constructor - */ - CSuiteObject(); - - /** - * 2nd phase constructor. - * @param aFileName File Name. - */ - void ConstructL( const TDesC& aFileName ); - -public: // new methods - - /** - * Get file name. - * @return file name. - */ - TPtrC FileName() const { return iFileName; } - - /** - * Get suite name. - * @return suite name. - */ - TPtrC SuiteName() const { return iName; } - - /** - * Set suite name. - * @param aName Name. - */ - void SetSuiteNameL( const TDesC& aName ); - - /** - * Set attribute. - * @param aAttrName atrribute name. - * @param aAttrValue atrribute value. - * @param aLocalized localisation of attribute. - */ - void SetInitialAttributeL( const TDesC& aAttrName, - const TDesC& aAttrValue, - TBool aLocalized ); - - void GetAttribute( const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ); - - /** - * Reset, destroy and close iAttributes array. - */ - void CloseSuiteArray(); - - -private: // data - - RBuf iFileName; /// - -/** -* Menu Engine Object attribute. -*/ -NONSHARABLE_CLASS( CSuiteObjectAttr ): public CBase - { - -public: // construction - - /** - * Destructor. - */ - virtual ~CSuiteObjectAttr(); - - /** - * Two-phased constructor. - * @param aName Name. - * @return The created object. - */ - static CSuiteObjectAttr* NewL( const TDesC& aName ); - - /** - * Two-phased constructor. - * @param aName Name. - * @return The created object. - */ - static CSuiteObjectAttr* NewLC( const TDesC& aName ); - -protected: // construction - - /** - * Constructor - */ - CSuiteObjectAttr(); - - /** - * 2nd phase constructor. - * @param aName Name. - */ - void ConstructL( const TDesC& aName ); - -public: // new methods - - /** - * Get name. - * @return Name. - */ - TPtrC Name() const { return iName; } - - /** - * Get value. - * @return Value. - */ - TPtrC Value() const { return iValue; } - - /** - * Set (or replace) value. - * @param aValue Value. - */ - void SetValueL( const TDesC& aValue ); - - /** - * Get localized status. - * @return ETrue if localized. - */ - TBool Localized() const { return iLocalized; } - - /** - * Set localized status. - * @param aLocalized ETrue if localized. - */ - void SetLocalized( TBool aLocalized ) { iLocalized = aLocalized; } - -private: // data - - RBuf iName; ///< Name. Own. - RBuf iValue; ///< Value. Own. - TBool iLocalized; ///< Localized status. - - }; - -/** -* Array of CSuiteObjectAttr-s. -*/ -NONSHARABLE_CLASS( RSuiteAttrArray ) -: public RPointerArray - { - -public: // new methods - - /** - * Find attribute by name. - * @param aName Name. - * @return Index of attribute, or KErrNotFound. - */ - TInt Find( const TDesC& aName ) const; - - }; - -#endif // SUITEOBJECTATTR_H diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvinc/mcssuiteobjectfactory.h --- a/menucontentsrv/srvinc/mcssuiteobjectfactory.h Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef __SUITEOBJECTFACTORY_H__ -#define __SUITEOBJECTFACTORY_H__ - -#include -// FORWARD DECLARATION - -class CGECODefaultObjectFactory; -class MGECOAttributeProvider; - -/** -* Menu Engine Object factory. -*/ -NONSHARABLE_CLASS( CSuiteObjectFactory ): public CGECODefaultObjectFactory - { - -public: // construction - - /** - * Destructor. - */ - virtual ~CSuiteObjectFactory(); - - /** - * Two-phased constructor. - * @return The created object. - */ - static CSuiteObjectFactory* NewL( ); - -protected: // construction - - /** - * Constructor. - */ - CSuiteObjectFactory(); - -public: // from CGECOObjectFactoryBase - - /** - * Initializes the current object with attribute provider data. - * @param aAttributeProvider Attribute provider for data initialization. - */ - void InitializeObjectL( - MGECOAttributeProvider& aAttributeProvider ); - - }; - -#endif // __SUITEOBJECTFACTORY_H__ diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvinc/mcssuiteparser.h --- a/menucontentsrv/srvinc/mcssuiteparser.h Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef SUITEPARSER_H -#define SUITEPARSER_H - -// INCLUDES -#include -#include -#include - -// FORWARD DECLARATIONS -class CXCFWTree; -class CSuiteObject; -class RSuiteObjectArray; -class CSuiteObjectFactory; - -// CLASS DECLARATION - -/** - * CSuiteParser - * - */ -NONSHARABLE_CLASS( CSuiteParser ) : public CBase, public MXCFWEngineObserver - { -public: - //event enumeration - - enum TSuiteParsingStatus // statuses - - { - ECompleted = 0, // factory settings completed successfully - EFailed = -1 // factory settings failed - }; - -public: - // Constructors and destructor - - /** - * Destructor. - */ - ~CSuiteParser(); - - /** - * Two-phased constructor. - * @param aFileName a xml file to parse. - */ - static CSuiteParser* NewL( const TDesC& aFileName ); - - /** - * Two-phased constructor. - * @param aFileName a xml file to parse. - */ - static CSuiteParser* NewLC( const TDesC& aFileName ); - - /** - * Gets suites array - * @param aSuitesArray array that wil be filled with suites. - */ - TInt GetSuitsArrayL( RPointerArray& aSuitesArray ); - -private: - - /** - * Constructor for performing 1st stage construction - */ - CSuiteParser(); - - /** - * EPOC default constructor for performing 2nd stage construction - * @param aFileName a xml file to parse. - */ - void ConstructL( const TDesC& aFileName ); - - /** - * Handles the "entries" node. - * @param aSuitesArray array that wil be filled with suites. - */ - void HandleEntriesL( RPointerArray& aSuitesArray ); - - /** - * Creats suite object from node in xml file - * @param aNode that contains suite's data. - */ - CSuiteObject* CreateSuiteLC( MXCFWNode* aNode ); - - -public: - // Functions from base classes - - /** - * Called when Engine parsing / saving state changes - * User can do desired actions on corresponding events. - * @param aEvent Engine event. - */ - virtual void HandleEngineEventL( TXCFWEngineEvent aEvent ); - - /** - * Called when there's an error during parsing / saving - * @param aErrorCode Error code from engine - */ - virtual void HandleEngineErrorL( TInt aErrorCode ); - - /** - * Called when the file parsing is finished - * - * @param aStatus parsing status. - */ - void HandleCompletionL( TSuiteParsingStatus aStatus ); - -private: // data - - /** - * Name of a file to parse. Own. - */ - RBuf iFileName; - - /** - * Content engine. Own. - */ - CXCFWEngine* iContentEngine; - - /** - * Content tree. Own. - */ - CXCFWTree* iContentTree; - - /** - * scheduler for make synchronous restoration - */ - CActiveSchedulerWait* iActiveScheduler; - - /** - * Status of parsing - */ - TSuiteParsingStatus iCompletionStatus; - - /** - * Factory object needed for localised attributes. Own. - */ - CSuiteObjectFactory* iObjectFactory; - - }; - - -#endif // SUITEPARSER_H diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvinc/menusrvappscanner.h --- a/menucontentsrv/srvinc/menusrvappscanner.h Tue May 25 13:01:39 2010 +0300 +++ b/menucontentsrv/srvinc/menusrvappscanner.h Wed Jun 09 10:01:25 2010 +0300 @@ -275,6 +275,13 @@ void HandleMissingItemsL( const RArray& aItems ); /** + * Returns proper flag to be set for missing or hidden item. + * @param aItem menu item. + * @return item proper flags for hidding. + */ + TMenuItem::TFlags GetProperFlagL( const TMenuItem& aItem ); + + /** * Updates objects flags to aFlagPresent if needed. * @param aFlagValue value for flag. * @param aItem menu item. diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvinc/menusrveng.h --- a/menucontentsrv/srvinc/menusrveng.h Tue May 25 13:01:39 2010 +0300 +++ b/menucontentsrv/srvinc/menusrveng.h Wed Jun 09 10:01:25 2010 +0300 @@ -38,10 +38,9 @@ class CMcsCacheHandler; class CMcsChildrenHandler; class CMcsRunningAppsHandler; -class CMcsSuiteHandler; class CMcsGetlistHandler; /** -* In release code the macro must be undefined and application +* In release code the macro must be undefined and application * scanning must be enabled! * Define the macro only for testing purposes! */ @@ -126,20 +125,20 @@ * self-deletion is scheduled. */ void RemoveSession( CMenuSrvSession* aSession ); - - + + /** * Get attribute name list. * @since S60 v5.0 * @param aList Attribute name list. * @throws System-wide error codes if an error occurs. * @panic None. - * + * */ void GetAttributeListL( TInt aId, RArray& aList ); - + /** * Get attribute value. * @since S60 v5.0 @@ -150,28 +149,21 @@ */ TPtrC GetAttributeL( TInt aId, const TDesC& aAttrName, TBool& aAttrExists ); - void GetAttributeL( TInt aId, const TDesC& aAttrName, + void GetAttributeL( TInt aId, const TDesC& aAttrName, TBool& aAttrExists, TDes& aAttrVal ); - //TODO: Add comment - TBool InstalledSuiteExist( const TDesC& aSuiteName ); - - //TODO: Add comment - void GetSuiteAttribute( const TDesC& aSuiteName, const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ); - /** - * Get array of running apps - * + * Get array of running apps + * */ void GetRunningAppsL( RArray& aArray ); - + /** * Fetches children count for a folder */ TUint GetChildrenCountL( TInt aId ); - + /** * Builds output list for GetList operation and returns result * @param aSerializedInput serialized list with input parameters @@ -185,12 +177,12 @@ * @return serialized output list */ TPtrC8 GetListDataL( ); - + /** * Closes output buffer. */ void CloseOutputBuffer( ); - + /** * Cleans attribute cache. Used in case of no memory. */ @@ -199,23 +191,23 @@ private: // from MMenuEngObserver - void GetExtendedAttributesL( TInt aId, const TDesC& aAttrName, + void GetExtendedAttributesL( TInt aId, const TDesC& aAttrName, TBool& aAttrExists, TDes& aAttrVal ); - + void AddToCacheL( TInt aId, const TDesC& aAttrName, TDes& aAttrVal ); - + /** - * Fetches an application native attribute value. + * Fetches an application native attribute value. * @param aId item id. * @param aAttrExists ETrue if attribute exist. * @param aAttrVal attribute value. */ void ApplicationNativeAttributeL( - TInt aId, + TInt aId, TBool & aAttrExists, TDes & aAttrVal ); - + /** * Engine event. Dispatch events to all dependent sessions. * @param aFolder Events relate to this folder. May be 0. @@ -228,7 +220,7 @@ * @param aErr Error code. */ void EngineError( TInt aErr ); - + /** * Engine tree reload event. * Run appscanner again. @@ -237,20 +229,20 @@ /** * Fetches an attribute value from the caption info attributes */ - void CaptionInfoL( TInt aId, const TDesC& aAttrName, + void CaptionInfoL( TInt aId, const TDesC& aAttrName, TBool& aExists, TDes& aAttrVal ); - - + + /** * Fetches an attribute value from the skin icon info attributes */ void SkinInfoL( TInt aId, TInt aSelect, TBool& aExists, TDes& aAttrVal ); - + /** * Fetches the DRM protection attribute value */ void AppDrmProtectionL( TInt aId, TBool& aExists, TDes& aAttrVal ); - + /** * Fetches an attribute value from the caption info attributes for application */ @@ -261,17 +253,17 @@ * Fetches the children_count attribute value (for folders) */ void FolderChildrenCountL( TInt aId, TBool& aExists, TDes& aAttrVal ); - + /** * Fetches the running status for application and folder */ void GetAppRunningL( TInt aId, TBool& aExists, TDes& aAttrVal ); - + /** * Appends extended attributes to attributes list */ void AppendExtendedAttrributesL( - const TDesC& aType, + const TDesC& aType, RArray& aList ); @@ -290,7 +282,6 @@ CMcsRunningAppsHandler* iRunningAppsHandler;//own CMcsCacheHandler* iCacheHandler; CMcsChildrenHandler* iChildrenHandler; - CMcsSuiteHandler* iSuiteHandler; CMcsGetlistHandler* iGetlistHandler; }; diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvinc/menusvrsuite.h --- a/menucontentsrv/srvinc/menusvrsuite.h Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of menu item attribute -* -*/ - -#ifndef MENUSUITE_H_ -#define MENUSUITE_H_ - -#include - -class CSuiteObject; - -NONSHARABLE_CLASS( RMenuSrvSuiteArray ) : public RPointerArray - { - -public: - - /** - * Find suite by name. - * @param aSuiteName suite name. - * @return TInt, possition in array if attribute was found, KErrNotFound if not found. - */ - TInt FindLastSuite( const TDesC& aSuiteName ); - - /** - * Find suite by file name. - * @param aSuiteName suite name. - * @return TInt, possition in array if attribute was found, KErrNotFound if not found. - */ - TInt FindByFile( const TDesC& aFileName ); - - /* - * Chech if Suite exists - * */ - TBool Exist( const TDesC& aSuiteName ); - - /** - * Remove attributes by suite name. - * @param aId Id. - */ - void RemoveByFileName( const TDesC& aFileName ); - - - /** - * Append new item. - */ - TInt Append(const CSuiteObject* anEntry); - - }; - -/** -* Push a ResetAndDestroy() on the cleanup stack. -* @param aArray Array. -*/ -void CleanupResetAndDestroyPushL( RMenuSrvSuiteArray& aArray ); - -#endif /* MENUSUITE_H_ */ diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvsrc/mcsgetlistcreatorinterface.cpp --- a/menucontentsrv/srvsrc/mcsgetlistcreatorinterface.cpp Tue May 25 13:01:39 2010 +0300 +++ b/menucontentsrv/srvsrc/mcsgetlistcreatorinterface.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -21,166 +21,12 @@ #include "mcsgetlistcreatorinterface.h" #include "menusrveng.h" -_LIT( KMenuAttrSuiteName, "suite_name" ); - -/** - * Class for getting attributes for installed suite items - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CMcsSuiteGetAttrStrategy ) : - public CMcsGetAttrStrategy - { -public: - - /** - * Constructor. - */ - CMcsSuiteGetAttrStrategy( CMenuSrvEng& aEng ); - - /** - * Destructor. - */ - virtual ~CMcsSuiteGetAttrStrategy(); - - /** - * TODO: add comments - */ - void PrepareL(TInt aId); - - /** - * GetAttributeL. - */ - void GetAttributeL(const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ); - -private: - RBuf iSuiteName; ///< Name of a suite for actual strategy. Own. - }; - -/** - * Class for getting attributes for non suite items / not installed suite items - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CMcsMainGetAttrStrategy ) : - public CMcsGetAttrStrategy - { -public: - - /** - * Constructor. - */ - CMcsMainGetAttrStrategy ( CMenuSrvEng& aEng ); - - /** - * TODO: add comments - */ - void PrepareL(TInt aId); - - /** - * GetAttributeL. - */ - void GetAttributeL(const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ); - -private: - TInt iId; ///< a id of an item for actual strategy. - }; - - -// --------------------------------------------------------- -// CMcsGetAttrStrategy::CMcsGetAttrStrategy -// --------------------------------------------------------- -// -CMcsGetAttrStrategy::CMcsGetAttrStrategy( CMenuSrvEng& aEng ) : - iEng(aEng) - { - } - - -// --------------------------------------------------------- -// CMcsGetAttrStrategy::~CMcsGetAttrStrategy -// --------------------------------------------------------- -// -CMcsGetAttrStrategy::~CMcsGetAttrStrategy() - { - } - -// --------------------------------------------------------- -// CMcsSuiteGetAttrStrategy::CMcsGetSuiteAttributeStrategy -// --------------------------------------------------------- -// -CMcsSuiteGetAttrStrategy::CMcsSuiteGetAttrStrategy( CMenuSrvEng& aEng ) : - CMcsGetAttrStrategy(aEng) - { - } - -// --------------------------------------------------------- -// CMcsSuiteGetAttrStrategy::~CMcsSuiteGetAttrStrategy -// --------------------------------------------------------- -// -CMcsSuiteGetAttrStrategy::~CMcsSuiteGetAttrStrategy() - { - iSuiteName.Close(); - } - -// --------------------------------------------------------- -// CMcsSuiteGetAttrStrategy::Prepare -// --------------------------------------------------------- -// -void CMcsSuiteGetAttrStrategy::PrepareL(TInt aId) - { - TBool suiteNameExists; - iSuiteName.Close(); - iSuiteName.CreateL( KMenuMaxAttrValueLen ); - iEng.GetAttributeL(aId, KMenuAttrSuiteName, suiteNameExists, iSuiteName); - } - -// --------------------------------------------------------- -// CMcsSuiteGetAttrStrategy::GetAttributeL -// --------------------------------------------------------- -// -void CMcsSuiteGetAttrStrategy::GetAttributeL(const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ) - { - iEng.GetSuiteAttribute(iSuiteName, aAttrName, aAttrExists, aAttrVal); - } - -// --------------------------------------------------------- -// CMcsSuiteGetAttrStrategy::CMcsGetSuiteAttributeStrategy -// --------------------------------------------------------- -// -CMcsMainGetAttrStrategy::CMcsMainGetAttrStrategy( CMenuSrvEng& aEng ) : - CMcsGetAttrStrategy(aEng) - { - } - -// --------------------------------------------------------- -// CMcsMainGetAttrStrategy::Prepare -// --------------------------------------------------------- -// -void CMcsMainGetAttrStrategy::PrepareL(TInt aId) - { - iId = aId; - } - -// --------------------------------------------------------- -// CMcsGetSuiteAttributeStrategy::GetAttributeL -// --------------------------------------------------------- -// -void CMcsMainGetAttrStrategy::GetAttributeL(const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ) - { - iEng.GetAttributeL (iId, aAttrName, aAttrExists, aAttrVal); - } - // --------------------------------------------------------- // CMcsGetListCreatorInterface::~CMcsGetListCreatorInterface // --------------------------------------------------------- // CMcsGetListCreatorInterface::~CMcsGetListCreatorInterface() { - delete iNormalGetter; - delete iSuiteGetter; } // --------------------------------------------------------- @@ -198,9 +44,6 @@ // void CMcsGetListCreatorInterface::ConstructL() { - iActualGetter = NULL; - iSuiteGetter = new(ELeave) CMcsSuiteGetAttrStrategy(iEng); - iNormalGetter = new(ELeave) CMcsMainGetAttrStrategy(iEng); } // --------------------------------------------------------- @@ -211,7 +54,7 @@ const TMenuItem& aMenuItem, CDesC16Array* aRequiredAttributes, CDesC16Array* aIgnoredAttributes, CLiwDefaultMap* aMap ) { - SetGetterStrategyL( aMenuItem.Id() ); + SetItemIdL( aMenuItem.Id() ); AddFundamentalAttributesL( aMenuItem, aMap ); if( aRequiredAttributes->MdcaCount() && @@ -300,7 +143,7 @@ if ( aMenuItem.Type() == KMenuTypeApp() || aMenuItem.Type() == KMenuTypeFolder() ) { - iActualGetter->GetAttributeL( KRunningStatus, exists, attrvalue ); + iEng.GetAttributeL( iId, KRunningStatus, exists, attrvalue ); aMap->InsertL( KRunning, TLiwVariant( exists ) ); } } @@ -314,8 +157,9 @@ } else { - iActualGetter->GetAttributeL( - aRequiredAttributes->MdcaPoint(i), exists, attrvalue ); + iEng.GetAttributeL( + iId, aRequiredAttributes->MdcaPoint(i), exists, attrvalue ); + if( exists ) { TBuf8 attrname; @@ -355,7 +199,7 @@ running.Copy( KRunning ); if( aIgnoredAttributes->Find( running, pos ) != KErrNone ) { - iActualGetter->GetAttributeL(KRunningStatus, exists, attrvalue ); + iEng.GetAttributeL( iId, KRunningStatus, exists, attrvalue ); aMap->InsertL( KRunning, TLiwVariant( exists ) ); } } @@ -368,7 +212,7 @@ { if( aIgnoredAttributes->Find( attrNameList[i], pos ) != KErrNone ) { - iActualGetter->GetAttributeL(attrNameList[i], exists, attrvalue ); + iEng.GetAttributeL( iId, attrNameList[i], exists, attrvalue ); if( exists ) { TBuf8 attrname; @@ -425,7 +269,7 @@ { if ( aMenuItem.Type() == KMenuTypeApp() || aMenuItem.Type() == KMenuTypeFolder() ) { - iActualGetter->GetAttributeL( KRunningStatus, exists, attrvalue ); + iEng.GetAttributeL( iId, KRunningStatus, exists, attrvalue ); aMap->InsertL( KRunning, TLiwVariant( exists ) ); } } @@ -441,7 +285,8 @@ } else if( aIgnoredAttributes->Find( aRequiredAttributes->MdcaPoint(i), pos ) != KErrNone ) { - iActualGetter->GetAttributeL( aRequiredAttributes->MdcaPoint(i), exists, attrvalue ); + iEng.GetAttributeL( + iId, aRequiredAttributes->MdcaPoint(i), exists, attrvalue ); if( exists ) { TBuf8 attrname; @@ -475,7 +320,7 @@ if ( aMenuItem.Type() == KMenuTypeApp() || aMenuItem.Type() == KMenuTypeFolder() ) { - iActualGetter->GetAttributeL( KRunningStatus, exists, attrvalue ); + iEng.GetAttributeL( iId, KRunningStatus, exists, attrvalue ); aMap->InsertL( KRunning, TLiwVariant( exists ) ); } RArray attrNameList; @@ -486,7 +331,7 @@ { TBuf8 attrname; attrname.Copy( attrNameList[i] ); - iActualGetter->GetAttributeL( attrNameList[i], exists, attrvalue ); + iEng.GetAttributeL( iId, attrNameList[i], exists, attrvalue ); if(exists) { attrname.Copy(attrNameList[i]); @@ -499,7 +344,6 @@ CleanupStack::PopAndDestroy( iconAttrMap ); CleanupStack::PopAndDestroy(&attrNameList); CleanupStack::PopAndDestroy( &attrvalue ); - } // --------------------------------------------------------- @@ -538,7 +382,7 @@ RBuf attrvalue; attrvalue.CreateL( KMenuMaxAttrValueLen ); CleanupClosePushL( attrvalue ); - iActualGetter->GetAttributeL(aAttrName, exists, attrvalue ); + iEng.GetAttributeL( iId, aAttrName, exists, attrvalue ); if ( exists ) { attrName.Copy( aAttrName ); @@ -551,23 +395,8 @@ // CMcsGetListCreatorInterface::SetGetterStrategyL // --------------------------------------------------------- // -void CMcsGetListCreatorInterface::SetGetterStrategyL(TInt aId) +void CMcsGetListCreatorInterface::SetItemIdL( TInt aId ) { - TBool suiteNameExists; - RBuf name; - name.CreateL( KMenuMaxAttrValueLen ); - CleanupClosePushL( name ); - - iEng.GetAttributeL(aId, KMenuAttrSuiteName, suiteNameExists, name); - if (suiteNameExists && iEng.InstalledSuiteExist(name)) - { - iActualGetter = iSuiteGetter; - } - else - { - iActualGetter = iNormalGetter; - } - iActualGetter->PrepareL(aId); - CleanupStack::PopAndDestroy(&name); + iId = aId; } // End of File diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvsrc/mcssuitehandler.cpp --- a/menucontentsrv/srvsrc/mcssuitehandler.cpp Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,699 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// INCLUDE FILES -#include -#include - -#include "mcssuitehandler.h" -#include "menueng.h" -#include "mcsinstallnotifier.h" -#include "mcssuiteparser.h" -#include "mcssuiteobject.h" -#include "menusrvengutils.h" -#include "mcsmenuitem.h" - -// ================= LOCAL FUNCTIONS ======================= - -/** -* Cleanup support method. Call ResetAndDestroy() on the array. -* @param RMenuItemArray* as TAny* -*/ -LOCAL_C void ResetAndDestroy( TAny* aArray ) - { - ((RPointerArray*)aArray)->ResetAndDestroy(); - } - -// --------------------------------------------------------- -// CleanupResetAndDestroyPushL -// --------------------------------------------------------- -// -LOCAL_C void CleanupResetAndDestroyPushL( RPointerArray& aArray ) - { - CleanupStack::PushL( TCleanupItem( ResetAndDestroy, &aArray ) ); - } - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CMcsSuiteHandler::NewL -// --------------------------------------------------------- -// -CMcsSuiteHandler* CMcsSuiteHandler::NewL( CMenuEng& aEng, const TDesC& aDirName ) - { - CMcsSuiteHandler* self = new( ELeave ) CMcsSuiteHandler( aEng ); - CleanupStack::PushL( self ); - self->ConstructL(aDirName); - CleanupStack::Pop( self ); - return self; - } - - -// --------------------------------------------------------- -// CMcsSuiteHandler::~CMcsSuiteHandler -// --------------------------------------------------------- -// -CMcsSuiteHandler::~CMcsSuiteHandler() - { - iSuites.ResetAndDestroy(); - delete iMmcObserver; - delete iFreeSpaceObserver; - delete iInstallNotifier; - iTimestamps.Close(); - iNewTimestamps.Close(); - iEng.DequeueOperation( *this ); - delete iInstalledFileList; - delete iFileNewList; - iDirPath.Close(); - iFs.Close(); - } - - -// --------------------------------------------------------- -// CMcsSuiteHandler::HaveSuite -// --------------------------------------------------------- -// -TBool CMcsSuiteHandler::HaveSuite(const TDesC& aSuiteName) - { - return iSuites.Exist(aSuiteName); - } - -void CMcsSuiteHandler::GetAttribute( const TDesC& aSuiteName, const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ) - { - TInt suitePos = iSuites.FindLastSuite(aSuiteName); - if (suitePos != KErrNotFound) - { - iSuites[suitePos]->GetAttribute(aAttrName, aAttrExists, aAttrVal); - } - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::CMcsSuiteHandler -// --------------------------------------------------------- -// -CMcsSuiteHandler::CMcsSuiteHandler( CMenuEng& aEng ) : - iEng(aEng) - { - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::ConstructL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::ConstructL(const TDesC& aDirName) - { - User::LeaveIfError( iFs.Connect( ) ); - iDirPath.CreateL( KMaxPath ); - User::LeaveIfError( iFs.PrivatePath( iDirPath ) ); - iDirPath.Append(KImportDir); - iDirPath.Append(KBackSlash); - iDirPath.Append(aDirName); - iDirPath.Append(KBackSlash); - iFileNewList = new (ELeave) CDesCArrayFlat(KDefaultGranularity); - iInstalledFileList = new (ELeave) CDesCArrayFlat(KDefaultGranularity); - iInstallNotifier = CMcsInstallNotifier::NewL(*this, KSAUidSoftwareInstallKeyValue); - iMmcObserver = CMcsMmcObserver::NewL( *this ); - iFreeSpaceObserver = CMcsFreeSpaceObserver::NewL( *this ); - // Import suites form suite dir - CheckSuiteDirL(); - iEvent = EInstOpRestore; - iEng.QueueOperationL( *this ); - } - - -// --------------------------------------------------------- -// CMcsSuiteHandler::HandleInstallNotifyL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::HandleInstallNotifyL(TInt aEvent) - { - // Look for new files - CheckSuiteDirL(); - iEvent = aEvent; - iEng.QueueOperationL( *this ); - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::HandleMmcEventL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::HandleMmcEventL(TInt aEvent) - { - CheckSuiteDirL(); - if (aEvent == EMmcInsert) - { - iEvent = EInstOpInstall; - } - else if (aEvent == EMmcRemove) - { - iEvent = EInstOpUninstall; - } - iEng.QueueOperationL( *this ); - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::HandleFreeSpaceEventL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::HandleFreeSpaceEventL() - { - CheckSuiteDirL(); - iEvent = EInstOpUninstall; - iEng.QueueOperationL( *this ); - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::CheckSuiteDirL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::CheckSuiteDirL() - { - // Get file list - iFileNewList->Reset(); - iNewTimestamps.Reset(); - - TDriveList driveList; - TChar driveLetter; - User::LeaveIfError(iFs.DriveList(driveList)); - for (TInt driveNumber = EDriveA; driveNumber <= EDriveZ; driveNumber++) - { - if (driveList[driveNumber]) - { - User::LeaveIfError(iFs.DriveToChar(driveNumber, driveLetter)); - RBuf filePath; - filePath.CreateL(KMaxPath); - CleanupClosePushL(filePath); - filePath.Append(driveLetter); - filePath.Append(KColen); - filePath.Append(iDirPath); - CDir* fileList; - - iFs.GetDir(filePath, KEntryAttMaskSupported, - ESortByName, fileList); - - CleanupStack::PopAndDestroy(&filePath); - if (fileList) - { - CleanupStack::PushL(fileList); - for (TInt i = 0; i < fileList->Count(); i++) - { - // Not dir, xml file - if (!(*fileList)[i].IsDir() && ValidExtansion( - (*fileList)[i].iName)) - { - // Don't add same file names more then once - // Or else it will case trouble during update - TInt dummy; - if ( iFileNewList->Find((*fileList)[i].iName, dummy) ) - { - iFileNewList->AppendL((*fileList)[i].iName); - iNewTimestamps.AppendL((*fileList)[i].iModified); - } - } - } - CleanupStack::PopAndDestroy(fileList); - } - } - } - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::AddNewL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::AddNew() - { - for ( TInt i = 0; i < iFileNewList->Count(); i++ ) - { - TPtrC fileNewName = (*iFileNewList)[i]; - TTime fileTimestamp = iNewTimestamps[i]; - - if ( !FileInstalled(fileNewName) ) - { - // Not yet installed, install it - TRAP_IGNORE( InstallFileL(fileNewName, fileTimestamp) ); - } - else if (FileNeedUpdate(fileNewName, fileTimestamp) ) - { - //Installed, but needs update - TRAP_IGNORE( UpdateFileL( fileNewName, fileTimestamp) ); - } - } - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::RemoveOldL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::RemoveOld() - { - for ( TInt i = 0; i < iInstalledFileList->Count(); i++ ) - { - TPtrC fileNewName = (*iInstalledFileList)[i]; - - // File was removed, unistall it - if ( FileUninstalled(fileNewName) ) - { - TRAP_IGNORE( UninstallFileL(fileNewName) ); - } - } - iInstalledFileList->Compress(); - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::ScanSuitesL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::ScanSuitesL() - { - RArray suiteItems; - CleanupClosePushL( suiteItems ); - GetMenuSuitesL( suiteItems, KMenuAttSuiteAdded(), KMenuTrue() ); - - for ( TInt i = 0; i < suiteItems.Count(); i++ ) - { - TBool dummy(EFalse); - TPtrC suiteName(KNullDesC); - iEng.ObjectL( suiteItems[i].Id() ). - FindAttribute( KMenuAttSuiteName, suiteName, dummy ); - - if ( !HaveSuite( suiteName ) ) - { - iEng.RemoveL( suiteItems[i].Id() ); - } - } - CleanupStack::PopAndDestroy(&suiteItems); - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::FileExistL -// --------------------------------------------------------- -// -TBool CMcsSuiteHandler::FileInstalled(const TDesC& aFileName) - { - TInt posInArray; - // uses Folded Comparing - if (iInstalledFileList->Find(aFileName, posInArray) == KErrNone) - { - return ETrue; - } - return EFalse; - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::FileUninstalled -// --------------------------------------------------------- -// -TBool CMcsSuiteHandler::FileUninstalled(const TDesC& aFileName) - { - for (TInt j = 0 ; j < iFileNewList->Count(); j++) - { - if ( !(*iFileNewList)[j].Compare( aFileName ) ) - { - // Wasn't removed but maybe needs to be updated (rom case) - return FileNeedUpdate(aFileName, iNewTimestamps[j]); - } - } - return ETrue; - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::FileNeedUpdate -// --------------------------------------------------------- -// -TBool CMcsSuiteHandler::FileNeedUpdate(const TDesC& aFileName, const TTime& aTimestamp) - { - TInt posInArray; - // uses Folded Comparing - if (iInstalledFileList->Find(aFileName, posInArray) == KErrNone) - { - // If timestamps mach then it's the same file - return (iTimestamps[posInArray] != aTimestamp); - } - return EFalse; - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::ValidExtansion -// --------------------------------------------------------- -// -TBool CMcsSuiteHandler::ValidExtansion(const TDesC& aFileName) - { - TPtrC fileExt = - aFileName.Mid( aFileName.LocateReverse( KDot ) + 1 ); - - return ( fileExt.CompareF(KXmlExt) == 0 ); - } - - -// --------------------------------------------------------- -// CMcsSuiteHandler::InstallFile -// --------------------------------------------------------- -// -void CMcsSuiteHandler::InstallFileL(const TDesC& aFileName, const TTime& aTimestam) - { - RPointerArray suiteArray; - CleanupResetAndDestroyPushL(suiteArray); - - // Get suite from suite file - GetSuitesL(aFileName, suiteArray); - - //Add filename to installed suites files array - //If Leave occured during GetSuitesL filename wont be added - iInstalledFileList->AppendL(aFileName); - iTimestamps.AppendL(aTimestam); - - // Take the ownership of suite items - for (TInt i = 0; i < suiteArray.Count(); i++ ) - { - User::LeaveIfError( iSuites.Append( suiteArray[i] ) ); - TRAPD( err, AddSuiteL( suiteArray[i]->SuiteName() ) ); - if( err!=KErrNone ) - { - if( i==0 ) - { - iInstalledFileList->Delete( iInstalledFileList->Count()-1 ); - iTimestamps.Remove( iTimestamps.Count()-1 ); - } - iSuites.Remove( iSuites.Count()-1 ); - User::Leave( err ); - } - suiteArray[i] = NULL; - } - CleanupStack::Pop(&suiteArray); - suiteArray.Close(); - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::UninstallFile -// --------------------------------------------------------- -// -void CMcsSuiteHandler::UninstallFileL(const TDesC& aFileName) - { - TInt pos(KErrNotFound); - if ( !iInstalledFileList->Find(aFileName, pos)) - { - - // Need to know what suites are beeing removed - CDesCArrayFlat* removedSuites = - new (ELeave) CDesCArrayFlat(KDefaultGranularity); - CleanupStack::PushL(removedSuites); - for (TInt i = 0; i < iSuites.Count(); i++) - { - if ( aFileName.Compare( iSuites[i]->FileName() ) == KErrNone ) - { - removedSuites->AppendL( iSuites[i]->SuiteName() ); - } - } - - // We know what suites are beeing removed, we can remove those safly - iSuites.RemoveByFileName(aFileName); - - // Remove uninstalled file from our list - iInstalledFileList->Delete(pos); - iTimestamps.Remove(pos); - - // And reopen removed suites defined in other files - for (TInt i = 0; i < removedSuites->Count(); i++) - { - TInt suitePos = iSuites.FindLastSuite( (*removedSuites)[i] ); - if (suitePos != KErrNotFound) - { - ReopenSuiteL(suitePos); - } - else - { - RemoveSuiteFromXmlL( (*removedSuites)[i] ); - } - } - - CleanupStack::PopAndDestroy(removedSuites); - } - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::UpdateFileL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::UpdateFileL(const TDesC& aFileName, const TTime& aTimestam) - { - TInt pos; - if (iInstalledFileList->Find(aFileName, pos) == KErrNone) - { - // Get rid of out of date suites - iSuites.RemoveByFileName(aFileName); - iInstalledFileList->Delete(pos); - //iInstalledFileList->Compress(); - iTimestamps.Remove(pos); - - // Instal suites form file name - InstallFileL(aFileName, aTimestam); - } - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::GetSuites -// --------------------------------------------------------- -// -void CMcsSuiteHandler::GetSuitesL(const TDesC& aFileName, - RPointerArray& aSuiteArray) - { - TDriveList driveList; - TChar driveLetter; - User::LeaveIfError( iFs.DriveList( driveList ) ); - for ( TInt driveNumber = EDriveZ; driveNumber >= EDriveA; driveNumber-- ) - { - if ( driveList[driveNumber] ) - { - User::LeaveIfError( iFs.DriveToChar( driveNumber, driveLetter ) ); - RBuf file; - file.CleanupClosePushL(); - file.CreateL( KMaxPath ); - file.Append( driveLetter ); - file.Append( KColen ); - file.Append( iDirPath ); - file.Append( aFileName ); - CSuiteParser* suiteParser = CSuiteParser::NewL(file); - CleanupStack::PushL(suiteParser); - TRAP_IGNORE( suiteParser->GetSuitsArrayL( aSuiteArray ) ); - CleanupStack::PopAndDestroy(suiteParser); - CleanupStack::PopAndDestroy( &file ); - } - } - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::ReopenSuite -// --------------------------------------------------------- -// -void CMcsSuiteHandler::ReopenSuiteL(TInt aSuiteArrayPos) - { - RPointerArray suiteArray; - CleanupResetAndDestroyPushL(suiteArray); - - TPtrC suiteName = iSuites[aSuiteArrayPos]->SuiteName(); - TPtrC fileName = iSuites[aSuiteArrayPos]->FileName(); - - // Get suite from suite file - GetSuitesL(fileName, suiteArray); - - // Find our suite in suites from specified file - CSuiteObject* neededSuite = NULL; - for (TInt j = 0; j < suiteArray.Count(); j++) - { - if (suiteArray[j]->SuiteName().Compare(suiteName) == KErrNone) - { - // Take ownership of Suite Object - neededSuite = suiteArray[j]; - suiteArray.Remove(j); - break; - } - } - - if ( neededSuite ) - { - // Replace Suite Object in suiteArray - delete iSuites[aSuiteArrayPos]; - iSuites[aSuiteArrayPos] = neededSuite; - } - else - { - // Must be some error, delete that suite - delete iSuites[aSuiteArrayPos]; - iSuites.Remove( aSuiteArrayPos ); - } - - CleanupStack::PopAndDestroy(&suiteArray); - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::GetMenuSuitesL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::GetMenuSuitesL( - RArray& aItemArray, - const TDesC& aAttrName, - const TDesC& aAttrValue ) - { - TInt root( 0 ); - iEng.RootFolderL( root ); - TMenuSrvTypeAttrFilter suiteFilter; - suiteFilter.SetType( KMenuTypeSuite() ); - suiteFilter.SetAttr( aAttrName, aAttrValue ); - iEng.GetItemsL( aItemArray, root, &suiteFilter, ETrue ); - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::AddSuiteL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::AddSuiteL( const TPtrC& aSuiteName ) - { - RArray mcsItems; - CleanupClosePushL( mcsItems ); - GetMenuSuitesL( mcsItems, KMenuAttSuiteName(), aSuiteName ); - - if( mcsItems.Count() == KErrNone ) - { - AddSuiteToXmlL( aSuiteName ); - } - else - { - UpdateItemsL( mcsItems ); - } - CleanupStack::PopAndDestroy(&mcsItems); - } - - -// --------------------------------------------------------- -// CMcsSuiteHandler::AddSuiteL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::RemoveSuiteFromXmlL( const TPtrC& aSuiteName ) - { - RArray mcsItems; - CleanupClosePushL( mcsItems ); - GetMenuSuitesL( mcsItems, KMenuAttSuiteName(), aSuiteName ); - - for( TInt i( 0 ); i < mcsItems.Count(); i++ ) - { - UpdateSuiteInXmlL( mcsItems, i ); - } - - CleanupStack::PopAndDestroy(&mcsItems); - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::UpdateSuiteInXmlL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::UpdateSuiteInXmlL( - RArray & aMcsItems, TInt aIndex ) - { - TBool dummy(EFalse); - TPtrC val(KNullDesC); - if( iEng.ObjectL(aMcsItems[aIndex].Id()). - FindAttribute( KMenuAttSuiteAdded, val, dummy ) ) - { - if ( val.Compare(KMenuTrue) == KErrNone ) - { - iEng.RemoveL(aMcsItems[aIndex].Id()); - } - else if ( val.Compare(KMenuFalse) == KErrNone ) - { - iEng.ModifiableObjectL(aMcsItems[aIndex].Id()). - RemoveAttribute( KMenuAttSuiteAdded ); - } - } - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::RunMenuEngOperationL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::RunMenuEngOperationL() - { - if ( iEvent & EInstOpInstall ) - { - // Add new suites - AddNew(); - } - else if ( ( iEvent & EInstOpUninstall ) ) - { - // Remove old suites, andd new if needed (stub sis case) - RemoveOld(); - AddNew(); - } - else if( ( iEvent & EInstOpRestore ) ) - { - AddNew(); - ScanSuitesL(); - } - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::CompletedMenuEngOperation -// --------------------------------------------------------- -// -void CMcsSuiteHandler::CompletedMenuEngOperation( TInt /*aErr*/ ) - { - - } -// --------------------------------------------------------- -// CMcsSuiteHandler::AddSuiteToXmlL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::AddSuiteToXmlL( const TPtrC& aSuiteName ) - { - TInt root( 0 ); - iEng.RootFolderL( root ); - - CMenuEngObject* obj = iEng.NewObjectL( KMenuTypeSuite ); - CleanupStack::PushL( obj ); - obj->SetAttributeL( KMenuAttSuiteName, aSuiteName, EFalse ); - obj->SetAttributeL( KMenuAttSuiteAdded, KMenuTrue, EFalse ); - iEng.AddL( *obj, root, 0 ); - CleanupStack::Pop( obj ); - } - -// --------------------------------------------------------- -// CMcsSuiteHandler::UpdateItemsL -// --------------------------------------------------------- -// -void CMcsSuiteHandler::UpdateItemsL( - const RArray& aItemArray ) - { - for( TInt i( 0 ); i < aItemArray.Count(); ++i ) - { - TPtrC val(KNullDesC); - TBool dummy( EFalse ); - iEng.ObjectL( aItemArray[i].Id() ). - FindAttribute( KMenuAttSuiteAdded, val, dummy ); - if( val.Compare( KMenuTrue ) != KErrNone ) - { - iEng.ModifiableObjectL( aItemArray[i].Id() ). - SetAttributeL( KMenuAttSuiteAdded, KMenuFalse, EFalse); - } - else - { - iEng.ModifiableObjectL( aItemArray[i].Id() ). - SetAttributeL( KMenuAttSuiteAdded, KMenuTrue, EFalse); - } - } - } - diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvsrc/mcssuiteobject.cpp --- a/menucontentsrv/srvsrc/mcssuiteobject.cpp Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INCLUDE FILES - -#include -#include "mcssuiteobject.h" - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CSuiteObject::~CSuiteObject -// --------------------------------------------------------- -// -CSuiteObject::~CSuiteObject() - { - iAttributes.ResetAndDestroy(); - iFileName.Close(); - iName.Close(); - } - -// --------------------------------------------------------- -// CSuiteObject::NewL -// --------------------------------------------------------- -// -CSuiteObject* CSuiteObject::NewL( const TDesC& aFileName ) - { - CSuiteObject* attr = NewLC( aFileName ); - CleanupStack::Pop( attr ); - return attr; - } - -// --------------------------------------------------------- -// CSuiteObject::NewLC -// --------------------------------------------------------- -// -CSuiteObject* CSuiteObject::NewLC( const TDesC& aFileName ) - { - CSuiteObject* attr = new (ELeave) CSuiteObject(); - CleanupStack::PushL( attr ); - attr->ConstructL( aFileName ); - return attr; - } - -// --------------------------------------------------------- -// CSuiteObject::CSuiteObject -// --------------------------------------------------------- -// -CSuiteObject::CSuiteObject() - { - } - -// --------------------------------------------------------- -// CSuiteObject::ConstructL -// --------------------------------------------------------- -// -void CSuiteObject::ConstructL( const TDesC& aFileName ) - { - iFileName.CreateL( aFileName ); - } - -// --------------------------------------------------------- -// CSuiteObject::SetSuiteNameL -// --------------------------------------------------------- -// -void CSuiteObject::SetSuiteNameL( const TDesC& aName ) - { - iName.CreateL( aName ); - } - -// --------------------------------------------------------- -// CSuiteObject::SetInitialAttributeL -// --------------------------------------------------------- -// -void CSuiteObject::SetInitialAttributeL( const TDesC& aAttrName, - const TDesC& aAttrValue, - TBool aLocalized ) - { - CSuiteObjectAttr* attr = CSuiteObjectAttr::NewLC( aAttrName ); - iAttributes.AppendL( attr ); - CleanupStack::Pop( attr ); - __ASSERT_DEBUG( attr, User::Invariant() ); - attr->SetValueL( aAttrValue ); - attr->SetLocalized( aLocalized ); - } - -// --------------------------------------------------------- -// CSuiteObject::GetAttributeL -// --------------------------------------------------------- -// -void CSuiteObject::GetAttribute( const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ) - { - aAttrExists = EFalse; - TInt attrPos = iAttributes.Find(aAttrName); - if (attrPos != KErrNotFound) - { - aAttrVal.Copy( iAttributes[attrPos]->Value() ); - aAttrExists = ETrue; - } - } - -// --------------------------------------------------------- -// CSuiteObject::CloseSuiteArray -// --------------------------------------------------------- -// -void CSuiteObject::CloseSuiteArray() - { - iAttributes.ResetAndDestroy(); - iAttributes.Close(); - } - - -// End of File diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvsrc/mcssuiteobjectattr.cpp --- a/menucontentsrv/srvsrc/mcssuiteobjectattr.cpp Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INCLUDE FILES - -#include -#include "mcssuiteobjectattr.h" - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CSuiteObjectAttr::~CSuiteObjectAttr -// --------------------------------------------------------- -// -CSuiteObjectAttr::~CSuiteObjectAttr() - { - iName.Close(); - iValue.Close(); - } - -// --------------------------------------------------------- -// CSuiteObjectAttr::NewL -// --------------------------------------------------------- -// -CSuiteObjectAttr* CSuiteObjectAttr::NewL( const TDesC& aName ) - { - CSuiteObjectAttr* attr = NewLC( aName ); - CleanupStack::Pop( attr ); - return attr; - } - -// --------------------------------------------------------- -// CSuiteObjectAttr::NewLC -// --------------------------------------------------------- -// -CSuiteObjectAttr* CSuiteObjectAttr::NewLC( const TDesC& aName ) - { - CSuiteObjectAttr* attr = new (ELeave) CSuiteObjectAttr(); - CleanupStack::PushL( attr ); - attr->ConstructL( aName ); - return attr; - } - -// --------------------------------------------------------- -// CSuiteObjectAttr::CSuiteObjectAttr -// --------------------------------------------------------- -// -CSuiteObjectAttr::CSuiteObjectAttr() - { - } - -// --------------------------------------------------------- -// CSuiteObjectAttr::ConstructL -// --------------------------------------------------------- -// -void CSuiteObjectAttr::ConstructL( const TDesC& aName ) - { - iName.CreateL( aName ); - } - -// --------------------------------------------------------- -// CSuiteObjectAttr::SetValueL -// --------------------------------------------------------- -// -void CSuiteObjectAttr::SetValueL( const TDesC& aValue ) - { - iValue.Close(); - iValue.CreateL( aValue ); - } - -// --------------------------------------------------------- -// RSuiteAttrArray::Find -// --------------------------------------------------------- -// -TInt RSuiteAttrArray::Find( const TDesC& aName ) const - { - for ( TInt i = 0; i < Count(); i++ ) - { - if ( !aName.Compare( operator[]( i )->Name() ) ) - { - return i; - } - } - return KErrNotFound; - } - -// End of File diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvsrc/mcssuiteobjectfactory.cpp --- a/menucontentsrv/srvsrc/mcssuiteobjectfactory.cpp Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INCLUDE FILES -#include -#include - -#include "mcssuiteobjectfactory.h" - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// CSuiteObjectFactory::~CSuiteObjectFactory -// --------------------------------------------------------- -// -CSuiteObjectFactory::~CSuiteObjectFactory() - { - } - -// --------------------------------------------------------- -// CSuiteObjectFactory::NewL -// --------------------------------------------------------- -// -CSuiteObjectFactory* CSuiteObjectFactory::NewL() - { - CSuiteObjectFactory* factory = - new (ELeave) CSuiteObjectFactory(); - return factory; - } - -// --------------------------------------------------------- -// CSuiteObjectFactory::CSuiteObjectFactory -// --------------------------------------------------------- -// -CSuiteObjectFactory::CSuiteObjectFactory() - { - } - - -// --------------------------------------------------------- -// CSuiteObjectFactory::InitializeObjectL -// --------------------------------------------------------- -// -void CSuiteObjectFactory::InitializeObjectL -( MGECOAttributeProvider& aAttributeProvider ) - { - if ( iContext ) - { - //Cast context to GECODefaultObject - CGECODefaultObject* temp = - reinterpret_cast( iContext ); - - TInt counter = aAttributeProvider.NumAttributes() - 1; - TPtrC name; - TPtrC value; - TBool islocalized = EFalse; - while ( counter >= 0 ) - { - aAttributeProvider.AttributeDetailsL( counter,name,value, islocalized ); - temp->SetAttributeL( name, value, islocalized ); - counter--; - } - } - } - -// End of File diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvsrc/mcssuiteparser.cpp --- a/menucontentsrv/srvsrc/mcssuiteparser.cpp Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,200 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// INCLUDE FILES -#include -#include -#include - -#include "mcssuiteparser.h" -#include "mcssuiteobject.h" -#include "mcsdef.h" -#include "mcssuiteobjectfactory.h" - - -// --------------------------------------------------------- -// CSuiteObject::CSuiteParser -// --------------------------------------------------------- -// -CSuiteParser::CSuiteParser() - { - // No implementation required - } - -// --------------------------------------------------------- -// CSuiteObject::~CSuiteParser -// --------------------------------------------------------- -// -CSuiteParser::~CSuiteParser() - { - iFileName.Close(); - delete iContentEngine; - delete iObjectFactory; - delete iActiveScheduler; - delete iContentTree; - } - -// --------------------------------------------------------- -// CSuiteObject::NewLC -// --------------------------------------------------------- -// -CSuiteParser* CSuiteParser::NewLC( const TDesC& aFileName ) - { - CSuiteParser* self = new (ELeave) CSuiteParser(); - CleanupStack::PushL(self); - self->ConstructL( aFileName ); - return self; - } - -// --------------------------------------------------------- -// CSuiteObject::NewL -// --------------------------------------------------------- -// -CSuiteParser* CSuiteParser::NewL( const TDesC& aFileName ) - { - CSuiteParser* self = CSuiteParser::NewLC( aFileName ); - CleanupStack::Pop( self ); // self; - return self; - } - -// --------------------------------------------------------- -// CSuiteObject::ConstructL -// --------------------------------------------------------- -// -void CSuiteParser::ConstructL( const TDesC& aFileName ) - { - iFileName.CreateL( aFileName ); - iActiveScheduler = new ( ELeave ) CActiveSchedulerWait(); - iObjectFactory = CSuiteObjectFactory::NewL(); - iContentEngine = CXCFWEngine::NewL( this ); - iContentEngine->RegisterObjectFactoryL( iObjectFactory ); - } - -// ----------------------------------------------------------------------------- -// CSuiteParser::GetSuitsArrayL -// ----------------------------------------------------------------------------- -// -TInt CSuiteParser::GetSuitsArrayL( RPointerArray& aSuitesArray ) - { - TInt err; - iContentTree = CXCFWTree::NewL( ); - iContentEngine->LoadL( *iContentTree, iFileName ); - - iActiveScheduler->Start( ); - - if ( iCompletionStatus == 0 /*TSuiteParsingStatus::ECompleted*/ ) - { - //this trap ensures stoping the ActiveSheduler - //in case a leave occurs when updating data - TRAP( err, HandleEntriesL( aSuitesArray ) ); - } - - delete iContentTree; - iContentTree = NULL; - return err; - } - -// --------------------------------------------------------- -// CSuiteObject::HandleEngineEventL -// --------------------------------------------------------- -// -void CSuiteParser::HandleEngineEventL( TXCFWEngineEvent aEvent ) - { - // handle completion - if ( aEvent == EEvtParsingComplete ) - { - TSuiteParsingStatus status = ECompleted; - HandleCompletionL( status ); - } - // else => ignore - } - -// --------------------------------------------------------- -// CSuiteObject::HandleEngineErrorL -// --------------------------------------------------------- -// -void CSuiteParser::HandleEngineErrorL( TInt /*aErrorCode*/) - { - HandleCompletionL( EFailed ); - } - -// --------------------------------------------------------- -// CSuiteObject::HandleCompletionL -// --------------------------------------------------------- -// -void CSuiteParser::HandleCompletionL( - TSuiteParsingStatus aStatus ) - { - iCompletionStatus = aStatus; - iActiveScheduler->AsyncStop( ); - } - - -// --------------------------------------------------------- -// CSuiteObject::HandleEntriesL -// --------------------------------------------------------- -// -void CSuiteParser::HandleEntriesL( RPointerArray& aSuitesArray ) - { - MXCFWNode* root = iContentTree->Root( ); - // get children - RNodeArray suites; - CleanupClosePushL( suites ); - iContentTree->GetChildNodesL( root, suites ); - for ( TInt i = 0; i < suites.Count( ); i++ ) - { - CSuiteObject* suite = CreateSuiteLC( suites[i] ); - aSuitesArray.AppendL( suite ); - CleanupStack::Pop( suite ); - } - - // clean up - CleanupStack::PopAndDestroy( &suites ); - } - -// --------------------------------------------------------- -// CSuiteObject::CreateSuiteLC -// --------------------------------------------------------- -// -CSuiteObject* CSuiteParser::CreateSuiteLC( MXCFWNode* aNode ) - { - TInt lastBackSlash = iFileName.Length() - - iFileName.LocateReverseF( KBackSlashSuite ) - 1; - CSuiteObject* suite = - CSuiteObject::NewLC( iFileName.Right( lastBackSlash ) ); - - CGECODefaultObject* node= - static_cast( aNode->Data() ); - - TPtrC name; - TPtrC value; - TInt attrCount = node->NumAttributes(); - TBool isLocalized = EFalse; - - for( TInt i = 0; i < attrCount; i++ ) - { - node->AttributeDetailsL( i, name, value, isLocalized ); - if( name == KMenuAttSuiteName() ) - { - suite->SetSuiteNameL( value ); - } - suite->SetInitialAttributeL( name, value, isLocalized ); - } - - return suite; - } - diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvsrc/menusrvappscanner.cpp --- a/menucontentsrv/srvsrc/menusrvappscanner.cpp Tue May 25 13:01:39 2010 +0300 +++ b/menucontentsrv/srvsrc/menusrvappscanner.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -32,6 +32,7 @@ _LIT( KMenuOne, "1" ); _LIT( KMenuAttrMmcId, "mmc_id" ); _LIT( KMenuMassStorage, "mass_storage" ); +_LIT( KMenuPredefinedWidget, "predefined_widget" ); _LIT( KMenuMmcHistoryFname, "mmchistory" ); // ==================== LOCAL FUNCTIONS ==================== @@ -1035,51 +1036,61 @@ // CMenuSrvAppScanner::HandleMissingItemsL // --------------------------------------------------------- // -void CMenuSrvAppScanner::HandleMissingItemsL -( const RArray& aItems ) +TMenuItem::TFlags CMenuSrvAppScanner::GetProperFlagL( const TMenuItem& aItem ) + { + TMenuItem::TFlags flags = TMenuItem::ENoFlag; + + TUint mmcId = 0; + TPtrC val; + TBool dummy; + if( iEng.ObjectL( aItem.Id() ).FindAttribute( KMenuAttrMmcId(), val, dummy ) ) + { + MenuUtils::GetTUint( val, mmcId ); + if ( mmcId && KErrNotFound != iMmcHistory->Find( mmcId ) ) + { + // This item is on an MMC which is currently in the MMC history. + // Set it "missing" but keep it. + flags = TMenuItem::EMissing; + } + else if ( val == KMenuMassStorage() + && IsDriveInUse( DriveInfo::EDefaultMassStorage ) ) + { + flags = TMenuItem::EMissing; + } + else if ( iEng.ObjectL( aItem.Id() ).FindAttribute( + KMenuPredefinedWidget(), val, dummy ) ) + { + flags = TMenuItem::EMissing; + } + } + else if( iEng.ObjectL( aItem.Id() ).GetAppType() + != CMenuEngObject::EWidgetApp + || iEng.ObjectL( aItem.Id() ).FindAttribute( + KMenuPredefinedWidget(), val, dummy ) ) + { + flags = TMenuItem::EHidden; + } + return flags; + } + +// --------------------------------------------------------- +// CMenuSrvAppScanner::HandleMissingItemsL +// --------------------------------------------------------- +// +void CMenuSrvAppScanner::HandleMissingItemsL( + const RArray& aItems ) { for ( TInt i = 0; i < aItems.Count(); i++ ) { - const TInt id = aItems[i].Id(); - TUint mmcId = 0; - TPtrC val; - TBool dummy; - if( iEng.ObjectL( id ).FindAttribute( KMenuAttrMmcId(), val, dummy ) ) + TMenuItem::TFlags flags = GetProperFlagL( aItems[i] ); + if( flags == TMenuItem::ENoFlag ) { - MenuUtils::GetTUint( val, mmcId ); - if ( mmcId && KErrNotFound != iMmcHistory->Find( mmcId ) ) - { - // This item is on an MMC which is currently in the MMC history. - // Set it "missing" but keep it. - SetObjectFlagsL( ETrue, aItems[i], TMenuItem::EMissing, - RMenuNotifier::EItemsAddedRemoved ); - } - else if ( val == KMenuMassStorage() - && IsDriveInUse( DriveInfo::EDefaultMassStorage ) ) - { - SetObjectFlagsL( ETrue, aItems[i], TMenuItem::EMissing, - RMenuNotifier::EItemsAddedRemoved ); - } - else - { - iEng.RemoveL( id ); - } + iEng.RemoveL( aItems[i].Id() ); } else { - // This item is not on MMC or its MMC has been purged from the MMC - // history. Hide the item. - SetObjectFlagsL( EFalse, aItems[i], TMenuItem::ELockDelete ); - - if( iEng.ObjectL( id ).GetAppType() != CMenuEngObject::EWidgetApp ) - { - SetObjectFlagsL( ETrue, aItems[i], TMenuItem::EHidden, - RMenuNotifier::EItemsAddedRemoved ); - } - else - { - iEng.RemoveL( id ); - } + SetObjectFlagsL( ETrue, aItems[i], flags, + RMenuNotifier::EItemsAddedRemoved ); } } } diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvsrc/menusrveng.cpp --- a/menucontentsrv/srvsrc/menusrveng.cpp Tue May 25 13:01:39 2010 +0300 +++ b/menucontentsrv/srvsrc/menusrveng.cpp Wed Jun 09 10:01:25 2010 +0300 @@ -34,7 +34,6 @@ #include "mcsrunningappshandler.h" #include "mcsgetlisthandler.h" #include "menusrvobjectfilter.h" -#include "mcssuitehandler.h" #include #include @@ -107,7 +106,6 @@ delete iFolderNotifier; delete iMcsSatMonitor; delete iRunningAppsHandler; - delete iSuiteHandler; delete iEng; iMenuSrv.EngineDeleted(); } @@ -156,7 +154,6 @@ *this, *iCMenuSrvEngUtils, *iCacheHandler ); iChildrenHandler = CMcsChildrenHandler::NewL( *this, *iCacheHandler); - iSuiteHandler = CMcsSuiteHandler::NewL(*iEng, iContentName); iTimedClose->Cancel(); iTimedClose->After( TTimeIntervalMicroSeconds32( KMenuSrvExitDelay ) ); @@ -265,7 +262,6 @@ delete iRunningAppsHandler; iRunningAppsHandler = NULL; delete iAppScanner; iAppScanner = NULL; delete iFolderNotifier; iFolderNotifier = NULL; - delete iSuiteHandler; iSuiteHandler = NULL; delete iEng; iEng = NULL; iContentName.Close(); @@ -339,26 +335,6 @@ } // --------------------------------------------------------- -// CMenuSrvEng::InstalledSuiteExist -// --------------------------------------------------------- -// -TBool CMenuSrvEng::InstalledSuiteExist(const TDesC& aSuiteName) - { - return iSuiteHandler->HaveSuite(aSuiteName); - } - -// --------------------------------------------------------- -// CMenuSrvEng::GetSuiteAttributeL -// --------------------------------------------------------- -// -void CMenuSrvEng::GetSuiteAttribute( const TDesC& aSuiteName, const TDesC& aAttrName, - TBool& aAttrExists, TDes& aAttrVal ) - { - iSuiteHandler->GetAttribute(aSuiteName, aAttrName, - aAttrExists, aAttrVal); - } - -// --------------------------------------------------------- // CMenuSrvEng::GetRunningAppsL() // --------------------------------------------------------- // diff -r 1b207dd38b72 -r ace62b58f4b2 menucontentsrv/srvsrc/menusvrsuite.cpp --- a/menucontentsrv/srvsrc/menusvrsuite.cpp Tue May 25 13:01:39 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Definition of menu item attribute -* -*/ - -#include -#include "menusvrsuite.h" -#include "mcssuiteobject.h" - -// ================= LOCAL FUNCTIONS ======================= - -/** -* Cleanup support method. Call ResetAndDestroy() on the array. -* @param RMenuSrvSuiteArray* as TAny* -*/ -LOCAL_C void ResetAndDestroy( TAny* aArray ) - { - ((RMenuSrvSuiteArray*)aArray)->ResetAndDestroy(); - } - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------- -// RMenuSrvSuiteArray::FindLastSuite -// --------------------------------------------------------- -// -TInt RMenuSrvSuiteArray::FindLastSuite( const TDesC& aSuiteName ) - { - for ( TInt i = Count()-1; i >= 0; i-- ) - { - if( aSuiteName == operator[]( i )->SuiteName() ) - { - return i; - } - } - return KErrNotFound; - } - -// --------------------------------------------------------- -// RMenuSrvSuiteArray::FindByFile -// --------------------------------------------------------- -// -TInt RMenuSrvSuiteArray::FindByFile( const TDesC& aFileName ) - { - for ( TInt i = Count()-1; i >= 0; i-- ) - { - if( aFileName == operator[]( i )->FileName() ) - { - return i; - } - } - return KErrNotFound; - } - -// --------------------------------------------------------- -// RMenuSrvSuiteArray::Exist -// --------------------------------------------------------- -// -TBool RMenuSrvSuiteArray::Exist( const TDesC& aSuiteName ) - { - return ( FindLastSuite(aSuiteName) != KErrNotFound ); - } - -// --------------------------------------------------------- -// RMenuSrvSuiteArray::RemoveByFileName -// --------------------------------------------------------- -// -void RMenuSrvSuiteArray::RemoveByFileName( const TDesC& aFileName ) - { - for ( TInt i = 0; i < Count(); i++ ) - { - if( aFileName == operator[]( i )->FileName() ) - { - delete operator[]( i ); - Remove( i ); - i--; - } - } - } - -// --------------------------------------------------------- -// RMenuSrvSuiteArray::Append -// --------------------------------------------------------- -// -TInt RMenuSrvSuiteArray::Append(const CSuiteObject* anEntry) - { - TInt pos = FindLastSuite( anEntry->SuiteName() ); - if (pos != KErrNotFound) - { - operator[]( pos )->CloseSuiteArray(); - } - return RPointerArray::Append( anEntry ); - } - - -// --------------------------------------------------------- -// CleanupResetAndDestroyPushL -// --------------------------------------------------------- -// -void CleanupResetAndDestroyPushL( RMenuSrvSuiteArray& aArray ) - { - CleanupStack::PushL( TCleanupItem( ResetAndDestroy, &aArray ) ); - }