# HG changeset patch # User kashif.sayed # Date 1269552962 -19800 # Node ID f9f9f96b1873285a9461304a219f9b650aecc1f1 # Parent f9c0abe18432bee4f4dbdf3185e08830126790e7 user: kashif.sayed added contentcontrolsrv/.cproject added contentcontrolsrv/.project added contentcontrolsrv/group/ABLD.BAT added contentpublishingsrv/.cproject added contentpublishingsrv/.project added contentpublishingsrv/contentharvester/.cproject added contentpublishingsrv/contentharvester/.project added contentpublishingsrv/contentharvester/contentharvesterclient/group/ABLD.BAT added contentpublishingsrv/contentharvester/contentharvesterserver/group/ABLD.BAT added contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/ABLD.BAT added contentpublishingsrv/contentharvester/factorysettingsplugin/group/ABLD.BAT added contentpublishingsrv/contentharvester/group/ABLD.BAT added contentpublishingsrv/group/ABLD.BAT added dependencies/S3libs/cpswrapper.lib added dependencies/S3libs/hscontentcontrol.lib added dependencies/S3libs/hspswrapper.lib added group/ABLD.BAT added homescreenpluginsrv/group/ABLD.BAT added homescreensrv_plat/group/ABLD.BAT added idlefw/group/ABLD.BAT added inc/ccontentmap.h added inc/cpdebug.h added inc/cpglobals.h added inc/cpliwmap.h added inc/cpluginvalidator.h added inc/cpserverdef.h added inc/cpublisherregistrymap.h added inc/mcssathandler.h added menucontentsrv/group/ABLD.BAT added xcfw/group/ABLD.BAT changed dependencies/S3libs/bld.inf diff -r f9c0abe18432 -r f9f9f96b1873 .cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.cproject Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f9c0abe18432 -r f9f9f96b1873 .project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.project Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,19 @@ + + + homescreensrv + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff -r f9c0abe18432 -r f9f9f96b1873 contentcontrolsrv/.cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/.cproject Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f9c0abe18432 -r f9f9f96b1873 contentcontrolsrv/.project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/.project Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,19 @@ + + + contentcontrolsrv + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff -r f9c0abe18432 -r f9f9f96b1873 contentcontrolsrv/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentcontrolsrv/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\contentcontrolsrv\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 contentpublishingsrv/.cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/.cproject Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f9c0abe18432 -r f9f9f96b1873 contentpublishingsrv/.project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/.project Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,19 @@ + + + chfactorysettingsplugin + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff -r f9c0abe18432 -r f9f9f96b1873 contentpublishingsrv/contentharvester/.cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/.cproject Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f9c0abe18432 -r f9f9f96b1873 contentpublishingsrv/contentharvester/.project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/.project Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,19 @@ + + + contentharvesterclient + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff -r f9c0abe18432 -r f9f9f96b1873 contentpublishingsrv/contentharvester/contentharvesterclient/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterclient/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\contentpublishingsrv\contentharvester\contentharvesterclient\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 contentpublishingsrv/contentharvester/contentharvesterserver/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterserver/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\contentpublishingsrv\contentharvester\contentharvesterserver\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/contentharvesterswiplugin/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\contentpublishingsrv\contentharvester\contentharvesterswiplugin\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 contentpublishingsrv/contentharvester/factorysettingsplugin/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/factorysettingsplugin/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\contentpublishingsrv\contentharvester\factorysettingsplugin\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 contentpublishingsrv/contentharvester/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/contentharvester/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\contentpublishingsrv\contentharvester\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 contentpublishingsrv/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contentpublishingsrv/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\contentpublishingsrv\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 dependencies/S3libs/bld.inf --- a/dependencies/S3libs/bld.inf Fri Mar 26 02:22:35 2010 +0530 +++ b/dependencies/S3libs/bld.inf Fri Mar 26 03:06:02 2010 +0530 @@ -15,4 +15,7 @@ aiwdialdata.lib \epoc32\release\winscw\udeb\aiwdialdata.lib networkhandling.lib \epoc32\release\winscw\udeb\networkhandling.lib akntransitionutils.lib \epoc32\release\winscw\udeb\akntransitionutils.lib -ssmcmn.lib \epoc32\release\winscw\udeb\ssmcmn.lib \ No newline at end of file +ssmcmn.lib \epoc32\release\winscw\udeb\ssmcmn.lib +hspswrapper.lib \epoc32\release\winscw\udeb\hspswrapper.lib +cpswrapper.lib \epoc32\release\winscw\udeb\cpswrapper.lib +hscontentcontrol.lib \epoc32\release\winscw\udeb\hscontentcontrol.lib \ No newline at end of file diff -r f9c0abe18432 -r f9f9f96b1873 dependencies/S3libs/cpswrapper.lib Binary file dependencies/S3libs/cpswrapper.lib has changed diff -r f9c0abe18432 -r f9f9f96b1873 dependencies/S3libs/hscontentcontrol.lib Binary file dependencies/S3libs/hscontentcontrol.lib has changed diff -r f9c0abe18432 -r f9f9f96b1873 dependencies/S3libs/hspswrapper.lib Binary file dependencies/S3libs/hspswrapper.lib has changed diff -r f9c0abe18432 -r f9f9f96b1873 group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 homescreenpluginsrv/.cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/.cproject Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f9c0abe18432 -r f9f9f96b1873 homescreenpluginsrv/.project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/.project Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,19 @@ + + + homescreenpluginsrv + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff -r f9c0abe18432 -r f9f9f96b1873 homescreenpluginsrv/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenpluginsrv/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\homescreenpluginsrv\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 homescreensrv_plat/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreensrv_plat/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\homescreensrv_plat\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 idlefw/.cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/.cproject Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f9c0abe18432 -r f9f9f96b1873 idlefw/.project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/.project Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,19 @@ + + + idlefw + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff -r f9c0abe18432 -r f9f9f96b1873 idlefw/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idlefw/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\idlefw\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 inc/ccontentmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/ccontentmap.h Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,215 @@ +/* +* 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: CContentMap - class used in Content Publisher + * +*/ + +#ifndef C_CONTENTMAP_H +#define C_CONTENTMAP_H + +#include "cpliwmap.h" + +// CLASS DECLARATION +/** + * Map which contains ids and serialized data stored by + * Content Publisher + * + * @lib cputils.dll + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CContentMap ): public CCPLiwMap + { +public: + + /** + * Two-phased constructor. + */ + IMPORT_C static CContentMap* NewL( ); + + /** + * Two-phased constructor. + */ + IMPORT_C static CContentMap* NewLC( ); + + /** + * Destructor. + */ + virtual ~CContentMap(); + + +private: + + /** + * Adds to database current content + * + * @param aSqlDb handle to database + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + * + * @return id of added entry + */ + TInt32 AddL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList = NULL ) const; + + /** + * Fetches entries from database + * + * @param aSqlDb handle to database + * @param aList target list for enntries + * @param aItemsToDelete ids of entries for removal - + * they were found to be expired + * + * @return number of fetched entries + */ + TUint GetListL( RSqlDatabase aSqlDb, + CLiwGenericParamList* aList, + RArray& aItemsToDelete ) const; + + /** + * Removes entries from database + * + * @param aSqlDb handle to database + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + */ + void RemoveL( RSqlDatabase aSqlDb , + CLiwDefaultList* aNotificationList = 0 ) const; + + /** + * Saves results from query to SQLite Server + * + * @param aStmt handle to SQL statement + * @param aList target list for enntries + * @param aItemsToDelete ids of entries for removal - + * they were found to be expired + */ + void SaveQueryResultsL( RSqlStatement& aStmt , + CLiwGenericParamList& aList, + RArray& aItemsToDelete ) const; + + /** + * Prepares SQL query for Add operation + * + * @param aSqlDb handle to database + * @param aStmt handle to SQL statement + * @param aQuery SQL query + * + */ + void PrepareStmtforAddL(RSqlDatabase aSqlDb, + RSqlStatement& aStmt , + const TDesC& aQuery ) const; + + /** + * Prepares SQL query for Update operation + * + * @param aSqlDb handle to database + * @param aStmt handle to SQL statement + * @param aId id of entry to update + * + */ + void PrepareStmtforUpdateL( RSqlDatabase aSqlDb, + RSqlStatement& aStmt, + TInt32 aId ) const; + + /** + * Updates entry in database + * + * @param aSqlDb handle to database + * @param aId id entry to update + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + */ + void UpdateL( RSqlDatabase aSqlDb, TInt32 aId, + CLiwDefaultList* aNotificationList ) const; + + /** + * Performs actuall add operation + * + * @param aSqlDb handle to database + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + * + * @return id of added entry + */ + TInt32 AddToDbL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList ) const; + + /** + * Appends sorting criteria as strings to SQL query according to aSort + * + * @param aQuery SQL query + * @param aSort sort filter as TInt + */ + void AppendSortL( RBuf& aQuery, const TCPSortOrder& aSort ) const; + + /** + * Checks expiration time + * @param aExpirationTime time to checking with current time + * @return true if aExpirationTime is correct + */ + TBool IsOutdated( const TTime aExpirationTime ) const; + + /** + * Check if data map is set + * + * @return ETrue if ContentType was set, EFalse if not + */ + void IsDataMapL() const; + + /** + * Gets expiration time from own data + * @param aResult expiration date + * @return ETrue if expiration date is find, EFalse if not + */ + TBool GetExpirationDateL( TTime& aResult ) const; + + /** + * Check if IDs are valid for Delete operation + * + */ + void IsValidForDeleteL() const; + + /** + * Check if IDs are valid for GetList operation + */ + void IsValidForGetListL() const ; + + /** + * + * @return ETrue if supported, EFalse if not + */ + TBool ActivateActionSupport( ) const; + + /** + * + * @return ETrue if activate flag is set, EFalse if not + */ + TBool GetActivateInfo( ) const; + + +private: + + /** + * C++ default constructor. + */ + CContentMap(); + + /** + * Perform the second phase construction of a CContentMap object. + */ + void ConstructL(); + + }; + +#endif // C_CONTENTMAP_H diff -r f9c0abe18432 -r f9f9f96b1873 inc/cpdebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/cpdebug.h Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,107 @@ +/* +* 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: Debug printing to a log file + * +*/ + +#ifndef C_CP_DEBUG_H +#define C_CP_DEBUG_H + +// INCLUDES + +#include +#ifdef CONTENT_PUBLISHER_DEBUG +#include + +_LIT(KCPDebugDirName, "contentpublisher" ); +_LIT(KCPDebugFileName, "c:\\contentpublisher.txt" ); +_LIT(KCPDebugFileName2, "c:\\server.txt" ); + +/** + * Content publisher debug + * + * + * @lib cpdebug.lib + * @since S60 v3.2 + */ +NONSHARABLE_CLASS( CCPDebug ): public CBase + { +public: + + IMPORT_C static CCPDebug* NewLC( const TDesC& aFile ); + + IMPORT_C static CCPDebug* NewL( const TDesC& aFile ); + + virtual ~CCPDebug(); + + /** + * Determines whether CCPDebug is exist . + */ + IMPORT_C static TBool Enable(); + + /** + * Enables or disables Printf message logging to a file. + * @param aEnable Set to true to enable logging, false to disable. + */ + IMPORT_C static void EnableLogging(TBool aEnable); + + /** + * Print debug text to the file (c:\\contentpublisher.txt). + * + */ + IMPORT_C static void Printf(TRefByValue aFormat, ...); + +private: + + CCPDebug(); + + void ConstructL( const TDesC& aFile ); + + /** + * Returns a pointer to the thread-local data struct. + */ + IMPORT_C static struct DebugData* Data(); + +private: // data + + /** + * Thread local storage for this DLL, as we cannot declare static + * global variables in Symbian. + */ + struct DebugData* iData; + + }; + +#define CP_DEBUG(s) CCPDebug::Printf(s) + +/** + * Thread local storage space. Writable static data is not supported in + * Symbian, so static data is stored in this struct. + */ +struct DebugData + { + RFile iLogFile; + RFs iFs; + TBool iLogEnabled; + TTime iFirstUpdateTime; + RBuf iFileName; + }; + +#else + +#define CP_DEBUG(s) + +#endif + +#endif // C_CP_DEBUG_H diff -r f9c0abe18432 -r f9f9f96b1873 inc/cpglobals.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/cpglobals.h Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,140 @@ +/* +* 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: Global definitions + * +*/ + + +#ifndef CPCLIENTGLOBALS_H +#define CPCLIENTGLOBALS_H + +/** Data types for CP content */ +enum TDataTypes + { + ECPHardcodedText = 1, // 0001 + ECPResourceText = 2, // 0010 + ECPFilepathImage = 4, // 0100 + ECPResourceIcon = 8 // 1000 + }; + +enum TCPGetListOrder + { + ECPRecent = 1, // 0001 + ECPPublisher = 2, // 0010 + ECPContent = 4, // 0100 + ECPContentId = 8 // 1000 + }; + +enum TFlag + { + EActivate = 1, // 0001 + }; + +const TInt KNameArgumentsLimit = 5; +const TInt KThreadNameLimit = 64; +const TUint KDisablePersist = 0x1000; + +_LIT( KService, "CP Service" ); + +_LIT8( KCPInterface, "IDataSource" ); +_LIT8( KCPContentInterface, "IContentPublishing" ); +_LIT8( KCPService, "Service.ContentPublishing" ); +_LIT8( KCommand, "cmd" ); + +//Supported Commands +_LIT8( KGetList, "GetList" ); +_LIT8( KAdd, "Add" ); +_LIT8( KDelete, "Delete" ); +_LIT8( KRequestNotification, "RequestNotification" ); +_LIT8( KExecuteAction, "ExecuteAction" ); +_LIT8( KCmdCancel, "Cancel" ); +_LIT8( KActivate, "Activate" ); +_LIT8( KActivateTrigger, "activate" ); +_LIT8( KDeactivateTrigger, "deactivate" ); + +// Input arguments +_LIT8( KType, "type" ); +_LIT8( KAction, "action" ); +_LIT8( KItem, "item" ); +_LIT8( KFilter, "filter" ); +_LIT8( KData, "data" ); +_LIT8( KSortOrder, "sort_order" ); +_LIT8( KItemId, "item_id" ); +_LIT8( KByPublisher, "by_publisher" ); +_LIT8( KByEntryIds, "by_entryids" ); +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT8( KExpirationDate, "expiration_date" ); +_LIT8( KActivatePublisher, "activate" ); +_LIT8( KIds, "ids" ); +_LIT8( KId, "id" ); +_LIT8( KFlag, "flag"); +_LIT8( KAccessList, "ACL" ); +_LIT8( KACLRead, "read"); +_LIT8( KACLWrite, "write"); +_LIT8( KACLDelete, "delete"); +_LIT8( KUIDs, "UID" ); +_LIT8( KCapability, "Capability" ); +_LIT( KAll, "all"); +_LIT( KSortPublisher, "publisher"); +_LIT( KSortContentType, "content_type"); +_LIT( KSortContentId, "content_id"); +_LIT( KSortRecent, "recent"); +_LIT( KOperationAdd, "add" ); +_LIT( KOperationUpdate, "update" ); +_LIT( KOperationDelete, "delete" ); +_LIT( KOperationExecute, "execute" ); +_LIT8( KDataType, "data_type" ); +_LIT8( KOperation, "operation" ); +_LIT8( KActionTrigger, "action_trigger" ); +_LIT8( KActionTrigger16, "action_trigger16" ); +_LIT8( KHardcodedText, "harcoded_text" ); +_LIT8( KResourceText, "resource_text" ); +_LIT8( KFilepathImage, "filepath_image" ); +_LIT8( KIdMask, "id_mask" ); +_LIT8( KResourceIcon, "resource_icon" ); +_LIT8( KIdIcon, "id_icon" ); +_LIT8( KIdText, "id_text" ); +_LIT( KCpData, "cp_data" ); +_LIT( KPublisher, "publisher" ); +_LIT8( KChangeInfo, "change_info" ); + +_LIT8( KPublisher_Uid, "publisher_Uid" ); + +// Argument in Action +_LIT8( KActionHandlerInterface, "IDataAction" ); +_LIT8( KActionHandlerService, "Service.ActionHandler" ); +_LIT8( KCmdExecute, "Execute" ); +_LIT8( KPluginUid, "plugin_id" ); +_LIT8( KDataForActionHandler, "data" ); + +_LIT8( KLaunchMethod, "launch_method" ); +_LIT8( KApplicationUid, "application_uid" ); +_LIT8( KDocumentName, "document_name" ); +_LIT8( KViewId, "view_id" ); +_LIT8( KMessageUid, "message_uid" ); + +// Output +_LIT8( KResults, "results" ); +_LIT8( KListMap, "list_map" ); +_LIT8( KStatus, "status" ); +_LIT8( KDataMap, "data_map" ); +_LIT8( KActionMap, "action_map" ); +_LIT8( KKey, "key" ); + +_LIT8( KTransactionID, "TransactionID" ); +_LIT8( KErrorCode, "ErrorCode" ); + +#endif /*CPCLIENTGLOBALS_H*/ diff -r f9c0abe18432 -r f9f9f96b1873 inc/cpliwmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/cpliwmap.h Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,620 @@ +/* +* 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: CCPLiwMap - class used in Content Publisher + * +*/ + +#ifndef C_CPLIWIDSMAP_H +#define C_CPLIWIDSMAP_H + +#include +#include +#include "cpglobals.h" + +class RDesReadStream; +class CCPSecurityPolicy; + +// CLASS DECLARATION +/** + * Base Map class for Publisher Registry and Content + * + * @lib cputils.dll + * @since S60 v5.0 + */ +class CCPLiwMap : public CLiwMap + { + +protected: + + /** + * Enum defining the properties of filter. + */ + enum TCPProperties + { + EPublisher = 1, + EContentType = 2, + EContentId = 4, + EFlag = 8, + }; + + /** + * Enum defining the sort ordering. + */ + enum TCPSortOrder + { + ECPRecent = 1, // 0001 + ECPPublisher = 2, // 0010 + ECPContent = 4, // 0100 + ECPContentId = 8 // 1000 + }; + +public: + + friend class CCpStorageEngine; + + /** + * Two-phased constructor. + */ + IMPORT_C static CCPLiwMap* NewL( RDesReadStream& aStream ); + + /** + * Two-phased constructor. + */ + IMPORT_C static CCPLiwMap* NewL( const CLiwGenericParamList& aList ); + + /** + * Used by client to serialize this object + * + * @return object serialized to binary + */ + IMPORT_C HBufC8* PackForServerLC() const; + + /** + * Reset map + */ + IMPORT_C void Reset( ) const; + + /** + * Leaves when Add data operation is not possible due + * to missing of some parameter + */ + virtual void IsValidForAddL( ) const; + + /** + * Leaves when Execute Action operation is not possible due + * to missing of some parameter + */ + IMPORT_C void IsValidForActionL( ) const; + + /** + * Leaves when RequestNotification operation is not possible due + * to missing of some parameter + */ + IMPORT_C void IsValidForNotificationL( ) const; + + /** + * Fetches value for property(key) from internal map + * + * @param aProperty name of the property ( key ) + * @param aResult target descriptor for fetching operation + * @return ETrue is property found or EFalse if not + */ + IMPORT_C TBool GetPropertyL( const TDesC8& aProperty, + RBuf& aResult ) const; + + /** + * Fetches value for property(key) from internal map + * + * @param aProperty name of the property ( key ) + * @param aResult target binary for fetching operation + * @return ETrue is property found or EFalse if not + */ + IMPORT_C TBool GetPropertyL( const TDesC8& aProperty, + RBuf8& aResult ) const; + + /** + * Fetches value for property(key) from internal map + * + * @param aProperty name of the property ( key ) + * @param aResult target integer for fetching operation + * @return ETrue is property found or EFalse if not + */ + IMPORT_C TBool GetProperty( const TDesC8& aProperty, + TInt32& aResult ) const; + + + /** + * Setter for security policy + * + * @param aPolicy security policy + */ + IMPORT_C void SetSecurityL( const RMessage2& aMessage ); + + /** + * Destructor. + */ + virtual ~CCPLiwMap(); + + /** + * Check if IDs are valid for Delete operation + */ + virtual void IsValidForDeleteL() const =0; + + /** + * Check if IDs are valid for GetList operation + */ + virtual void IsValidForGetListL() const =0; + + /** + * + * @return ETrue if supported, EFalse if not + */ + virtual TBool ActivateActionSupport( ) const = 0; + + /** + * + * @return ETrue if activate flag is set, EFalse if not + */ + virtual TBool GetActivateInfo( ) const = 0; + + +public: + + // from base class CLiwMap + /** + * Inserts a key-value pair element to the map collection. If + * the specified key already exists, it will be removed from + * the collection and the new key-value pair will be added to the + * map. + * + * @param aKey the key to be stored + * @param aValue the value associated with the key to be stored + */ + void InsertL( const TDesC8& aKey, const TLiwVariant& aValue ); + + /** + * Finds a value stored in the map collection based on the key. + * + * @param aKey the key to be searched + * @param aFndValue the value associated with the found key + * @return false if there is no key stored; true otherwise + */ + TBool FindL( const TDesC8& aKey, TLiwVariant& aValue ) const; + + /** + * Returns the number of key-value pair stored in the map collection. + * + * @return the number of key-value pair stored in the map collection + */ + TInt Count() const; + + /** + * Returns the key stored at a specified index. + * + * @param aIndex the index of the key to be found + * @param aFndKey the key found at the passed index + * + * @return true if a key-value entry is found at the passed index; + * false otherwise + */ + TBool AtL( TInt aIndex, TDes8& aFndKey ) const; + + /** + * Removes a key from the map collection. + * + * @param aKey the key to be removed from the map + */ + void Remove( const TDesC8& aKey ); + + /** + * Returns the size of the collection. The size is + * calculated based on the total numer of key-value elements + * and the size of each pair in the collection + * + * @return the size of the collection + */ + TInt Size() const; + + /** + * The container managed data values can be serialized to an output + * stream. + * + * @param aOutputStream the output stream to which the data will be streamed + */ + void ExternalizeL( RWriteStream& aOutputStream ) const; + +protected: + + /** + * Adds to database current content + * + * @param aSqlDb handle to database + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + * + * @return id of added entry + */ + virtual TInt32 AddL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList = 0 ) const= 0; + + /** + * Fetches entries from database + * + * @param aSqlDb handle to database + * @param aList target list for enntries + * @param aItemsToDelete ids of entries for removal - + * they were found to be expired + * + * @return number of fetched entries + */ + virtual TUint GetListL( RSqlDatabase aSqlDb, CLiwGenericParamList* aList, + RArray& aItemsToDelete ) const = 0; + + /** + * Removes entries from database + * + * @param aSqlDb handle to database + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + */ + virtual void RemoveL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList = 0 ) const = 0; + + /** + * Saves results from query to SQLite Server + * + * @param aStmt handle to SQL statement + * @param aList target list for enntries + * @param aItemsToDelete ids of entries for removal - + * they were found to be expired + */ + virtual void SaveQueryResultsL( RSqlStatement& aStmt, + CLiwGenericParamList& aList, RArray& aItemsToDelete ) const = 0; + + /** + * Updates entry in database + * + * @param aSqlDb handle to database + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + */ + virtual void UpdateL( RSqlDatabase aSqlDb, TInt32 aId, + CLiwDefaultList* aNotificationList = 0 ) const = 0; + + /** + * Performs actuall add operation + * + * @param aSqlDb handle to database + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + * + * @return id of added entry + */ + virtual TInt32 AddToDbL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList = 0 ) const = 0; + + /** + * Checks if operation value is proper + * + * @param aValue contains operation value + */ + void IsProperOperationL( const TLiwVariant& aValue ) const; + + + /** + * Appends GetList filter as strings to SQL query according to aFilter + * + * @param aQuery SQL query + * @param aFilter as enum + * + */ + void AppendGetListFilterL( RBuf& aQuery, TUint& aFilter ) const; + + /** + * Appends Remove filter as strings to SQL query according to aFilter + * + * @param aQuery SQL query + * @param aFilter as enum + * + */ + void AppendRemoveFilterL( RBuf& aQuery, TUint& aFilter ) const; + + + /** + * Appends filter as strings to SQL query according to aFilter + * + * @param aQuery SQL query + * @param aFilter as enum + * + */ + virtual void AppendFilterL( RBuf& aQuery, TUint& aFilter ) const; + + /** + * Prepares SQL query for Add operation + * + * @param aSqlDb handle to database + * @param aStmt handle to SQL statement + * @param aQuery SQL query + * + */ + virtual void PrepareStmtforAddL( RSqlDatabase aSqlDb, + RSqlStatement& aStmt, const TDesC& aQuery ) const; + /** + * Appends sorting criteria as strings to SQL query according to aSort + * + * @param aQuery SQL query + * @param aSort sort filter as TInt + * + */ + virtual void AppendSortL( RBuf& aQuery, + const TCPSortOrder& aSort ) const = 0; + + /** + * Fills change info map with proper values + *aStmt + * @param aStmt handle to SQL statement + * @param aChangeInfoMap map that will be filed + * + */ + virtual void FillChangeInfoMapL( RSqlStatement& aStmt, + CLiwDefaultMap* aMap ) const; + +protected: + + /** + * Sets all parameters according to provided list + * @param aItemMap map with parameters + */ + void SetL( const CLiwGenericParamList& aInParamList ); + + /** + * Check Get properties + * + * @return logical sum of TCPProperties of the object + */ + TUint GetFilterL() const; + + /** + * Check and return sort order + * + * @return Sort Criteria + */ + TCPSortOrder GetSortL() const; + + /** + * Check if Publisher name is set + * + * @return ETrue if Publisher name was set, EFalse if not + */ + TBool IsPublisherNameL() const; + + /** + * Check if ContentType is set + * + * @return ETrue if ContentType was set, EFalse if not + */ + TBool IsContentTypeL() const; + + /** + * Check if ContentId is set + * + * @return ETrue if ContentId was set, EFalse if not + */ + TBool IsContentIdL() const; + + /** + * Check if ActionTrigger is set + * + * @return ETrue if ActionTrigger was set, EFalse if not + */ + TBool IsTriggerL( ) const; + + /** + * Check if Flag is present + * + * @return ETrue if ContentId was set, EFalse if not + */ + TBool IsFlag( ) const; + + /** + * Checks if Id property is present in internal map + * + */ + TBool IsId() const; + + /** + * Checks if property(key) is present in internal map + * + */ + TBool PropertyExists( const TDesC8& aProperty ) const; + + + /** + * Fetches entries from database + * + * @param aSqlDb handle to database + * @param aQuery aQuery SQL query + * @param aList target list for enntries + * @param aItemsToDelete ids of entries for removal - + * they were found to be expired + * + * @return number of fetched entries + */ + TUint GetListL( RSqlDatabase aSqlDb, const TDesC& aQuery, + CLiwGenericParamList* aList, RArray& aItemsToDelete ) const; + + /** + * Removes entries from database + * + * @param aSqlDb handle to database + * @param aQuery SQL query + * + */ + void RemoveL( RSqlDatabase aSqlDb, const TDesC& aQuery ) const; + + /** + * Fetches Ids (Publisher, ContentType, ContentId) from database + * + * @param aId id entry in database + * @param aQuery SQL query + * @param aMap map to insert Ids + * @param aSqlDb handle to database + * + */ + void FetchIdsL( TInt32 aId, const TDesC& aQuery, CLiwDefaultMap* aMap, + RSqlDatabase aSqlDb ) const; + + /** + * Fetches Id from database + * + * @param aSqlDb handle to database + * @param aQuery SQL query + * @param aId id entry from database + * + */ + void FetchIdL( RSqlDatabase aSqlDb, + const TDesC& aQuery, TInt32& aId ) const; + + /** + * Gets Ids (Id, Publisher, ContentType, ContentId) + * of removed entries from database + * + * @param aSqlDb handle to database + * @param aQuery SQL query + * @param aList List with ids + * + */ + void GetIdsOfRemovedEntriesL( RSqlDatabase aSqlDb, const TDesC& aQuery, + CLiwDefaultList* aList ) const; + + /** + * Saves Ids (Id, Publisher, ContentType, ContentId) from database + * + * @param aSqlDb handle to database + * @param aList List with ids + * + */ + void SaveQueryResultsIdsL( RSqlStatement& aStmt, + CLiwDefaultList* aList ) const; + + /** + * Contructs SQL query to select entry + * @param aQuery SQL query + * + */ + void ConstructSelectIdL( RBuf& aQuery ) const; + + /** + * Contructs SQL query to select entries for GetList + * @param aQuery SQL query + * + */ + void ConstructGetListSelectL( RBuf& aQuery, TBool aGet = ETrue ) const; + + /** + * Contructs SQL query to select entries for Remove + * @param aQuery SQL query + * + */ + void ConstructRemoveSelectL( RBuf& aQuery, TBool aGet = ETrue ) const; + + /** + * Binds value to query + * @param aQuery SQL query + * @param aSqlDb handle to database + * + */ + void BindValueL( const RBuf& aQuery, RSqlStatement& aStmt ) const; + + /** + * Checks if GetList for all items should be done + * @param aFilter flag describing which ids are set + * @return ETrue if getlist for all items shold be done, EFalse if not + */ + TBool IsGetListAllL( TUint aFilter ) const; + + /** + * Removes attributes with "All" value from map + * @param aFilter filter bit will be reset if any attribute == "all" + */ + void RemoveAllAttributeL( TUint& aFilter ) const; + + /** + * Leaves if publisher, content type od content_id is not descriptor type. + */ + void CheckIdentifiersL() const; + + /** + * Leaves if aParameterIndex is negative-error value + * or in case of binding error. + */ + void BindTextL(RSqlStatement& aStmt, TInt aParameterIndex, + const TDesC& aParameterText) const; + + /** + * Leaves if aParameterIndex is negative-error value + * or in case of binding error. + */ + void BindBinaryL(RSqlStatement& aStmt, TInt aParameterIndex, + const TDesC8& aParameterText) const; + + /** + * Leaves if aParameterIndex is negative-error value + * or in case of binding error. + */ + void BindInt64L(RSqlStatement& aStmt, TInt aParameterIndex, + TInt64 aParameterValue) const; + + /** + * Leaves if aParameterIndex is negative-error value + * or in case of binding error. + */ + void BindIntL(RSqlStatement& aStmt, TInt aParameterIndex, + TInt aParameterValue) const; + + /** + * Leaves if column index return value is negative. + * @return result of RSqlStatement::ColumnIndex + */ + TInt ColumnIndexL( RSqlStatement& aStmt, const TDesC& aColumnName ) const; +protected: + + /** + * C++ default constructor. + */ + CCPLiwMap(); + + /** + * Perform the second phase construction of a CCPLiwMap object. + */ + void ConstructL(); + +protected: + // data + + /* + * The underlying generic parameter list + * Own. + */ + CLiwGenericParamList* iMap; + + /* + * Class used for security + *Own. + */ + const CCPSecurityPolicy* iPolicy; + + }; + +#endif // C_CPLIWIDSMAP_H diff -r f9c0abe18432 -r f9f9f96b1873 inc/cpluginvalidator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/cpluginvalidator.h Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,195 @@ +/* +* Copyright (c) 2006-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: + * +*/ + + +#ifndef CPLUGINVALIDATOR_H +#define CPLUGINVALIDATOR_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class REComSession; + +/** + * Class containing information regarding a plugin + * + * + * @lib cpclient.dll + * @since S60 v 5.0 + */ +NONSHARABLE_CLASS( TPluginInfo ) + { +public: + TAny* iPlugin; // not own + TUid iImplementationUid; + TInt iVersion; + TUid iDtor_ID_Key; + }; + +/** + * Class used to maintain required ECOM plugins implementations + * + * + * @lib cpclient.dll + * @since S60 v 5.0 + */ +NONSHARABLE_CLASS( CPluginValidator ): public CActive + { +public: + + /** + * Two-phased constructor. + * + */ + IMPORT_C static CPluginValidator* NewL( TUid aUid, + TAny *aParameter = NULL ); + + /** + * Two-phased constructor. + * + */ + IMPORT_C static CPluginValidator* NewLC( TUid aUid, + TAny *aParameter = NULL ); + + /** + * Gets plugin with provided UID + * + * @param aUid required plugin + * @return pointer to plugin implementation + */ + IMPORT_C TAny* GetImplementation( TUid aUid ); + + /** + * Gets plugin with provided index + * + * @param aIndex index of plugin + * @return pointer to plugin implementation + */ + IMPORT_C TAny* GetImplementation( TInt aIndex ); + + /** + * Gets number of plugins + * + * @return number of plugins + */ + IMPORT_C TInt GetCount(); + + /** + * Desctructor. + */ + virtual ~CPluginValidator(); + +protected: + + /** + * From CActive, RunL. + * Handles the active object’s request completion event + */ + void RunL(); + + /** + * From CActive, DoCancel. + * Implements cancellation of an outstanding request. + */ + void DoCancel(); + + /** + * From CActive, RunError. + * Method called when leave occured in RunL + */ + TInt RunError( TInt aError ); + +protected: + + /** + * C++ default constructor. + */ + CPluginValidator( TUid aUid, TAny *aParameter ); + + /** + * Perform the second phase construction of a CPluginValidator object. + */ + void ConstructL(); + + /* + * Checks if plugin is present in an array + */ + TBool PresentInArrayL( TPluginInfo aPluginInfo, + const RImplInfoPtrArray& aInfoArray ); + + /* + * + */ + void DestroyPlugin( TInt aIndex ); + + /** + * Cleans plugins table; + */ + void CleanPluginsTable(); + + /** + * Loads or destroys plugins + */ + virtual void ManagePluginsL(); + + /** + * Loads ECOM plugins + */ + virtual void LoadPluginL( TPluginInfo& aPluginInfo ); + +protected: + + /** + * ECOM handler + * Own. + */ + REComSession* iSession; + + /** + * Array containing plugins + * Own. + */ + RArray iPluginArray; + + /** + * UID of the interface + */ + const TUid iUid; + + /** + * Parameter to pass to the object creation method. + */ + TAny* iParameter; + }; + +// ==================== LOCAL FUNCTIONS ==================== + +/** +* Identity function to search in an array of TPluginInfo. +* @param aLeft Search term. +* @param aRight Array item. +* @return ETrue if ID-s match. +*/ +LOCAL_C TBool UidMatch( const TPluginInfo& aLeft, const TPluginInfo& aRight ) + { + return aLeft.iImplementationUid == aRight.iImplementationUid; + } + +#endif // CPLUGINVALIDATOR_H diff -r f9c0abe18432 -r f9f9f96b1873 inc/cpserverdef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/cpserverdef.h Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,90 @@ +/* +* 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: Globals for Content Publisher server + * +*/ + + +#ifndef C_CPSERVERDEF_H +#define C_CPSERVERDEF_H + +// CONSTANTS +const TUint KCPServerMajorVersionNumber = 0; +const TUint KCPServerMinorVersionNumber = 1; +const TUint KCPServerBuildVersionNumber = 1; + +// ENUMERATIONS +// Opcodes used in message passing between client and server +enum TCpServerRqst + { + ECpServerAddData = 1, + ECpServerRemoveData = 2, + ECpServerAddDataNonPersistent = 3, + ECpServerGetListSize = 10, + ECpServerGetListData = 11, + ECpServerRegisterObserver = 20, + ECpServerUnRegisterObserver = 21, + ECpServerGetChangeInfoData = 22, + ECpServerAddObserver = 23, + ECpServerRemoveObserver = 24, + ECpServerExecuteAction = 30, + ECpServerInternal = 100 + }; + +_LIT( KCPServerThreadName, "cpserver_MainThread" ); +_LIT( KCPServerName, "cpserver" ); +_LIT( KCPServerFilename, "cpserver" ); +_LIT( KActiveDes, "1" ); +_LIT( KInActiveDes, "0" ); +_LIT( KColon, ":" ); +_LIT( KSemiColon, ";" ); + +_LIT( KCPServerPluginThreadName, "CPS plugin command execution thread %d" ); +const TInt KCPServerPluginThreadMinHeapSize = 0x400; // 1kB +const TInt KCPServerPluginThreadMaxHeapSize = 0x100000; // 1MB + +const TUid KServerUid3 = + { + 0x20016B7B + }; + +/** Panic Category */ + +/** Active Data Server panic codes */ +enum TCPServerPanic + { + ECPServerBadRequest = 1, + ECPServerBadDescriptor = 2, + ECPServerSrvCreateServer = 3 + }; + +const TUint KDescriptorPosition( 0); +const TUint KReturnPosition( 1); +const TUint KInfoPosition( 2); +const TUint KTransactionPosition( 3); +const TBool KActive( ETrue ); +const TBool KInActive( EFalse ); + +// Uid of CP Server +const TUid KServerUid = { 0x20016B7B }; +// Uid of cpstorage +const TUint32 KCPStorageUid = { 0x20016B7C }; +//Values of KSQLDBStateKey key +const TInt KSQLDBStateNormal = 0x00000001; +const TInt KSQLDBStateRestored = 0x00000002;//KSQLDBStateNormal << 1 +// const ITnt NextState = LastState << 1; + + + +#endif // C_CPSERVERDEF_H diff -r f9c0abe18432 -r f9f9f96b1873 inc/cpublisherregistrymap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/cpublisherregistrymap.h Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,204 @@ +/* +* 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: CPublisherRegistryMap - class used in Content Publisher + * +*/ + +#ifndef C_CPUBLISHERREGISTRYMAP_H +#define C_CPUBLISHERREGISTRYMAP_H + +#include "cpliwmap.h" + +// CLASS DECLARATION +/** + * Map which contains Publisher Registry information + * + * @lib cputils.dll + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CPublisherRegistryMap ): public CCPLiwMap + { +public: + + /** + * Two-phased constructor. + */ + IMPORT_C static CPublisherRegistryMap* NewL( ); + + /** + * Two-phased constructor. + */ + IMPORT_C static CPublisherRegistryMap* NewLC( ); + + /** + * Destructor. + */ + virtual ~CPublisherRegistryMap(); + +private: + + /** + * Adds to database current content + * + * @param aSqlDb handle to database + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + * + * @return id of added entry + */ + TInt32 AddL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList = 0 ) const; + + /** + * Fetches entries from database + * + * @param aSqlDb handle to database + * @param aList target list for enntries + * @param aItemsToDelete ids of entries for removal - + * they were found to be expired + * + * @return number of fetched entries + */ + TUint GetListL( RSqlDatabase aSqlDb, + CLiwGenericParamList* aList, + RArray& aItemsToDelete ) const; + /** + * + */ + void RemoveL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList = 0 ) const; + + /** + * Removes entries from database + * + * @param aSqlDb handle to database + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + */ + void SaveQueryResultsL( RSqlStatement& aStmt , + CLiwGenericParamList& aList, + RArray& aItemsToDelete )const; + + /** + * Performs actuall add operation + * + * @param aSqlDb handle to database + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + * + * @return id of added entry + */ + TInt32 AddToDbL( RSqlDatabase aSqlDb, + CLiwDefaultList* aNotificationList ) const; + + /** + * Appends filter as strings to SQL query according to aFilter + * + * @param aQuery SQL query + * @param aFilter as enum + * + */ + void AppendFilterL( RBuf& aQuery, TUint& aFilter ) const; + + /** + * Appends sorting criteria as strings to SQL query according to aSort + * + * @param aQuery SQL query + * @param aSort sort filter as TInt + */ + void AppendSortL( RBuf& aQuery, const TCPSortOrder& aSort ) const; + + /** + * Prepares SQL query for Add operation + * + * @param aSqlDb handle to database + * @param aStmt handle to SQL statement + * @param aQuery SQL query + * + */ + void PrepareStmtforAddL(RSqlDatabase aSqlDb, + RSqlStatement& aStmt , + const TDesC& aQuery ) const; + + /** + * Prepares SQL query for Update operation + * + * @param aSqlDb handle to database + * @param aStmt handle to SQL statement + * @param aId id of entry to update + * + */ + void PrepareStmtforUpdateL( RSqlDatabase aSqlDb, + RSqlStatement& aStmt, + TInt32 aId ) const; + + /** + * Updates entry in database + * + * @param aSqlDb handle to database + * @param aId id entry to update + * @param aNotificationList list of notifications to fill in when + * something was actually changed in dataabse + */ + void UpdateL( RSqlDatabase aSqlDb, TInt32 aId, + CLiwDefaultList* aNotificationList = 0 ) const; + + /** + * Check if IDs are valid for Delete operation + * + */ + void IsValidForDeleteL() const; + + /** + * Check if IDs are valid for GetList operation + */ + void IsValidForGetListL() const ; + + /** + * + * @return ETrue if supported, EFalse if not + */ + TBool ActivateActionSupport( ) const; + + /** + * + * @return ETrue if activate flag is set, EFalse if not + */ + TBool GetActivateInfo( ) const; + + /** + * Fills change info map with proper values + *aStmt + * @param aStmt handle to SQL statement + * @param aChangeInfoMap map that will be filed + * + */ + void FillChangeInfoMapL( RSqlStatement& aStmt, + CLiwDefaultMap* aMap ) const; + +private: + + /** + * C++ default constructor. + */ + CPublisherRegistryMap(); + + /** + * Perform the second phase construction of a CPublisherRegistryMap object. + */ + void ConstructL(); + + }; + +#endif // C_CPUBLISHERREGISTRYMAP_H diff -r f9c0abe18432 -r f9f9f96b1873 inc/mcssathandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/mcssathandler.h Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,89 @@ +/* +* 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: The API supports attributes not present in MCS from SAT Api +* +*/ + + +#ifndef __MCSSATHANDLER_H__ +#define __MCSSATHANDLER_H__ + +#include + +#include +#include +#ifdef SIM_ATK_SERVICE_API_V1 +#include // MCL +#else +#include // 5.0 +#endif +/** + * SAT Handler. + * @lib mcssathandler.lib + * @since S60 v5.0 + */ +NONSHARABLE_CLASS( CMcsSatHandler ): public CBase + { +public: + + /** + * Two-phased constructor. Leaves on failure. + * @return The constructed object. + */ + IMPORT_C static CMcsSatHandler* NewL(); + + /** + * Destructor. + * @since S60 v5.0 + * @capability None. + * @throws None. + * @panic None. + */ + virtual ~CMcsSatHandler(); + + IMPORT_C CAknIcon* LoadIconL(); + + IMPORT_C TInt GetName( TDes& aName ); + + IMPORT_C static TBool CheckVisibility() ; + +private: + + /** + * Constructor. + */ + CMcsSatHandler(); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * Gets best icon from aIconEF. + */ + CFbsBitmap* GetBitmapL( const RIconEf& aIconEF ); + +private: // data + + RSatSession iSatSession; + +#ifdef SIM_ATK_SERVICE_API_V1 + RSatService iSatIcon; +#else + RSatIcon iSatIcon; +#endif + }; + +#endif // __MCSSATHANDLER_H__ diff -r f9c0abe18432 -r f9f9f96b1873 menucontentsrv/.cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/.cproject Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f9c0abe18432 -r f9f9f96b1873 menucontentsrv/.project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/.project Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,19 @@ + + + menucontentsrv + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff -r f9c0abe18432 -r f9f9f96b1873 menucontentsrv/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/menucontentsrv/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\menucontentsrv\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r f9c0abe18432 -r f9f9f96b1873 xcfw/.cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xcfw/.cproject Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f9c0abe18432 -r f9f9f96b1873 xcfw/.project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xcfw/.project Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,19 @@ + + + xcfw + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + + diff -r f9c0abe18432 -r f9f9f96b1873 xcfw/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xcfw/group/ABLD.BAT Fri Mar 26 03:06:02 2010 +0530 @@ -0,0 +1,15 @@ +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\S60\devices\S60_5th_Edition_SDK_v1.0\homescreensrv\xcfw\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End