# HG changeset patch # User Kashif.sayed # Date 1269541095 -19800 # Node ID 1161e0025932e1ebfb6c2757cda934e74a2d27e7 # Parent 512eb1a5d85127aef68ba2c9cb64cbf19e958b2b . diff -r 512eb1a5d851 -r 1161e0025932 dependencies/uncategorized/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/uncategorized/ABLD.BAT Thu Mar 25 23:48:15 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\dependencies\uncategorized\\" %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 512eb1a5d851 -r 1161e0025932 dependencies/uncategorized/AiwCommon.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/uncategorized/AiwCommon.hrh Thu Mar 25 23:48:15 2010 +0530 @@ -0,0 +1,419 @@ +/* +* Copyright (c) 2003-2005 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: Declares common constants to be used in both resources and +* C++ code of consumers and providers. +* +*/ + + + + + +#ifndef AIW_COMMON_HRH +#define AIW_COMMON_HRH + +// DATA TYPES + +// CONSTANTS + +/** +* Predefined service commands (UIDs). +*/ +enum TAiwServiceCommands + { + /** Null value. */ + KAiwCmdNone = 0, + + /** Create new content. */ + KAiwCmdNew = 0x101F864C, + + /** Edit existing content. */ + KAiwCmdEdit = 0x101F864D, + + /** Select content. */ + KAiwCmdSelect = 0x101F864E, + + /** View content. */ + KAiwCmdView = 0x101F864F, + + /** Create call. */ + KAiwCmdCall = 0x101F86B0, + + /** Send content. */ + KAiwCmdSend = 0x101F86B3, + + /** Print content. */ + KAiwCmdPrint = 0x101F8666, + + /** Assign content. */ + KAiwCmdAssign = 0x101F8716, + + /** Share content. */ + KAiwCmdShare = 0x101F871E, + + /** Synchronize content. */ + KAiwCmdSynchronize = 0x101F8724, + + /** Synchronize selected. */ + KAiwCmdSynchronizeSelected = 0x1020720C, + + /** Search content. */ + KAiwCmdSearch = 0x101F87DF, + + /** Copy content. */ + KAiwCmdCopy = 0x101F87DE, + + /** Show print preview. */ + KAiwCmdPrintPreview = 0x101FD656, + + /** Push to talk. */ + KAiwCmdPoC = 0x101FD657, + + /** View content in online store. */ + KAiwCmdViewOnline = 0x102072EA, + + /** Upload content. */ + KAiwCmdUpload = 0x102072EB, + + /** Transfer a range of media files to a remote storage device. */ + KAiwCmdXpressTransfer = 0x10207430, + + /** UPnP copy content. */ + KAiwCmdUPnPCopy = 0x10207431, + + /** UPnP move content. */ + KAiwCmdUPnPMove = 0x10207432, + + /** UPnP play content. */ + KAiwCmdUPnPPlay = 0x10207433, + + /** UPnP open content. */ + KAiwCmdUPnPOpen = 0x10207434, + + /** UPnP enable external. */ + KAiwCmdUPnPEnableExternal = 0x10207435, + + /** Show help content. */ + KAiwCmdHelp = 0x10275075, + + /** Add or remove items from intent. (Should be used as a menu service command). */ + KAiwCmdIntent = 0x10275114, + + /** Add items to intent. (Should be used as a base service command). */ + KAiwCmdAddToIntent = 0x10275115, + + /** Remove items from intent. (Should be used as a base service command). */ + KAiwCmdRemoveFromIntent = 0x10275116, + + /** Client can request that map should be displayed on screen. */ + KAiwCmdMnShowMap = 0x10206904, + + /** Allows to start navigation to desired destination. */ + KAiwCmdMnNavigateTo = 0x10206905, + + /** Starts reverse geocoding request: finding address for given coordinate. */ + KAiwCmdMnAddrByCoord = 0x10206906, + + /** Starts geocoding request: finding coordinate by given address. */ + KAiwCmdMnCoordByAddr = 0x10206907, + + /** Allows client to request that user shall select a location from map. */ + KAiwCmdMnSelectFromMap = 0x10206908, + + /** Send via Bluetooth. */ + KAiwCmdSendViaBT = 0x10281894, + + /** Send via Irda. */ + KAiwCmdSendViaIR = 0x10281895, + + /** Enterprise telephony. */ + KAiwCmdEnterpriseTel = 0x20001FC6, + + /** Rotate image etc. */ + KAiwCmdRotate = 0x10281F96, + + /** Rotate device screen. */ + KAiwCmdRotateScreen = 0x10281F97, + + /** Set call image. */ + KAiwCmdCallImage = 0x1028245E, + + /** Give different objects to another device using Near Field Communications. */ + KAiwCmdNFCGive = 0x1028245F, + + /** Start listening secondary bearer (e.g. Bluetooth) setup events via Near Field Communication. */ + KAiwCmdNFCEasySetup = 0x2001FE32, + + /** SettingWizard Email view activation. */ + KAiwCmdSettingWizardEmailView = 0x10281C95, + + /** In-device search. */ + KAiwCmdContentSearch = 0x10282844, + + /** A special service command enabling consumer to attach for all relevant + AIW services for a certain object. */ + KAiwCmdAnyCmdForObject = 0x102823F1, + + /** To support VoIP settings provisioning with plugins **/ + KAiwCmdEasyVoIPProvisioning = 0x10283099, + + /** Assign Screensaver*/ + KAiwCmdAssignScreenSaver = 0x1028309A, + + /*Location Trail*/ + KAiwCmdLocationTrail=0x10282845 +/* + +*/ +// BRANCH 08-04-18 : gronoff + , + /** Converged service plugin and UI extension plugin*/ + KAiwCmdCSCServicePlugins = 0x1020E56F, + KAiwCmdCSCUiExtensionPlugins = 0x10282EF7, + KAiwCmdSaveToCalendar = 0x2002A507 +// BRANCH_END 08-04-18 : gronoff + }; + + +// Service command strings. These strings are used in service provider's +// opaque data field to specify what service command(s) the provider implements. + +#define KAiwCmdNoneStr "00000000" +#define KAiwCmdNewStr "101F864C" +#define KAiwCmdEditStr "101F864D" +#define KAiwCmdSelectStr "101F864E" +#define KAiwCmdViewStr "101F864F" +#define KAiwCmdPrintStr "101F8666" +#define KAiwCmdCallStr "101F86B0" +#define KAiwCmdSendStr "101F86B3" +#define KAiwCmdAssignStr "101F8716" +#define KAiwCmdShareStr "101F871E" +#define KAiwCmdSynchronizeStr "101F8724" +#define KAiwCmdSearchStr "101F87DF" +#define KAiwCmdCopy "101F87DE" +#define KAiwCmdPrintPreviewStr "101FD656" +#define KAiwCmdPoCStr "101FD657" +#define KAiwCmdSynchronizeSelectedStr "1020720C" +#define KAiwCmdViewOnlineStr "102072EA" +#define KAiwCmdUploadStr "102072EB" +#define KAiwCmdXpressTransferStr "10207430" +#define KAiwCmdUPnPCopyStr "10207431" +#define KAiwCmdUPnPMoveStr "10207432" +#define KAiwCmdUPnPPlayStr "10207433" +#define KAiwCmdUPnPOpenStr "10207434" +#define KAiwCmdUPnPEnableExternalStr "10207435" +#define KAiwCmdHelpStr "10275075" +#define KAiwCmdIntentStr "10275114" +#define KAiwCmdAddToIntentStr "10275115" +#define KAiwCmdRemoveFromIntentStr "10275116" +#define KAiwCmdMnShowMapStr "10206904" +#define KAiwCmdMnNavigateToStr "10206905" +#define KAiwCmdMnAddrByCoordStr "10206906" +#define KAiwCmdMnCoordByAddrStr "10206907" +#define KAiwCmdMnSelectFromMapStr "10206908" +#define KAiwCmdSendViaBTStr "10281894" +#define KAiwCmdSendViaIRStr "10281895" +#define KAiwCmdEnterpriseTelStr "20001FC6" +#define KAiwCmdRotateStr "10281F96" +#define KAiwCmdRotateScreenStr "10281F97" +#define KAiwCmdCallImageStr "1028245E" +#define KAiwCmdNFCGiveStr "1028245F" +#define KAiwCmdNFCEasySetupStr "2001FE32" +#define KAiwCmdSettingWizardEmailViewStr "10281C95" +#define KAiwCmdContentSearchStr "10282844" +#define KAiwCmdAnyCmdForObjectStr "102823F1" +#define KAiwCmdEasyVoIPProvisioningStr "10283099" +#define KAiwCmdAssignScreenSaverStr "1028309A" +#define KAiwCmdLocationTrail "10282845" +/* + +*/ +// BRANCH 08-04-18 : gronoff +#define KAiwCmdCSCServicePluginsStr "1020E56F" +#define KAiwCmdCSCUiExtensionPluginsStr "10282EF7" +#define KAiwCmdSaveToCalendarStr "2002A507" +// BRANCH_END 08-04-18 : gronoff + +/** +* Service command options (bits) to alter command handling behaviour. +*/ +enum TAiwServiceCmdOptions + { + /** + * Consumer wants asynchronous command handling. + * The default is synchronous command handling. + * In asynchronous case consumer needs to pass a callback to provider. + */ + KAiwOptASyncronous = 0x0001, + + /** + * Consumer wants provider to make a callback to check coming output + * parameters prior returning from service command handling. + * Consumer needs to pass a callback to provider. + */ + KAiwOptOutParamCheck = 0x0002, + + /** + * Consumer tells provider that it is prepared to handle + * callback events for possibly incomplete/wrong parameter list. + */ + KAiwOptInParamCheck = 0x0004, + + /** + * Consumer wants to cancel an asynchronous AIW service. + * When a consumer wants to cancel the asynchronous service that a provider + * is executing, it should call ExecuteMenuCmdL() or ExecuteServiceCmdL() + * with the same parameters as when requesting the service, but set this + * cancel bit on. The cancel operation itself is synchronous, i.e. the + * provider must call the consumer's callback with KAiwEventCanceled before + * the Execute*CmdL() returns. + */ + KAiwOptCancel = 0x0008 + }; + + +/** +* Service classes (UID). Technically these are same as service interface UIDs. +*/ +enum TAiwServiceClass + { + /** + * None. + */ + KAiwClassNone = 0x0, + + /** + * Base service (no UI expected). + * Every other class must implement this always! + */ + KAiwClassBase = 0x101F8650, + + /** + * Filter service class. + */ + KAiwClassFilter = 0x101F8651, + + /** + * Menu service class (offers menu based services). + */ + KAiwClassMenu = 0x101F8652, + + /** + * Stub service class. + */ + KAiwClassStub = 0x101F8653, + + /** + * View service class (offers view based services). + */ + KAiwClassView = 0x101F8654, + + /** + * This class is for R&D purposes. + */ + KAiwClassDebug = 0x101F866B + }; + + +/** +* Event codes. To be used with HandleNotifyL method. +*/ +enum + { + /** + * Asynchronous service informs consumer to prepare itself for + * action. + */ + KAiwEventStarted = 1, + + /** + * Asynchronous service request completed. + */ + KAiwEventCompleted = 2, + + /** + * Asynchronous service request canceled. + */ + KAiwEventCanceled = 3, + + /** + * Error during asynchronous service request. + */ + KAiwEventError = 4, + + /** + * Relates to KAiwOptOutParamCheck. + */ + KAiwEventOutParamCheck = 5, + + /** + * Relates to KAiwOptInParamCheck. + */ + KAiwEventInParamCheck = 6, + + /** + * Provider informs consumer that service is no longer available or + * has stopped. + */ + KAiwEventStopped = 7, + + /** + * Provider asks consumer whether Exit can be done (needed at least in + * embedded use cases where server application offers Exit possibility + * to end user, but consumer can not allow Exit due to fact that for + * example network connections owned by consumer are open and they need + * to be kept alive). + */ + KAiwEventQueryExit = 8 + }; + +// ============================================================================ +// Menu item flags for AIW consumers. +// ============================================================================ +/** + * Always keep the provider menu items in a submenu. + */ +#define AIW_CASCADE_ID 0x01010001 + +/** + * Menu item is placed intelligently either to the main level or a submenu. + */ +#define AIW_INTELLIGENT_CASCADE_ID 0x01010010 + +/** + * Consumer defines the menu title. + */ +#define AIW_LOCK_SUBMENU_TITLE 0x00000020 + +// ============================================================================ +// Criteria item flags for AIW consumers. +// ============================================================================ +/** + * Criteria item loadOptions bit, only providers in ROM are accepted. + */ +#define AIW_OPTIONS_ROM_ONLY 0x01 + +// ============================================================================ +// Menu item flags for AIW providers. +// ============================================================================ +/** + * For providers only: Provider suggests the submenu title. + */ +#define AIW_SUBMENU_TITLE 0x0ff11012 + +#endif // AIW_COMMON_HRH + +// End of file + + diff -r 512eb1a5d851 -r 1161e0025932 dependencies/uncategorized/aiwdialdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/uncategorized/aiwdialdata.h Thu Mar 25 23:48:15 2010 +0530 @@ -0,0 +1,213 @@ +/* +* 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: Dial data used with AIW for making calls. +* +*/ + + +#ifndef CAIWDIALDATA_H +#define CAIWDIALDATA_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CAiwGenericParamList; +class CAiwInternalDialData; + +/** Constant used by aiwdialdata interface. */ +namespace AIWDialData + { + /** Maximum phone number length same as used by phone. */ + const TInt KMaximumPhoneNumberLength = 100; + + /** Default windowgroup value */ + const TInt KAiwGoToIdle(0); + } + +// CLASS DECLARATION + +/** +* Creating call using CAiwDialData API. +* +* @code +* +* - Client must be Service Handler client. For more information see +* service handler desing document. +* +* - Client creates intance of CAiwDialData: +* +* CAiwDialData* dialData = CAiwDialData::NewLC(); +* +* - Define call parameters(phone number is compulsory parameter ): +* +* dialData->SetCallType( CAiwDialData::EAIWVoice ); +* _LIT(phoneNumber, "050123456"); +* dialData->SetPhoneNumberL( phoneNumber ); +* dialData->SetWindowGroup( AIWDialData::KAiwGoToIdle ); +* +* - Client creates reference to CAiwGenericParamList and fills paramlist: +* +* CAiwGenericParamList& paramList = iServiceHandler->InParamListL(); +* dialData->FillInParamListL( paramList ); +* +* - Now client can give execute command to service handler. +* +* iServiceHandler->ExecuteServiceCmdL( KAiwCmdCall, paramList, +* iServiceHandler->OutParamListL(), +* 0, NULL ); +* @endcode +* +* Dial data for SDK applications. +* +* @lib aiwdialdata.lib +* @since S60 3.2 +*/ +NONSHARABLE_CLASS( CAiwDialData ): public CBase + { + public: // Enum. + + /** Different type of calls. */ + enum TCallType + { + /* Voice call. If there is a VoIP service that is registered and set as preferred, the + * call is created as VoIP call, otherwise CS call. */ + EAIWVoice = 0, + /** Video call. */ + EAIWVideo = 1, + /** Forced video call, creates video call directly without + * queries. */ + EAIWForcedVideo = 2, + /** Voip call. */ + EAIWVoiP = 3, + /* Forced voice call, creates always CS voice call. Use this value if the call type is + * not allowed to be changed */ + EAIWForcedCS = 4 + }; + + public: // Constructors and destructor + + /** + * Two-phased constructor for implementation class. + * Use this method for creating a instance with null items. + * + * @since S60 3.2 + * @return A pointer to the new object. + */ + IMPORT_C static CAiwDialData* NewL(); + + /** + * Two-phased constructor for implementation class. Leaves the + * pointer to the cleanup stack. + * Use this method for creating a instance with null items. + * + * @since S60 3.2 + * @return A pointer to the new object. + */ + IMPORT_C static CAiwDialData* NewLC(); + + /** + * Destructor. + */ + virtual ~CAiwDialData(); + + public: // New + + /** + * Composes data set package and inserts data to aInParamList. + * + * @since S60 3.2 + * @param aInParamList In parameter used with CAiwService. + */ + IMPORT_C void FillInParamListL( CAiwGenericParamList& aInParamList ); + + public: // Access - Setters + + /** + * Sets the phone number. + * + * @since S60 3.2 + * @param aPhoneNumber Phone number, which maximum length is + * KMaximumPhoneNumberLength. + * Default: empty. + * @leaves KErrArgument if aPhoneNumber length is over + * KMaximumPhoneNumberLength. + */ + IMPORT_C void SetPhoneNumberL( const TDesC& aPhoneNumber ); + + /** + * Sets call type. + * + * @since S60 3.2 + * @param aCallType defines the call type. + * Default: EAIWVoice. + */ + IMPORT_C void SetCallType( TCallType aCallType ); + + /** + * Sets the window group identifier. When call is ended, + * set window group is actived. + * + * @since S60 3.2 + * @param aWindowGroup Window group id. + * Default: KAiwGoToIdle. + */ + IMPORT_C void SetWindowGroup( TInt aWindowGroup ); + + public: // Access - Getters + + /** + * Phone number. + * + * @since S60 3.2 + * @return Phone number. + */ + IMPORT_C const TDesC& PhoneNumber() const; + + /** + * Call type. + * + * @since S60 3.2 + * @return Current call type. + */ + IMPORT_C TCallType CallType() const; + + /** + * Window group id. + * + * @since S60 3.2 + * @return Window group id. + */ + IMPORT_C TInt WindowGroup() const; + + private: + + /** + * C++ default constructor. + */ + CAiwDialData(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + private: + + CAiwInternalDialData* iInternalDialData; + }; + +#endif // CAIWDIALDATA_H + +// End of File diff -r 512eb1a5d851 -r 1161e0025932 dependencies/uncategorized/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/uncategorized/bld.inf Thu Mar 25 23:48:15 2010 +0530 @@ -0,0 +1,10 @@ +#include +PRJ_EXPORTS +ccontentmap.h ccontentmap.h +cpliwmap.h cpliwmap.h +cpserverdef.h cpserverdef.h +cpdebug.h cpdebug.h +cpglobals.h cpglobals.h +aiwdialdata.h aiwdialdata.h +AiwCommon.hrh AiwCommon.hrh +cpluginvalidator.h cpluginvalidator.h diff -r 512eb1a5d851 -r 1161e0025932 dependencies/uncategorized/ccontentmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/uncategorized/ccontentmap.h Thu Mar 25 23:48:15 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 512eb1a5d851 -r 1161e0025932 dependencies/uncategorized/cpdebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/uncategorized/cpdebug.h Thu Mar 25 23:48:15 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 512eb1a5d851 -r 1161e0025932 dependencies/uncategorized/cpglobals.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/uncategorized/cpglobals.h Thu Mar 25 23:48:15 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 512eb1a5d851 -r 1161e0025932 dependencies/uncategorized/cpliwmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/uncategorized/cpliwmap.h Thu Mar 25 23:48:15 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 512eb1a5d851 -r 1161e0025932 dependencies/uncategorized/cpluginvalidator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/uncategorized/cpluginvalidator.h Thu Mar 25 23:48:15 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 512eb1a5d851 -r 1161e0025932 dependencies/uncategorized/cpserverdef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dependencies/uncategorized/cpserverdef.h Thu Mar 25 23:48:15 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